diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a6cdad9a24..e2bed8fe026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 5.10.0 (August 23, 2023) + +### Added +Support for BDS - Automated Patching for OS/Kernel, Node Maintenance, Add Master/Utility +Support for Database In-Memory support for Autonomous Database | ADB-D and ADB on ExaC@C +Support for BDS - Cluster Profiles for Kafka +### Bug Fix +Fix reference hashicorp/oci to oracle/oci in some documents + ## 5.9.0 (August 15, 2023) ### Added diff --git a/examples/big_data_service/GetOsPatch/main.tf b/examples/big_data_service/GetOsPatch/main.tf new file mode 100755 index 00000000000..085b9ee49e1 --- /dev/null +++ b/examples/big_data_service/GetOsPatch/main.tf @@ -0,0 +1,96 @@ + + # Need to have this block even though it's empty; for import testing + provider "oci" { + } + + variable "tenancy_ocid" { + } + + variable "ssh_public_key" { + } + + variable "region" { + default = "us-ashburn-1" + } + + +data "oci_bds_bds_instance_get_os_patch" "test_bds_instance_get_os_patch" { +bds_instance_id = "${oci_bds_bds_instance.test_bds_instance.id}" +os_patch_version = "${var.os_patch_version}" +} +variable "compartment_id" {} +variable "subnet_id" { } +variable "os_patch_version" { default = "ol7.9-x86_64-1.24.0.100-0.0" } + +resource "oci_bds_bds_instance" "test_bds_instance" { +cluster_admin_password = "T3JhY2xlVGVhbVVTQSExMjM=" +cluster_public_key = "${var.ssh_public_key}" +cluster_version = "ODH1" +compartment_id = "${var.compartment_id}" +compute_only_worker_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +display_name = "displayName" +edge_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +is_high_availability = "true" +is_secure = "true" +master_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +util_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +worker_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "3" +shape = "VM.Standard2.4" +subnet_id = "${var.subnet_id}" +} +} + +resource "oci_core_subnet" "test_subnet" { +cidr_block = "10.0.0.0/24" +compartment_id = "${var.compartment_id}" +lifecycle { +ignore_changes = ["defined_tags"] +} +vcn_id = "${oci_core_vcn.test_vcn.id}" +} + +resource "oci_core_vcn" "test_vcn" { +cidr_block = "10.0.0.0/16" +compartment_id = "${var.compartment_id}" +lifecycle { +ignore_changes = ["defined_tags"] +} +} diff --git a/examples/big_data_service/ListOsPatch/main.tf b/examples/big_data_service/ListOsPatch/main.tf new file mode 100755 index 00000000000..e220e0cb4a2 --- /dev/null +++ b/examples/big_data_service/ListOsPatch/main.tf @@ -0,0 +1,94 @@ + + # Need to have this block even though it's empty; for import testing + provider "oci" { + } + + variable "tenancy_ocid" { + } + + variable "ssh_public_key" { + } + + variable "region" { + default = "us-ashburn-1" + } + + +data "oci_bds_bds_instance_list_os_patches" "test_bds_instance_list_os_patches" { +bds_instance_id = "${oci_bds_bds_instance.test_bds_instance.id}" +} +variable "compartment_id" { } +variable "subnet_id" { } + +resource "oci_bds_bds_instance" "test_bds_instance" { +cluster_admin_password = "T3JhY2xlVGVhbVVTQSExMjM=" +cluster_public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpUa4zUZKyU3AkW9yoJTBDO550wpWZOXdHswfRq75gbJ2ZYlMtifvwiO3qUL/RIZSC6e1wA5OL2LQ97UaHrLLPXgjvKGVIDRHqPkzTOayjJ4ZA7NPNhcu6f/OxhKkCYF3TAQObhMJmUSMrWSUeufaRIujDz1HHqazxOgFk09fj4i2dcGnfPcm32t8a9MzlsHSmgexYCUwxGisuuWTsnMgxbqsj6DaY51l+SEPi5tf10iFmUWqziF0eKDDQ/jHkwLJ8wgBJef9FSOmwJReHcBY+NviwFTatGj7Cwtnks6CVomsFD+rAMJ9uzM8SCv5agYunx07hnEXbR9r/TXqgXGfN bdsclusterkey@oracleoci.com" +cluster_version = "ODH1" +compartment_id = "${var.compartment_id}" +compute_only_worker_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +display_name = "displayName" +edge_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +is_high_availability = "true" +is_secure = "true" +master_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +util_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "2" +shape = "VM.Standard.E4.Flex" +shape_config { +memory_in_gbs = "32" +ocpus = "3" +} +subnet_id = "${var.subnet_id}" +} +worker_node { +block_volume_size_in_gbs = "150" +number_of_nodes = "3" +shape = "VM.Standard2.4" +subnet_id = "${var.subnet_id}" +} +} + +resource "oci_core_subnet" "test_subnet" { +cidr_block = "10.0.0.0/24" +compartment_id = "${var.compartment_id}" +lifecycle { +ignore_changes = ["defined_tags"] +} +vcn_id = "${oci_core_vcn.test_vcn.id}" +} + +resource "oci_core_vcn" "test_vcn" { +cidr_block = "10.0.0.0/16" +compartment_id = "${var.compartment_id}" +lifecycle { +ignore_changes = ["defined_tags"] +} +} diff --git a/examples/big_data_service/main.tf b/examples/big_data_service/main.tf index 335cb72465c..2cc19d9614b 100644 --- a/examples/big_data_service/main.tf +++ b/examples/big_data_service/main.tf @@ -204,7 +204,7 @@ resource "oci_bds_bds_instance" "test_bds_instance" { is_secure = var.bds_instance_is_secure kms_key_id = var.kms_key_id cluster_profile = var.cluster_profile - bootstrap_script_url = "https://objectstorage.us-ashburn-1.oraclecloud.com/p/5M6CdCgyfNKcMGvdSIdK20tC9TAf0mVFkMsSlMdmmCaKusIX3DVixBS-_oDhJoxi/n/oraclebigdatadb/b/bootstrap-script-sdk-test/o/bootstrapScriptTemplate1bootstrapScript1.sh" + bootstrap_script_url = "https://objectstorage.us-ashburn-1.oraclecloud.com/p/1hWiiE-2GVzGiKhaBX1zyXVa_jTIu_cU5kDdKTyYS74Wk5xmEA2WKht9NTA2y935/n/oraclebigdatadb/b/bootstrap-script-sdk-test/o/bootstrapScriptTemplate1bootstrapScript1.sh" master_node { #Required @@ -269,6 +269,24 @@ resource "oci_bds_bds_instance" "test_bds_instance" { is_cloud_sql_configured = false + + #Change value to true for use of Kafka cluster + is_kafka_configured = false + + #Uncomment kafka_broker_node block for use of Kafka cluster + #kafka_broker_node { + #Required + # shape = var.bds_instance_compute_only_worker_node_shape + + # subnet_id = var.subnet_id + # block_volume_size_in_gbs = var.bds_instance_worker_nodes_block_volume_size_in_gbs + # number_of_nodes = 1 + # shape_config { + # memory_in_gbs = var.bds_instance_compute_only_worker_memory_per_node + # ocpus = var.bds_instance_compute_only_worker_ocpu_per_node + # } + #} + #Optional #Uncomment this when running in home region (PHX) # defined_tags = { diff --git a/examples/database/atp-d/exadata.tf b/examples/database/atp-d/exadata.tf index 83125ec1373..1842473dbc4 100644 --- a/examples/database/atp-d/exadata.tf +++ b/examples/database/atp-d/exadata.tf @@ -77,7 +77,7 @@ resource "oci_database_cloud_autonomous_vm_cluster" "test_cloud_autonomous_vm_cl # total_container_databases = 12 compute_model = "ECPU" - //To ignore changes to autonomous_data_storage_size_in_tbs + //To ignore changes to autonomous_data_storage_size_in_tbs and db_servers lifecycle { ignore_changes = [ autonomous_data_storage_size_in_tbs, diff --git a/examples/database/atp-d/main.tf b/examples/database/atp-d/main.tf index ea743f2fcbc..3cb5f77909c 100644 --- a/examples/database/atp-d/main.tf +++ b/examples/database/atp-d/main.tf @@ -14,7 +14,7 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container cloud_autonomous_vm_cluster_id = oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id display_name = "example-container-database" patch_model = "RELEASE_UPDATES" - db_version = "19.18.0.1.0" + db_version = "19.20.0.1.0" db_name = "ACDNAME" #Optional @@ -74,7 +74,7 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { #Required admin_password = random_string.autonomous_database_admin_password.result compartment_id = var.compartment_ocid - compute_count = "1" + compute_count = 8 data_storage_size_in_tbs = "1" db_name = "atpdb1" @@ -85,6 +85,7 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { freeform_tags = var.autonomous_database_freeform_tags is_dedicated = "true" rotate_key_trigger = "true" + in_memory_percentage = 50 compute_model = "ECPU" } diff --git a/examples/database/exadata_cc/adbd/acd.tf b/examples/database/exadata_cc/adbd/acd.tf index 85e8636ade0..6e59ee45be7 100644 --- a/examples/database/exadata_cc/adbd/acd.tf +++ b/examples/database/exadata_cc/adbd/acd.tf @@ -6,7 +6,7 @@ resource "random_string" "db_unique_name" { resource "oci_database_autonomous_container_database" "autonomous_container_database" { autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id - db_version = "19.18.0.1.0" + db_version = "19.20.0.1.0" backup_config { backup_destination_details { type = "LOCAL" diff --git a/examples/database/exadata_cc/adbd/adb.tf b/examples/database/exadata_cc/adbd/adb.tf index 28dcc9259c7..e88babc1fa5 100644 --- a/examples/database/exadata_cc/adbd/adb.tf +++ b/examples/database/exadata_cc/adbd/adb.tf @@ -10,7 +10,7 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { #Required admin_password = random_string.autonomous_database_admin_password.result compartment_id = var.compartment_ocid - ocpu_count = "2" + compute_count = 8 data_storage_size_in_tbs = "1" db_name = "atpdb1" diff --git a/go.mod b/go.mod index 35b8741da2d..8f15e5c239d 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/mitchellh/mapstructure v1.1.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect - github.com/oracle/oci-go-sdk/v65 v65.47.1 + github.com/oracle/oci-go-sdk/v65 v65.47.2 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sony/gobreaker v0.5.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect diff --git a/go.sum b/go.sum index 2c808b057bc..9772923415d 100644 --- a/go.sum +++ b/go.sum @@ -289,8 +289,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/oracle/oci-go-sdk/v65 v65.47.1 h1:g+yMS4Lkcu+M+mEUIwMRnbaY0tMyNKhEOTgZ6hX6w/w= -github.com/oracle/oci-go-sdk/v65 v65.47.1/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.47.2 h1:tSb37xxw9T3CggDhQMsbLkwqx7v2U3z402Lg/xVLY1Y= +github.com/oracle/oci-go-sdk/v65 v65.47.2/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/internal/globalvar/version.go b/internal/globalvar/version.go index f0c334f6c4b..79fac4fd3bd 100644 --- a/internal/globalvar/version.go +++ b/internal/globalvar/version.go @@ -7,8 +7,8 @@ import ( "log" ) -const Version = "5.9.0" -const ReleaseDate = "2023-08-17" +const Version = "5.10.0" +const ReleaseDate = "2023-08-23" func PrintVersion() { log.Printf("[INFO] terraform-provider-oci %s\n", Version) diff --git a/internal/integrationtest/bds_bds_instance_get_os_patch_test.go b/internal/integrationtest/bds_bds_instance_get_os_patch_test.go new file mode 100644 index 00000000000..2b46c3c0171 --- /dev/null +++ b/internal/integrationtest/bds_bds_instance_get_os_patch_test.go @@ -0,0 +1,64 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + BdsBdsInstanceGetOsPatchDataSourceRepresentation = map[string]interface{}{ + "bds_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_bds_bds_instance.test_bds_instance.id}`}, + "os_patch_version": acctest.Representation{RepType: acctest.Required, Create: `${var.os_patch_version}`}, + } + + BdsBdsInstanceGetOsPatchResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Required, acctest.Create, bdsInstanceOdhRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) +) + +// issue-routing-tag: bds/default +func TestBdsBdsInstanceGetOsPatchResource_basic(t *testing.T) { + httpreplay.SetScenario("TestBdsBdsInstanceGetOsPatchResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + osPatchVersion := utils.GetEnvSettingWithBlankDefault("os_patch_version") + osPatchVersionVariableStr := fmt.Sprintf("variable \"os_patch_version\" { default = \"%s\" }\n", osPatchVersion) + + subnetId := utils.GetEnvSettingWithBlankDefault("subnet_ocid") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) + + datasourceName := "data.oci_bds_bds_instance_get_os_patch.test_bds_instance_get_os_patch" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_bds_bds_instance_get_os_patch", "test_bds_instance_get_os_patch", acctest.Required, acctest.Create, BdsBdsInstanceGetOsPatchDataSourceRepresentation) + + compartmentIdVariableStr + subnetIdVariableStr + osPatchVersionVariableStr + BdsBdsInstanceGetOsPatchResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "bds_instance_id"), + resource.TestCheckResourceAttr(datasourceName, "os_patch_version", "ol7.9-x86_64-1.24.0.100-0.0"), + resource.TestCheckResourceAttrSet(datasourceName, "min_bds_version"), + resource.TestCheckResourceAttrSet(datasourceName, "patch_type"), + resource.TestCheckResourceAttrSet(datasourceName, "release_date"), + ), + }, + }) +} diff --git a/internal/integrationtest/bds_bds_instance_list_os_patch_test.go b/internal/integrationtest/bds_bds_instance_list_os_patch_test.go new file mode 100644 index 00000000000..e6ef3f0318b --- /dev/null +++ b/internal/integrationtest/bds_bds_instance_list_os_patch_test.go @@ -0,0 +1,60 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + BdsBdsInstanceListOsPatchDataSourceRepresentation = map[string]interface{}{ + "bds_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_bds_bds_instance.test_bds_instance.id}`}, + } + + BdsBdsInstanceListOsPatchResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Required, acctest.Create, bdsInstanceOdhRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) +) + +// issue-routing-tag: bds/default +func TestBdsBdsInstanceListOsPatchResource_basic(t *testing.T) { + httpreplay.SetScenario("TestBdsBdsInstanceListOsPatchResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + subnetId := utils.GetEnvSettingWithBlankDefault("subnet_ocid") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) + + datasourceName := "data.oci_bds_bds_instance_list_os_patches.test_bds_instance_list_os_patches" + acctest.SaveConfigContent("", "", "", t) + // acctest.SaveConfigContent(config+compartmentIdVariableStr+BdsBdsInstanceListOsPatchResourceConfig+ + // acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Required, acctest.Create, BdsBdsInstanceListOsPatchDataSourceRepresentation), "bds", "bdsInstanceListOsPatch", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_bds_bds_instance_list_os_patches", "test_bds_instance_list_os_patches", acctest.Required, acctest.Create, BdsBdsInstanceListOsPatchDataSourceRepresentation) + + compartmentIdVariableStr + subnetIdVariableStr + BdsBdsInstanceListOsPatchResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "bds_instance_id"), + + resource.TestCheckResourceAttrSet(datasourceName, "os_patches.#"), + resource.TestCheckResourceAttrSet(datasourceName, "os_patches.0.os_patch_version"), + resource.TestCheckResourceAttrSet(datasourceName, "os_patches.0.release_date"), + ), + }, + }) +} diff --git a/internal/integrationtest/bds_bds_instance_patch_history_test.go b/internal/integrationtest/bds_bds_instance_patch_history_test.go index 88c1baacb07..f27428e6e9d 100644 --- a/internal/integrationtest/bds_bds_instance_patch_history_test.go +++ b/internal/integrationtest/bds_bds_instance_patch_history_test.go @@ -18,6 +18,7 @@ import ( var ( BdsBdsInstancePatchHistoryDataSourceRepresentation = map[string]interface{}{ "bds_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_bds_bds_instance.test_bds_instance.id}`}, + "patch_type": acctest.Representation{RepType: acctest.Optional, Create: `ODH`}, "patch_version": acctest.Representation{RepType: acctest.Optional, Create: `patchVersion`}, "state": acctest.Representation{RepType: acctest.Optional, Create: `INSTALLED`}, } @@ -38,6 +39,9 @@ func TestBdsBdsInstancePatchHistoryResource_basic(t *testing.T) { compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + subnetId := utils.GetEnvSettingWithBlankDefault("subnet_ocid") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) + datasourceName := "data.oci_bds_bds_instance_patch_histories.test_bds_instance_patch_histories" acctest.SaveConfigContent("", "", "", t) @@ -47,11 +51,14 @@ func TestBdsBdsInstancePatchHistoryResource_basic(t *testing.T) { { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_bds_bds_instance_patch_histories", "test_bds_instance_patch_histories", acctest.Required, acctest.Create, BdsBdsInstancePatchHistoryDataSourceRepresentation) + - compartmentIdVariableStr + BdsBdsInstancePatchHistoryResourceConfig, + compartmentIdVariableStr + subnetIdVariableStr + BdsBdsInstancePatchHistoryResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(datasourceName, "bds_instance_id"), - + resource.TestCheckResourceAttr(datasourceName, "patch_type", "ODH"), + resource.TestCheckResourceAttr(datasourceName, "patch_version", "patchVersion"), + resource.TestCheckResourceAttr(datasourceName, "state", "AVAILABLE"), resource.TestCheckResourceAttrSet(datasourceName, "patch_histories.#"), + resource.TestCheckResourceAttrSet(datasourceName, "patch_histories.0.patch_type"), resource.TestCheckResourceAttrSet(datasourceName, "patch_histories.0.state"), resource.TestCheckResourceAttrSet(datasourceName, "patch_histories.0.time_updated"), resource.TestCheckResourceAttrSet(datasourceName, "patch_histories.0.version"), diff --git a/internal/integrationtest/bds_odh_instance_resource_test.go b/internal/integrationtest/bds_odh_instance_resource_test.go index 7a3ad2b29b9..bde49616263 100644 --- a/internal/integrationtest/bds_odh_instance_resource_test.go +++ b/internal/integrationtest/bds_odh_instance_resource_test.go @@ -33,6 +33,12 @@ var ( BdsInstanceOdhWithRegularComputeWorkerResourceConfig = BdsInstanceOdhResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Update, bdsInstanceOdhWithRegularComputeAndFlexMasterUtilRepresentation) + BdsInstanceOdhWithAddMasterUtilRequiredOnlyResource = BdsInstanceOdhResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Required, acctest.Update, bdsInstanceOdhWithAddMasterUtilRepresentation) + + BdsInstanceOdhWithAddMasterUtilWorkerResourceConfig = BdsInstanceOdhResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Update, bdsInstanceOdhWithAddMasterUtilRepresentation) + bdsInstanceOdhSingularDataSourceRepresentation = map[string]interface{}{ "bds_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_bds_bds_instance.test_bds_instance.id}`}, } @@ -66,12 +72,13 @@ var ( "is_cloud_sql_configured": acctest.Representation{RepType: acctest.Optional, Create: `false`}, "kms_key_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.kms_key_id}`, Update: `${var.kms_key_id_for_update}`}, - //"cloud_sql_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: bdsInstanceNodesOdhCloudSqlRepresentation}, // capacity issue + //"cloud_sql_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: bdsInstanceNodesOdhCloudSqlRepresentation}, // capacity issue //Uncomment this when running in home region (PHX) // "defined_tags": acctest.Representation{RepType: acctest.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")}`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, "network_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: bdsInstanceOdhNetworkConfigRepresentation}, + //"os_patch_version": acctest.Representation{RepType: acctest.Optional, Update: `ol7.9-x86_64-1.24.0.100-0.0`}, // Test when patch is available } bdsInstanceOdhWithFlexComputeAndRegularMasterUtilRepresentation = acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation, @@ -86,7 +93,6 @@ var ( bdsInstanceOdhWithRegularComputeAndFlexMasterUtilRepresentation = acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation, map[string]interface{}{ "compute_only_worker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesOdhUtilRepresentation}, // Regular util shape representation usable for compute worker - "edge_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesOdhUtilRepresentation}, }) bdsInstanceNodesOdhCloudSqlRepresentation = map[string]interface{}{ @@ -120,14 +126,41 @@ var ( "number_of_nodes": acctest.Representation{RepType: acctest.Required, Create: `2`}, "shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesShapeConfigRepresentation}, } + bdsInstanceNodeFlex3ShapeRepresentation = map[string]interface{}{ + "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard3.Flex`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`}, + "block_volume_size_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `150`}, + "number_of_nodes": acctest.Representation{RepType: acctest.Required, Create: `2`}, + "shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesShapeConfigRepresentation}, + } bdsInstanceNodesShapeConfigRepresentation = map[string]interface{}{ "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `32`}, "ocpus": acctest.Representation{RepType: acctest.Required, Create: `3`}, } + bdsInstanceOdhWithAddMasterUtilRepresentation = acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation, + map[string]interface{}{ + // Master & Util shape should be same + "master_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceOdhWithUpdateMasterUtilRepresentation}, + "util_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceOdhWithUpdateMasterUtilRepresentation}, + }) + bdsInstanceOdhWithUpdateMasterUtilRepresentation = map[string]interface{}{ + "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard.E4.Flex`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`}, + "block_volume_size_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `150`}, + "number_of_nodes": acctest.Representation{RepType: acctest.Required, Update: `3`}, + "shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesShapeConfigRepresentation}, + } bdsInstanceOdhNetworkConfigRepresentation = map[string]interface{}{ "cidr_block": acctest.Representation{RepType: acctest.Optional, Create: `111.112.0.0/16`}, "is_nat_gateway_required": acctest.Representation{RepType: acctest.Optional, Create: `true`}, } + bdsInstanceKafkaBrokerNodeFlexShapeRepresentation = map[string]interface{}{ + "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard.E4.Flex`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`}, + "block_volume_size_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `150`}, + "number_of_kafka_nodes": acctest.Representation{RepType: acctest.Required, Create: `3`}, + "shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceNodesShapeConfigRepresentation}, + } BdsInstanceOdhResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, acctest.GetMultipleUpdatedRepresenationCopy( @@ -180,7 +213,6 @@ func TestResourceBdsOdhInstance(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Create, bdsInstanceOdhRepresentation), "bds", "bdsInstanceOdh", t) acctest.ResourceTest(t, testAccCheckBdsBdsInstanceOdhDestroy, []resource.TestStep{ - // verify Create with required fields { Config: config + compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr + @@ -262,6 +294,119 @@ func TestResourceBdsOdhInstance(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "state", "ACTIVE"), ), }, + // delete before next Create + { + Config: config + compartmentIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr, + }, + // Create cluster with HADOOP_EXTENDED + { + Config: config + compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation, map[string]interface{}{ + "cluster_profile": acctest.Representation{RepType: acctest.Optional, Create: `HADOOP_EXTENDED`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `hadext1`, Update: `hadext1`}, + })), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "cluster_admin_password", "T3JhY2xlVGVhbVVTQSExMjM="), + resource.TestCheckResourceAttrSet(resourceName, "cluster_public_key"), + resource.TestCheckResourceAttr(resourceName, "cluster_version", "ODH1"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "is_high_availability", "true"), + resource.TestCheckResourceAttr(resourceName, "is_secure", "true"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.node_type"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.shape"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.subnet_id"), + resource.TestCheckResourceAttr(resourceName, "state", "ACTIVE"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + // Add Kafka to cluster + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + kmsKeyIdUVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Update, + acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation, map[string]interface{}{ + "is_kafka_configured": acctest.Representation{RepType: acctest.Required, Create: `false`, Update: `true`}, + "cluster_profile": acctest.Representation{RepType: acctest.Optional, Create: `HADOOP_EXTENDED`, Update: `HADOOP_EXTENDED`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `hadext1`, Update: `hadext1`}, + "kafka_broker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceKafkaBrokerNodeFlexShapeRepresentation}, + })), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "cluster_admin_password", "T3JhY2xlVGVhbVVTQSExMjM="), + resource.TestCheckResourceAttrSet(resourceName, "cluster_public_key"), + resource.TestCheckResourceAttr(resourceName, "cluster_version", "ODH1"), + resource.TestCheckResourceAttr(resourceName, "is_high_availability", "true"), + resource.TestCheckResourceAttr(resourceName, "is_secure", "true"), + resource.TestCheckResourceAttr(resourceName, "is_kafka_configured", "true"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.node_type"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.shape"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.subnet_id"), + resource.TestCheckResourceAttr(resourceName, "state", "ACTIVE"), + ), + }, + // Remove Kafka to cluster + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + kmsKeyIdUVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Update, + acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation, map[string]interface{}{ + "is_kafka_configured": acctest.Representation{RepType: acctest.Required, Create: `false`, Update: `false`}, + "cluster_profile": acctest.Representation{RepType: acctest.Optional, Create: `HADOOP_EXTENDED`, Update: `HADOOP_EXTENDED`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `hadext1`, Update: `hadext1`}, + "kafka_broker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceKafkaBrokerNodeFlexShapeRepresentation}, + })), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "cluster_admin_password", "T3JhY2xlVGVhbVVTQSExMjM="), + resource.TestCheckResourceAttrSet(resourceName, "cluster_public_key"), + resource.TestCheckResourceAttr(resourceName, "cluster_version", "ODH1"), + resource.TestCheckResourceAttr(resourceName, "is_high_availability", "true"), + resource.TestCheckResourceAttr(resourceName, "is_secure", "true"), + resource.TestCheckResourceAttr(resourceName, "is_kafka_configured", "false"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.node_type"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.shape"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.subnet_id"), + resource.TestCheckResourceAttr(resourceName, "state", "ACTIVE"), + ), + }, + // delete before next Create + { + Config: config + compartmentIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr, + }, + // verify Create with required fields Kafka cluster + { + Config: config + compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + bootstrapScriptUrlVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Required, acctest.Create, + acctest.RepresentationCopyWithNewProperties(bdsInstanceOdhRepresentation, map[string]interface{}{ + "is_kafka_configured": acctest.Representation{RepType: acctest.Required, Create: `false`, Update: `false`}, + "cluster_profile": acctest.Representation{RepType: acctest.Optional, Create: `KAFKA`, Update: `HADOOP_EXTENDED`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `kafkacluster`, Update: `kafkacluster`}, + "kafka_broker_node": acctest.RepresentationGroup{RepType: acctest.Required, Group: bdsInstanceKafkaBrokerNodeFlexShapeRepresentation}, + })), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "cluster_admin_password", "T3JhY2xlVGVhbVVTQSExMjM="), + resource.TestCheckResourceAttrSet(resourceName, "cluster_public_key"), + resource.TestCheckResourceAttr(resourceName, "cluster_version", "ODH1"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "is_high_availability", "true"), + resource.TestCheckResourceAttr(resourceName, "is_secure", "true"), + resource.TestCheckResourceAttr(resourceName, "is_kafka_configured", "false"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.node_type"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.shape"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.subnet_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, // delete before next Create { @@ -316,7 +461,6 @@ func TestResourceBdsOdhInstance(t *testing.T) { }, ), }, - // verify Update to the compartment (the compartment will be switched back in the next step) and change shapes { Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + bootstrapScriptUrlVariableStr + BdsInstanceOdhResourceDependencies + @@ -367,7 +511,6 @@ func TestResourceBdsOdhInstance(t *testing.T) { }, ), }, - // verify updates to updatable parameters, add a worker, update compute worker flex->regular, update util regular -> flex { Config: config + compartmentIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + @@ -404,7 +547,54 @@ func TestResourceBdsOdhInstance(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "util_node.0.shape", "VM.Standard.E4.Flex"), resource.TestCheckResourceAttr(resourceName, "master_node.0.shape", "VM.Standard.E4.Flex"), resource.TestCheckResourceAttr(resourceName, "compute_only_worker_node.0.shape", "VM.Standard2.4"), - resource.TestCheckResourceAttr(resourceName, "edge_node.0.shape", "VM.Standard2.4"), + resource.TestCheckResourceAttr(resourceName, "edge_node.0.shape", "VM.Standard.E4.Flex"), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceName, "id") + if resId != resId2 { + return fmt.Errorf("Resource recreated when it was supposed to be updated.") + } + return err + }, + ), + }, + // Add Master and Utility Node + { + Config: config + compartmentIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + subnetIdVariableStr + BdsInstanceOdhResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Update, bdsInstanceOdhWithAddMasterUtilRepresentation), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "cluster_admin_password", "T3JhY2xlVGVhbVVTQSExMjM="), + resource.TestCheckResourceAttr(resourceName, "cluster_profile", "HADOOP"), + resource.TestCheckResourceAttrSet(resourceName, "cluster_public_key"), + resource.TestCheckResourceAttr(resourceName, "cluster_version", "ODH1"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "is_cloud_sql_configured"), + resource.TestCheckResourceAttr(resourceName, "is_high_availability", "true"), + resource.TestCheckResourceAttr(resourceName, "is_secure", "true"), + resource.TestCheckResourceAttr(resourceName, "kerberos_realm_name", "BDSCLOUDSERVICE.ORACLE.COM"), + resource.TestCheckResourceAttr(resourceName, "kms_key_id", kmsKeyIdU), + resource.TestCheckResourceAttr(resourceName, "network_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_config.0.cidr_block", "111.112.0.0/16"), + resource.TestCheckResourceAttr(resourceName, "network_config.0.is_nat_gateway_required", "true"), + resource.TestCheckResourceAttr(resourceName, "nodes.#", "14"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.availability_domain"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.display_name"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.fault_domain"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.instance_id"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.node_type"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.shape"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.state"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.subnet_id"), + resource.TestCheckResourceAttrSet(resourceName, "nodes.0.time_created"), + resource.TestCheckResourceAttr(resourceName, "number_of_nodes", "14"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "util_node.0.shape", "VM.Standard.E4.Flex"), + resource.TestCheckResourceAttr(resourceName, "master_node.0.shape", "VM.Standard.E4.Flex"), + resource.TestCheckResourceAttr(resourceName, "compute_only_worker_node.0.shape", "VM.Standard.E4.Flex"), + resource.TestCheckResourceAttr(resourceName, "edge_node.0.shape", "VM.Standard.E4.Flex"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -415,16 +605,18 @@ func TestResourceBdsOdhInstance(t *testing.T) { }, ), }, + // verify datasource { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_bds_bds_instances", "test_bds_instances", acctest.Optional, acctest.Update, bdsInstanceOdhDataSourceRepresentation) + compartmentIdVariableStr + kmsKeyIdUVariableStr + subnetIdVariableStr + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + BdsInstanceOdhResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Update, bdsInstanceOdhWithRegularComputeAndFlexMasterUtilRepresentation), + acctest.GenerateResourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Optional, acctest.Update, bdsInstanceOdhWithAddMasterUtilRepresentation), Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + resource.TestCheckResourceAttr(resourceName, "is_kafka_configured", "false"), resource.TestCheckResourceAttr(datasourceName, "bds_instances.#", "1"), resource.TestCheckResourceAttr(datasourceName, "bds_instances.0.cluster_profile", "HADOOP"), resource.TestCheckResourceAttr(datasourceName, "bds_instances.0.cluster_version", "ODH1"), @@ -436,6 +628,8 @@ func TestResourceBdsOdhInstance(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "bds_instances.0.is_high_availability", "true"), resource.TestCheckResourceAttr(datasourceName, "bds_instances.0.is_secure", "true"), resource.TestCheckResourceAttrSet(datasourceName, "bds_instances.0.number_of_nodes"), + resource.TestCheckResourceAttrSet(datasourceName, "bds_instances.0.number_of_nodes_requiring_maintenance_reboot"), + resource.TestCheckResourceAttr(datasourceName, "bds_instances.0.state", "ACTIVE"), resource.TestCheckResourceAttrSet(datasourceName, "bds_instances.0.state"), resource.TestCheckResourceAttrSet(datasourceName, "bds_instances.0.time_created"), ), @@ -444,7 +638,7 @@ func TestResourceBdsOdhInstance(t *testing.T) { { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_bds_bds_instance", "test_bds_instance", acctest.Required, acctest.Create, bdsInstanceOdhSingularDataSourceRepresentation) + - compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + BdsInstanceOdhWithRegularComputeWorkerResourceConfig, + compartmentIdVariableStr + kmsKeyIdVariableStr + subnetIdVariableStr + kmsKeyIdUVariableStr + bootstrapScriptUrlVariableStr + bootstrapScriptUrlUVariableStr + BdsInstanceOdhWithAddMasterUtilWorkerResourceConfig, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrSet(singularDatasourceName, "bds_instance_id"), @@ -464,12 +658,13 @@ func TestResourceBdsOdhInstance(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "is_cloud_sql_configured"), + resource.TestCheckResourceAttr(resourceName, "is_kafka_configured", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "is_high_availability", "true"), resource.TestCheckResourceAttr(singularDatasourceName, "is_secure", "true"), resource.TestCheckResourceAttr(singularDatasourceName, "network_config.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "network_config.0.cidr_block", "111.112.0.0/16"), resource.TestCheckResourceAttr(singularDatasourceName, "network_config.0.is_nat_gateway_required", "true"), - resource.TestCheckResourceAttr(singularDatasourceName, "nodes.#", "12"), + resource.TestCheckResourceAttr(singularDatasourceName, "nodes.#", "14"), resource.TestCheckResourceAttrSet(singularDatasourceName, "nodes.0.availability_domain"), resource.TestCheckResourceAttrSet(singularDatasourceName, "nodes.0.display_name"), resource.TestCheckResourceAttrSet(singularDatasourceName, "nodes.0.fault_domain"), @@ -482,13 +677,16 @@ func TestResourceBdsOdhInstance(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "nodes.0.state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "nodes.0.time_created"), resource.TestCheckResourceAttrSet(singularDatasourceName, "number_of_nodes"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "number_of_nodes_requiring_maintenance_reboot"), + resource.TestCheckResourceAttr(singularDatasourceName, "state", "ACTIVE"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "number_of_nodes"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), ), }, // verify resource import { - Config: config + BdsInstanceOdhWithRegularComputeRequiredOnlyResource, + Config: config + BdsInstanceOdhWithAddMasterUtilRequiredOnlyResource, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -502,6 +700,7 @@ func TestResourceBdsOdhInstance(t *testing.T) { "worker_node.0.shape_config", "compute_only_worker_node.0.shape_config", "edge_node.0.shape_config", + "kafka_broker_node.0.shape_config", }, ResourceName: resourceName, }, diff --git a/internal/integrationtest/database_autonomous_container_database_resource_test.go b/internal/integrationtest/database_autonomous_container_database_resource_test.go index 74b5dda76e0..322862600fb 100644 --- a/internal/integrationtest/database_autonomous_container_database_resource_test.go +++ b/internal/integrationtest/database_autonomous_container_database_resource_test.go @@ -46,7 +46,7 @@ var ( "maintenance_window_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseAutonomousContainerDatabaseMaintenanceWindowDetailsRepresentation}, "service_level_agreement_type": acctest.Representation{RepType: acctest.Optional, Create: `STANDARD`}, "db_name": acctest.Representation{RepType: acctest.Optional, Create: `DBNAME`}, - "db_version": acctest.Representation{RepType: acctest.Required, Create: `19.18.0.1.0`}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: `19.20.0.1.0`}, } ACDatabaseBackupConfigRepresentation = map[string]interface{}{ diff --git a/internal/integrationtest/database_autonomous_container_database_test.go b/internal/integrationtest/database_autonomous_container_database_test.go index bfe75aa4a98..cf41f97c32a 100644 --- a/internal/integrationtest/database_autonomous_container_database_test.go +++ b/internal/integrationtest/database_autonomous_container_database_test.go @@ -54,7 +54,7 @@ var ( "version_preference": acctest.Representation{RepType: acctest.Optional, Create: `LATEST_RELEASE_UPDATE`, Update: `NEXT_RELEASE_UPDATE`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `containerDatabase2`, Update: `displayName2`}, "patch_model": acctest.Representation{RepType: acctest.Required, Create: `RELEASE_UPDATES`, Update: `RELEASE_UPDATE_REVISIONS`}, - "db_version": acctest.Representation{RepType: acctest.Required, Create: `19.18.0.1.0`}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: `19.20.0.1.0`}, "cloud_autonomous_vm_cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id}`}, "backup_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ACDatabaseBackupConfigRepresentation}, "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, diff --git a/internal/integrationtest/database_autonomous_database_resource_test.go b/internal/integrationtest/database_autonomous_database_resource_test.go index e4af9908bb5..12582f98527 100644 --- a/internal/integrationtest/database_autonomous_database_resource_test.go +++ b/internal/integrationtest/database_autonomous_database_resource_test.go @@ -12,13 +12,14 @@ import ( "testing" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/oracle/terraform-provider-oci/internal/acctest" "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" "github.com/oracle/terraform-provider-oci/internal/utils" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" oci_common "github.com/oracle/oci-go-sdk/v65/common" oci_database "github.com/oracle/oci-go-sdk/v65/database" @@ -68,7 +69,8 @@ var ( "character_set": acctest.Representation{RepType: acctest.Optional, Create: `AR8ADOS710`}, "ncharacter_set": acctest.Representation{RepType: acctest.Optional, Create: `UTF8`}, "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `ECPU`}, - "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`, Update: `6.0`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `8.0`, Update: `10.0`}, + "in_memory_percentage": acctest.Representation{RepType: acctest.Optional, Create: `50`, Update: `60`}, }) autonomousDatabaseDedicatedRepresentationForClone = acctest.RepresentationCopyWithNewProperties( @@ -139,6 +141,9 @@ var ( "is_mtls_connection_required": acctest.Representation{RepType: acctest.Optional, Create: `false`}, }) + // fetch KMS from compartment_id_for_static_resource(set in KeyResourceDependencyConfigDbaas) + ATPDAutonomousContainerDatabaseResourceDependenciesDbaasOnly = DatabaseCloudAutonomousVmClusterRequiredOnlyResource + kmsKeyIdCreateVariableStr + kmsKeyIdUpdateVariableStr + KeyResourceDependencyConfigDbaas + AutonomousDatabaseDedicatedResourceDependencies = DatabaseAutonomousContainerDatabaseResourceConfig autonomousDatabaseRefreshableCloneSourceADBRepresentation = acctest.RepresentationCopyWithNewProperties( @@ -200,23 +205,52 @@ var ( "autonomous_container_database_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_autonomous_container_database.test_autonomous_container_database.id}`}, "is_dedicated": acctest.Representation{RepType: acctest.Optional, Create: `true`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: adbExaccName}, - "is_access_control_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `true`}, - "whitelisted_ips": acctest.Representation{RepType: acctest.Optional, Create: []string{`1.1.1.1/28`}, Update: []string{`1.1.1.1/28`, `2.2.2.2/28`}}, "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, }) autonomousDatabaseDGExaccRepresentation = acctest.RepresentationCopyWithNewProperties( - acctest.RepresentationCopyWithRemovedProperties(acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbExaccName}, DatabaseAutonomousDatabaseRepresentation), []string{"license_model", "db_version", "is_auto_scaling_enabled", "operations_insights_status", "admin_password", "kms_key_id", "vault_id", "autonomous_maintenance_schedule_type", "customer_contacts", "scheduled_operations"}), + acctest.RepresentationCopyWithRemovedProperties(acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbExaccName}, DatabaseAutonomousDatabaseRepresentation), []string{"license_model", "db_version", "is_auto_scaling_enabled", "operations_insights_status", "admin_password", "kms_key_id", "vault_id", "autonomous_maintenance_schedule_type", "customer_contacts", "scheduled_operations", "whitelisted_ips"}), + map[string]interface{}{ + "autonomous_container_database_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_autonomous_container_database.exacc_test_autonomous_container_database.id}`}, + "is_dedicated": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: adbExaccName}, + "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, + }) + + InMemoryautonomousDatabaseDGExaccRepresentation = acctest.RepresentationCopyWithNewProperties( + acctest.RepresentationCopyWithRemovedProperties(acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbExaccName}, DatabaseAutonomousDatabaseRepresentation), []string{"cpu_core_count", "compute_model", "license_model", "db_version", "is_auto_scaling_enabled", "operations_insights_status", "admin_password", "kms_key_id", "vault_id", "autonomous_maintenance_schedule_type", "customer_contacts", "scheduled_operations", "freeform_tags", "is_mtls_connection_required", "whitelisted_ips"}), map[string]interface{}{ "autonomous_container_database_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_autonomous_container_database.exacc_test_autonomous_container_database.id}`}, "is_dedicated": acctest.Representation{RepType: acctest.Optional, Create: `true`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: adbExaccName}, - "is_access_control_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `true`}, - "whitelisted_ips": acctest.Representation{RepType: acctest.Optional, Create: []string{`1.1.1.1/28`}, Update: []string{`1.1.1.1/28`, `2.2.2.2/28`}}, - "standby_whitelisted_ips": acctest.Representation{RepType: acctest.Optional, Update: []string{`3.4.5.6/28`, `3.6.7.8/28`}}, - "are_primary_whitelisted_ips_used": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `false`}, "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, + //"is_access_control_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + //"whitelisted_ips": acctest.Representation{RepType: acctest.Optional, Create: []string{`1.1.1.1/28`}}, + //"standby_whitelisted_ips": acctest.Representation{RepType: acctest.Optional, Create: []string{`3.4.5.6/28`, `3.6.7.8/28`}}, + //"are_primary_whitelisted_ips_used": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `false`}, + "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `OCPU`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `8.0`, Update: `10.0`}, + "in_memory_percentage": acctest.Representation{RepType: acctest.Optional, Create: `50`, Update: `60`}, }) + + InmemoryautonomousDatabaseExaccRepresentation = acctest.RepresentationCopyWithNewProperties( + acctest.RepresentationCopyWithRemovedProperties(acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbExaccName}, DatabaseAutonomousDatabaseRepresentation), []string{"cpu_core_count", "compute_model", "license_model", "defined_tags", "db_version", "is_auto_scaling_enabled", "operations_insights_status", "admin_password", "kms_key_id", "vault_id", "autonomous_maintenance_schedule_type", "customer_contacts", "scheduled_operations", "freeform_tags", "is_mtls_connection_required", "whitelisted_ips"}), + map[string]interface{}{ + "autonomous_container_database_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_autonomous_container_database.test_autonomous_container_database.id}`}, + "is_dedicated": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: adbExaccName}, + //"is_access_control_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + //"whitelisted_ips": acctest.Representation{RepType: acctest.Optional, Create: []string{`1.1.1.1/28`}}, + + "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, + "is_mtls_connection_required": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `8.0`, Update: `10.0`}, + "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `OCPU`}, + "in_memory_percentage": acctest.Representation{RepType: acctest.Optional, Create: `50`, Update: `60`}, + }) + autonomousDatabaseDGExaccEcpuRepresentation = acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(autonomousDatabaseDGExaccRepresentation, []string{"cpu_core_count"}), map[string]interface{}{ "compute_count": acctest.Representation{RepType: acctest.Required, Create: `1`}, }) @@ -235,7 +269,9 @@ var ( "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, } - ATPDAutonomousContainerDatabaseResourceDependenciesDbaas = DatabaseCloudAutonomousVmClusterRequiredOnlyResource + KeyResourceDependencyConfigDbaas + ATPDAutonomousContainerDatabaseResourceDependenciesDbaas = DatabaseCloudAutonomousVmClusterRequiredOnlyResource + KeyResourceDependencyConfigDbaas + ExaccutonomousContainerDatabaseResourceDependenciesDbaasOnly = ACDatabaseResourceDependencies + kmsKeyIdCreateVariableStr + kmsKeyIdUpdateVariableStr + ExaccKeyResourceDependencyConfigDbaas + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database", acctest.Optional, acctest.Update, ACDatabaseRepresentation) autonomousDatabaseExaccRequiredOnlyResource = ExaccADBDatabaseResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Required, acctest.Create, autonomousDatabaseExaccRepresentation) @@ -245,6 +281,24 @@ var ( ExaccADBDatabaseResourceDependencies = ExaccACDResourceConfig + ExaccKeyResourceDependencyConfigDbaas = tfStaticCompartmentIdVariableStr + ` + data "oci_kms_keys" "test_keys_dependency" { + #Required + compartment_id = "${var.compartment_id_for_static_resource}" + management_endpoint = "${data.oci_kms_vault.test_vault.management_endpoint}" + algorithm = "AES" + + filter { + name = "state" + values = ["ENABLED", "UPDATING"] + } + }` + ` + data "oci_kms_vault" "test_vault" { + #Required + vault_id = "${var.kms_vault_id}" + } + ` + ExaccADBWithDataguardResourceDependencies = DatabaseAutonomousContainerExaccAutonomousContainerDatabaseDataguardAssociationResourceConfig PrimarySourceId string @@ -282,16 +336,15 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { DatabaseAutonomousContainerDatabaseMaintenanceWindowDetailsRepresentation), []string{"lead_time_in_weeks"}) AutonomousContainerDatabaseDedicatedRepresentation := acctest.GetUpdatedRepresentationCopy("maintenance_window_details", acctest.RepresentationGroup{RepType: acctest.Optional, Group: AutonomousContainerDatabaseDedicatedMaintenanceWindowDetailsRepresentation}, DatabaseAutonomousContainerDatabaseRepresentation) - AutonomousContainerDatabaseDedicatedResourceConfig := ATPDAutonomousContainerDatabaseResourceDependenciesDbaas + + AutonomousContainerDatabaseDedicatedResourceConfig := ATPDAutonomousContainerDatabaseResourceDependenciesDbaasOnly + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database", acctest.Optional, acctest.Update, AutonomousContainerDatabaseDedicatedRepresentation) AutonomousDatabaseDedicatedResourceDependencies := AutonomousContainerDatabaseDedicatedResourceConfig AutonomousDatabaseDedicatedResourceConfig := AutonomousDatabaseDedicatedResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, autonomousDatabaseDedicatedRepresentation) - var resId, resId2 string acctest.ResourceTest(t, nil, []resource.TestStep{ - // verify Create with optionals + // 1. verify Create with optionals { Config: config + compartmentIdVariableStr + AutonomousDatabaseDedicatedResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, @@ -302,6 +355,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), resource.TestCheckResourceAttrSet(resourceName, "autonomous_container_database_id"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "compute_count", "8"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbDedicatedName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -313,6 +367,8 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttr(resourceName, "character_set", "AR8ADOS710"), resource.TestCheckResourceAttr(resourceName, "ncharacter_set", "UTF8"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "50"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -321,7 +377,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { ), }, - // verify updates to updatable parameters + // 2. verify updates to updatable parameters { Config: config + compartmentIdVariableStr + AutonomousDatabaseDedicatedResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, @@ -332,6 +388,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#12"), resource.TestCheckResourceAttrSet(resourceName, "autonomous_container_database_id"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "compute_count", "10"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbDedicatedName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -341,6 +398,8 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), resource.TestCheckResourceAttr(resourceName, "rotate_key_trigger", "false"), resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "60"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -351,7 +410,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { }, ), }, - // verify rotate key + // 3. verify rotate key { Config: config + compartmentIdVariableStr + AutonomousDatabaseDedicatedResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, @@ -362,6 +421,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#12"), resource.TestCheckResourceAttrSet(resourceName, "autonomous_container_database_id"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "compute_count", "10"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbDedicatedName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -371,6 +431,8 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), resource.TestCheckResourceAttr(resourceName, "rotate_key_trigger", "true"), resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "60"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -381,7 +443,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { }, ), }, - // verify no rotation of key + // 4. verify no rotation of key { Config: config + compartmentIdVariableStr + AutonomousDatabaseDedicatedResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, @@ -392,6 +454,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#12"), resource.TestCheckResourceAttrSet(resourceName, "autonomous_container_database_id"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "compute_count", "10"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbDedicatedName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -401,6 +464,8 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), resource.TestCheckResourceAttr(resourceName, "rotate_key_trigger", "true"), resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "60"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -431,6 +496,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { // ), // }, // verify datasource , fractional ocpu and gb storage + // 5. verify datasource { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_database_autonomous_databases", "test_autonomous_databases", acctest.Optional, acctest.Update, autonomousDatabaseDedicatedDataSourceRepresentation) + @@ -448,6 +514,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "autonomous_databases.0.compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "autonomous_databases.0.connection_strings.#", "1"), resource.TestCheckResourceAttr(datasourceName, "autonomous_databases.0.connection_urls.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "autonomous_databases.0.compute_count", "10"), resource.TestCheckResourceAttr(datasourceName, "autonomous_databases.0.data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(datasourceName, "autonomous_databases.0.db_name", adbDedicatedName), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_databases.0.db_version"), @@ -459,9 +526,11 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "autonomous_databases.0.provisionable_cpus.#"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_databases.0.state"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_databases.0.time_created"), + resource.TestCheckResourceAttr(datasourceName, "autonomous_databases.0.in_memory_percentage", "60"), + resource.TestCheckResourceAttrSet(datasourceName, "autonomous_databases.0.in_memory_area_in_gbs"), ), }, - // verify singular datasource + // 6. verify singular datasource { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Required, acctest.Create, acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseBackupRepresentation, []string{"display_name"})) + @@ -473,6 +542,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "connection_strings.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "connection_strings.0.all_connection_strings.%", "3"), resource.TestCheckResourceAttr(singularDatasourceName, "connection_urls.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "compute_count", "10"), resource.TestCheckResourceAttr(singularDatasourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "db_name", adbDedicatedName), resource.TestCheckResourceAttrSet(singularDatasourceName, "db_version"), @@ -484,9 +554,11 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "is_dedicated", "true"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "in_memory_area_in_gbs"), + resource.TestCheckResourceAttr(singularDatasourceName, "in_memory_percentage", "60"), ), }, - // verify resource import + // 7. verify resource import { Config: config + DatabaseAutonomousDatabaseRequiredOnlyResource, ImportState: true, @@ -509,11 +581,11 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { ResourceName: resourceName, }, - // remove any previously created resources + // 8. remove any previously created resources { Config: config + compartmentIdVariableStr, }, - // verify ADB clone from a source ADB + // 9. verify ADB clone from a source ADB 9 { Config: config + compartmentIdVariableStr + AutonomousDatabaseDedicatedResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_source", acctest.Optional, acctest.Create, autonomousDatabaseDedicatedRepresentation) + @@ -522,6 +594,7 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), resource.TestCheckResourceAttr(resourceName, "clone_type", "FULL"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "compute_count", "8"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbDedicatedCloneName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -533,6 +606,8 @@ func TestResourceDatabaseAutonomousDatabaseDedicated(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttr(resourceName, "character_set", "AR8ADOS710"), resource.TestCheckResourceAttr(resourceName, "ncharacter_set", "UTF8"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "50"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -1706,7 +1781,7 @@ func TestResourceDatabaseAutonomousDatabaseResource_dbVersion(t *testing.T) { Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, acctest.GetUpdatedRepresentationCopy("db_version", acctest.Representation{RepType: acctest.Optional, Update: `19c`}, - acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbDbVersionName}, DatabaseAutonomousDatabaseRepresentation))), + acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbDbVersionName}, acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseRepresentation, []string{"scheduled_operations"})))), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#12"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), @@ -1907,10 +1982,10 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource_dataGuard(t *testing.T) resource.TestCheckResourceAttr(resourceName, "is_auto_scaling_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), resource.TestCheckResourceAttrSet(resourceName, "state"), - resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "1"), - resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "are_primary_whitelisted_ips_used", "true"), - resource.TestCheckResourceAttr(resourceName, "standby_whitelisted_ips.#", "1"), + //resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "1"), + //resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), + //resource.TestCheckResourceAttr(resourceName, "are_primary_whitelisted_ips_used", "true"), + //resource.TestCheckResourceAttr(resourceName, "standby_whitelisted_ips.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "memory_per_oracle_compute_unit_in_gbs"), func(s *terraform.State) (err error) { @@ -1939,10 +2014,10 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource_dataGuard(t *testing.T) resource.TestCheckResourceAttr(resourceName, "display_name", adbExaccName), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), - resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "are_primary_whitelisted_ips_used", "false"), - resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "2"), - resource.TestCheckResourceAttr(resourceName, "standby_whitelisted_ips.#", "2"), + //resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), + //resource.TestCheckResourceAttr(resourceName, "are_primary_whitelisted_ips_used", "false"), + //resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "2"), + //resource.TestCheckResourceAttr(resourceName, "standby_whitelisted_ips.#", "2"), resource.TestCheckResourceAttrSet(resourceName, "state"), func(s *terraform.State) (err error) { @@ -1997,8 +2072,8 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "is_auto_scaling_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), resource.TestCheckResourceAttrSet(resourceName, "state"), - resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "1"), - resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), + //resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "1"), + //resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), resource.TestCheckResourceAttrSet(resourceName, "memory_per_oracle_compute_unit_in_gbs"), func(s *terraform.State) (err error) { @@ -2027,8 +2102,8 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "display_name", adbExaccName), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), - resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "2"), + //resource.TestCheckResourceAttr(resourceName, "is_access_control_enabled", "true"), + //resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "2"), resource.TestCheckResourceAttrSet(resourceName, "state"), func(s *terraform.State) (err error) { @@ -2053,6 +2128,167 @@ func ListAutonomousDatabasesWaitCondition(response oci_common.OCIOperationRespon return false } +// issue-routing-tag: database/ExaCC +func TestResourceDatabaseInMemoryExaccAutonomousDatabaseResource_dataGuard(t *testing.T) { + httpreplay.SetScenario("TestResourceDatabaseExaccAutonomousDatabaseResource_dataGuard") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + const standbyDbWaitConditionDuration = time.Duration(60 * time.Minute) + + resourceName := "oci_database_autonomous_database.test_autonomous_database" + + var resId, resId2 string + + acctest.ResourceTest(t, testAccCheckDatabaseAutonomousDatabaseDestroy, []resource.TestStep{ + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + ExaccADBWithDataguardResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, InMemoryautonomousDatabaseDGExaccRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), + resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), + resource.TestCheckResourceAttrSet(resourceName, "db_version"), + resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), + resource.TestCheckResourceAttr(resourceName, "display_name", adbExaccName), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_auto_scaling_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "memory_per_oracle_compute_unit_in_gbs"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "50"), + resource.TestCheckResourceAttr(resourceName, "compute_count", "8"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "false")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + // verify updates to acl parameter for Exacc + { + Config: config + compartmentIdVariableStr + ExaccADBWithDataguardResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, InMemoryautonomousDatabaseDGExaccRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttrSet(resourceName, "autonomous_container_database_id"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), + resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), + resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), + resource.TestCheckResourceAttr(resourceName, "display_name", adbExaccName), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "60"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), + resource.TestCheckResourceAttr(resourceName, "compute_count", "10"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceName, "id") + if resId != resId2 { + return fmt.Errorf("Resource recreated when it was supposed to be updated.") + } + return err + }, + ), + }, + }) +} + +// issue-routing-tag: database/ExaCC +func TestResourceDatabaseInMemoryExaccAutonomousDatabaseResource(t *testing.T) { + httpreplay.SetScenario("TestResourceDatabaseExaccAutonomousDatabaseResource") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + const standbyDbWaitConditionDuration = time.Duration(60 * time.Minute) + + resourceName := "oci_database_autonomous_database.test_autonomous_database" + + var resId, resId2 string + + acctest.ResourceTest(t, testAccCheckDatabaseAutonomousDatabaseDestroy, []resource.TestStep{ + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + ExaccutonomousContainerDatabaseResourceDependenciesDbaasOnly + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, InmemoryautonomousDatabaseExaccRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + //resource.TestCheckResourceAttr(resourceName, "cpu_core_count", "1"), + resource.TestCheckResourceAttr(resourceName, "compute_count", "8"), + resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), + resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), + resource.TestCheckResourceAttrSet(resourceName, "db_version"), + resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), + resource.TestCheckResourceAttr(resourceName, "display_name", adbExaccName), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_auto_scaling_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "memory_per_oracle_compute_unit_in_gbs"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "50"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "false")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + // verify updates to acl parameter for Exacc + { + Config: config + compartmentIdVariableStr + ExaccutonomousContainerDatabaseResourceDependenciesDbaasOnly + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, InmemoryautonomousDatabaseExaccRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttrSet(resourceName, "autonomous_container_database_id"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + //resource.TestCheckResourceAttr(resourceName, "cpu_core_count", "1"), + resource.TestCheckResourceAttr(resourceName, "compute_count", "10"), + resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), + resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), + resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), + resource.TestCheckResourceAttr(resourceName, "display_name", adbExaccName), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_dedicated", "true"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "in_memory_percentage", "60"), + resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceName, "id") + if resId != resId2 { + return fmt.Errorf("Resource recreated when it was supposed to be updated.") + } + return err + }, + ), + }, + }) +} + func listListAutonomousDatabasesFetchOperation(client *client.OracleClients, databaseId *string, retryPolicy *oci_common.RetryPolicy) error { _, err := client.DatabaseClient().ListAutonomousDatabases(context.Background(), oci_database.ListAutonomousDatabasesRequest{ AutonomousContainerDatabaseId: databaseId, diff --git a/internal/integrationtest/database_vm_cluster_network_test.go b/internal/integrationtest/database_vm_cluster_network_test.go index 351638957ab..51476c3cd55 100644 --- a/internal/integrationtest/database_vm_cluster_network_test.go +++ b/internal/integrationtest/database_vm_cluster_network_test.go @@ -78,16 +78,16 @@ var ( "hostname": acctest.Representation{RepType: acctest.Required, Create: `myprefix1-ivmmj-scan`, Update: `myprefix2-ivmmj-scan`}, "ips": acctest.Representation{RepType: acctest.Required, Create: []string{`192.168.19.7`, `192.168.19.6`, `192.168.19.8`}, Update: []string{`192.168.19.7`, `192.168.19.8`, `192.168.19.9`}}, "port": acctest.Representation{RepType: acctest.Required, Create: `1521`, Update: `1522`}, - "scan_listener_port_tcp": acctest.Representation{RepType: acctest.Optional, Create: `1521`, Update: `1522`}, - "scan_listener_port_tcp_ssl": acctest.Representation{RepType: acctest.Optional, Create: `2484`, Update: `2484`}, + "scan_listener_port_tcp": acctest.Representation{RepType: acctest.Required, Create: `1521`, Update: `1522`}, + "scan_listener_port_tcp_ssl": acctest.Representation{RepType: acctest.Required, Create: `2484`, Update: `2484`}, } DatabaseVmClusterNetwork2ScansRepresentation = map[string]interface{}{ "hostname": acctest.Representation{RepType: acctest.Required, Create: `myprefix4-ivmmj-scan`, Update: `myprefix3-ivmmj-scan`}, "ips": acctest.Representation{RepType: acctest.Required, Create: []string{`192.168.19.26`, `192.168.19.27`, `192.168.19.28`}, Update: []string{`192.168.19.27`, `192.168.19.28`, `192.168.19.29`}}, "port": acctest.Representation{RepType: acctest.Required, Create: `1521`, Update: `1522`}, - "scan_listener_port_tcp": acctest.Representation{RepType: acctest.Optional, Create: `1521`, Update: `1522`}, - "scan_listener_port_tcp_ssl": acctest.Representation{RepType: acctest.Optional, Create: `2484`, Update: `2484`}, + "scan_listener_port_tcp": acctest.Representation{RepType: acctest.Required, Create: `1521`, Update: `1522`}, + "scan_listener_port_tcp_ssl": acctest.Representation{RepType: acctest.Required, Create: `2484`, Update: `2484`}, } DatabaseVmClusterNetworkBackupVmNetworkRepresentation = map[string]interface{}{ diff --git a/internal/service/bds/bds_bds_instance_data_source.go b/internal/service/bds/bds_bds_instance_data_source.go index 7a93570cdae..dbd576d5f7d 100644 --- a/internal/service/bds/bds_bds_instance_data_source.go +++ b/internal/service/bds/bds_bds_instance_data_source.go @@ -112,6 +112,10 @@ func (s *BdsBdsInstanceDataSourceCrud) SetData() error { s.D.Set("is_high_availability", *s.Res.IsHighAvailability) } + if s.Res.IsKafkaConfigured != nil { + s.D.Set("is_kafka_configured", *s.Res.IsKafkaConfigured) + } + if s.Res.IsSecure != nil { s.D.Set("is_secure", *s.Res.IsSecure) } @@ -144,6 +148,10 @@ func (s *BdsBdsInstanceDataSourceCrud) SetData() error { s.D.Set("number_of_nodes", *s.Res.NumberOfNodes) } + if s.Res.NumberOfNodesRequiringMaintenanceReboot != nil { + s.D.Set("number_of_nodes_requiring_maintenance_reboot", *s.Res.NumberOfNodesRequiringMaintenanceReboot) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeCreated != nil { diff --git a/internal/service/bds/bds_bds_instance_get_os_patch_data_source.go b/internal/service/bds/bds_bds_instance_get_os_patch_data_source.go new file mode 100644 index 00000000000..1bb4246689a --- /dev/null +++ b/internal/service/bds/bds_bds_instance_get_os_patch_data_source.go @@ -0,0 +1,171 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package bds + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_bds "github.com/oracle/oci-go-sdk/v65/bds" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func BdsBdsInstanceGetOsPatchDataSource() *schema.Resource { + return &schema.Resource{ + Read: readBdsBdsInstanceGetOsPatch, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "bds_instance_id": { + Type: schema.TypeString, + Required: true, + }, + "os_patch_version": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "min_bds_version": { + Type: schema.TypeString, + Computed: true, + }, + "min_compatible_odh_version_map": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "patch_type": { + Type: schema.TypeString, + Computed: true, + }, + "release_date": { + Type: schema.TypeString, + Computed: true, + }, + "target_packages": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "package_name": { + Type: schema.TypeString, + Computed: true, + }, + "related_cv_es": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "target_version": { + Type: schema.TypeString, + Computed: true, + }, + "update_type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func readBdsBdsInstanceGetOsPatch(d *schema.ResourceData, m interface{}) error { + sync := &BdsBdsInstanceGetOsPatchDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).BdsClient() + + return tfresource.ReadResource(sync) +} + +type BdsBdsInstanceGetOsPatchDataSourceCrud struct { + D *schema.ResourceData + Client *oci_bds.BdsClient + Res *oci_bds.GetOsPatchDetailsResponse +} + +func (s *BdsBdsInstanceGetOsPatchDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *BdsBdsInstanceGetOsPatchDataSourceCrud) Get() error { + request := oci_bds.GetOsPatchDetailsRequest{} + + if bdsInstanceId, ok := s.D.GetOkExists("bds_instance_id"); ok { + tmp := bdsInstanceId.(string) + request.BdsInstanceId = &tmp + } + + if osPatchVersion, ok := s.D.GetOkExists("os_patch_version"); ok { + tmp := osPatchVersion.(string) + request.OsPatchVersion = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "bds") + + response, err := s.Client.GetOsPatchDetails(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *BdsBdsInstanceGetOsPatchDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("BdsBdsInstanceGetOsPatchDataSource-", BdsBdsInstanceGetOsPatchDataSource(), s.D)) + + if s.Res.MinBdsVersion != nil { + s.D.Set("min_bds_version", *s.Res.MinBdsVersion) + } + + s.D.Set("min_compatible_odh_version_map", s.Res.MinCompatibleOdhVersionMap) + s.D.Set("min_compatible_odh_version_map", s.Res.MinCompatibleOdhVersionMap) + + s.D.Set("patch_type", s.Res.PatchType) + + if s.Res.ReleaseDate != nil { + s.D.Set("release_date", s.Res.ReleaseDate.String()) + } + + targetPackages := []interface{}{} + for _, item := range s.Res.TargetPackages { + targetPackages = append(targetPackages, OsPatchPackageSummaryToMap(item)) + } + s.D.Set("target_packages", targetPackages) + + return nil +} + +func OsPatchPackageSummaryToMap(obj oci_bds.OsPatchPackageSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.PackageName != nil { + result["package_name"] = string(*obj.PackageName) + } + + result["related_cv_es"] = obj.RelatedCVEs + result["related_cv_es"] = obj.RelatedCVEs + + if obj.TargetVersion != nil { + result["target_version"] = string(*obj.TargetVersion) + } + + result["update_type"] = string(obj.UpdateType) + + return result +} diff --git a/internal/service/bds/bds_bds_instance_list_os_patches_data_source.go b/internal/service/bds/bds_bds_instance_list_os_patches_data_source.go new file mode 100644 index 00000000000..a7aabaeb03d --- /dev/null +++ b/internal/service/bds/bds_bds_instance_list_os_patches_data_source.go @@ -0,0 +1,134 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package bds + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_bds "github.com/oracle/oci-go-sdk/v65/bds" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func BdsBdsInstanceListOsPatchesDataSource() *schema.Resource { + return &schema.Resource{ + Read: readBdsBdsInstanceListOsPatches, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "bds_instance_id": { + Type: schema.TypeString, + Required: true, + }, + "os_patches": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "bds_instance_id": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + + // Computed + "os_patch_version": { + Type: schema.TypeString, + Computed: true, + }, + "release_date": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func readBdsBdsInstanceListOsPatches(d *schema.ResourceData, m interface{}) error { + sync := &BdsBdsInstanceListOsPatchesDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).BdsClient() + + return tfresource.ReadResource(sync) +} + +type BdsBdsInstanceListOsPatchesDataSourceCrud struct { + D *schema.ResourceData + Client *oci_bds.BdsClient + Res *oci_bds.ListOsPatchesResponse +} + +func (s *BdsBdsInstanceListOsPatchesDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *BdsBdsInstanceListOsPatchesDataSourceCrud) Get() error { + request := oci_bds.ListOsPatchesRequest{} + + if bdsInstanceId, ok := s.D.GetOkExists("bds_instance_id"); ok { + tmp := bdsInstanceId.(string) + request.BdsInstanceId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "bds") + + response, err := s.Client.ListOsPatches(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListOsPatches(context.Background(), request) + if err != nil { + return err + } + + s.Res.Items = append(s.Res.Items, listResponse.Items...) + request.Page = listResponse.OpcNextPage + } + + return nil +} + +func (s *BdsBdsInstanceListOsPatchesDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("BdsBdsInstanceListOsPatchesDataSource-", BdsBdsInstanceListOsPatchesDataSource(), s.D)) + resources := []map[string]interface{}{} + + for _, r := range s.Res.Items { + bdsInstanceListOsPatch := map[string]interface{}{} + + if r.OsPatchVersion != nil { + bdsInstanceListOsPatch["os_patch_version"] = *r.OsPatchVersion + } + + if r.ReleaseDate != nil { + bdsInstanceListOsPatch["release_date"] = r.ReleaseDate.String() + } + + resources = append(resources, bdsInstanceListOsPatch) + } + + if f, fOk := s.D.GetOkExists("filter"); fOk { + resources = tfresource.ApplyFilters(f.(*schema.Set), resources, BdsBdsInstanceListOsPatchesDataSource().Schema["os_patches"].Elem.(*schema.Resource).Schema) + } + + if err := s.D.Set("os_patches", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/bds/bds_bds_instance_patch_histories_data_source.go b/internal/service/bds/bds_bds_instance_patch_histories_data_source.go index 64b96b93775..1eac1e67a23 100644 --- a/internal/service/bds/bds_bds_instance_patch_histories_data_source.go +++ b/internal/service/bds/bds_bds_instance_patch_histories_data_source.go @@ -22,6 +22,10 @@ func BdsBdsInstancePatchHistoriesDataSource() *schema.Resource { Type: schema.TypeString, Required: true, }, + "patch_type": { + Type: schema.TypeString, + Optional: true, + }, "patch_version": { Type: schema.TypeString, Optional: true, @@ -36,6 +40,10 @@ func BdsBdsInstancePatchHistoriesDataSource() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Computed + "patch_type": { + Type: schema.TypeString, + Computed: true, + }, "state": { Type: schema.TypeString, Computed: true, @@ -81,6 +89,10 @@ func (s *BdsBdsInstancePatchHistoriesDataSourceCrud) Get() error { request.BdsInstanceId = &tmp } + if patchType, ok := s.D.GetOkExists("patch_type"); ok { + request.PatchType = oci_bds.PatchHistorySummaryPatchTypeEnum(patchType.(string)) + } + if patchVersion, ok := s.D.GetOkExists("patch_version"); ok { tmp := patchVersion.(string) request.PatchVersion = &tmp @@ -124,6 +136,8 @@ func (s *BdsBdsInstancePatchHistoriesDataSourceCrud) SetData() error { for _, r := range s.Res.Items { bdsInstancePatchHistory := map[string]interface{}{} + bdsInstancePatchHistory["patch_type"] = r.PatchType + bdsInstancePatchHistory["state"] = r.LifecycleState if r.TimeUpdated != nil { diff --git a/internal/service/bds/bds_bds_instance_resource.go b/internal/service/bds/bds_bds_instance_resource.go index 36f6f51ab1b..bddc5072f90 100644 --- a/internal/service/bds/bds_bds_instance_resource.go +++ b/internal/service/bds/bds_bds_instance_resource.go @@ -102,7 +102,7 @@ func BdsBdsInstanceResource() *schema.Resource { "number_of_nodes": { Type: schema.TypeInt, Required: true, - ValidateFunc: validation.IntBetween(1, 2), + ValidateFunc: validation.IntAtLeast(1), }, "shape_config": { @@ -165,7 +165,7 @@ func BdsBdsInstanceResource() *schema.Resource { "number_of_nodes": { Type: schema.TypeInt, Required: true, - ValidateFunc: validation.IntBetween(1, 2), + ValidateFunc: validation.IntAtLeast(1), }, "shape_config": { @@ -390,7 +390,69 @@ func BdsBdsInstanceResource() *schema.Resource { }, }, }, + "kafka_broker_node": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "shape": { + Type: schema.TypeString, + Required: true, + }, + "subnet_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "block_volume_size_in_gbs": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: tfresource.ValidateInt64TypeString, + DiffSuppressFunc: tfresource.Int64StringDiffSuppressFunction, + }, + + "number_of_kafka_nodes": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(3), + }, + + "shape_config": { + Type: schema.TypeList, + Optional: true, + Computed: false, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + // Optional + "memory_in_gbs": { + Type: schema.TypeInt, + Optional: true, + }, + "ocpus": { + Type: schema.TypeInt, + Optional: true, + }, + "nvmes": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + }, + }, + }, // Optional "bootstrap_script_url": { Type: schema.TypeString, @@ -531,6 +593,10 @@ func BdsBdsInstanceResource() *schema.Resource { Type: schema.TypeBool, Optional: true, }, + "os_patch_version": { + Type: schema.TypeString, + Optional: true, + }, // Computed "cluster_details": { Type: schema.TypeList, @@ -701,13 +767,25 @@ func BdsBdsInstanceResource() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "time_maintenance_reboot_due": { + Type: schema.TypeString, + Computed: true, + }, }, }, }, + "is_kafka_configured": { + Type: schema.TypeBool, + Optional: true, + }, "number_of_nodes": { Type: schema.TypeInt, Computed: true, }, + "number_of_nodes_requiring_maintenance_reboot": { + Type: schema.TypeInt, + Computed: true, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -776,6 +854,13 @@ func createBdsBdsInstance(d *schema.ResourceData, m interface{}) error { return tfresource.ReadResource(sync) } + if _, ok := sync.D.GetOkExists("os_patch_version"); ok { + err := sync.InstallOsPatch() + if err != nil { + return err + } + } + if powerOff { if err := sync.StopBdsInstance(); err != nil { return err @@ -816,6 +901,13 @@ func updateBdsBdsInstance(d *schema.ResourceData, m interface{}) error { sync.D.Set("state", oci_bds.BdsInstanceLifecycleStateActive) } + if _, ok := sync.D.GetOkExists("os_patch_version"); ok { + err := sync.InstallOsPatch() + if err != nil { + return err + } + } + if err := tfresource.UpdateResource(d, sync); err != nil { return err } @@ -986,6 +1078,17 @@ func (s *BdsBdsInstanceResourceCrud) Create() error { } } + if clusterProfile, ok := s.D.GetOkExists("cluster_profile"); ok { + if clusterProfile == "KAFKA" { + if _, ok := s.D.GetOkExists("kafka_broker_node"); ok { + fieldKey := fmt.Sprintf("%s.%d.%s", "kafka_broker_node", 0, "number_of_kafka_nodes") + if numOfWorkers, ok := s.D.GetOkExists(fieldKey); ok { + numOfNode = numOfNode + numOfWorkers.(int) + } + } + } + } + createNodeDetails := make([]oci_bds.CreateNodeDetails, numOfNode) currentPos := 0 @@ -1050,6 +1153,30 @@ func (s *BdsBdsInstanceResourceCrud) Create() error { } } + if clusterProfile, ok := s.D.GetOkExists("cluster_profile"); ok { + if clusterProfile == "KAFKA" { + if nodes, ok := s.D.GetOkExists("kafka_broker_node"); ok { + interfaces := nodes.([]interface{}) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "kafka_broker_node", stateDataIndex) + converted, err := s.mapToCreateNodeDetails(fieldKeyFormat, "KAFKA_BROKER") + if err != nil { + return err + } + fieldKey := fmt.Sprintf(fieldKeyFormat, "number_of_kafka_nodes") + if numOfWorkers, ok := s.D.GetOkExists(fieldKey); ok { + for idx := 0; idx < numOfWorkers.(int); idx++ { + createNodeDetails[currentPos] = converted + currentPos = currentPos + 1 + } + + } + } + } + } + } + request.Nodes = createNodeDetails request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds") @@ -1082,6 +1209,24 @@ func (s *BdsBdsInstanceResourceCrud) Create() error { return createResultError } + if clusterProfile, ok := s.D.GetOkExists("cluster_profile"); ok { + isAddKafka, ok := s.D.GetOkExists("is_kafka_configured") + if clusterProfile != "KAFKA" && isAddKafka == true && ok { + if nodes, ok := s.D.GetOkExists("kafka_broker_node"); ok && nodes != nil { + interfaces := nodes.([]interface{}) + if len(interfaces) == 0 { + return fmt.Errorf("kafka broker node definition is missing") + } + err := s.AddKafka() + if err != nil { + return err + } + } else { + return fmt.Errorf("kafka broker node definition is missing") + } + } + } + _, computeWorkerAdditionError := s.updateComputeWorkersIfRequired() if computeWorkerAdditionError != nil { return computeWorkerAdditionError @@ -1091,7 +1236,6 @@ func (s *BdsBdsInstanceResourceCrud) Create() error { if edgeAdditionError != nil { return edgeAdditionError } - return nil } @@ -1279,6 +1423,52 @@ func (s *BdsBdsInstanceResourceCrud) Update() error { } } + if nodes, ok := s.D.GetOkExists("kafka_broker_node"); ok && nodes != nil { + interfaces := nodes.([]interface{}) + if len(interfaces) > 0 { + kafkaConfigured, ok := s.D.GetOkExists("is_kafka_configured") + if ok && !kafkaConfigured.(bool) { + return fmt.Errorf("Found a kafka broker node definition without is_kafka_configured set to true") + } + } + } + + // kafka + if kafkaConfigured, ok := s.D.GetOkExists("is_kafka_configured"); ok && s.D.HasChange("is_kafka_configured") { + oldRaw, newRaw := s.D.GetChange("is_kafka_configured") + if newRaw != "" && oldRaw != "" { + if kafkaConfigured.(bool) { + if nodes, ok := s.D.GetOkExists("kafka_broker_node"); ok && nodes != nil { + interfaces := nodes.([]interface{}) + if len(interfaces) == 0 { + return fmt.Errorf("kafka broker node definition is missing") + } + err := s.AddKafka() + if err != nil { + return err + } + } else { + return fmt.Errorf("kafka broker node definition is missing") + } + } else { + if clusterProfile, ok := s.D.GetOkExists("cluster_profile"); ok { + if clusterProfile == "KAFKA" { + if nodes, ok := s.D.GetOkExists("kafka_broker_node"); ok && nodes != nil { + interfaces := nodes.([]interface{}) + if len(interfaces) > 0 { + return fmt.Errorf("remove_kafka operation not permitted") + } + } + } + } + err := s.RemoveKafka() + if err != nil { + return err + } + } + } + } + err := s.ExecuteBootstrapScript() if err != nil { return err @@ -1300,6 +1490,7 @@ func (s *BdsBdsInstanceResourceCrud) Update() error { computeOnlyWorkerNodeFieldKeyFormat := "compute_only_worker_node.0.%s" edgeNodeFieldKeyFormat := "edge_node.0.%s" cloudSqlNodeFieldKeyFormat := "cloud_sql_details.0.%s" + kafkaBrokerNodeFieldKeyFormat := "kafka_broker_node.0.%s" _, blockVolumeSizeInGbsPresent := s.D.GetOkExists(fmt.Sprintf(workerNodeFieldKeyFormat, "block_volume_size_in_gbs")) if blockVolumeSizeInGbsPresent && s.D.HasChange(fmt.Sprintf(workerNodeFieldKeyFormat, "block_volume_size_in_gbs")) { @@ -1358,6 +1549,12 @@ func (s *BdsBdsInstanceResourceCrud) Update() error { return edgeErr } + // kafka + isKafkaBrokerAdded, kafkaBrokerErr := s.updateKafkaBrokerIfRequired() + if kafkaBrokerErr != nil { + return kafkaBrokerErr + } + result := oci_bds.ChangeShapeNodes{} changeShapeRequest := oci_bds.ChangeShapeRequest{} @@ -1414,7 +1611,16 @@ func (s *BdsBdsInstanceResourceCrud) Update() error { result.EdgeShapeConfig = &edgeShapeConfig } } - + kafkaBroker, ok := s.D.GetOkExists(fmt.Sprintf(kafkaBrokerNodeFieldKeyFormat, "shape")) + if ok && (!isKafkaBrokerAdded) && (s.D.HasChange(fmt.Sprintf(kafkaBrokerNodeFieldKeyFormat, "shape")) || + s.D.HasChange(fmt.Sprintf(kafkaBrokerNodeFieldKeyFormat, "shape_config"))) { + tmp := kafkaBroker.(string) + result.KafkaBroker = &tmp + if nodeConfig, ok := s.D.GetOkExists("kafka_broker_node.0.shape_config"); ok && len(nodeConfig.([]interface{})) != 0 { + kafkaBrokerShapeConfig, _ := s.mapToShapeConfigDetails("kafka_broker_node.0.shape_config.0.%s") + result.KafkaBrokerShapeConfig = &kafkaBrokerShapeConfig + } + } if _, ok := s.D.GetOkExists("is_cloud_sql_configured"); ok { cloudSqlNodeShape, ok := s.D.GetOkExists(fmt.Sprintf(cloudSqlNodeFieldKeyFormat, "shape")) if ok && s.D.HasChange(fmt.Sprintf(cloudSqlNodeFieldKeyFormat, "shape")) { @@ -1449,6 +1655,41 @@ func (s *BdsBdsInstanceResourceCrud) Update() error { tmp := s.D.Id() request.BdsInstanceId = &tmp + // ADD MASTER AND UTILITY NODES + _, numOfMastersPresent := s.D.GetOkExists(fmt.Sprintf(masterNodeFieldKeyFormat, "number_of_nodes")) + if numOfMastersPresent && s.D.HasChange(fmt.Sprintf(masterNodeFieldKeyFormat, "number_of_nodes")) { + oldRaw, newRaw := s.D.GetChange(fmt.Sprintf(masterNodeFieldKeyFormat, "number_of_nodes")) + tmpOld := oldRaw.(int) + tmpNew := newRaw.(int) + if tmpNew > tmpOld { + if clusterAdminPassword, ok := s.D.GetOkExists("cluster_admin_password"); ok { + err := s.updateMasterNode(s.D.Id(), clusterAdminPassword, tmpNew-tmpOld, nil, nil, nil) + if err != nil { + return err + } + } + } else { + return fmt.Errorf("the new value should be larger than previous one") + } + } + + _, numOfUtilityPresent := s.D.GetOkExists(fmt.Sprintf(utilNodeFieldKeyFormat, "number_of_nodes")) + if numOfUtilityPresent && s.D.HasChange(fmt.Sprintf(utilNodeFieldKeyFormat, "number_of_nodes")) { + oldRaw, newRaw := s.D.GetChange(fmt.Sprintf(utilNodeFieldKeyFormat, "number_of_nodes")) + tmpOld := oldRaw.(int) + tmpNew := newRaw.(int) + if tmpNew > tmpOld { + if clusterAdminPassword, ok := s.D.GetOkExists("cluster_admin_password"); ok { + err := s.updateUtilityNode(s.D.Id(), clusterAdminPassword, tmpNew-tmpOld, nil, nil, nil) + if err != nil { + return err + } + } + } else { + return fmt.Errorf("the new value should be larger than previous one") + } + } + if bootstrapScriptUrl, ok := s.D.GetOkExists("bootstrap_script_url"); ok { tmp := bootstrapScriptUrl.(string) request.BootstrapScriptUrl = &tmp @@ -1561,6 +1802,43 @@ func (s *BdsBdsInstanceResourceCrud) updateEdgeIfRequired() (bool, error) { return areEdgeAdded, nil } +func (s *BdsBdsInstanceResourceCrud) updateKafkaBrokerIfRequired() (bool, error) { + areKafkaBrokerAdded := false + kafkaBrokerNodeFieldKeyFormat := "kafka_broker_node.0.%s" + var kafkaBrokerBlockVolumeSizeGBInt int64 + var kafkaBrokerBlockVolumeConversionError error + if kafkaBrokerBlockVolumeSizeInGBs, kafkaBrokerBlockVolumeSizeInGbsPresent := s.D.GetOkExists(fmt.Sprintf(kafkaBrokerNodeFieldKeyFormat, "block_volume_size_in_gbs")); kafkaBrokerBlockVolumeSizeInGbsPresent { + kafkaBrokerBlockVolumeSizeGBInt, kafkaBrokerBlockVolumeConversionError = strconv.ParseInt(kafkaBrokerBlockVolumeSizeInGBs.(string), 10, 64) + if kafkaBrokerBlockVolumeConversionError != nil { + return false, kafkaBrokerBlockVolumeConversionError + } + } + kafka_broker_shape, _ := s.D.GetOkExists("kafka_broker_node.0.shape") + kafka_broker_shape_string := kafka_broker_shape.(string) + kafka_broker_shape_config, _ := s.mapToShapeConfigDetails("kafka_broker_node.0.shape_config.0.%s") + _, numOfKafkaBrokersPresent := s.D.GetOkExists(fmt.Sprintf(kafkaBrokerNodeFieldKeyFormat, "number_of_kafka_nodes")) + if numOfKafkaBrokersPresent && s.D.HasChange(fmt.Sprintf(kafkaBrokerNodeFieldKeyFormat, "number_of_kafka_nodes")) { + oldRaw, newRaw := s.D.GetChange(fmt.Sprintf(kafkaBrokerNodeFieldKeyFormat, "number_of_kafka_nodes")) + var tmpOld = 0 + if oldRaw != nil { + tmpOld = oldRaw.(int) + } + tmpNew := newRaw.(int) + if tmpNew > tmpOld { + if clusterAdminPassword, ok := s.D.GetOkExists("cluster_admin_password"); ok { + err := s.updateWorkerNode(s.D.Id(), clusterAdminPassword, tmpNew-tmpOld, oci_bds.AddWorkerNodesDetailsNodeTypeKafkaBroker, &kafkaBrokerBlockVolumeSizeGBInt, &kafka_broker_shape_string, &kafka_broker_shape_config) + if err != nil { + return false, err + } + areKafkaBrokerAdded = true + } + } else { + return false, fmt.Errorf("the new number of kafka broker node should be larger than previous one") + } + } + return areKafkaBrokerAdded, nil +} + func (s *BdsBdsInstanceResourceCrud) Delete() error { request := oci_bds.DeleteBdsInstanceRequest{} @@ -1629,6 +1907,10 @@ func (s *BdsBdsInstanceResourceCrud) SetData() error { s.D.Set("is_high_availability", *s.Res.IsHighAvailability) } + if s.Res.IsKafkaConfigured != nil { + s.D.Set("is_kafka_configured", *s.Res.IsKafkaConfigured) + } + if s.Res.IsSecure != nil { s.D.Set("is_secure", *s.Res.IsSecure) } @@ -1655,11 +1937,13 @@ func (s *BdsBdsInstanceResourceCrud) SetData() error { workerNodeConfig := nodeMap["WORKER"] computeOnlyWorkerNodeConfig := nodeMap["COMPUTE_ONLY_WORKER"] edgeNodeConfig := nodeMap["EDGE"] + kafkaBrokerNodeConfig := nodeMap["KAFKA_BROKER"] s.deleteShapeConfigIfMissingInInput("master_node", masterNodeConfig) s.deleteShapeConfigIfMissingInInput("util_node", utilNodeConfig) s.deleteShapeConfigIfMissingInInput("worker_node", workerNodeConfig) s.deleteShapeConfigIfMissingInInput("compute_only_worker_node", computeOnlyWorkerNodeConfig) s.deleteShapeConfigIfMissingInInput("edge", edgeNodeConfig) + s.deleteShapeConfigIfMissingInInput("kafka_broker_node", kafkaBrokerNodeConfig) s.D.Set("nodes", nodes) s.D.Set("master_node", []interface{}{masterNodeConfig}) s.D.Set("util_node", []interface{}{utilNodeConfig}) @@ -1673,10 +1957,18 @@ func (s *BdsBdsInstanceResourceCrud) SetData() error { s.D.Set("edge_node", []interface{}{edgeNodeConfig}) } + if _, ok := nodeMap["KAFKA_BROKER"]; ok { + s.D.Set("kafka_broker_node", []interface{}{kafkaBrokerNodeConfig}) + } + if s.Res.NumberOfNodes != nil { s.D.Set("number_of_nodes", *s.Res.NumberOfNodes) } + if s.Res.NumberOfNodesRequiringMaintenanceReboot != nil { + s.D.Set("number_of_nodes_requiring_maintenance_reboot", *s.Res.NumberOfNodesRequiringMaintenanceReboot) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeCreated != nil { @@ -1739,6 +2031,70 @@ func (s *BdsBdsInstanceResourceCrud) StopBdsInstance() error { return tfresource.WaitForResourceCondition(s, retentionPolicyFunc, s.D.Timeout(schema.TimeoutUpdate)) } +func (s *BdsBdsInstanceResourceCrud) AddKafka() error { + + request := oci_bds.AddKafkaRequest{} + + idTmp := s.D.Id() + request.BdsInstanceId = &idTmp + + if nodes, ok := s.D.GetOkExists("kafka_broker_node"); ok { + interfaces := nodes.([]interface{}) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "kafka_broker_node", stateDataIndex) + + if blockVolumeSizeInGBs, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "block_volume_size_in_gbs")); ok { + tmp := blockVolumeSizeInGBs.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return err + } + request.BlockVolumeSizeInGBs = &tmpInt64 + } + + if shape, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "shape")); ok { + tmp := shape.(string) + request.Shape = &tmp + } + + if shapeConfig, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "shape_config")); ok { + if tmpList := shapeConfig.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "shape_config"), 0) + tmp, err := s.mapToShapeConfigDetails(fieldKeyFormatNextLevel) + if err != nil { + return err + } + request.ShapeConfig = &tmp + } + } + + if numberOfKafkaNodes, ok := s.D.GetOkExists("number_of_kafka_nodes"); ok { + tmp := numberOfKafkaNodes.(int) + request.NumberOfKafkaNodes = &tmp + } + } + } + + if clusterAdminPassword, ok := s.D.GetOkExists("cluster_admin_password"); ok { + tmp := clusterAdminPassword.(string) + request.ClusterAdminPassword = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds") + response, err := s.Client.AddKafka(context.Background(), request) + if err != nil { + return err + } + + if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + return waitErr + } + + workId := response.OpcWorkRequestId + return s.getBdsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds"), oci_bds.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + func (s *BdsBdsInstanceResourceCrud) ExecuteBootstrapScript() error { request := oci_bds.ExecuteBootstrapScriptRequest{} @@ -1778,6 +2134,62 @@ func (s *BdsBdsInstanceResourceCrud) deleteShapeConfigIfMissingInInput(node_type } } +func (s *BdsBdsInstanceResourceCrud) RemoveKafka() error { + request := oci_bds.RemoveKafkaRequest{} + + idTmp := s.D.Id() + request.BdsInstanceId = &idTmp + + if clusterAdminPassword, ok := s.D.GetOkExists("cluster_admin_password"); ok { + tmp := clusterAdminPassword.(string) + request.ClusterAdminPassword = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds") + + response, err := s.Client.RemoveKafka(context.Background(), request) + if err != nil { + return err + } + + if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + return waitErr + } + + workId := response.OpcWorkRequestId + return s.getBdsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds"), oci_bds.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + +func (s *BdsBdsInstanceResourceCrud) InstallOsPatch() error { + request := oci_bds.InstallOsPatchRequest{} + + idTmp := s.D.Id() + request.BdsInstanceId = &idTmp + + if clusterAdminPassword, ok := s.D.GetOkExists("cluster_admin_password"); ok { + tmp := clusterAdminPassword.(string) + request.ClusterAdminPassword = &tmp + } + + if osPatchVersion, ok := s.D.GetOkExists("os_patch_version"); ok { + tmp := osPatchVersion.(string) + request.OsPatchVersion = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds") + + _, err := s.Client.InstallOsPatch(context.Background(), request) + if err != nil { + return err + } + + if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + return waitErr + } + + return nil +} + func CloudSqlDetailsToMap(obj *oci_bds.CloudSqlDetails) map[string]interface{} { result := map[string]interface{}{} @@ -1984,6 +2396,10 @@ func BdsNodeToMap(obj oci_bds.Node) map[string]interface{} { result["time_created"] = obj.TimeCreated.String() } + if obj.TimeMaintenanceRebootDue != nil { + result["time_maintenance_reboot_due"] = obj.TimeMaintenanceRebootDue.String() + } + if obj.TimeUpdated != nil { result["time_updated"] = obj.TimeUpdated.String() } @@ -2144,6 +2560,68 @@ func (s *BdsBdsInstanceResourceCrud) updateWorkerNode(id string, clusterAdminPas return s.getBdsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds"), oci_bds.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate)) } +func (s *BdsBdsInstanceResourceCrud) updateMasterNode(id string, clusterAdminPassword interface{}, numberOfMaster int, blockVolumeSizeInGBs *int64, shape *string, shapeConfig *oci_bds.ShapeConfigDetails) error { + addMasterNodesRequest := oci_bds.AddMasterNodesRequest{} + addMasterNodesRequest.BdsInstanceId = &id + + if shape != nil { + addMasterNodesRequest.Shape = shape + } + + if shapeConfig != nil { + addMasterNodesRequest.ShapeConfig = shapeConfig + } + + if blockVolumeSizeInGBs != nil { + addMasterNodesRequest.BlockVolumeSizeInGBs = blockVolumeSizeInGBs + } + + clusterAdminPasswordTmp := clusterAdminPassword.(string) + addMasterNodesRequest.ClusterAdminPassword = &clusterAdminPasswordTmp + + addMasterNodesRequest.NumberOfMasterNodes = &numberOfMaster + + addMasterNodesRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds") + + response, err := s.Client.AddMasterNodes(context.Background(), addMasterNodesRequest) + if err != nil { + return err + } + workId := response.OpcWorkRequestId + return s.getBdsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds"), oci_bds.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + +func (s *BdsBdsInstanceResourceCrud) updateUtilityNode(id string, clusterAdminPassword interface{}, numberOfUtility int, blockVolumeSizeInGBs *int64, shape *string, shapeConfig *oci_bds.ShapeConfigDetails) error { + addUtilityNodesRequest := oci_bds.AddUtilityNodesRequest{} + addUtilityNodesRequest.BdsInstanceId = &id + + if shape != nil { + addUtilityNodesRequest.Shape = shape + } + + if shapeConfig != nil { + addUtilityNodesRequest.ShapeConfig = shapeConfig + } + + if blockVolumeSizeInGBs != nil { + addUtilityNodesRequest.BlockVolumeSizeInGBs = blockVolumeSizeInGBs + } + + clusterAdminPasswordTmp := clusterAdminPassword.(string) + addUtilityNodesRequest.ClusterAdminPassword = &clusterAdminPasswordTmp + + addUtilityNodesRequest.NumberOfUtilityNodes = &numberOfUtility + + addUtilityNodesRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds") + + response, err := s.Client.AddUtilityNodes(context.Background(), addUtilityNodesRequest) + if err != nil { + return err + } + workId := response.OpcWorkRequestId + return s.getBdsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "bds"), oci_bds.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + func (s *BdsBdsInstanceResourceCrud) addCloudSql(request oci_bds.AddCloudSqlRequest) error { response, err := s.Client.AddCloudSql(context.Background(), request) if err != nil { diff --git a/internal/service/bds/bds_bds_instances_data_source.go b/internal/service/bds/bds_bds_instances_data_source.go index bc7ebddfcb9..796de92a5da 100644 --- a/internal/service/bds/bds_bds_instances_data_source.go +++ b/internal/service/bds/bds_bds_instances_data_source.go @@ -157,6 +157,10 @@ func (s *BdsBdsInstancesDataSourceCrud) SetData() error { bdsInstance["is_high_availability"] = *r.IsHighAvailability } + if r.IsKafkaConfigured != nil { + bdsInstance["is_kafka_configured"] = *r.IsKafkaConfigured + } + if r.IsSecure != nil { bdsInstance["is_secure"] = *r.IsSecure } @@ -165,6 +169,10 @@ func (s *BdsBdsInstancesDataSourceCrud) SetData() error { bdsInstance["number_of_nodes"] = *r.NumberOfNodes } + if r.NumberOfNodesRequiringMaintenanceReboot != nil { + bdsInstance["number_of_nodes_requiring_maintenance_reboot"] = *r.NumberOfNodesRequiringMaintenanceReboot + } + bdsInstance["state"] = r.LifecycleState if r.TimeCreated != nil { diff --git a/internal/service/bds/register_datasource.go b/internal/service/bds/register_datasource.go index 8e9a3cf3df4..c0871e79952 100644 --- a/internal/service/bds/register_datasource.go +++ b/internal/service/bds/register_datasource.go @@ -11,6 +11,8 @@ func RegisterDatasource() { tfresource.RegisterDatasource("oci_bds_bds_instance", BdsBdsInstanceDataSource()) tfresource.RegisterDatasource("oci_bds_bds_instance_api_key", BdsBdsInstanceApiKeyDataSource()) tfresource.RegisterDatasource("oci_bds_bds_instance_api_keys", BdsBdsInstanceApiKeysDataSource()) + tfresource.RegisterDatasource("oci_bds_bds_instance_get_os_patch", BdsBdsInstanceGetOsPatchDataSource()) + tfresource.RegisterDatasource("oci_bds_bds_instance_list_os_patches", BdsBdsInstanceListOsPatchesDataSource()) tfresource.RegisterDatasource("oci_bds_bds_instance_metastore_config", BdsBdsInstanceMetastoreConfigDataSource()) tfresource.RegisterDatasource("oci_bds_bds_instance_metastore_configs", BdsBdsInstanceMetastoreConfigsDataSource()) tfresource.RegisterDatasource("oci_bds_bds_instance_patch_histories", BdsBdsInstancePatchHistoriesDataSource()) diff --git a/internal/service/database/database_autonomous_database_data_source.go b/internal/service/database/database_autonomous_database_data_source.go index 99f27f79a8f..cfc14c28979 100644 --- a/internal/service/database/database_autonomous_database_data_source.go +++ b/internal/service/database/database_autonomous_database_data_source.go @@ -180,6 +180,14 @@ func (s *DatabaseAutonomousDatabaseDataSourceCrud) SetData() error { s.D.Set("freeform_tags", s.Res.FreeformTags) + if s.Res.InMemoryAreaInGBs != nil { + s.D.Set("in_memory_area_in_gbs", *s.Res.InMemoryAreaInGBs) + } + + if s.Res.InMemoryPercentage != nil { + s.D.Set("in_memory_percentage", *s.Res.InMemoryPercentage) + } + s.D.Set("infrastructure_type", s.Res.InfrastructureType) if s.Res.IsAccessControlEnabled != nil { diff --git a/internal/service/database/database_autonomous_database_resource.go b/internal/service/database/database_autonomous_database_resource.go index e4081da4b35..b0aae53ce8d 100644 --- a/internal/service/database/database_autonomous_database_resource.go +++ b/internal/service/database/database_autonomous_database_resource.go @@ -188,6 +188,11 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "in_memory_percentage": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, "is_access_control_enabled": { Type: schema.TypeBool, Optional: true, @@ -624,6 +629,10 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "in_memory_area_in_gbs": { + Type: schema.TypeInt, + Computed: true, + }, "infrastructure_type": { Type: schema.TypeString, Computed: true, @@ -1430,7 +1439,12 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) Update() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } - if isAccessControlEnabled, ok := s.D.GetOkExists("is_access_control_enabled"); ok { + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + request.InMemoryPercentage = &tmp + } + + if isAccessControlEnabled, ok := s.D.GetOkExists("is_access_control_enabled"); ok && s.D.HasChange("is_access_control_enabled") { tmp := isAccessControlEnabled.(bool) request.IsAccessControlEnabled = &tmp } @@ -1752,6 +1766,14 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) SetData() error { s.D.Set("freeform_tags", s.Res.FreeformTags) + if s.Res.InMemoryAreaInGBs != nil { + s.D.Set("in_memory_area_in_gbs", *s.Res.InMemoryAreaInGBs) + } + + if s.Res.InMemoryPercentage != nil { + s.D.Set("in_memory_percentage", *s.Res.InMemoryPercentage) + } + s.D.Set("infrastructure_type", s.Res.InfrastructureType) if s.Res.IsAccessControlEnabled != nil { @@ -2413,6 +2435,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + details.InMemoryPercentage = &tmp + } if isAutoScalingEnabled, ok := s.D.GetOkExists("is_auto_scaling_enabled"); ok { tmp := isAutoScalingEnabled.(bool) details.IsAutoScalingEnabled = &tmp @@ -2652,6 +2678,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + details.InMemoryPercentage = &tmp + } if isAutoScalingEnabled, ok := s.D.GetOkExists("is_auto_scaling_enabled"); ok { tmp := isAutoScalingEnabled.(bool) details.IsAutoScalingEnabled = &tmp @@ -2880,6 +2910,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + details.InMemoryPercentage = &tmp + } if isAutoScalingEnabled, ok := s.D.GetOkExists("is_auto_scaling_enabled"); ok { tmp := isAutoScalingEnabled.(bool) details.IsAutoScalingEnabled = &tmp @@ -3101,6 +3135,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + details.InMemoryPercentage = &tmp + } if isAccessControlEnabled, ok := s.D.GetOkExists("is_access_control_enabled"); ok { tmp := isAccessControlEnabled.(bool) details.IsAccessControlEnabled = &tmp @@ -3309,6 +3347,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + details.InMemoryPercentage = &tmp + } if isAccessControlEnabled, ok := s.D.GetOkExists("is_access_control_enabled"); ok { tmp := isAccessControlEnabled.(bool) details.IsAccessControlEnabled = &tmp @@ -3528,6 +3570,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + details.InMemoryPercentage = &tmp + } if isAccessControlEnabled, ok := s.D.GetOkExists("is_access_control_enabled"); ok { tmp := isAccessControlEnabled.(bool) details.IsAccessControlEnabled = &tmp @@ -3751,6 +3797,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if inMemoryPercentage, ok := s.D.GetOkExists("in_memory_percentage"); ok { + tmp := inMemoryPercentage.(int) + details.InMemoryPercentage = &tmp + } if isAccessControlEnabled, ok := s.D.GetOkExists("is_access_control_enabled"); ok { tmp := isAccessControlEnabled.(bool) details.IsAccessControlEnabled = &tmp diff --git a/internal/service/database/database_autonomous_databases_clones_data_source.go b/internal/service/database/database_autonomous_databases_clones_data_source.go index d65505b5c3a..148010ed68a 100644 --- a/internal/service/database/database_autonomous_databases_clones_data_source.go +++ b/internal/service/database/database_autonomous_databases_clones_data_source.go @@ -328,6 +328,14 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "in_memory_area_in_gbs": { + Type: schema.TypeInt, + Computed: true, + }, + "in_memory_percentage": { + Type: schema.TypeInt, + Computed: true, + }, "infrastructure_type": { Type: schema.TypeString, Computed: true, @@ -979,6 +987,14 @@ func (s *DatabaseAutonomousDatabasesClonesDataSourceCrud) SetData() error { autonomousDatabasesClone["id"] = *r.Id } + if r.InMemoryAreaInGBs != nil { + autonomousDatabasesClone["in_memory_area_in_gbs"] = *r.InMemoryAreaInGBs + } + + if r.InMemoryPercentage != nil { + autonomousDatabasesClone["in_memory_percentage"] = *r.InMemoryPercentage + } + autonomousDatabasesClone["infrastructure_type"] = r.InfrastructureType if r.IsAccessControlEnabled != nil { diff --git a/internal/service/database/database_autonomous_databases_data_source.go b/internal/service/database/database_autonomous_databases_data_source.go index f48c2c633f6..b0f927a1f20 100644 --- a/internal/service/database/database_autonomous_databases_data_source.go +++ b/internal/service/database/database_autonomous_databases_data_source.go @@ -284,6 +284,14 @@ func (s *DatabaseAutonomousDatabasesDataSourceCrud) SetData() error { autonomousDatabase["id"] = *r.Id } + if r.InMemoryAreaInGBs != nil { + autonomousDatabase["in_memory_area_in_gbs"] = *r.InMemoryAreaInGBs + } + + if r.InMemoryPercentage != nil { + autonomousDatabase["in_memory_percentage"] = *r.InMemoryPercentage + } + autonomousDatabase["infrastructure_type"] = r.InfrastructureType if r.IsAccessControlEnabled != nil { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go index 794aa64f466..434b65d0972 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go @@ -13,7 +13,7 @@ import ( const ( major = "65" minor = "47" - patch = "1" + patch = "2" tag = "" ) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go index cfacd8c4ff3..7f6b0e2391b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database.go @@ -56,6 +56,12 @@ type AutonomousDatabase struct { // AL16UTF16 or UTF8. NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + + // The area assigned to In-Memory tables in Autonomous Database. + InMemoryAreaInGBs *int `mandatory:"false" json:"inMemoryAreaInGBs"` + // The date and time when the next long-term backup would be created. NextLongTermBackupTimeStamp *common.SDKTime `mandatory:"false" json:"nextLongTermBackupTimeStamp"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go index c6ab6f874ad..50f5118b0ab 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_summary.go @@ -57,6 +57,12 @@ type AutonomousDatabaseSummary struct { // AL16UTF16 or UTF8. NcharacterSet *string `mandatory:"false" json:"ncharacterSet"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + + // The area assigned to In-Memory tables in Autonomous Database. + InMemoryAreaInGBs *int `mandatory:"false" json:"inMemoryAreaInGBs"` + // The date and time when the next long-term backup would be created. NextLongTermBackupTimeStamp *common.SDKTime `mandatory:"false" json:"nextLongTermBackupTimeStamp"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go index c927e5ac222..1c41b3204bf 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go @@ -115,6 +115,9 @@ type CreateAutonomousDatabaseBase interface { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). GetAutonomousContainerDatabaseId() *string + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + GetInMemoryPercentage() *int + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -256,6 +259,7 @@ type createautonomousdatabasebase struct { IsAutoScalingEnabled *bool `mandatory:"false" json:"isAutoScalingEnabled"` IsDedicated *bool `mandatory:"false" json:"isDedicated"` AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` IsAccessControlEnabled *bool `mandatory:"false" json:"isAccessControlEnabled"` WhitelistedIps []string `mandatory:"false" json:"whitelistedIps"` ArePrimaryWhitelistedIpsUsed *bool `mandatory:"false" json:"arePrimaryWhitelistedIpsUsed"` @@ -315,6 +319,7 @@ func (m *createautonomousdatabasebase) UnmarshalJSON(data []byte) error { m.IsAutoScalingEnabled = s.Model.IsAutoScalingEnabled m.IsDedicated = s.Model.IsDedicated m.AutonomousContainerDatabaseId = s.Model.AutonomousContainerDatabaseId + m.InMemoryPercentage = s.Model.InMemoryPercentage m.IsAccessControlEnabled = s.Model.IsAccessControlEnabled m.WhitelistedIps = s.Model.WhitelistedIps m.ArePrimaryWhitelistedIpsUsed = s.Model.ArePrimaryWhitelistedIpsUsed @@ -496,6 +501,11 @@ func (m createautonomousdatabasebase) GetAutonomousContainerDatabaseId() *string return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m createautonomousdatabasebase) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m createautonomousdatabasebase) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go index 90b27bccb01..1d7d6305168 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go @@ -95,6 +95,9 @@ type CreateAutonomousDatabaseCloneDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -343,6 +346,11 @@ func (m CreateAutonomousDatabaseCloneDetails) GetAutonomousContainerDatabaseId() return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseCloneDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseCloneDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go index 41cc2e29c30..d4276c9d89e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go @@ -92,6 +92,9 @@ type CreateAutonomousDatabaseDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -337,6 +340,11 @@ func (m CreateAutonomousDatabaseDetails) GetAutonomousContainerDatabaseId() *str return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go index 68e5440baa6..084a1cdab25 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go @@ -95,6 +95,9 @@ type CreateAutonomousDatabaseFromBackupDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -343,6 +346,11 @@ func (m CreateAutonomousDatabaseFromBackupDetails) GetAutonomousContainerDatabas return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseFromBackupDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseFromBackupDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go index 5b6dd7e6968..aee8e243092 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go @@ -95,6 +95,9 @@ type CreateAutonomousDatabaseFromBackupTimestampDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -349,6 +352,11 @@ func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetAutonomousContain return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go index 2abb313c2eb..a8e53cfee80 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go @@ -137,6 +137,9 @@ type CreateCrossRegionAutonomousDatabaseDataGuardDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -382,6 +385,11 @@ func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetAutonomousContai return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go index e2058f94ccb..61a1b04e320 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go @@ -135,6 +135,9 @@ type CreateCrossRegionDisasterRecoveryDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -385,6 +388,11 @@ func (m CreateCrossRegionDisasterRecoveryDetails) GetAutonomousContainerDatabase return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateCrossRegionDisasterRecoveryDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateCrossRegionDisasterRecoveryDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go index fed12954e1f..a37f2ed200c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go @@ -95,6 +95,9 @@ type CreateRefreshableAutonomousDatabaseCloneDetails struct { // The Autonomous Container Database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). AutonomousContainerDatabaseId *string `mandatory:"false" json:"autonomousContainerDatabaseId"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Indicates if the database-level access control is enabled. // If disabled, database access is defined by the network security rules. // If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, @@ -343,6 +346,11 @@ func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetAutonomousContainerD return m.AutonomousContainerDatabaseId } +//GetInMemoryPercentage returns InMemoryPercentage +func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetInMemoryPercentage() *int { + return m.InMemoryPercentage +} + //GetIsAccessControlEnabled returns IsAccessControlEnabled func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetIsAccessControlEnabled() *bool { return m.IsAccessControlEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go index ab2e853e74d..9e5918fa357 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go @@ -29,6 +29,9 @@ type UpdateAutonomousDatabaseDetails struct { // The compute model of the Autonomous Database. This is required if using the `computeCount` parameter. If using `cpuCoreCount` then it is an error to specify `computeModel` to a non-null value. ComputeModel UpdateAutonomousDatabaseDetailsComputeModelEnum `mandatory:"false" json:"computeModel,omitempty"` + // The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. + InMemoryPercentage *int `mandatory:"false" json:"inMemoryPercentage"` + // Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard LocalAdgAutoFailoverMaxDataLossLimit *int `mandatory:"false" json:"localAdgAutoFailoverMaxDataLossLimit"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/awr_hub.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/awr_hub.go index 0a69f3fcfe8..b68379a0de4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/awr_hub.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/awr_hub.go @@ -61,6 +61,9 @@ type AwrHub struct { // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // Dst Time Zone Version of the AWR Hub + HubDstTimezoneVersion *string `mandatory:"false" json:"hubDstTimezoneVersion"` } func (m AwrHub) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_bind_parameter.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_bind_parameter.go new file mode 100644 index 00000000000..329a0c31741 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_bind_parameter.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataObjectBindParameter Details for a bind parameter used in data object query. +type DataObjectBindParameter struct { + + // Name of the bind parameter. + Name *string `mandatory:"true" json:"name"` + + // Value for the bind parameter. + Value *interface{} `mandatory:"true" json:"value"` + + // Data type of the bind parameter. + DataType *string `mandatory:"true" json:"dataType"` +} + +func (m DataObjectBindParameter) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DataObjectBindParameter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go index 69eaddd71df..8b563080700 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go @@ -27,6 +27,9 @@ type DataObjectColumnMetadata struct { // Category of the column. Category DataObjectColumnMetadataCategoryEnum `mandatory:"false" json:"category,omitempty"` + // Type of a data object column. + DataType *string `mandatory:"false" json:"dataType"` + // Type name of a data object column. DataTypeName DataObjectColumnMetadataDataTypeNameEnum `mandatory:"false" json:"dataTypeName,omitempty"` @@ -68,6 +71,7 @@ func (m DataObjectColumnMetadata) ValidateEnumValue() (bool, error) { func (m *DataObjectColumnMetadata) UnmarshalJSON(data []byte) (e error) { model := struct { Category DataObjectColumnMetadataCategoryEnum `json:"category"` + DataType *string `json:"dataType"` DataTypeName DataObjectColumnMetadataDataTypeNameEnum `json:"dataTypeName"` DisplayName *string `json:"displayName"` Description *string `json:"description"` @@ -83,6 +87,8 @@ func (m *DataObjectColumnMetadata) UnmarshalJSON(data []byte) (e error) { var nn interface{} m.Category = model.Category + m.DataType = model.DataType + m.DataTypeName = model.DataTypeName m.DisplayName = model.DisplayName @@ -114,18 +120,21 @@ const ( DataObjectColumnMetadataCategoryDimension DataObjectColumnMetadataCategoryEnum = "DIMENSION" DataObjectColumnMetadataCategoryMetric DataObjectColumnMetadataCategoryEnum = "METRIC" DataObjectColumnMetadataCategoryTimeDimension DataObjectColumnMetadataCategoryEnum = "TIME_DIMENSION" + DataObjectColumnMetadataCategoryUnknown DataObjectColumnMetadataCategoryEnum = "UNKNOWN" ) var mappingDataObjectColumnMetadataCategoryEnum = map[string]DataObjectColumnMetadataCategoryEnum{ "DIMENSION": DataObjectColumnMetadataCategoryDimension, "METRIC": DataObjectColumnMetadataCategoryMetric, "TIME_DIMENSION": DataObjectColumnMetadataCategoryTimeDimension, + "UNKNOWN": DataObjectColumnMetadataCategoryUnknown, } var mappingDataObjectColumnMetadataCategoryEnumLowerCase = map[string]DataObjectColumnMetadataCategoryEnum{ "dimension": DataObjectColumnMetadataCategoryDimension, "metric": DataObjectColumnMetadataCategoryMetric, "time_dimension": DataObjectColumnMetadataCategoryTimeDimension, + "unknown": DataObjectColumnMetadataCategoryUnknown, } // GetDataObjectColumnMetadataCategoryEnumValues Enumerates the set of values for DataObjectColumnMetadataCategoryEnum @@ -143,6 +152,7 @@ func GetDataObjectColumnMetadataCategoryEnumStringValues() []string { "DIMENSION", "METRIC", "TIME_DIMENSION", + "UNKNOWN", } } @@ -160,18 +170,21 @@ const ( DataObjectColumnMetadataDataTypeNameNumber DataObjectColumnMetadataDataTypeNameEnum = "NUMBER" DataObjectColumnMetadataDataTypeNameTimestamp DataObjectColumnMetadataDataTypeNameEnum = "TIMESTAMP" DataObjectColumnMetadataDataTypeNameVarchar2 DataObjectColumnMetadataDataTypeNameEnum = "VARCHAR2" + DataObjectColumnMetadataDataTypeNameOther DataObjectColumnMetadataDataTypeNameEnum = "OTHER" ) var mappingDataObjectColumnMetadataDataTypeNameEnum = map[string]DataObjectColumnMetadataDataTypeNameEnum{ "NUMBER": DataObjectColumnMetadataDataTypeNameNumber, "TIMESTAMP": DataObjectColumnMetadataDataTypeNameTimestamp, "VARCHAR2": DataObjectColumnMetadataDataTypeNameVarchar2, + "OTHER": DataObjectColumnMetadataDataTypeNameOther, } var mappingDataObjectColumnMetadataDataTypeNameEnumLowerCase = map[string]DataObjectColumnMetadataDataTypeNameEnum{ "number": DataObjectColumnMetadataDataTypeNameNumber, "timestamp": DataObjectColumnMetadataDataTypeNameTimestamp, "varchar2": DataObjectColumnMetadataDataTypeNameVarchar2, + "other": DataObjectColumnMetadataDataTypeNameOther, } // GetDataObjectColumnMetadataDataTypeNameEnumValues Enumerates the set of values for DataObjectColumnMetadataDataTypeNameEnum @@ -189,6 +202,7 @@ func GetDataObjectColumnMetadataDataTypeNameEnumStringValues() []string { "NUMBER", "TIMESTAMP", "VARCHAR2", + "OTHER", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_query.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_query.go index 29bd754036b..7c20eb7b11f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_query.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_query.go @@ -20,11 +20,19 @@ import ( // DataObjectQuery Information required to form and execute query on a data object. type DataObjectQuery interface { + + // List of bind parameters to be applied in the query. + GetBindParams() []DataObjectBindParameter + + // Timeout (in seconds) to be set for the data object query execution. + GetQueryExecutionTimeoutInSeconds() *float64 } type dataobjectquery struct { - JsonData []byte - QueryType string `json:"queryType"` + JsonData []byte + BindParams []DataObjectBindParameter `mandatory:"false" json:"bindParams"` + QueryExecutionTimeoutInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeoutInSeconds"` + QueryType string `json:"queryType"` } // UnmarshalJSON unmarshals json @@ -38,6 +46,8 @@ func (m *dataobjectquery) UnmarshalJSON(data []byte) error { if err != nil { return err } + m.BindParams = s.Model.BindParams + m.QueryExecutionTimeoutInSeconds = s.Model.QueryExecutionTimeoutInSeconds m.QueryType = s.Model.QueryType return err @@ -52,6 +62,10 @@ func (m *dataobjectquery) UnmarshalPolymorphicJSON(data []byte) (interface{}, er var err error switch m.QueryType { + case "STANDARD_QUERY": + mm := DataObjectStandardQuery{} + err = json.Unmarshal(data, &mm) + return mm, err case "TEMPLATIZED_QUERY": mm := DataObjectTemplatizedQuery{} err = json.Unmarshal(data, &mm) @@ -62,6 +76,16 @@ func (m *dataobjectquery) UnmarshalPolymorphicJSON(data []byte) (interface{}, er } } +//GetBindParams returns BindParams +func (m dataobjectquery) GetBindParams() []DataObjectBindParameter { + return m.BindParams +} + +//GetQueryExecutionTimeoutInSeconds returns QueryExecutionTimeoutInSeconds +func (m dataobjectquery) GetQueryExecutionTimeoutInSeconds() *float64 { + return m.QueryExecutionTimeoutInSeconds +} + func (m dataobjectquery) String() string { return common.PointerString(m) } @@ -84,14 +108,17 @@ type DataObjectQueryQueryTypeEnum string // Set of constants representing the allowable values for DataObjectQueryQueryTypeEnum const ( DataObjectQueryQueryTypeTemplatizedQuery DataObjectQueryQueryTypeEnum = "TEMPLATIZED_QUERY" + DataObjectQueryQueryTypeStandardQuery DataObjectQueryQueryTypeEnum = "STANDARD_QUERY" ) var mappingDataObjectQueryQueryTypeEnum = map[string]DataObjectQueryQueryTypeEnum{ "TEMPLATIZED_QUERY": DataObjectQueryQueryTypeTemplatizedQuery, + "STANDARD_QUERY": DataObjectQueryQueryTypeStandardQuery, } var mappingDataObjectQueryQueryTypeEnumLowerCase = map[string]DataObjectQueryQueryTypeEnum{ "templatized_query": DataObjectQueryQueryTypeTemplatizedQuery, + "standard_query": DataObjectQueryQueryTypeStandardQuery, } // GetDataObjectQueryQueryTypeEnumValues Enumerates the set of values for DataObjectQueryQueryTypeEnum @@ -107,6 +134,7 @@ func GetDataObjectQueryQueryTypeEnumValues() []DataObjectQueryQueryTypeEnum { func GetDataObjectQueryQueryTypeEnumStringValues() []string { return []string{ "TEMPLATIZED_QUERY", + "STANDARD_QUERY", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_standard_query.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_standard_query.go new file mode 100644 index 00000000000..adb92d8e6f7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_standard_query.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataObjectStandardQuery Information required to execute query on data objects. Query is given in standard SQL syntax providing flexibility +// to form complex queries such as queries with joins and nested queries. +type DataObjectStandardQuery struct { + + // List of bind parameters to be applied in the query. + BindParams []DataObjectBindParameter `mandatory:"false" json:"bindParams"` + + // Timeout (in seconds) to be set for the data object query execution. + QueryExecutionTimeoutInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeoutInSeconds"` + + // SQL query statement with standard Oracle supported SQL syntax. + // - When Warehouse (e.g: Awr hub) data objects are queried, use the actual names of underlying data objects (e.g: tables, views) in the query. + // The same query that works through JDBC connection with the OperationsInsightsWarehouseUsers credentials will work here and vice-versa. + // SCHEMA.VIEW syntax can also be used here. + // - When OPSI data objects are queried, use name of the respective OPSI data object, just like how views are used in a query. + // Identifier of the OPSI data object cannot be used in the query. + Statement *string `mandatory:"false" json:"statement"` + + TimeFilters *DataObjectQueryTimeFilters `mandatory:"false" json:"timeFilters"` +} + +//GetBindParams returns BindParams +func (m DataObjectStandardQuery) GetBindParams() []DataObjectBindParameter { + return m.BindParams +} + +//GetQueryExecutionTimeoutInSeconds returns QueryExecutionTimeoutInSeconds +func (m DataObjectStandardQuery) GetQueryExecutionTimeoutInSeconds() *float64 { + return m.QueryExecutionTimeoutInSeconds +} + +func (m DataObjectStandardQuery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m DataObjectStandardQuery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DataObjectStandardQuery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDataObjectStandardQuery DataObjectStandardQuery + s := struct { + DiscriminatorParam string `json:"queryType"` + MarshalTypeDataObjectStandardQuery + }{ + "STANDARD_QUERY", + (MarshalTypeDataObjectStandardQuery)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_templatized_query.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_templatized_query.go index 37ddf7e0122..f858ef42d86 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_templatized_query.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_templatized_query.go @@ -21,9 +21,21 @@ import ( // DataObjectTemplatizedQuery Information required in a structured template to form and execute query on a data object. type DataObjectTemplatizedQuery struct { + // List of bind parameters to be applied in the query. + BindParams []DataObjectBindParameter `mandatory:"false" json:"bindParams"` + + // Timeout (in seconds) to be set for the data object query execution. + QueryExecutionTimeoutInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeoutInSeconds"` + // List of items to be added into the SELECT clause of the query; items will be added with comma separation. SelectList []string `mandatory:"false" json:"selectList"` + // Unique data object name that will be added into the FROM clause of the query, just like a view name in FROM clause. + // - Use actual name of the data objects (e.g: tables, views) in case of Warehouse (e.g: Awr hub) data objects query. SCHEMA.VIEW name syntax can also be used here. + // e.g: SYS.DBA_HIST_SNAPSHOT or DBA_HIST_SNAPSHOT + // - Use name of the data object (e.g: SQL_STATS_DO) in case of OPSI data objects. Identifier of the OPSI data object cannot be used here. + FromClause *string `mandatory:"false" json:"fromClause"` + // List of items to be added into the WHERE clause of the query; items will be added with AND separation. // Item can contain a single condition or multiple conditions. // Single condition e.g: "optimizer_mode='mode1'" @@ -42,6 +54,16 @@ type DataObjectTemplatizedQuery struct { TimeFilters *DataObjectQueryTimeFilters `mandatory:"false" json:"timeFilters"` } +//GetBindParams returns BindParams +func (m DataObjectTemplatizedQuery) GetBindParams() []DataObjectBindParameter { + return m.BindParams +} + +//GetQueryExecutionTimeoutInSeconds returns QueryExecutionTimeoutInSeconds +func (m DataObjectTemplatizedQuery) GetQueryExecutionTimeoutInSeconds() *float64 { + return m.QueryExecutionTimeoutInSeconds +} + func (m DataObjectTemplatizedQuery) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_time_column_unit.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_time_column_unit.go index d877112fb6c..a8e72115939 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_time_column_unit.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_time_column_unit.go @@ -81,6 +81,7 @@ const ( DataObjectTimeColumnUnitUnitWeek DataObjectTimeColumnUnitUnitEnum = "WEEK" DataObjectTimeColumnUnitUnitMonth DataObjectTimeColumnUnitUnitEnum = "MONTH" DataObjectTimeColumnUnitUnitYear DataObjectTimeColumnUnitUnitEnum = "YEAR" + DataObjectTimeColumnUnitUnitMinute DataObjectTimeColumnUnitUnitEnum = "MINUTE" ) var mappingDataObjectTimeColumnUnitUnitEnum = map[string]DataObjectTimeColumnUnitUnitEnum{ @@ -94,6 +95,7 @@ var mappingDataObjectTimeColumnUnitUnitEnum = map[string]DataObjectTimeColumnUni "WEEK": DataObjectTimeColumnUnitUnitWeek, "MONTH": DataObjectTimeColumnUnitUnitMonth, "YEAR": DataObjectTimeColumnUnitUnitYear, + "MINUTE": DataObjectTimeColumnUnitUnitMinute, } var mappingDataObjectTimeColumnUnitUnitEnumLowerCase = map[string]DataObjectTimeColumnUnitUnitEnum{ @@ -107,6 +109,7 @@ var mappingDataObjectTimeColumnUnitUnitEnumLowerCase = map[string]DataObjectTime "week": DataObjectTimeColumnUnitUnitWeek, "month": DataObjectTimeColumnUnitUnitMonth, "year": DataObjectTimeColumnUnitUnitYear, + "minute": DataObjectTimeColumnUnitUnitMinute, } // GetDataObjectTimeColumnUnitUnitEnumValues Enumerates the set of values for DataObjectTimeColumnUnitUnitEnum @@ -131,6 +134,7 @@ func GetDataObjectTimeColumnUnitUnitEnumStringValues() []string { "WEEK", "MONTH", "YEAR", + "MINUTE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_type.go new file mode 100644 index 00000000000..e45d939d895 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_type.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// DataObjectTypeEnum Enum with underlying type: string +type DataObjectTypeEnum string + +// Set of constants representing the allowable values for DataObjectTypeEnum +const ( + DataObjectTypeView DataObjectTypeEnum = "VIEW" + DataObjectTypeTable DataObjectTypeEnum = "TABLE" +) + +var mappingDataObjectTypeEnum = map[string]DataObjectTypeEnum{ + "VIEW": DataObjectTypeView, + "TABLE": DataObjectTypeTable, +} + +var mappingDataObjectTypeEnumLowerCase = map[string]DataObjectTypeEnum{ + "view": DataObjectTypeView, + "table": DataObjectTypeTable, +} + +// GetDataObjectTypeEnumValues Enumerates the set of values for DataObjectTypeEnum +func GetDataObjectTypeEnumValues() []DataObjectTypeEnum { + values := make([]DataObjectTypeEnum, 0) + for _, v := range mappingDataObjectTypeEnum { + values = append(values, v) + } + return values +} + +// GetDataObjectTypeEnumStringValues Enumerates the set of values in String for DataObjectTypeEnum +func GetDataObjectTypeEnumStringValues() []string { + return []string{ + "VIEW", + "TABLE", + } +} + +// GetMappingDataObjectTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDataObjectTypeEnum(val string) (DataObjectTypeEnum, bool) { + enum, ok := mappingDataObjectTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object.go index f6e3e7ae44f..13640beb9da 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object.go @@ -32,6 +32,20 @@ type DatabaseInsightsDataObject struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` } //GetIdentifier returns Identifier @@ -49,11 +63,31 @@ func (m DatabaseInsightsDataObject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m DatabaseInsightsDataObject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m DatabaseInsightsDataObject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m DatabaseInsightsDataObject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + //GetColumnsMetadata returns ColumnsMetadata func (m DatabaseInsightsDataObject) GetColumnsMetadata() []DataObjectColumnMetadata { return m.ColumnsMetadata } +//GetSupportedQueryParams returns SupportedQueryParams +func (m DatabaseInsightsDataObject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m DatabaseInsightsDataObject) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object_summary.go index 620e2ab91fd..70497194db1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/database_insights_data_object_summary.go @@ -29,6 +29,12 @@ type DatabaseInsightsDataObjectSummary struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` } //GetIdentifier returns Identifier @@ -46,6 +52,16 @@ func (m DatabaseInsightsDataObjectSummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m DatabaseInsightsDataObjectSummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m DatabaseInsightsDataObjectSummary) GetGroupNames() []string { + return m.GroupNames +} + func (m DatabaseInsightsDataObjectSummary) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object.go index 670a3d12348..9372413eb4a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object.go @@ -32,6 +32,20 @@ type ExadataInsightsDataObject struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` } //GetIdentifier returns Identifier @@ -49,11 +63,31 @@ func (m ExadataInsightsDataObject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m ExadataInsightsDataObject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m ExadataInsightsDataObject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m ExadataInsightsDataObject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + //GetColumnsMetadata returns ColumnsMetadata func (m ExadataInsightsDataObject) GetColumnsMetadata() []DataObjectColumnMetadata { return m.ColumnsMetadata } +//GetSupportedQueryParams returns SupportedQueryParams +func (m ExadataInsightsDataObject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m ExadataInsightsDataObject) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object_summary.go index 012df3170c0..423d10080e0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insights_data_object_summary.go @@ -29,6 +29,12 @@ type ExadataInsightsDataObjectSummary struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` } //GetIdentifier returns Identifier @@ -46,6 +52,16 @@ func (m ExadataInsightsDataObjectSummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m ExadataInsightsDataObjectSummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m ExadataInsightsDataObjectSummary) GetGroupNames() []string { + return m.GroupNames +} + func (m ExadataInsightsDataObjectSummary) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object.go index 94e1b7ea7b5..77a5436a3e3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object.go @@ -32,6 +32,20 @@ type HostInsightsDataObject struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` } //GetIdentifier returns Identifier @@ -49,11 +63,31 @@ func (m HostInsightsDataObject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m HostInsightsDataObject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m HostInsightsDataObject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m HostInsightsDataObject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + //GetColumnsMetadata returns ColumnsMetadata func (m HostInsightsDataObject) GetColumnsMetadata() []DataObjectColumnMetadata { return m.ColumnsMetadata } +//GetSupportedQueryParams returns SupportedQueryParams +func (m HostInsightsDataObject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m HostInsightsDataObject) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object_summary.go index 9a04262eff2..bbfc12f487b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/host_insights_data_object_summary.go @@ -29,6 +29,12 @@ type HostInsightsDataObjectSummary struct { // Description of OPSI data object. Description *string `mandatory:"false" json:"description"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Names of all the groups to which the data object belongs to. + GroupNames []string `mandatory:"false" json:"groupNames"` } //GetIdentifier returns Identifier @@ -46,6 +52,16 @@ func (m HostInsightsDataObjectSummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m HostInsightsDataObjectSummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m HostInsightsDataObjectSummary) GetGroupNames() []string { + return m.GroupNames +} + func (m HostInsightsDataObjectSummary) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/individual_opsi_data_object_details_in_query.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/individual_opsi_data_object_details_in_query.go new file mode 100644 index 00000000000..a01cb30b618 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/individual_opsi_data_object_details_in_query.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// IndividualOpsiDataObjectDetailsInQuery Details applicable for an individual OPSI data object used in a data object query. +type IndividualOpsiDataObjectDetailsInQuery struct { + + // Unique OPSI data object identifier. + DataObjectIdentifier *string `mandatory:"true" json:"dataObjectIdentifier"` + + // An array of query parameters to be applied, for the OPSI data objects targetted by dataObjectDetailsTarget, before executing the query. + // Refer to supportedQueryParams of OpsiDataObject for the supported query parameters. + QueryParams []OpsiDataObjectQueryParam `mandatory:"false" json:"queryParams"` +} + +//GetQueryParams returns QueryParams +func (m IndividualOpsiDataObjectDetailsInQuery) GetQueryParams() []OpsiDataObjectQueryParam { + return m.QueryParams +} + +func (m IndividualOpsiDataObjectDetailsInQuery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m IndividualOpsiDataObjectDetailsInQuery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m IndividualOpsiDataObjectDetailsInQuery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeIndividualOpsiDataObjectDetailsInQuery IndividualOpsiDataObjectDetailsInQuery + s := struct { + DiscriminatorParam string `json:"dataObjectDetailsTarget"` + MarshalTypeIndividualOpsiDataObjectDetailsInQuery + }{ + "INDIVIDUAL_OPSIDATAOBJECT", + (MarshalTypeIndividualOpsiDataObjectDetailsInQuery)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_opsi_data_objects_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_opsi_data_objects_request_response.go index d961ff5e9e3..0f590a76057 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_opsi_data_objects_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_opsi_data_objects_request_response.go @@ -45,6 +45,12 @@ type ListOpsiDataObjectsRequest struct { // OPSI data object list sort options. SortBy ListOpsiDataObjectsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + // A filter to return only data objects that belongs to the group of the given group name. By default, no filtering will be applied on group name. + GroupName *string `mandatory:"false" contributesTo:"query" name:"groupName"` + + // A filter to return only data objects that match the entire data object name. By default, no filtering will be applied on data object name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + // Unique Oracle-assigned identifier for the request. If you need to contact // Oracle about a particular request, please provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` @@ -180,16 +186,19 @@ type ListOpsiDataObjectsSortByEnum string const ( ListOpsiDataObjectsSortByDisplayname ListOpsiDataObjectsSortByEnum = "displayName" ListOpsiDataObjectsSortByDataobjecttype ListOpsiDataObjectsSortByEnum = "dataObjectType" + ListOpsiDataObjectsSortByName ListOpsiDataObjectsSortByEnum = "name" ) var mappingListOpsiDataObjectsSortByEnum = map[string]ListOpsiDataObjectsSortByEnum{ "displayName": ListOpsiDataObjectsSortByDisplayname, "dataObjectType": ListOpsiDataObjectsSortByDataobjecttype, + "name": ListOpsiDataObjectsSortByName, } var mappingListOpsiDataObjectsSortByEnumLowerCase = map[string]ListOpsiDataObjectsSortByEnum{ "displayname": ListOpsiDataObjectsSortByDisplayname, "dataobjecttype": ListOpsiDataObjectsSortByDataobjecttype, + "name": ListOpsiDataObjectsSortByName, } // GetListOpsiDataObjectsSortByEnumValues Enumerates the set of values for ListOpsiDataObjectsSortByEnum @@ -206,6 +215,7 @@ func GetListOpsiDataObjectsSortByEnumStringValues() []string { return []string{ "displayName", "dataObjectType", + "name", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_warehouse_data_objects_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_warehouse_data_objects_request_response.go new file mode 100644 index 00000000000..22af80ef6a0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_warehouse_data_objects_request_response.go @@ -0,0 +1,314 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWarehouseDataObjectsRequest wrapper for the ListWarehouseDataObjects operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListWarehouseDataObjects.go.html to see an example of how to use ListWarehouseDataObjectsRequest. +type ListWarehouseDataObjectsRequest struct { + + // Type of the Warehouse. + WarehouseType ListWarehouseDataObjectsWarehouseTypeEnum `mandatory:"true" contributesTo:"path" name:"warehouseType"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a Warehouse. + WarehouseId *string `mandatory:"true" contributesTo:"path" name:"warehouseId"` + + // A filter to return only data objects that match the data object type. By default, no filtering will be applied on data object type. + DataObjectType []DataObjectTypeEnum `contributesTo:"query" name:"dataObjectType" omitEmpty:"true" collectionFormat:"multi"` + + // A filter to return only data objects that match the entire data object name. By default, no filtering will be applied on data object name. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // A filter to return only data objects that match the entire data object owner name. By default, no filtering will be applied on data object owner name. + Owner *string `mandatory:"false" contributesTo:"query" name:"owner"` + + // For list pagination. The maximum number of results per page, or items to + // return in a paginated "List" call. + // For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from + // the previous "List" call. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWarehouseDataObjectsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Sort options for Warehouse data objects list. + SortBy ListWarehouseDataObjectsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Specifies the optional fields to return in a WarehouseDataObjectSummary. Unless requested, these fields are not returned by default. + SummaryField []ListWarehouseDataObjectsSummaryFieldEnum `contributesTo:"query" name:"summaryField" omitEmpty:"true" collectionFormat:"multi"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWarehouseDataObjectsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWarehouseDataObjectsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWarehouseDataObjectsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWarehouseDataObjectsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWarehouseDataObjectsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWarehouseDataObjectsWarehouseTypeEnum(string(request.WarehouseType)); !ok && request.WarehouseType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WarehouseType: %s. Supported values are: %s.", request.WarehouseType, strings.Join(GetListWarehouseDataObjectsWarehouseTypeEnumStringValues(), ","))) + } + for _, val := range request.DataObjectType { + if _, ok := GetMappingDataObjectTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataObjectType: %s. Supported values are: %s.", val, strings.Join(GetDataObjectTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListWarehouseDataObjectsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWarehouseDataObjectsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWarehouseDataObjectsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWarehouseDataObjectsSortByEnumStringValues(), ","))) + } + for _, val := range request.SummaryField { + if _, ok := GetMappingListWarehouseDataObjectsSummaryFieldEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SummaryField: %s. Supported values are: %s.", val, strings.Join(GetListWarehouseDataObjectsSummaryFieldEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWarehouseDataObjectsResponse wrapper for the ListWarehouseDataObjects operation +type ListWarehouseDataObjectsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WarehouseDataObjectCollection instances + WarehouseDataObjectCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWarehouseDataObjectsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWarehouseDataObjectsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWarehouseDataObjectsWarehouseTypeEnum Enum with underlying type: string +type ListWarehouseDataObjectsWarehouseTypeEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsWarehouseTypeEnum +const ( + ListWarehouseDataObjectsWarehouseTypeAwrhubs ListWarehouseDataObjectsWarehouseTypeEnum = "awrHubs" +) + +var mappingListWarehouseDataObjectsWarehouseTypeEnum = map[string]ListWarehouseDataObjectsWarehouseTypeEnum{ + "awrHubs": ListWarehouseDataObjectsWarehouseTypeAwrhubs, +} + +var mappingListWarehouseDataObjectsWarehouseTypeEnumLowerCase = map[string]ListWarehouseDataObjectsWarehouseTypeEnum{ + "awrhubs": ListWarehouseDataObjectsWarehouseTypeAwrhubs, +} + +// GetListWarehouseDataObjectsWarehouseTypeEnumValues Enumerates the set of values for ListWarehouseDataObjectsWarehouseTypeEnum +func GetListWarehouseDataObjectsWarehouseTypeEnumValues() []ListWarehouseDataObjectsWarehouseTypeEnum { + values := make([]ListWarehouseDataObjectsWarehouseTypeEnum, 0) + for _, v := range mappingListWarehouseDataObjectsWarehouseTypeEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsWarehouseTypeEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsWarehouseTypeEnum +func GetListWarehouseDataObjectsWarehouseTypeEnumStringValues() []string { + return []string{ + "awrHubs", + } +} + +// GetMappingListWarehouseDataObjectsWarehouseTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsWarehouseTypeEnum(val string) (ListWarehouseDataObjectsWarehouseTypeEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsWarehouseTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWarehouseDataObjectsSortOrderEnum Enum with underlying type: string +type ListWarehouseDataObjectsSortOrderEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsSortOrderEnum +const ( + ListWarehouseDataObjectsSortOrderAsc ListWarehouseDataObjectsSortOrderEnum = "ASC" + ListWarehouseDataObjectsSortOrderDesc ListWarehouseDataObjectsSortOrderEnum = "DESC" +) + +var mappingListWarehouseDataObjectsSortOrderEnum = map[string]ListWarehouseDataObjectsSortOrderEnum{ + "ASC": ListWarehouseDataObjectsSortOrderAsc, + "DESC": ListWarehouseDataObjectsSortOrderDesc, +} + +var mappingListWarehouseDataObjectsSortOrderEnumLowerCase = map[string]ListWarehouseDataObjectsSortOrderEnum{ + "asc": ListWarehouseDataObjectsSortOrderAsc, + "desc": ListWarehouseDataObjectsSortOrderDesc, +} + +// GetListWarehouseDataObjectsSortOrderEnumValues Enumerates the set of values for ListWarehouseDataObjectsSortOrderEnum +func GetListWarehouseDataObjectsSortOrderEnumValues() []ListWarehouseDataObjectsSortOrderEnum { + values := make([]ListWarehouseDataObjectsSortOrderEnum, 0) + for _, v := range mappingListWarehouseDataObjectsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsSortOrderEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsSortOrderEnum +func GetListWarehouseDataObjectsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWarehouseDataObjectsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsSortOrderEnum(val string) (ListWarehouseDataObjectsSortOrderEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWarehouseDataObjectsSortByEnum Enum with underlying type: string +type ListWarehouseDataObjectsSortByEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsSortByEnum +const ( + ListWarehouseDataObjectsSortByDataobjecttype ListWarehouseDataObjectsSortByEnum = "dataObjectType" + ListWarehouseDataObjectsSortByName ListWarehouseDataObjectsSortByEnum = "name" + ListWarehouseDataObjectsSortByOwner ListWarehouseDataObjectsSortByEnum = "owner" +) + +var mappingListWarehouseDataObjectsSortByEnum = map[string]ListWarehouseDataObjectsSortByEnum{ + "dataObjectType": ListWarehouseDataObjectsSortByDataobjecttype, + "name": ListWarehouseDataObjectsSortByName, + "owner": ListWarehouseDataObjectsSortByOwner, +} + +var mappingListWarehouseDataObjectsSortByEnumLowerCase = map[string]ListWarehouseDataObjectsSortByEnum{ + "dataobjecttype": ListWarehouseDataObjectsSortByDataobjecttype, + "name": ListWarehouseDataObjectsSortByName, + "owner": ListWarehouseDataObjectsSortByOwner, +} + +// GetListWarehouseDataObjectsSortByEnumValues Enumerates the set of values for ListWarehouseDataObjectsSortByEnum +func GetListWarehouseDataObjectsSortByEnumValues() []ListWarehouseDataObjectsSortByEnum { + values := make([]ListWarehouseDataObjectsSortByEnum, 0) + for _, v := range mappingListWarehouseDataObjectsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsSortByEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsSortByEnum +func GetListWarehouseDataObjectsSortByEnumStringValues() []string { + return []string{ + "dataObjectType", + "name", + "owner", + } +} + +// GetMappingListWarehouseDataObjectsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsSortByEnum(val string) (ListWarehouseDataObjectsSortByEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWarehouseDataObjectsSummaryFieldEnum Enum with underlying type: string +type ListWarehouseDataObjectsSummaryFieldEnum string + +// Set of constants representing the allowable values for ListWarehouseDataObjectsSummaryFieldEnum +const ( + ListWarehouseDataObjectsSummaryFieldDetails ListWarehouseDataObjectsSummaryFieldEnum = "details" +) + +var mappingListWarehouseDataObjectsSummaryFieldEnum = map[string]ListWarehouseDataObjectsSummaryFieldEnum{ + "details": ListWarehouseDataObjectsSummaryFieldDetails, +} + +var mappingListWarehouseDataObjectsSummaryFieldEnumLowerCase = map[string]ListWarehouseDataObjectsSummaryFieldEnum{ + "details": ListWarehouseDataObjectsSummaryFieldDetails, +} + +// GetListWarehouseDataObjectsSummaryFieldEnumValues Enumerates the set of values for ListWarehouseDataObjectsSummaryFieldEnum +func GetListWarehouseDataObjectsSummaryFieldEnumValues() []ListWarehouseDataObjectsSummaryFieldEnum { + values := make([]ListWarehouseDataObjectsSummaryFieldEnum, 0) + for _, v := range mappingListWarehouseDataObjectsSummaryFieldEnum { + values = append(values, v) + } + return values +} + +// GetListWarehouseDataObjectsSummaryFieldEnumStringValues Enumerates the set of values in String for ListWarehouseDataObjectsSummaryFieldEnum +func GetListWarehouseDataObjectsSummaryFieldEnumStringValues() []string { + return []string{ + "details", + } +} + +// GetMappingListWarehouseDataObjectsSummaryFieldEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWarehouseDataObjectsSummaryFieldEnum(val string) (ListWarehouseDataObjectsSummaryFieldEnum, bool) { + enum, ok := mappingListWarehouseDataObjectsSummaryFieldEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/operation_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/operation_type.go index 144a47db69d..b711995d597 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/operation_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/operation_type.go @@ -69,6 +69,12 @@ const ( OperationTypeEnableAdbAdvancedFeatures OperationTypeEnum = "ENABLE_ADB_ADVANCED_FEATURES" OperationTypeDisableAdbAdvancedFeatures OperationTypeEnum = "DISABLE_ADB_ADVANCED_FEATURES" OperationTypeUpdateAdbAdvancedFeatures OperationTypeEnum = "UPDATE_ADB_ADVANCED_FEATURES" + OperationTypeCreateNewsReport OperationTypeEnum = "CREATE_NEWS_REPORT" + OperationTypeEnableNewsReport OperationTypeEnum = "ENABLE_NEWS_REPORT" + OperationTypeDisableNewsReport OperationTypeEnum = "DISABLE_NEWS_REPORT" + OperationTypeUpdateNewsReport OperationTypeEnum = "UPDATE_NEWS_REPORT" + OperationTypeMoveNewsReport OperationTypeEnum = "MOVE_NEWS_REPORT" + OperationTypeDeleteNewsReport OperationTypeEnum = "DELETE_NEWS_REPORT" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ @@ -121,6 +127,12 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "ENABLE_ADB_ADVANCED_FEATURES": OperationTypeEnableAdbAdvancedFeatures, "DISABLE_ADB_ADVANCED_FEATURES": OperationTypeDisableAdbAdvancedFeatures, "UPDATE_ADB_ADVANCED_FEATURES": OperationTypeUpdateAdbAdvancedFeatures, + "CREATE_NEWS_REPORT": OperationTypeCreateNewsReport, + "ENABLE_NEWS_REPORT": OperationTypeEnableNewsReport, + "DISABLE_NEWS_REPORT": OperationTypeDisableNewsReport, + "UPDATE_NEWS_REPORT": OperationTypeUpdateNewsReport, + "MOVE_NEWS_REPORT": OperationTypeMoveNewsReport, + "DELETE_NEWS_REPORT": OperationTypeDeleteNewsReport, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ @@ -173,6 +185,12 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "enable_adb_advanced_features": OperationTypeEnableAdbAdvancedFeatures, "disable_adb_advanced_features": OperationTypeDisableAdbAdvancedFeatures, "update_adb_advanced_features": OperationTypeUpdateAdbAdvancedFeatures, + "create_news_report": OperationTypeCreateNewsReport, + "enable_news_report": OperationTypeEnableNewsReport, + "disable_news_report": OperationTypeDisableNewsReport, + "update_news_report": OperationTypeUpdateNewsReport, + "move_news_report": OperationTypeMoveNewsReport, + "delete_news_report": OperationTypeDeleteNewsReport, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -236,6 +254,12 @@ func GetOperationTypeEnumStringValues() []string { "ENABLE_ADB_ADVANCED_FEATURES", "DISABLE_ADB_ADVANCED_FEATURES", "UPDATE_ADB_ADVANCED_FEATURES", + "CREATE_NEWS_REPORT", + "ENABLE_NEWS_REPORT", + "DISABLE_NEWS_REPORT", + "UPDATE_NEWS_REPORT", + "MOVE_NEWS_REPORT", + "DELETE_NEWS_REPORT", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object.go index ec5ceda84bf..143c13145db 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object.go @@ -32,15 +32,33 @@ type OpsiDataObject interface { // Description of OPSI data object. GetDescription() *string + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + GetName() *string + + // Names of all the groups to which the data object belongs to. + GetGroupNames() []string + + // Time period supported by the data object for quering data. + // Time period is in ISO 8601 format with respect to current time. Default is last 30 days represented by P30D. + // Examples: P90D (last 90 days), P4W (last 4 weeks), P2M (last 2 months), P1Y (last 12 months). + GetSupportedQueryTimePeriod() *string + + // Supported query parameters by this OPSI data object that can be configured while a data object query involving this data object is executed. + GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam } type opsidataobject struct { - JsonData []byte - Identifier *string `mandatory:"true" json:"identifier"` - DisplayName *string `mandatory:"true" json:"displayName"` - ColumnsMetadata []DataObjectColumnMetadata `mandatory:"true" json:"columnsMetadata"` - Description *string `mandatory:"false" json:"description"` - DataObjectType string `json:"dataObjectType"` + JsonData []byte + Identifier *string `mandatory:"true" json:"identifier"` + DisplayName *string `mandatory:"true" json:"displayName"` + ColumnsMetadata []DataObjectColumnMetadata `mandatory:"true" json:"columnsMetadata"` + Description *string `mandatory:"false" json:"description"` + Name *string `mandatory:"false" json:"name"` + GroupNames []string `mandatory:"false" json:"groupNames"` + SupportedQueryTimePeriod *string `mandatory:"false" json:"supportedQueryTimePeriod"` + SupportedQueryParams []OpsiDataObjectSupportedQueryParam `mandatory:"false" json:"supportedQueryParams"` + DataObjectType string `json:"dataObjectType"` } // UnmarshalJSON unmarshals json @@ -58,6 +76,10 @@ func (m *opsidataobject) UnmarshalJSON(data []byte) error { m.DisplayName = s.Model.DisplayName m.ColumnsMetadata = s.Model.ColumnsMetadata m.Description = s.Model.Description + m.Name = s.Model.Name + m.GroupNames = s.Model.GroupNames + m.SupportedQueryTimePeriod = s.Model.SupportedQueryTimePeriod + m.SupportedQueryParams = s.Model.SupportedQueryParams m.DataObjectType = s.Model.DataObjectType return err @@ -110,6 +132,26 @@ func (m opsidataobject) GetDescription() *string { return m.Description } +//GetName returns Name +func (m opsidataobject) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m opsidataobject) GetGroupNames() []string { + return m.GroupNames +} + +//GetSupportedQueryTimePeriod returns SupportedQueryTimePeriod +func (m opsidataobject) GetSupportedQueryTimePeriod() *string { + return m.SupportedQueryTimePeriod +} + +//GetSupportedQueryParams returns SupportedQueryParams +func (m opsidataobject) GetSupportedQueryParams() []OpsiDataObjectSupportedQueryParam { + return m.SupportedQueryParams +} + func (m opsidataobject) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_details_in_query.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_details_in_query.go new file mode 100644 index 00000000000..73dc38b1ad6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_details_in_query.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectDetailsInQuery Details for OPSI data object used in a data object query. +type OpsiDataObjectDetailsInQuery interface { + + // An array of query parameters to be applied, for the OPSI data objects targetted by dataObjectDetailsTarget, before executing the query. + // Refer to supportedQueryParams of OpsiDataObject for the supported query parameters. + GetQueryParams() []OpsiDataObjectQueryParam +} + +type opsidataobjectdetailsinquery struct { + JsonData []byte + QueryParams []OpsiDataObjectQueryParam `mandatory:"false" json:"queryParams"` + DataObjectDetailsTarget string `json:"dataObjectDetailsTarget"` +} + +// UnmarshalJSON unmarshals json +func (m *opsidataobjectdetailsinquery) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshaleropsidataobjectdetailsinquery opsidataobjectdetailsinquery + s := struct { + Model Unmarshaleropsidataobjectdetailsinquery + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.QueryParams = s.Model.QueryParams + m.DataObjectDetailsTarget = s.Model.DataObjectDetailsTarget + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *opsidataobjectdetailsinquery) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.DataObjectDetailsTarget { + case "INDIVIDUAL_OPSIDATAOBJECT": + mm := IndividualOpsiDataObjectDetailsInQuery{} + err = json.Unmarshal(data, &mm) + return mm, err + case "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS": + mm := OpsiDataObjectTypeOpsiDataObjectDetailsInQuery{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for OpsiDataObjectDetailsInQuery: %s.", m.DataObjectDetailsTarget) + return *m, nil + } +} + +//GetQueryParams returns QueryParams +func (m opsidataobjectdetailsinquery) GetQueryParams() []OpsiDataObjectQueryParam { + return m.QueryParams +} + +func (m opsidataobjectdetailsinquery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m opsidataobjectdetailsinquery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_details_target.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_details_target.go new file mode 100644 index 00000000000..2cc89fe26f5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_details_target.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// OpsiDataObjectDetailsTargetEnum Enum with underlying type: string +type OpsiDataObjectDetailsTargetEnum string + +// Set of constants representing the allowable values for OpsiDataObjectDetailsTargetEnum +const ( + OpsiDataObjectDetailsTargetIndividualOpsidataobject OpsiDataObjectDetailsTargetEnum = "INDIVIDUAL_OPSIDATAOBJECT" + OpsiDataObjectDetailsTargetOpsidataobjecttypeOpsidataobjects OpsiDataObjectDetailsTargetEnum = "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS" +) + +var mappingOpsiDataObjectDetailsTargetEnum = map[string]OpsiDataObjectDetailsTargetEnum{ + "INDIVIDUAL_OPSIDATAOBJECT": OpsiDataObjectDetailsTargetIndividualOpsidataobject, + "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS": OpsiDataObjectDetailsTargetOpsidataobjecttypeOpsidataobjects, +} + +var mappingOpsiDataObjectDetailsTargetEnumLowerCase = map[string]OpsiDataObjectDetailsTargetEnum{ + "individual_opsidataobject": OpsiDataObjectDetailsTargetIndividualOpsidataobject, + "opsidataobjecttype_opsidataobjects": OpsiDataObjectDetailsTargetOpsidataobjecttypeOpsidataobjects, +} + +// GetOpsiDataObjectDetailsTargetEnumValues Enumerates the set of values for OpsiDataObjectDetailsTargetEnum +func GetOpsiDataObjectDetailsTargetEnumValues() []OpsiDataObjectDetailsTargetEnum { + values := make([]OpsiDataObjectDetailsTargetEnum, 0) + for _, v := range mappingOpsiDataObjectDetailsTargetEnum { + values = append(values, v) + } + return values +} + +// GetOpsiDataObjectDetailsTargetEnumStringValues Enumerates the set of values in String for OpsiDataObjectDetailsTargetEnum +func GetOpsiDataObjectDetailsTargetEnumStringValues() []string { + return []string{ + "INDIVIDUAL_OPSIDATAOBJECT", + "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS", + } +} + +// GetMappingOpsiDataObjectDetailsTargetEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOpsiDataObjectDetailsTargetEnum(val string) (OpsiDataObjectDetailsTargetEnum, bool) { + enum, ok := mappingOpsiDataObjectDetailsTargetEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_query_param.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_query_param.go new file mode 100644 index 00000000000..768ef53b12f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_query_param.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectQueryParam Details for a query parameter to be applied on an OPSI data object, when a data object query is executed. +type OpsiDataObjectQueryParam struct { + + // Name of the query parameter. + Name *string `mandatory:"true" json:"name"` + + // Value for the query parameter. + Value *interface{} `mandatory:"true" json:"value"` +} + +func (m OpsiDataObjectQueryParam) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiDataObjectQueryParam) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_summary.go index 05be4b64d87..21e6b8fc73a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_summary.go @@ -29,14 +29,22 @@ type OpsiDataObjectSummary interface { // Description of OPSI data object. GetDescription() *string + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + GetName() *string + + // Names of all the groups to which the data object belongs to. + GetGroupNames() []string } type opsidataobjectsummary struct { JsonData []byte - Identifier *string `mandatory:"true" json:"identifier"` - DisplayName *string `mandatory:"true" json:"displayName"` - Description *string `mandatory:"false" json:"description"` - DataObjectType string `json:"dataObjectType"` + Identifier *string `mandatory:"true" json:"identifier"` + DisplayName *string `mandatory:"true" json:"displayName"` + Description *string `mandatory:"false" json:"description"` + Name *string `mandatory:"false" json:"name"` + GroupNames []string `mandatory:"false" json:"groupNames"` + DataObjectType string `json:"dataObjectType"` } // UnmarshalJSON unmarshals json @@ -53,6 +61,8 @@ func (m *opsidataobjectsummary) UnmarshalJSON(data []byte) error { m.Identifier = s.Model.Identifier m.DisplayName = s.Model.DisplayName m.Description = s.Model.Description + m.Name = s.Model.Name + m.GroupNames = s.Model.GroupNames m.DataObjectType = s.Model.DataObjectType return err @@ -100,6 +110,16 @@ func (m opsidataobjectsummary) GetDescription() *string { return m.Description } +//GetName returns Name +func (m opsidataobjectsummary) GetName() *string { + return m.Name +} + +//GetGroupNames returns GroupNames +func (m opsidataobjectsummary) GetGroupNames() []string { + return m.GroupNames +} + func (m opsidataobjectsummary) String() string { return common.PointerString(m) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_supported_query_param.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_supported_query_param.go new file mode 100644 index 00000000000..0e8ade00447 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_supported_query_param.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectSupportedQueryParam Details of query parameter supported by an OPSI data object. +type OpsiDataObjectSupportedQueryParam struct { + + // Name of the query parameter. + Name *string `mandatory:"true" json:"name"` + + // Description of the query parameter. + Description *string `mandatory:"false" json:"description"` + + // Data type of the for the query parameter. + DataType *string `mandatory:"false" json:"dataType"` +} + +func (m OpsiDataObjectSupportedQueryParam) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiDataObjectSupportedQueryParam) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_type_opsi_data_object_details_in_query.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_type_opsi_data_object_details_in_query.go new file mode 100644 index 00000000000..7965c4d748f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_data_object_type_opsi_data_object_details_in_query.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiDataObjectTypeOpsiDataObjectDetailsInQuery Details applicable for all OPSI data objects of a specific OpsiDataObjectType used in a data object query. +type OpsiDataObjectTypeOpsiDataObjectDetailsInQuery struct { + + // An array of query parameters to be applied, for the OPSI data objects targetted by dataObjectDetailsTarget, before executing the query. + // Refer to supportedQueryParams of OpsiDataObject for the supported query parameters. + QueryParams []OpsiDataObjectQueryParam `mandatory:"false" json:"queryParams"` + + // Type of OPSI data object. + DataObjectType OpsiDataObjectTypeEnum `mandatory:"true" json:"dataObjectType"` +} + +//GetQueryParams returns QueryParams +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) GetQueryParams() []OpsiDataObjectQueryParam { + return m.QueryParams +} + +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingOpsiDataObjectTypeEnum(string(m.DataObjectType)); !ok && m.DataObjectType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataObjectType: %s. Supported values are: %s.", m.DataObjectType, strings.Join(GetOpsiDataObjectTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m OpsiDataObjectTypeOpsiDataObjectDetailsInQuery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeOpsiDataObjectTypeOpsiDataObjectDetailsInQuery OpsiDataObjectTypeOpsiDataObjectDetailsInQuery + s := struct { + DiscriminatorParam string `json:"dataObjectDetailsTarget"` + MarshalTypeOpsiDataObjectTypeOpsiDataObjectDetailsInQuery + }{ + "OPSIDATAOBJECTTYPE_OPSIDATAOBJECTS", + (MarshalTypeOpsiDataObjectTypeOpsiDataObjectDetailsInQuery)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go index 0ad7a700ec6..a4b2f771d2c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go @@ -5646,6 +5646,64 @@ func (client OperationsInsightsClient) listSqlTexts(ctx context.Context, request return response, err } +// ListWarehouseDataObjects Gets a list of Warehouse data objects (e.g: views, tables), based on the query parameters specified. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListWarehouseDataObjects.go.html to see an example of how to use ListWarehouseDataObjects API. +// A default retry strategy applies to this operation ListWarehouseDataObjects() +func (client OperationsInsightsClient) ListWarehouseDataObjects(ctx context.Context, request ListWarehouseDataObjectsRequest) (response ListWarehouseDataObjectsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWarehouseDataObjects, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWarehouseDataObjectsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWarehouseDataObjectsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWarehouseDataObjectsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWarehouseDataObjectsResponse") + } + return +} + +// listWarehouseDataObjects implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) listWarehouseDataObjects(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/{warehouseType}/{warehouseId}/dataObjects", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWarehouseDataObjectsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/OpsiWarehouseDataObjects/ListWarehouseDataObjects" + err = common.PostProcessServiceError(err, "OperationsInsights", "ListWarehouseDataObjects", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListWorkRequestErrors Return a (paginated) list of errors for a given work request. // // See also @@ -5879,6 +5937,65 @@ func (client OperationsInsightsClient) queryOpsiDataObjectData(ctx context.Conte return response, err } +// QueryWarehouseDataObjectData Queries Warehouse data objects (e.g: views, tables) with the inputs provided and sends the result set back. +// Any data to which an OperationsInsightsWarehouseUser with a permission to the corresponding Warehouse can be queried. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/QueryWarehouseDataObjectData.go.html to see an example of how to use QueryWarehouseDataObjectData API. +// A default retry strategy applies to this operation QueryWarehouseDataObjectData() +func (client OperationsInsightsClient) QueryWarehouseDataObjectData(ctx context.Context, request QueryWarehouseDataObjectDataRequest) (response QueryWarehouseDataObjectDataResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.queryWarehouseDataObjectData, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = QueryWarehouseDataObjectDataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = QueryWarehouseDataObjectDataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(QueryWarehouseDataObjectDataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into QueryWarehouseDataObjectDataResponse") + } + return +} + +// queryWarehouseDataObjectData implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) queryWarehouseDataObjectData(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/{warehouseType}/{warehouseId}/actions/queryData", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response QueryWarehouseDataObjectDataResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/OpsiWarehouseDataObjects/QueryWarehouseDataObjectData" + err = common.PostProcessServiceError(err, "OperationsInsights", "QueryWarehouseDataObjectData", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &querydataobjectresultsetrowscollection{}) + return response, err +} + // RotateOperationsInsightsWarehouseWallet Rotate the ADW wallet for Operations Insights Warehouse using which the Hub data is exposed. // // See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_warehouse_data_objects.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_warehouse_data_objects.go new file mode 100644 index 00000000000..2c88801bccb --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_warehouse_data_objects.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OpsiWarehouseDataObjects Logical grouping used for Operations Insights Warehouse data objects operations. +type OpsiWarehouseDataObjects struct { + + // Operations Insights Warehouse Data Object. + OpsiWarehouseDataObjects *interface{} `mandatory:"false" json:"opsiWarehouseDataObjects"` +} + +func (m OpsiWarehouseDataObjects) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OpsiWarehouseDataObjects) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_json_result_set_rows_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_json_result_set_rows_collection.go index 00ad7dedf88..a926d95eef9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_json_result_set_rows_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_json_result_set_rows_collection.go @@ -26,6 +26,10 @@ type QueryDataObjectJsonResultSetRowsCollection struct { // Array of QueryDataObjectResultSetColumnMetadata objects that describe the result set columns. ItemsMetadata []QueryDataObjectResultSetColumnMetadata `mandatory:"true" json:"itemsMetadata"` + + // Time taken for executing the data object query (in seconds). + // Consider optimizing the query or reducing the target data range, if query execution time is longer. + QueryExecutionTimeInSeconds *float64 `mandatory:"false" json:"queryExecutionTimeInSeconds"` } func (m QueryDataObjectJsonResultSetRowsCollection) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go index 68e23c8b096..4b297f376e5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go @@ -23,6 +23,9 @@ type QueryDataObjectResultSetColumnMetadata struct { // Name of the column in a data object query result set. Name *string `mandatory:"true" json:"name"` + // Type of the column in a data object query result. + DataType *string `mandatory:"false" json:"dataType"` + // Type name of the column in a data object query result set. DataTypeName QueryDataObjectResultSetColumnMetadataDataTypeNameEnum `mandatory:"false" json:"dataTypeName,omitempty"` } @@ -54,18 +57,21 @@ const ( QueryDataObjectResultSetColumnMetadataDataTypeNameNumber QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "NUMBER" QueryDataObjectResultSetColumnMetadataDataTypeNameTimestamp QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "TIMESTAMP" QueryDataObjectResultSetColumnMetadataDataTypeNameVarchar2 QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "VARCHAR2" + QueryDataObjectResultSetColumnMetadataDataTypeNameOther QueryDataObjectResultSetColumnMetadataDataTypeNameEnum = "OTHER" ) var mappingQueryDataObjectResultSetColumnMetadataDataTypeNameEnum = map[string]QueryDataObjectResultSetColumnMetadataDataTypeNameEnum{ "NUMBER": QueryDataObjectResultSetColumnMetadataDataTypeNameNumber, "TIMESTAMP": QueryDataObjectResultSetColumnMetadataDataTypeNameTimestamp, "VARCHAR2": QueryDataObjectResultSetColumnMetadataDataTypeNameVarchar2, + "OTHER": QueryDataObjectResultSetColumnMetadataDataTypeNameOther, } var mappingQueryDataObjectResultSetColumnMetadataDataTypeNameEnumLowerCase = map[string]QueryDataObjectResultSetColumnMetadataDataTypeNameEnum{ "number": QueryDataObjectResultSetColumnMetadataDataTypeNameNumber, "timestamp": QueryDataObjectResultSetColumnMetadataDataTypeNameTimestamp, "varchar2": QueryDataObjectResultSetColumnMetadataDataTypeNameVarchar2, + "other": QueryDataObjectResultSetColumnMetadataDataTypeNameOther, } // GetQueryDataObjectResultSetColumnMetadataDataTypeNameEnumValues Enumerates the set of values for QueryDataObjectResultSetColumnMetadataDataTypeNameEnum @@ -83,6 +89,7 @@ func GetQueryDataObjectResultSetColumnMetadataDataTypeNameEnumStringValues() []s "NUMBER", "TIMESTAMP", "VARCHAR2", + "OTHER", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_opsi_data_object_data_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_opsi_data_object_data_details.go index 9e73848c8e5..69ca4f5d0c6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_opsi_data_object_data_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_opsi_data_object_data_details.go @@ -25,6 +25,9 @@ type QueryOpsiDataObjectDataDetails struct { // Unique OPSI data object identifier. DataObjectIdentifier *string `mandatory:"false" json:"dataObjectIdentifier"` + // Details of OPSI data objects used in the query. + DataObjects []OpsiDataObjectDetailsInQuery `mandatory:"false" json:"dataObjects"` + ResourceFilters *ResourceFilters `mandatory:"false" json:"resourceFilters"` } @@ -47,9 +50,10 @@ func (m QueryOpsiDataObjectDataDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *QueryOpsiDataObjectDataDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - DataObjectIdentifier *string `json:"dataObjectIdentifier"` - ResourceFilters *ResourceFilters `json:"resourceFilters"` - Query dataobjectquery `json:"query"` + DataObjectIdentifier *string `json:"dataObjectIdentifier"` + DataObjects []opsidataobjectdetailsinquery `json:"dataObjects"` + ResourceFilters *ResourceFilters `json:"resourceFilters"` + Query dataobjectquery `json:"query"` }{} e = json.Unmarshal(data, &model) @@ -59,6 +63,19 @@ func (m *QueryOpsiDataObjectDataDetails) UnmarshalJSON(data []byte) (e error) { var nn interface{} m.DataObjectIdentifier = model.DataObjectIdentifier + m.DataObjects = make([]OpsiDataObjectDetailsInQuery, len(model.DataObjects)) + for i, n := range model.DataObjects { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.DataObjects[i] = nn.(OpsiDataObjectDetailsInQuery) + } else { + m.DataObjects[i] = nil + } + } + m.ResourceFilters = model.ResourceFilters nn, e = model.Query.UnmarshalPolymorphicJSON(model.Query.JsonData) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_warehouse_data_object_data_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_warehouse_data_object_data_details.go new file mode 100644 index 00000000000..12dc1ab644c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_warehouse_data_object_data_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueryWarehouseDataObjectDataDetails Information required to form and execute Operations Insights Warehouse data objects query. +type QueryWarehouseDataObjectDataDetails struct { + Query DataObjectQuery `mandatory:"true" json:"query"` +} + +func (m QueryWarehouseDataObjectDataDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m QueryWarehouseDataObjectDataDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *QueryWarehouseDataObjectDataDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Query dataobjectquery `json:"query"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.Query.UnmarshalPolymorphicJSON(model.Query.JsonData) + if e != nil { + return + } + if nn != nil { + m.Query = nn.(DataObjectQuery) + } else { + m.Query = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_warehouse_data_object_data_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_warehouse_data_object_data_request_response.go new file mode 100644 index 00000000000..41be9c5de29 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_warehouse_data_object_data_request_response.go @@ -0,0 +1,155 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// QueryWarehouseDataObjectDataRequest wrapper for the QueryWarehouseDataObjectData operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/QueryWarehouseDataObjectData.go.html to see an example of how to use QueryWarehouseDataObjectDataRequest. +type QueryWarehouseDataObjectDataRequest struct { + + // Type of the Warehouse. + WarehouseType QueryWarehouseDataObjectDataWarehouseTypeEnum `mandatory:"true" contributesTo:"path" name:"warehouseType"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a Warehouse. + WarehouseId *string `mandatory:"true" contributesTo:"path" name:"warehouseId"` + + // The information to be used for querying a Warehouse. + QueryWarehouseDataObjectDataDetails `contributesTo:"body"` + + // For list pagination. The maximum number of results per page, or items to + // return in a paginated "List" call. + // For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from + // the previous "List" call. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request QueryWarehouseDataObjectDataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request QueryWarehouseDataObjectDataRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request QueryWarehouseDataObjectDataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request QueryWarehouseDataObjectDataRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request QueryWarehouseDataObjectDataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingQueryWarehouseDataObjectDataWarehouseTypeEnum(string(request.WarehouseType)); !ok && request.WarehouseType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for WarehouseType: %s. Supported values are: %s.", request.WarehouseType, strings.Join(GetQueryWarehouseDataObjectDataWarehouseTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// QueryWarehouseDataObjectDataResponse wrapper for the QueryWarehouseDataObjectData operation +type QueryWarehouseDataObjectDataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of QueryDataObjectResultSetRowsCollection instances + QueryDataObjectResultSetRowsCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response QueryWarehouseDataObjectDataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response QueryWarehouseDataObjectDataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// QueryWarehouseDataObjectDataWarehouseTypeEnum Enum with underlying type: string +type QueryWarehouseDataObjectDataWarehouseTypeEnum string + +// Set of constants representing the allowable values for QueryWarehouseDataObjectDataWarehouseTypeEnum +const ( + QueryWarehouseDataObjectDataWarehouseTypeAwrhubs QueryWarehouseDataObjectDataWarehouseTypeEnum = "awrHubs" +) + +var mappingQueryWarehouseDataObjectDataWarehouseTypeEnum = map[string]QueryWarehouseDataObjectDataWarehouseTypeEnum{ + "awrHubs": QueryWarehouseDataObjectDataWarehouseTypeAwrhubs, +} + +var mappingQueryWarehouseDataObjectDataWarehouseTypeEnumLowerCase = map[string]QueryWarehouseDataObjectDataWarehouseTypeEnum{ + "awrhubs": QueryWarehouseDataObjectDataWarehouseTypeAwrhubs, +} + +// GetQueryWarehouseDataObjectDataWarehouseTypeEnumValues Enumerates the set of values for QueryWarehouseDataObjectDataWarehouseTypeEnum +func GetQueryWarehouseDataObjectDataWarehouseTypeEnumValues() []QueryWarehouseDataObjectDataWarehouseTypeEnum { + values := make([]QueryWarehouseDataObjectDataWarehouseTypeEnum, 0) + for _, v := range mappingQueryWarehouseDataObjectDataWarehouseTypeEnum { + values = append(values, v) + } + return values +} + +// GetQueryWarehouseDataObjectDataWarehouseTypeEnumStringValues Enumerates the set of values in String for QueryWarehouseDataObjectDataWarehouseTypeEnum +func GetQueryWarehouseDataObjectDataWarehouseTypeEnumStringValues() []string { + return []string{ + "awrHubs", + } +} + +// GetMappingQueryWarehouseDataObjectDataWarehouseTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingQueryWarehouseDataObjectDataWarehouseTypeEnum(val string) (QueryWarehouseDataObjectDataWarehouseTypeEnum, bool) { + enum, ok := mappingQueryWarehouseDataObjectDataWarehouseTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_collection.go new file mode 100644 index 00000000000..4053917f1a0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseDataObjectCollection Collection of Warehouse data object summary objects. +type WarehouseDataObjectCollection struct { + + // Array of Warehouse data object summary objects. + Items []WarehouseDataObjectSummary `mandatory:"true" json:"items"` +} + +func (m WarehouseDataObjectCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseDataObjectCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_details.go new file mode 100644 index 00000000000..401ca25b674 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_details.go @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseDataObjectDetails Warehouse data object details. +type WarehouseDataObjectDetails interface { +} + +type warehousedataobjectdetails struct { + JsonData []byte + DataObjectType string `json:"dataObjectType"` +} + +// UnmarshalJSON unmarshals json +func (m *warehousedataobjectdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerwarehousedataobjectdetails warehousedataobjectdetails + s := struct { + Model Unmarshalerwarehousedataobjectdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.DataObjectType = s.Model.DataObjectType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *warehousedataobjectdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.DataObjectType { + case "VIEW": + mm := WarehouseViewDataObjectDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "TABLE": + mm := WarehouseTableDataObjectDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for WarehouseDataObjectDetails: %s.", m.DataObjectType) + return *m, nil + } +} + +func (m warehousedataobjectdetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m warehousedataobjectdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_summary.go new file mode 100644 index 00000000000..555333ad219 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_data_object_summary.go @@ -0,0 +1,86 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseDataObjectSummary Summary of a Warehouse data object. +type WarehouseDataObjectSummary struct { + + // Type of the data object. + DataObjectType DataObjectTypeEnum `mandatory:"true" json:"dataObjectType"` + + // Name of the data object, which can be used in data object queries just like how view names are used in a query. + Name *string `mandatory:"false" json:"name"` + + // Owner of the data object, which can be used in data object queries in front of data object names just like SCHEMA.VIEW notation in queries. + Owner *string `mandatory:"false" json:"owner"` + + Details WarehouseDataObjectDetails `mandatory:"false" json:"details"` +} + +func (m WarehouseDataObjectSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseDataObjectSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDataObjectTypeEnum(string(m.DataObjectType)); !ok && m.DataObjectType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataObjectType: %s. Supported values are: %s.", m.DataObjectType, strings.Join(GetDataObjectTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *WarehouseDataObjectSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + Name *string `json:"name"` + Owner *string `json:"owner"` + Details warehousedataobjectdetails `json:"details"` + DataObjectType DataObjectTypeEnum `json:"dataObjectType"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Name = model.Name + + m.Owner = model.Owner + + nn, e = model.Details.UnmarshalPolymorphicJSON(model.Details.JsonData) + if e != nil { + return + } + if nn != nil { + m.Details = nn.(WarehouseDataObjectDetails) + } else { + m.Details = nil + } + + m.DataObjectType = model.DataObjectType + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_table_data_object_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_table_data_object_details.go new file mode 100644 index 00000000000..d19f761ca80 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_table_data_object_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseTableDataObjectDetails Details of a TABLE type data object in a Warehouse. +type WarehouseTableDataObjectDetails struct { + + // Metadata of columns in the data object. + ColumnsMetadata []DataObjectColumnMetadata `mandatory:"false" json:"columnsMetadata"` +} + +func (m WarehouseTableDataObjectDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseTableDataObjectDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m WarehouseTableDataObjectDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeWarehouseTableDataObjectDetails WarehouseTableDataObjectDetails + s := struct { + DiscriminatorParam string `json:"dataObjectType"` + MarshalTypeWarehouseTableDataObjectDetails + }{ + "TABLE", + (MarshalTypeWarehouseTableDataObjectDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_view_data_object_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_view_data_object_details.go new file mode 100644 index 00000000000..57a8cff696a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/warehouse_view_data_object_details.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WarehouseViewDataObjectDetails Details of a VIEW type data object in a Warehouse. +type WarehouseViewDataObjectDetails struct { + + // Metadata of columns in the data object. + ColumnsMetadata []DataObjectColumnMetadata `mandatory:"false" json:"columnsMetadata"` +} + +func (m WarehouseViewDataObjectDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WarehouseViewDataObjectDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m WarehouseViewDataObjectDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeWarehouseViewDataObjectDetails WarehouseViewDataObjectDetails + s := struct { + DiscriminatorParam string `json:"dataObjectType"` + MarshalTypeWarehouseViewDataObjectDetails + }{ + "VIEW", + (MarshalTypeWarehouseViewDataObjectDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 4fb8c338d33..94a44d10609 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -248,7 +248,7 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.0.0 ## explicit github.com/oklog/run -# github.com/oracle/oci-go-sdk/v65 v65.47.1 +# github.com/oracle/oci-go-sdk/v65 v65.47.2 ## explicit; go 1.13 github.com/oracle/oci-go-sdk/v65/adm github.com/oracle/oci-go-sdk/v65/aianomalydetection diff --git a/website/docs/d/bds_auto_scaling_configuration.html.markdown b/website/docs/d/bds_auto_scaling_configuration.html.markdown index d272009e1b2..a1ff3cb08c0 100644 --- a/website/docs/d/bds_auto_scaling_configuration.html.markdown +++ b/website/docs/d/bds_auto_scaling_configuration.html.markdown @@ -37,7 +37,7 @@ The following attributes are exported: * `display_name` - A user-friendly name. The name does not have to be unique, and it may be changed. Avoid entering confidential information. * `id` - The unique identifier for the autoscale configuration. -* `node_type` - A node type that is managed by an autoscale configuration. The only supported types are WORKER and COMPUTE_ONLY_WORKER. +* `node_type` - A node type that is managed by an autoscale configuration. The only supported types are WORKER, COMPUTE_ONLY_WORKER, KAFKA_BROKER. * `policy` - This model for autoscaling policy is deprecated and not supported for ODH clusters. Use the `AutoScalePolicyDetails` model to manage autoscale policy details for ODH clusters. * `policy_type` - Types of autoscale policies. Options are SCHEDULE-BASED or THRESHOLD-BASED. (Only THRESHOLD-BASED is supported in this release.) * `rules` - The list of rules for autoscaling. If an action has multiple rules, the last rule in the array will be applied. @@ -97,12 +97,12 @@ The following attributes are exported: * `operator` - The comparison operator to use. Options are greater than (GT) or less than (LT). * `value` - Integer non-negative value. 0 < value < 100 * `ocpu_step_size` - For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the number of OCPUs to add to each node during a scale-up event. This value is not used for nodes with fixed compute shapes. - * `schedule_details` - + * `schedule_details` - Details of a horizontal scaling schedule. * `schedule_type` - The type of schedule. - * `time_and_horizontal_scaling_config` - + * `time_and_horizontal_scaling_config` - Time of day and horizontal scaling configuration. * `target_node_count` - This value is the desired number of nodes in the cluster. * `time_recurrence` - Day/time recurrence (specified following RFC 5545) at which to trigger autoscaling action. Currently only WEEKLY frequency is supported. Days of the week are specified using BYDAY field. Time of the day is specified using BYHOUR and BYMINUTE fields. Other fields are not supported. - * `time_and_vertical_scaling_config` - + * `time_and_vertical_scaling_config` - Time of day and vertical scaling configuration * `target_memory_per_node` - For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired memory in GBs on each node. This value is not used for nodes with fixed compute shapes. * `target_ocpus_per_node` - For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired OCPUs count on each node. This value is not used for nodes with fixed compute shapes. * `target_shape` - For nodes with [fixed compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired shape of each node. This value is not used for nodes with flexible compute shapes. diff --git a/website/docs/d/bds_bds_instance.html.markdown b/website/docs/d/bds_bds_instance.html.markdown index ded8e0d9a1f..b6476aee876 100644 --- a/website/docs/d/bds_bds_instance.html.markdown +++ b/website/docs/d/bds_bds_instance.html.markdown @@ -67,6 +67,7 @@ The following attributes are exported: * `id` - The OCID of the Big Data Service resource. * `is_cloud_sql_configured` - Boolean flag specifying whether or not Cloud SQL should be configured. * `is_high_availability` - Boolean flag specifying whether or not the cluster is highly available (HA) +* `is_kafka_configured` - Boolean flag specifying whether or not Kafka should be configured. * `is_secure` - Boolean flag specifying whether or not the cluster should be set up as secure. * `kms_key_id` - The OCID of the Key Management master encryption key. * `network_config` - Additional configuration of the user's network. @@ -93,8 +94,10 @@ The following attributes are exported: * `state` - The state of the node. * `subnet_id` - The OCID of the subnet in which the node is to be created. * `time_created` - The time the node was created, shown as an RFC 3339 formatted datetime string. + * `time_maintenance_reboot_due` - The date and time the instance is expected to be stopped / started, in the format defined by RFC3339. * `time_updated` - The time the cluster was updated, shown as an RFC 3339 formatted datetime string. * `number_of_nodes` - The number of nodes that form the cluster. +* `number_of_nodes_requiring_maintenance_reboot` - Number of nodes that require a maintenance reboot * `state` - The state of the cluster. * `time_created` - The time the cluster was created, shown as an RFC 3339 formatted datetime string. * `time_updated` - The time the cluster was updated, shown as an RFC 3339 formatted datetime string. diff --git a/website/docs/d/bds_bds_instance_get_os_patch.html.markdown b/website/docs/d/bds_bds_instance_get_os_patch.html.markdown new file mode 100644 index 00000000000..76c8f7deff5 --- /dev/null +++ b/website/docs/d/bds_bds_instance_get_os_patch.html.markdown @@ -0,0 +1,53 @@ +--- +subcategory: "Big Data Service" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_bds_bds_instance_get_os_patch" +sidebar_current: "docs-oci-datasource-bds-bds_instance_get_os_patch" +description: |- + Provides the list of Bds Instance Get Os Patch in Oracle Cloud Infrastructure Big Data Service service +--- + +# Data Source: oci_bds_bds_instance_get_os_patch +This data source provides the list of Bds Instance Get Os Patch in Oracle Cloud Infrastructure Big Data Service service. + +Get the details of an os patch + +## Example Usage + +```hcl +data "oci_bds_bds_instance_get_os_patch" "test_bds_instance_get_os_patch" { + #Required + bds_instance_id = oci_bds_bds_instance.test_bds_instance.id + os_patch_version = var.bds_instance_get_os_patch_os_patch_version +} +``` + +## Argument Reference + +The following arguments are supported: + +* `bds_instance_id` - (Required) The OCID of the cluster. +* `os_patch_version` - (Required) The version of the OS patch. + + +## Attributes Reference + +The following attributes are exported: + +* `os_patch_details` - The list of os_patch_details. + +### BdsInstanceGetOsPatch Reference + +The following attributes are exported: + +* `min_bds_version` - Minimum BDS version required to install current OS patch. +* `min_compatible_odh_version_map` - Map of major ODH version to minimum ODH version required to install current OS patch. e.g. {ODH0.9: 0.9.1} +* `os_patch_version` - Version of the os patch. +* `patch_type` - Type of a specific os patch. REGULAR means standard released os patches. CUSTOM means os patches with some customizations. EMERGENT means os patches with some emergency fixes that should be prioritized. +* `release_date` - Released date of the OS patch. +* `target_packages` - List of summaries of individual target packages. + * `package_name` - The package's name. + * `related_cv_es` - Related CVEs of the package update. + * `target_version` - The target version of the package. + * `update_type` - The action that current package will be executed on the cluster. + diff --git a/website/docs/d/bds_bds_instance_list_os_patches.html.markdown b/website/docs/d/bds_bds_instance_list_os_patches.html.markdown new file mode 100644 index 00000000000..5e93ea31dfb --- /dev/null +++ b/website/docs/d/bds_bds_instance_list_os_patches.html.markdown @@ -0,0 +1,43 @@ +--- +subcategory: "Big Data Service" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_bds_bds_instance_list_os_patches" +sidebar_current: "docs-oci-datasource-bds-bds_instance_list_os_patches" +description: |- + Provides the list of Bds Instance List Os Patches in Oracle Cloud Infrastructure Big Data Service service +--- + +# Data Source: oci_bds_bds_instance_list_os_patches +This data source provides the list of Bds Instance List Os Patches in Oracle Cloud Infrastructure Big Data Service service. + +List all available os patches for a given cluster + +## Example Usage + +```hcl +data "oci_bds_bds_instance_list_os_patches" "test_bds_instance_list_os_patches" { + #Required + bds_instance_id = oci_bds_bds_instance.test_bds_instance.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `bds_instance_id` - (Required) The OCID of the cluster. + + +## Attributes Reference + +The following attributes are exported: + +* `os_patches` - The list of os_patches. + +### BdsInstanceListOsPatch Reference + +The following attributes are exported: + +* `os_patch_version` - Patch version of the os patch. +* `release_date` - The time when the OS patch was released. + diff --git a/website/docs/d/bds_bds_instance_patch_histories.html.markdown b/website/docs/d/bds_bds_instance_patch_histories.html.markdown index 3be5a7f0e25..05b6582aa5b 100644 --- a/website/docs/d/bds_bds_instance_patch_histories.html.markdown +++ b/website/docs/d/bds_bds_instance_patch_histories.html.markdown @@ -21,6 +21,7 @@ data "oci_bds_bds_instance_patch_histories" "test_bds_instance_patch_histories" bds_instance_id = oci_bds_bds_instance.test_bds_instance.id #Optional + patch_type = var.bds_instance_patch_history_patch_type patch_version = var.bds_instance_patch_history_patch_version state = var.bds_instance_patch_history_state } @@ -31,6 +32,7 @@ data "oci_bds_bds_instance_patch_histories" "test_bds_instance_patch_histories" The following arguments are supported: * `bds_instance_id` - (Required) The OCID of the cluster. +* `patch_type` - (Optional) The type of a BDS patch history entity. * `patch_version` - (Optional) The version of the patch * `state` - (Optional) The status of the patch. @@ -45,6 +47,7 @@ The following attributes are exported: The following attributes are exported: +* `patch_type` - The type of current patch history. DP - Data Plane patch(This history type is internal available only) ODH - Oracle Distribution of Hadoop patch OS - Operating System patch * `state` - The status of this patch. * `time_updated` - The time when the patch history was last updated. * `version` - The version of the patch. diff --git a/website/docs/d/bds_bds_instances.html.markdown b/website/docs/d/bds_bds_instances.html.markdown index 925d5f195ba..124a7afde99 100644 --- a/website/docs/d/bds_bds_instances.html.markdown +++ b/website/docs/d/bds_bds_instances.html.markdown @@ -80,6 +80,7 @@ The following attributes are exported: * `id` - The OCID of the Big Data Service resource. * `is_cloud_sql_configured` - Boolean flag specifying whether or not Cloud SQL should be configured. * `is_high_availability` - Boolean flag specifying whether or not the cluster is highly available (HA) +* `is_kafka_configured` - Boolean flag specifying whether or not Kafka should be configured. * `is_secure` - Boolean flag specifying whether or not the cluster should be set up as secure. * `kms_key_id` - The OCID of the Key Management master encryption key. * `network_config` - Additional configuration of the user's network. @@ -106,8 +107,10 @@ The following attributes are exported: * `state` - The state of the node. * `subnet_id` - The OCID of the subnet in which the node is to be created. * `time_created` - The time the node was created, shown as an RFC 3339 formatted datetime string. + * `time_maintenance_reboot_due` - The date and time the instance is expected to be stopped / started, in the format defined by RFC3339. * `time_updated` - The time the cluster was updated, shown as an RFC 3339 formatted datetime string. * `number_of_nodes` - The number of nodes that form the cluster. +* `number_of_nodes_requiring_maintenance_reboot` - Number of nodes that require a maintenance reboot * `state` - The state of the cluster. * `time_created` - The time the cluster was created, shown as an RFC 3339 formatted datetime string. * `time_updated` - The time the cluster was updated, shown as an RFC 3339 formatted datetime string. diff --git a/website/docs/d/database_autonomous_database.html.markdown b/website/docs/d/database_autonomous_database.html.markdown index 0c250f8f6ca..ba4c825e094 100644 --- a/website/docs/d/database_autonomous_database.html.markdown +++ b/website/docs/d/database_autonomous_database.html.markdown @@ -100,6 +100,8 @@ The following attributes are exported: * `failed_data_recovery_in_seconds` - Indicates the number of seconds of data loss for a Data Guard failover. * `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database. +* `in_memory_area_in_gbs` - The area assigned to In-Memory tables in Autonomous Database. +* `in_memory_percentage` - The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. * `infrastructure_type` - The infrastructure type this resource belongs to. * `is_access_control_enabled` - Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. diff --git a/website/docs/d/database_autonomous_databases.html.markdown b/website/docs/d/database_autonomous_databases.html.markdown index 452ecfd98f0..64eccfc4c75 100644 --- a/website/docs/d/database_autonomous_databases.html.markdown +++ b/website/docs/d/database_autonomous_databases.html.markdown @@ -126,6 +126,8 @@ The following attributes are exported: * `failed_data_recovery_in_seconds` - Indicates the number of seconds of data loss for a Data Guard failover. * `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database. +* `in_memory_area_in_gbs` - The area assigned to In-Memory tables in Autonomous Database. +* `in_memory_percentage` - The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. * `infrastructure_type` - The infrastructure type this resource belongs to. * `is_access_control_enabled` - Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. diff --git a/website/docs/d/database_autonomous_databases_clones.html.markdown b/website/docs/d/database_autonomous_databases_clones.html.markdown index ce67f28527d..371233658b6 100644 --- a/website/docs/d/database_autonomous_databases_clones.html.markdown +++ b/website/docs/d/database_autonomous_databases_clones.html.markdown @@ -116,6 +116,8 @@ The following attributes are exported: * `failed_data_recovery_in_seconds` - Indicates the number of seconds of data loss for a Data Guard failover. * `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database. +* `in_memory_area_in_gbs` - The area assigned to In-Memory tables in Autonomous Database. +* `in_memory_percentage` - The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. * `infrastructure_type` - The infrastructure type this resource belongs to. * `is_access_control_enabled` - Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. diff --git a/website/docs/r/bds_auto_scaling_configuration.html.markdown b/website/docs/r/bds_auto_scaling_configuration.html.markdown index a832de9d60f..52784451946 100644 --- a/website/docs/r/bds_auto_scaling_configuration.html.markdown +++ b/website/docs/r/bds_auto_scaling_configuration.html.markdown @@ -82,7 +82,7 @@ The following arguments are supported: * `cluster_admin_password` - (Required) (Updatable) Base-64 encoded password for the cluster (and Cloudera Manager) admin user. * `display_name` - (Optional) (Updatable) A user-friendly name. The name does not have to be unique, and it may be changed. Avoid entering confidential information. * `is_enabled` - (Required) (Updatable) Whether the autoscale configuration is enabled. -* `node_type` - (Required) A node type that is managed by an autoscale configuration. The only supported types are WORKER and COMPUTE_ONLY_WORKER. +* `node_type` - (Required) A node type that is managed by an autoscale configuration. The only supported types are WORKER, COMPUTE_ONLY_WORKER and KAFKA_BROKER. * `policy` - (Optional) (Updatable) This model for autoscaling policy is deprecated and not supported for ODH clusters. Use the `AutoScalePolicyDetails` model to manage autoscale policy details for ODH clusters. * `policy_type` - (Required) (Updatable) Types of autoscale policies. Options are SCHEDULE-BASED or THRESHOLD-BASED. (Only THRESHOLD-BASED is supported in this release.) * `rules` - (Required) (Updatable) The list of rules for autoscaling. If an action has multiple rules, the last rule in the array will be applied. @@ -145,12 +145,12 @@ The following arguments are supported: * `operator` - (Required when policy_type=METRIC_BASED_VERTICAL_SCALING_POLICY) (Updatable) The comparison operator to use. Options are greater than (GT) or less than (LT). * `value` - (Required when policy_type=METRIC_BASED_VERTICAL_SCALING_POLICY) (Updatable) Integer non-negative value. 0 < value < 100 * `ocpu_step_size` - (Applicable when policy_type=METRIC_BASED_VERTICAL_SCALING_POLICY) (Updatable) For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the number of OCPUs to add to each node during a scale-up event. This value is not used for nodes with fixed compute shapes. - * `schedule_details` - (Applicable when policy_type=SCHEDULE_BASED_HORIZONTAL_SCALING_POLICY | SCHEDULE_BASED_VERTICAL_SCALING_POLICY) (Updatable) + * `schedule_details` - (Applicable when policy_type=SCHEDULE_BASED_HORIZONTAL_SCALING_POLICY | SCHEDULE_BASED_VERTICAL_SCALING_POLICY) (Updatable) Details of a horizontal scaling schedule. * `schedule_type` - (Optional) (Updatable) The type of schedule. - * `time_and_horizontal_scaling_config` - (Optional) (Updatable) + * `time_and_horizontal_scaling_config` - (Optional) (Updatable) Time of day and horizontal scaling configuration. * `target_node_count` - (Optional) (Updatable) This value is the desired number of nodes in the cluster. * `time_recurrence` - (Optional) (Updatable) Day/time recurrence (specified following RFC 5545) at which to trigger autoscaling action. Currently only WEEKLY frequency is supported. Days of the week are specified using BYDAY field. Time of the day is specified using BYHOUR and BYMINUTE fields. Other fields are not supported. - * `time_and_vertical_scaling_config` - (Optional) (Updatable) + * `time_and_vertical_scaling_config` - (Optional) (Updatable) Time of day and vertical scaling configuration * `target_memory_per_node` - (Optional) (Updatable) For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired memory in GBs on each node. This value is not used for nodes with fixed compute shapes. * `target_ocpus_per_node` - (Optional) (Updatable) For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired OCPUs count on each node. This value is not used for nodes with fixed compute shapes. * `target_shape` - (Optional) (Updatable) For nodes with [fixed compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired shape of each node. This value is not used for nodes with flexible compute shapes. @@ -227,12 +227,12 @@ The following attributes are exported: * `operator` - The comparison operator to use. Options are greater than (GT) or less than (LT). * `value` - Integer non-negative value. 0 < value < 100 * `ocpu_step_size` - For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the number of OCPUs to add to each node during a scale-up event. This value is not used for nodes with fixed compute shapes. - * `schedule_details` - + * `schedule_details` - Details of a horizontal scaling schedule. * `schedule_type` - The type of schedule. - * `time_and_horizontal_scaling_config` - + * `time_and_horizontal_scaling_config` - Time of day and horizontal scaling configuration. * `target_node_count` - This value is the desired number of nodes in the cluster. * `time_recurrence` - Day/time recurrence (specified following RFC 5545) at which to trigger autoscaling action. Currently only WEEKLY frequency is supported. Days of the week are specified using BYDAY field. Time of the day is specified using BYHOUR and BYMINUTE fields. Other fields are not supported. - * `time_and_vertical_scaling_config` - + * `time_and_vertical_scaling_config` - Time of day and vertical scaling configuration * `target_memory_per_node` - For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired memory in GBs on each node. This value is not used for nodes with fixed compute shapes. * `target_ocpus_per_node` - For nodes with [flexible compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired OCPUs count on each node. This value is not used for nodes with fixed compute shapes. * `target_shape` - For nodes with [fixed compute shapes](https://docs.cloud.oracle.com/iaas/Content/bigdata/create-cluster.htm#cluster-plan-shape), this value is the desired shape of each node. This value is not used for nodes with flexible compute shapes. diff --git a/website/docs/r/bds_bds_instance.html.markdown b/website/docs/r/bds_bds_instance.html.markdown index 3c7f2664fa9..716c57ab3b2 100644 --- a/website/docs/r/bds_bds_instance.html.markdown +++ b/website/docs/r/bds_bds_instance.html.markdown @@ -100,6 +100,21 @@ resource "oci_bds_bds_instance" "test_bds_instance" { ocpus = var.bds_instance_nodes_shape_config_ocpus } } + kafka_broker_node { + #Required + shape = var.bds_instance_nodes_shape + subnet_id = oci_core_subnet.test_subnet.id + number_of_nodes = var.bds_instance_number_of_nodes + #Optional + block_volume_size_in_gbs = var.bds_instance_nodes_block_volume_size_in_gbs + shape_config { + + #Optional + memory_in_gbs = var.bds_instance_nodes_shape_config_memory_in_gbs + nvmes = var.bds_instance_nodes_shape_config_nvmes + ocpus = var.bds_instance_nodes_shape_config_ocpus + } + } #Optional bootstrap_script_url = var.bds_instance_bootstrap_script_url @@ -141,36 +156,64 @@ The following arguments are supported: * `network_config` - (Optional) Additional configuration of the user's network. * `cidr_block` - (Optional) The CIDR IP address block of the VCN. * `is_nat_gateway_required` - (Optional) A boolean flag whether to configure a NAT gateway. +* `state` - (Optional) (Updatable) The target state for the Bds Instance. Could be set to `ACTIVE` or `INACTIVE`. +* `nodes` - (Required) The list of nodes in the Big Data Service cluster. + * `block_volume_size_in_gbs` - (Required) The size of block volume in GB to be attached to a given node. All the details needed for attaching the block volume are managed by service itself. + * `node_type` - (Required) The Big Data Service cluster node type. + * `shape` - (Required) (Updatable) Shape of the node. + * `shape_config` - (Optional) The shape configuration requested for the node. + * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes. + * `nvmes` - (Optional) The number of NVMe drives to be used for storage. A single drive has 6.8 TB available. + * `ocpus` - (Optional) The total number of OCPUs available to the node. + * `subnet_id` - (Required) The OCID of the subnet in which the node will be created. +* `state` - (Optional) (Updatable) The target state for the Bds Instance. Could be set to `ACTIVE` or `INACTIVE`. +* `execute_bootstrap_script_trigger` - (Optional) (Updatable) An optional property when incremented triggers Execute Bootstrap Script. Could be set to any integer value. +* `install_os_patch_trigger` - (Optional) (Updatable) An optional property when incremented triggers Install Os Patch. Could be set to any integer value. +* `is_force_stop_jobs` - (Optional) (Updatable) When setting state as `INACTIVE` for stopping a cluster, setting this flag to true forcefully stops the bds instance. +* `is_kafka_configured` - (Optional) Boolean flag specifying whether or not Kafka should be configured. +* `os_patch_version` - (Optional) (Updatable) The version of the patch to be upated. * `state` - (Optional) (Updatable) The target state for the Bds Instance. Could be set to `ACTIVE` or `INACTIVE` to start/stop the bds instance. * `is_force_stop_jobs` - (Optional) (Updatable) When setting state as `INACTIVE` for stopping a cluster, setting this flag to true forcefully stops the bds instance. -* `network_config` - (Optional) Additional configuration of customer's network. - * `cidr_block` - (Required) The CIDR IP address block of the VCN. - * `is_nat_gateway_required` - (Required) A boolean flag whether to configure a NAT gateway. * `master_node` - (Required) The master node in the BDS instance - * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. - * `number_of_nodes` - (Required) The amount of master nodes should be created. - * `shape` - (Required) Shape of the node - * `subnet_id` - (Required) The OCID of the subnet in which the node should be created - * `shape_config` - (Optional) The shape configuration requested for the node. - * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes - * `ocpus` - (Optional) The total number of OCPUs available to the node. + * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. + * `number_of_nodes` - (Required) The amount of master nodes should be created. + * `shape` - (Required) Shape of the node + * `subnet_id` - (Required) The OCID of the subnet in which the node should be created + * `shape_config` - (Optional) The shape configuration requested for the node. + * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes + * `ocpus` - (Optional) The total number of OCPUs available to the node. * `util_node` - (Required) The utility node in the BDS instance - * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. - * `number_of_nodes` - (Required) The amount of utility nodes should be created. - * `shape` - (Required) Shape of the node - * `subnet_id` - (Required) The OCID of the subnet in which the node should be created - * `shape_config` - (Optional) The shape configuration requested for the node. - * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes - * `ocpus` - (Optional) The total number of OCPUs available to the node. + * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. + * `number_of_nodes` - (Required) The amount of utility nodes should be created. + * `shape` - (Required) Shape of the node + * `subnet_id` - (Required) The OCID of the subnet in which the node should be created + * `shape_config` - (Optional) The shape configuration requested for the node. + * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes + * `ocpus` - (Optional) The total number of OCPUs available to the node. * `woker_node` - (Required) The worker node in the BDS instance - * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. - * `number_of_nodes` - (Required) The amount of worker nodes should be created, at least be 3. - * `shape` - (Required) Shape of the node - * `subnet_id` - (Required) The OCID of the subnet in which the node should be created - * `shape_config` - (Optional) The shape configuration requested for the node. - * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes - * `ocpus` - (Optional) The total number of OCPUs available to the node. + * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. + * `number_of_nodes` - (Required) The amount of worker nodes should be created, at least be 3. + * `shape` - (Required) Shape of the node + * `subnet_id` - (Required) The OCID of the subnet in which the node should be created + * `shape_config` - (Optional) The shape configuration requested for the node. + * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes + * `ocpus` - (Optional) The total number of OCPUs available to the node. * `compute_only_woker_node` - (Optional) The worker node in the BDS instance + * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. + * `number_of_nodes` - (Required) The amount of worker nodes should be created + * `shape` - (Required) Shape of the node + * `subnet_id` - (Required) The OCID of the subnet in which the node should be created + * `shape_config` - (Optional) The shape configuration requested for the node. + * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes + * `ocpus` - (Optional) The total number of OCPUs available to the node. +* `kafka_broker_node` - (Optional) The kafka broker node in the BDS instance + * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. + * `number_of_nodes` - (Required) The amount of worker nodes should be created + * `shape` - (Required) Shape of the node + * `subnet_id` - (Required) The OCID of the subnet in which the node should be created + * `shape_config` - (Optional) The shape configuration requested for the node. + * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes + * `ocpus` - (Optional) The total number of OCPUs available to the node. * `block_volume_size_in_gbs` - (Optional) The size of block volume in GB that needs to be attached to a given node. All the necessary details needed for attachment are managed by service itself. * `number_of_nodes` - (Required) The amount of worker nodes should be created * `shape` - (Required) Shape of the node @@ -178,8 +221,6 @@ The following arguments are supported: * `shape_config` - (Optional) The shape configuration requested for the node. * `memory_in_gbs` - (Optional) The total amount of memory available to the node, in gigabytes * `ocpus` - (Optional) The total number of OCPUs available to the node. - - ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values @@ -223,6 +264,7 @@ The following attributes are exported: * `id` - The OCID of the Big Data Service resource. * `is_cloud_sql_configured` - Boolean flag specifying whether or not Cloud SQL should be configured. * `is_high_availability` - Boolean flag specifying whether or not the cluster is highly available (HA) +* `is_kafka_configured` - Boolean flag specifying whether or not Kafka should be configured. * `is_secure` - Boolean flag specifying whether or not the cluster should be set up as secure. * `kms_key_id` - The OCID of the Key Management master encryption key. * `network_config` - Additional configuration of the user's network. @@ -249,8 +291,10 @@ The following attributes are exported: * `state` - The state of the node. * `subnet_id` - The OCID of the subnet in which the node is to be created. * `time_created` - The time the node was created, shown as an RFC 3339 formatted datetime string. + * `time_maintenance_reboot_due` - The date and time the instance is expected to be stopped / started, in the format defined by RFC3339. * `time_updated` - The time the cluster was updated, shown as an RFC 3339 formatted datetime string. * `number_of_nodes` - The number of nodes that form the cluster. +* `number_of_nodes_requiring_maintenance_reboot` - Number of nodes that require a maintenance reboot * `state` - The state of the cluster. * `time_created` - The time the cluster was created, shown as an RFC 3339 formatted datetime string. * `time_updated` - The time the cluster was updated, shown as an RFC 3339 formatted datetime string. diff --git a/website/docs/r/database_application_vip.html.markdown b/website/docs/r/database_application_vip.html.markdown index 1887e2ecc48..a83463d9ef0 100644 --- a/website/docs/r/database_application_vip.html.markdown +++ b/website/docs/r/database_application_vip.html.markdown @@ -60,7 +60,7 @@ The following attributes are exported: ## Timeouts -The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/hashicorp/oci/latest/docs/guides/changing_timeouts) for certain operations: +The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/oracle/oci/latest/docs/guides/changing_timeouts) for certain operations: * `create` - (Defaults to 20 minutes), when creating the Application Vip * `delete` - (Defaults to 20 minutes), when destroying the Application Vip diff --git a/website/docs/r/database_autonomous_database.html.markdown b/website/docs/r/database_autonomous_database.html.markdown index 4210279cdb5..ef703a3769b 100644 --- a/website/docs/r/database_autonomous_database.html.markdown +++ b/website/docs/r/database_autonomous_database.html.markdown @@ -48,6 +48,7 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { defined_tags = var.autonomous_database_defined_tags display_name = var.autonomous_database_display_name freeform_tags = {"Department"= "Finance"} + in_memory_percentage = var.autonomous_database_in_memory_percentage is_access_control_enabled = var.autonomous_database_is_access_control_enabled is_auto_scaling_enabled = var.autonomous_database_is_auto_scaling_enabled is_auto_scaling_for_storage_enabled = var.autonomous_database_is_auto_scaling_for_storage_enabled @@ -143,6 +144,7 @@ The following arguments are supported: * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). * `display_name` - (Optional) (Updatable) The user-friendly name for the Autonomous Database. The name does not have to be unique. * `freeform_tags` - (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `in_memory_percentage` - (Optional) (Updatable) The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. * `is_access_control_enabled` - (Optional) (Updatable) Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. @@ -311,6 +313,8 @@ The following attributes are exported: * `failed_data_recovery_in_seconds` - Indicates the number of seconds of data loss for a Data Guard failover. * `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database. +* `in_memory_area_in_gbs` - The area assigned to In-Memory tables in Autonomous Database. +* `in_memory_percentage` - The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. * `infrastructure_type` - The infrastructure type this resource belongs to. * `is_access_control_enabled` - Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the `whitelistedIps` property. While specifying `whitelistedIps` rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the `UpdateAutonomousDatabase` API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone. diff --git a/website/docs/r/datascience_pipeline.html.markdown b/website/docs/r/datascience_pipeline.html.markdown index deafff27ae2..23fd042a923 100644 --- a/website/docs/r/datascience_pipeline.html.markdown +++ b/website/docs/r/datascience_pipeline.html.markdown @@ -190,7 +190,7 @@ The following attributes are exported: ## Timeouts -The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/hashicorp/oci/latest/docs/guides/changing_timeouts) for certain operations: +The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/oracle/oci/latest/docs/guides/changing_timeouts) for certain operations: * `create` - (Defaults to 20 minutes), when creating the Pipeline * `update` - (Defaults to 20 minutes), when updating the Pipeline * `delete` - (Defaults to 20 minutes), when destroying the Pipeline diff --git a/website/docs/r/datascience_pipeline_run.html.markdown b/website/docs/r/datascience_pipeline_run.html.markdown index 857780b4fdb..5bf29a77596 100644 --- a/website/docs/r/datascience_pipeline_run.html.markdown +++ b/website/docs/r/datascience_pipeline_run.html.markdown @@ -144,7 +144,7 @@ The following attributes are exported: ## Timeouts -The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/hashicorp/oci/latest/docs/guides/changing_timeouts) for certain operations: +The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/oracle/oci/latest/docs/guides/changing_timeouts) for certain operations: * `create` - (Defaults to 20 minutes), when creating the Pipeline Run * `update` - (Defaults to 20 minutes), when updating the Pipeline Run * `delete` - (Defaults to 20 minutes), when destroying the Pipeline Run diff --git a/website/docs/r/opsi_opsi_configuration.html.markdown b/website/docs/r/opsi_opsi_configuration.html.markdown index 93cfc0e6f95..427cb0d4065 100644 --- a/website/docs/r/opsi_opsi_configuration.html.markdown +++ b/website/docs/r/opsi_opsi_configuration.html.markdown @@ -104,7 +104,7 @@ The following attributes are exported: ## Timeouts -The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/hashicorp/oci/latest/docs/guides/changing_timeouts) for certain operations: +The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/oracle/oci/latest/docs/guides/changing_timeouts) for certain operations: * `create` - (Defaults to 20 minutes), when creating the Opsi Configuration * `update` - (Defaults to 20 minutes), when updating the Opsi Configuration * `delete` - (Defaults to 20 minutes), when destroying the Opsi Configuration