diff --git a/CHANGELOG.md b/CHANGELOG.md index 73d87105810..da3893dbdc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +## 7.21.0 (October 1, 2025) + +### Added +- Support for Immutable Backup and Undelete DB | ADB-D and ADB on ExaC@C +- Support for sigint context to go sdk for GoldenGate +- support for distinct instance_shape_config in capacity reservations +- Support for Generative AI - Private Endpoint support for DAC +- Support for Vertical Stack Update for Guest OS and GI using generic scheduling mechanism or point operations +- Support for ADB-S: ADB@GCP (Oasis) Google Key Management Support (GCP CMEK) R3 +- Support for Datastore Management for Standard Shapes +- Support for Reselling NVAIE License from NVidia +- Support for Long Running Functions With Guaranteed Response Delivery +- Support for Resource Analytics service +- Support for Multicloud service + +### Bug Fix +- for MongoDB API support | ADB-D & ADB-C@C +- Issue updating management policies with type set to None. + ## 7.20.0 (September 23, 2025) ### Added diff --git a/coverage/coverage_test.go b/coverage/coverage_test.go index 40006e48416..31f16061358 100644 --- a/coverage/coverage_test.go +++ b/coverage/coverage_test.go @@ -14,7 +14,7 @@ import ( var totalRgx = regexp.MustCompile(`total:\s+\(statements\)\s+([^"]*)%`) -const CodeCoverageThreshold = 54.6 +const CodeCoverageThreshold = 54.7 func TestCoverage(t *testing.T) { if os.Getenv("CHECK_COVERAGE") != "true" { diff --git a/examples/README.md b/examples/README.md index 64b5b9b063d..26ca1fc83a9 100644 --- a/examples/README.md +++ b/examples/README.md @@ -141,6 +141,8 @@ This directory contains Terraform configuration files showing how to create spec [![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle/terraform-provider-oci/raw/master/examples/zips/jms.zip) - jms_java_downloads [![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle/terraform-provider-oci/raw/master/examples/zips/jms_java_downloads.zip) +- jms_utils + [![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle/terraform-provider-oci/raw/master/examples/zips/jms_utils.zip) - kms [![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle/terraform-provider-oci/raw/master/examples/zips/kms.zip) - license_manager diff --git a/examples/compute/capacity_reservation/config.tf b/examples/compute/capacity_reservation/config.tf index f0274db21cc..ef364e6e5be 100644 --- a/examples/compute/capacity_reservation/config.tf +++ b/examples/compute/capacity_reservation/config.tf @@ -6,6 +6,19 @@ resource "oci_core_compute_capacity_reservation" "cr" { instance_reservation_configs { instance_shape = var.instance_shape reserved_count = var.instance_count + instance_shape_config { + ocpus = "2" + memory_in_gbs = "18" + } + } + + instance_reservation_configs { + instance_shape = var.instance_shape + reserved_count = var.instance_count + instance_shape_config { + ocpus = "3" + memory_in_gbs = "22" + } } } @@ -20,6 +33,10 @@ resource "oci_core_instance" "test_instance" { assign_public_ip = false subnet_id = oci_core_subnet.test_subnet.id } + shape_config { + ocpus = "2" + memory_in_gbs = "18" + } source_details { source_type = "image" source_id = var.instance_image_ocid[var.region] diff --git a/examples/compute/capacity_reservation/variables.tf b/examples/compute/capacity_reservation/variables.tf index f6a7a467190..24bc166ced3 100644 --- a/examples/compute/capacity_reservation/variables.tf +++ b/examples/compute/capacity_reservation/variables.tf @@ -52,5 +52,5 @@ variable "instance_image_ocid" { } variable "instance_shape" { - default = "VM.Standard2.1" + default = "VM.Standard.E5.Flex" } diff --git a/examples/compute/instance/instance_with_aie_flag.tf b/examples/compute/instance/instance_with_aie_flag.tf new file mode 100644 index 00000000000..e8ee957f972 --- /dev/null +++ b/examples/compute/instance/instance_with_aie_flag.tf @@ -0,0 +1,119 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 +variable "subnet_ocid" { +} + +variable "image_ocid" { +} + +variable "config_file_profile" { +} + +# provider "oci" { +# region = var.region +# auth = "SecurityToken" +# config_file_profile = var.config_file_profile +# version = "7.18.0" +# } + +data "oci_identity_availability_domain" "ad" { + compartment_id = var.tenancy_ocid + ad_number = 1 +} + +resource "oci_core_instance_configuration" "test_instance_configuration_with_aie" { + compartment_id = var.compartment_ocid + display_name = "TestInstanceConfiguration" + + instance_details { + instance_type = "compute" + + launch_details { + compartment_id = var.compartment_ocid + shape = "BM.GPU.A10.4" + is_ai_enterprise_enabled = true + + source_details { + source_type = "image" + image_id = var.image_ocid + } + + instance_options { + are_legacy_imds_endpoints_disabled = true + } + + create_vnic_details { + subnet_id = var.subnet_ocid + display_name = "Primaryvnic" + } + } + } +} + +resource "oci_core_instance_pool" "test_instance_pool_with_aie" { + compartment_id = var.compartment_ocid + instance_configuration_id = oci_core_instance_configuration.test_instance_configuration_with_aie.id + size = 1 + state = "RUNNING" + display_name = "TestInstancePool" + + placement_configurations { + availability_domain = data.oci_identity_availability_domain.ad.name + primary_subnet_id = var.subnet_ocid + } +} + +resource "oci_core_instance" "test_instance_with_aie" { + availability_domain = data.oci_identity_availability_domain.ad.name + compartment_id = var.compartment_ocid + display_name = "TestInstance" + shape = "BM.GPU.A10.4" + is_ai_enterprise_enabled = true + + create_vnic_details { + subnet_id = var.subnet_ocid + display_name = "Primaryvnic" + } + + source_details { + source_type = "image" + source_id = var.image_ocid + } + + instance_options { + are_legacy_imds_endpoints_disabled = true + } + + timeouts { + create = "60m" + } +} + +output "aie_instance_config_data" { + value = oci_core_instance_configuration.test_instance_configuration_with_aie +} + +data "oci_core_instance_pool_instances" "aie_instance_pool_instance" { + compartment_id = var.compartment_ocid + instance_pool_id = oci_core_instance_pool.test_instance_pool_with_aie.id +} + +data "oci_core_instance" "aie_instance_pool_instance_data" { + instance_id = data.oci_core_instance_pool_instances.aie_instance_pool_instance.instances[0].id +} + +data "oci_core_instances" "aie_instance_data" { + compartment_id = var.compartment_ocid + filter { + name = "id" + values = [oci_core_instance.test_instance_with_aie.id] + } +} + +output "aie_instance_pool_instance_data" { + value = data.oci_core_instance.aie_instance_pool_instance_data +} + +output "aie_instance_data" { + value = data.oci_core_instances.aie_instance_data +} \ No newline at end of file diff --git a/examples/database/adb/adb_clones/autonomous_database_clones.tf b/examples/database/adb/adb_clones/autonomous_database_clones.tf new file mode 100644 index 00000000000..c9677a85fe1 --- /dev/null +++ b/examples/database/adb/adb_clones/autonomous_database_clones.tf @@ -0,0 +1,88 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +resource "random_string" "autonomous_database_admin_password" { + length = 16 + min_numeric = 1 + min_lower = 1 + min_upper = 1 + min_special = 1 +} + +data "oci_database_autonomous_db_versions" "test_autonomous_db_versions" { + #Required + compartment_id = var.compartment_ocid + + #Optional + db_workload = var.autonomous_database_db_workload + + filter { + name = "version" + values = ["19c"] + } +} + +resource "oci_database_autonomous_database" "autonomous_database" { + #Required + admin_password = random_string.autonomous_database_admin_password.result + compartment_id = var.compartment_ocid + compute_count = "1" + compute_model = "ECPU" + data_storage_size_in_tbs = "1" + db_name = "adbDatabaseName123" + + #Optional + db_version = data.oci_database_autonomous_db_versions.test_autonomous_db_versions.autonomous_db_versions[0].version + db_workload = var.autonomous_database_db_workload + display_name = "example_autonomous_database" + freeform_tags = var.autonomous_database_freeform_tags + is_auto_scaling_enabled = "true" + is_auto_scaling_for_storage_enabled = "true" + license_model = var.autonomous_database_license_model + is_preview_version_with_service_terms_accepted = "false" + whitelisted_ips = ["1.1.1.1/28"] + character_set = "AL32UTF8" + ncharacter_set = "AL16UTF16" +} + +resource "oci_database_autonomous_database" "test_autonomous_database" { + admin_password = random_string.autonomous_database_admin_password.result + compartment_id = var.compartment_ocid + cpu_core_count = "1" + data_storage_size_in_tbs = "1" + db_name = "adbdb11f" + db_version = "19c" + db_workload = "AJD" + license_model = "LICENSE_INCLUDED" + is_free_tier = "false" + autonomous_maintenance_schedule_type = var.autonomous_database_autonomous_maintenance_schedule_type +} + + +data "oci_database_autonomous_databases" "autonomous_databases" { + #Required + compartment_id = var.compartment_ocid + + #Optional + display_name = oci_database_autonomous_database.autonomous_database.display_name + db_workload = var.autonomous_database_db_workload +} + +data "oci_database_autonomous_database_refreshable_clones" "autonomous_database_refreshable_clones" { + #Required + autonomous_database_id = oci_database_autonomous_database.autonomous_database.id +} + +output "autonomous_database_admin_password" { + value = random_string.autonomous_database_admin_password.result +} + + +data "oci_database_autonomous_databases_clones" "test_autonomous_databases_clones" { + #Required + autonomous_database_id = oci_database_autonomous_database.test_autonomous_database.id + compartment_id = var.compartment_ocid + + #Optional + clone_type = "REFRESHABLE_CLONE" +} diff --git a/examples/database/adb/adb_clones/provider.tf b/examples/database/adb/adb_clones/provider.tf new file mode 100644 index 00000000000..c76dcfbfb99 --- /dev/null +++ b/examples/database/adb/adb_clones/provider.tf @@ -0,0 +1,11 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + diff --git a/examples/database/adb/adb_clones/variables.tf b/examples/database/adb/adb_clones/variables.tf new file mode 100644 index 00000000000..31054af426d --- /dev/null +++ b/examples/database/adb/adb_clones/variables.tf @@ -0,0 +1,38 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" { +} + +variable "user_ocid" { +} + +variable "fingerprint" { +} + +variable "private_key_path" { +} + +variable "region" { +} + +variable "compartment_ocid" { +} + +variable "autonomous_database_freeform_tags" { + default = { + "Department" = "Finance" + } +} + +variable "autonomous_database_license_model" { + default = "LICENSE_INCLUDED" +} + +variable "autonomous_database_db_workload" { + default = "OLTP" +} + +variable "autonomous_database_autonomous_maintenance_schedule_type" { + default = "EARLY" +} \ No newline at end of file diff --git a/examples/database/adb/encryption_key/autonomous_database_encryption_key.tf b/examples/database/adb/encryption_key/autonomous_database_encryption_key.tf index a28c20f0d48..9ca363d4674 100644 --- a/examples/database/adb/encryption_key/autonomous_database_encryption_key.tf +++ b/examples/database/adb/encryption_key/autonomous_database_encryption_key.tf @@ -39,4 +39,22 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { encryption_key { autonomous_database_provider = "ORACLE_MANAGED" } + + resource "oci_database_autonomous_database" "test_autonomous_database_gcp_kms" { + admin_password = "BEstrO0ng_#11" + compartment_id = var.compartment_ocid + cpu_core_count = "1" + data_storage_size_in_tbs = "1" + db_name = "Xsk5djnfdl23423dss" + db_version = "19c" + db_workload = "AJD" + license_model = "LICENSE_INCLUDED" + encryption_key { + autonomous_database_provider = "GCP" + key_name = "key_name" + key_ring = "key_ring" + location = "location" + project = "project" + } + } } \ No newline at end of file diff --git a/examples/database/atp-d/data_sources.tf b/examples/database/atp-d/data_sources.tf index 4f7efe800c4..b85af26b1e1 100644 --- a/examples/database/atp-d/data_sources.tf +++ b/examples/database/atp-d/data_sources.tf @@ -61,8 +61,4 @@ data "oci_database_cloud_autonomous_vm_cluster_resource_usage" "test_cloud_auton data "oci_database_autonomous_database_software_image" "test_autonomous_database_software_image" { autonomous_database_software_image_id = oci_database_autonomous_database_software_image.autonomous_database_software_image.id -} - -data "oci_database_cloud_autonomous_vm_clusters" "test_cloud_autonomous_vm_clusters" { - compartment_id = var.compartment_ocid } \ No newline at end of file diff --git a/examples/database/atp-d/main.tf b/examples/database/atp-d/main.tf index 3959c418120..965b8fe1916 100644 --- a/examples/database/atp-d/main.tf +++ b/examples/database/atp-d/main.tf @@ -13,6 +13,11 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container backup_config { #Optional recovery_window_in_days = var.autonomous_container_database_backup_config_recovery_window_in_days + backup_destination_details { + type = "OBJECT_STORE" + backup_retention_policy_on_terminate = "RETAIN_FOR_72_HOURS" + is_retention_lock_enabled = false + } } #Optional @@ -88,6 +93,11 @@ resource "oci_database_autonomous_container_database" "autonomous_container_data cloud_autonomous_vm_cluster_id = oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id database_software_image_id = oci_database_autonomous_database_software_image.autonomous_database_software_image.id backup_config { + backup_destination_details { + type = "OBJECT_STORE" + backup_retention_policy_on_terminate = "RETAIN_FOR_72_HOURS" + is_retention_lock_enabled = false + } recovery_window_in_days = "7" } compartment_id = var.compartment_ocid diff --git a/examples/database/atp-d/variables.tf b/examples/database/atp-d/variables.tf index 7fc4a7aab66..7c45aa8b411 100644 --- a/examples/database/atp-d/variables.tf +++ b/examples/database/atp-d/variables.tf @@ -58,7 +58,7 @@ variable "cloud_exadata_infrastructure_un_allocated_resource_db_servers" { } variable "acd_db_version" { - default = "19.26.0.1.0" + default = "19.28.0.1.0" } variable "tenant_subscription_id" { diff --git a/examples/database/exadata_cc/adbd-dg-ms/main.tf b/examples/database/exadata_cc/adbd-dg-ms/main.tf index fec21049d5e..be48d00c627 100644 --- a/examples/database/exadata_cc/adbd-dg-ms/main.tf +++ b/examples/database/exadata_cc/adbd-dg-ms/main.tf @@ -294,7 +294,7 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.primary_autonomous_vm_cluster.id display_name = "PrimaryACD" patch_model = "RELEASE_UPDATES" - db_version = "19.26.0.1.0" + db_version = "19.28.0.1.0" db_name = "PRIMARY" #Optional diff --git a/examples/database/exadata_cc/adbd/acd.tf b/examples/database/exadata_cc/adbd/acd.tf index 7837a52427a..6566f8bbf38 100644 --- a/examples/database/exadata_cc/adbd/acd.tf +++ b/examples/database/exadata_cc/adbd/acd.tf @@ -6,10 +6,13 @@ 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.26.0.1.0" + db_version = "19.28.0.1.0" backup_config { backup_destination_details { - type = "LOCAL" + type = "NFS" + id = oci_database_backup_destination.test_backup_destination.id + backup_retention_policy_on_terminate = "RETAIN_FOR_72_HOURS" + is_retention_lock_enabled = false } recovery_window_in_days = "7" } @@ -31,6 +34,14 @@ resource "oci_database_autonomous_container_database" "autonomous_container_data // OKV related key_store_id = oci_database_key_store.test_key_store.id okv_end_point_group_name = "DUMMY_OKV_EPG_GROUP" + + customer_contacts { + email = "contact1@example.com" + } + + customer_contacts { + email = "contact2@example.com" + } } resource "oci_database_key_store" "test_key_store" { @@ -43,13 +54,6 @@ resource "oci_database_key_store" "test_key_store" { type = "ORACLE_KEY_VAULT" vault_id = var.kms_vault_ocid } - customer_contacts { - email = "contact1@example.com" - } - - customer_contacts { - email = "contact2@example.com" - } } data "oci_database_autonomous_container_database_resource_usage" "test_autonomous_container_database_resource_usages" { diff --git a/examples/database/exadata_cc/vm_cluster.tf b/examples/database/exadata_cc/vm_cluster.tf index e39199a7c45..66266b5c6dd 100644 --- a/examples/database/exadata_cc/vm_cluster.tf +++ b/examples/database/exadata_cc/vm_cluster.tf @@ -495,5 +495,5 @@ data "oci_database_backup_destinations" "test_database_backup_destinations" { data "oci_database_backup_destination" "test_database_backup_destination" { #Required - id = oci_database_backup_destination.test_backup_destination_nfs.id + backup_destination_id = oci_database_backup_destination.test_backup_destination_nfs.id } \ No newline at end of file diff --git a/examples/functions/main.tf b/examples/functions/main.tf index f1378b3c064..d82b1ed7adb 100644 --- a/examples/functions/main.tf +++ b/examples/functions/main.tf @@ -50,6 +50,19 @@ resource "oci_core_subnet" "test_subnet" { vcn_id = oci_core_vcn.test_vcn.id } +resource "oci_queue_queue" "test_queue" { + #Required + compartment_id = var.compartment_ocid + display_name = "example-function-test-queue" +} + +resource "oci_streaming_stream" "test_stream" { + compartment_id = var.compartment_ocid + name = "example-function-test-stream" + partitions = "1" + retention_in_hours = "24" +} + # Terraform will take 5 minutes after destroying an application due to a known service issue. # please refer: https://docs.cloud.oracle.com/iaas/Content/Functions/Tasks/functionsdeleting.htm resource "oci_functions_application" "test_application" { @@ -94,21 +107,32 @@ resource "oci_functions_function" "test_function" { application_id = oci_functions_application.test_application.id display_name = "example-function-test" image = var.function_image - memory_in_mbs = "128" + memory_in_mbs = var.function_memory_in_mbs #Optional config = var.config image_digest = var.function_image_digest - timeout_in_seconds = "30" + timeout_in_seconds = var.function_timeout_in_seconds trace_config { is_enabled = var.function_trace_config.is_enabled } - is_dry_run = var.dry_run provisioned_concurrency_config { strategy = "CONSTANT" count = 40 } + + detached_mode_timeout_in_seconds = var.function_detached_mode_timeout_in_seconds + failure_destination { + kind = "QUEUE" + channel_id = "failure123" + queue_id = oci_queue_queue.test_queue.id + } + + success_destination { + kind = "STREAM" + stream_id = oci_streaming_stream.test_stream.id + } } data "oci_functions_pbf_listings" "test_listings" { @@ -142,7 +166,7 @@ data "oci_functions_pbf_listing_triggers" "test_triggers" { resource "oci_functions_function" "test_pre_built_function" { application_id = oci_functions_application.test_application.id display_name = "example-pre-built-function" - memory_in_mbs = "128" + memory_in_mbs = var.function_memory_in_mbs source_details { pbf_listing_id = var.pbf_listing_id source_type = "PRE_BUILT_FUNCTIONS" diff --git a/examples/functions/variables.tf b/examples/functions/variables.tf index f3aeb1aa525..da88fe35d8b 100644 --- a/examples/functions/variables.tf +++ b/examples/functions/variables.tf @@ -20,7 +20,7 @@ variable "compartment_ocid" { } variable "config" { - type = map(string) + type = map(string) default = { "MEDIA_WORKFLOW_ID" = "someworkflowid" } @@ -69,10 +69,6 @@ variable "function_image" { variable "function_image_digest" { } -variable "dry_run" { - default = "false" -} - variable "function_trace_config" { type = object({ is_enabled = bool @@ -83,13 +79,17 @@ variable "function_trace_config" { } variable "function_memory_in_mbs" { - default = 128 + default = 256 } variable "function_timeout_in_seconds" { default = 30 } +variable "function_detached_mode_timeout_in_seconds" { + default = 301 +} + variable "kms_key_ocid" { } @@ -107,4 +107,4 @@ variable "pbf_trigger_name" { variable "application_shape" { default = "GENERIC_X86" -} \ No newline at end of file +} diff --git a/examples/generative_ai/private_endpoint/generative_ai_private_endpoint.tf b/examples/generative_ai/private_endpoint/generative_ai_private_endpoint.tf new file mode 100644 index 00000000000..4a4ac8290af --- /dev/null +++ b/examples/generative_ai/private_endpoint/generative_ai_private_endpoint.tf @@ -0,0 +1,63 @@ +variable "generative_ai_private_endpoint_display_name" { + default = "PrivateEndpointTF" +} +variable "generative_ai_private_endpoint_description" { + default = "PrivateEndpointTF" +} +variable "generative_ai_private_endpoint_dns_prefix" { + default = "tersi" +} +variable "generative_ai_private_endpoint_state" { + default = "ACTIVE" +} +variable "tenancy_ocid" { +} + +resource "oci_generative_ai_generative_ai_private_endpoint" "test_generative_ai_private_endpoint" { + #Required + compartment_id = var.compartment_ocid + dns_prefix = var.generative_ai_private_endpoint_dns_prefix + subnet_id = oci_core_subnet.vcn_subnet.id + + #Optional + description = var.generative_ai_private_endpoint_description + display_name = var.generative_ai_private_endpoint_display_name + freeform_tags = { "Department" = "Marketing" } + nsg_ids = [] +} + +resource "oci_core_subnet" "vcn_subnet" { + availability_domain = data.oci_identity_availability_domain.ad.name + cidr_block = "10.1.20.0/24" + display_name = "PE" + dns_label = "PE" + security_list_ids = [oci_core_vcn.pe_vcn.default_security_list_id] + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.pe_vcn.id + dhcp_options_id = oci_core_vcn.pe_vcn.default_dhcp_options_id +} + +data "oci_identity_availability_domain" "ad" { + compartment_id = var.tenancy_ocid + ad_number = 1 +} + +resource "oci_core_vcn" "pe_vcn" { + cidr_block = "10.1.0.0/16" + compartment_id = var.compartment_ocid + display_name = "pe" + dns_label = "pe" +} + +data "oci_generative_ai_generative_ai_private_endpoint" "test_generative_ai_private_endpoint" { + #Required + generative_ai_private_endpoint_id = oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint.id +} + +data "oci_generative_ai_generative_ai_private_endpoints" "test_generative_ai_private_endpoints" { + #Required + compartment_id = var.compartment_ocid + + #Optional + state = var.generative_ai_private_endpoint_state +} \ No newline at end of file diff --git a/examples/generative_ai/private_endpoint/provider.tf b/examples/generative_ai/private_endpoint/provider.tf new file mode 100644 index 00000000000..f813949a1db --- /dev/null +++ b/examples/generative_ai/private_endpoint/provider.tf @@ -0,0 +1,19 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable config_file_profile { +} + +variable "region" { +} + +variable "compartment_ocid" { +} + +provider "oci" { + auth = "SecurityToken" + config_file_profile = var.config_file_profile + region = var.region +} + + diff --git a/examples/jms_utils/README.md b/examples/jms_utils/README.md new file mode 100644 index 00000000000..8e3f2cff30a --- /dev/null +++ b/examples/jms_utils/README.md @@ -0,0 +1,6 @@ +# Overview +This is a Terraform configuration that creates the `jms_utils` service on Oracle Cloud Infrastructure. + +The Terraform code is used to create a Resource Manager stack, that creates the required resources and configures the application on the created resources. +## Magic Button +[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle/terraform-provider-oci/raw/master/examples/zips/jms_utils.zip) \ No newline at end of file diff --git a/examples/jms_utils/description.md b/examples/jms_utils/description.md new file mode 100644 index 00000000000..17a7fff277a --- /dev/null +++ b/examples/jms_utils/description.md @@ -0,0 +1,4 @@ +# Overview +This is a Terraform configuration that creates the `jms_utils` service on Oracle Cloud Infrastructure. + +The Terraform code is used to create a Resource Manager stack, that creates the required resources and configures the application on the created resources. \ No newline at end of file diff --git a/examples/multicloud/ExternalLocationMappingMetadata/external_location_mapping_metadata.tf b/examples/multicloud/ExternalLocationMappingMetadata/external_location_mapping_metadata.tf new file mode 100644 index 00000000000..71f4b54b234 --- /dev/null +++ b/examples/multicloud/ExternalLocationMappingMetadata/external_location_mapping_metadata.tf @@ -0,0 +1,27 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_id" {} +variable "subscription_service_name_list" { + type = list(string) +} + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_external_location_mapping_metadata" "test_external_location_mapping_metadata" { + #Required + compartment_id = var.compartment_id + subscription_service_name = var.subscription_service_name_list +} diff --git a/examples/multicloud/ExternalLocationSummariesMetadata/external_location_summaries_metadata.tf b/examples/multicloud/ExternalLocationSummariesMetadata/external_location_summaries_metadata.tf new file mode 100644 index 00000000000..b3b68a8c7c8 --- /dev/null +++ b/examples/multicloud/ExternalLocationSummariesMetadata/external_location_summaries_metadata.tf @@ -0,0 +1,26 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_id" {} +variable "subscription_service_name" {} + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_external_location_summaries_metadata" "test_external_location_summaries_metadata" { + #Required + compartment_id = var.compartment_id + subscription_service_name = var.subscription_service_name + +} diff --git a/examples/multicloud/ExternalLocationsMetadata/external_locations_metadata.tf b/examples/multicloud/ExternalLocationsMetadata/external_locations_metadata.tf new file mode 100644 index 00000000000..3fb6b1a34f8 --- /dev/null +++ b/examples/multicloud/ExternalLocationsMetadata/external_locations_metadata.tf @@ -0,0 +1,27 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_id" {} +variable "subscription_id" {} +variable "subscription_service_name" {} + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_external_locations_metadata" "test_external_locations_metadata" { + #Required + compartment_id = var.compartment_id + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name +} diff --git a/examples/multicloud/NetworkAnchor/network_anchor.tf b/examples/multicloud/NetworkAnchor/network_anchor.tf new file mode 100644 index 00000000000..6598cd068a3 --- /dev/null +++ b/examples/multicloud/NetworkAnchor/network_anchor.tf @@ -0,0 +1,27 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "network_anchor_id" {} +variable "subscription_id" {} +variable "subscription_service_name" {} + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_network_anchor" "test_network_anchor" { + #Required + network_anchor_id = var.network_anchor_id + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name +} \ No newline at end of file diff --git a/examples/multicloud/NetworkAnchors/network_anchors.tf b/examples/multicloud/NetworkAnchors/network_anchors.tf new file mode 100644 index 00000000000..a3d251f6dff --- /dev/null +++ b/examples/multicloud/NetworkAnchors/network_anchors.tf @@ -0,0 +1,31 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "subscription_id" {} +variable "subscription_service_name" {} +variable "network_anchor_external_location" {} +variable "network_anchor_compartment_id" {} + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_network_anchors" "test_network_anchors" { + #Required + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name + external_location = var.network_anchor_external_location + + #Optiional + compartment_id = var.network_anchor_compartment_id +} \ No newline at end of file diff --git a/examples/multicloud/OmHubMultiCloudMetadata/om_hub_multi_cloud_metadata.tf b/examples/multicloud/OmHubMultiCloudMetadata/om_hub_multi_cloud_metadata.tf new file mode 100644 index 00000000000..e6331b159eb --- /dev/null +++ b/examples/multicloud/OmHubMultiCloudMetadata/om_hub_multi_cloud_metadata.tf @@ -0,0 +1,27 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "om_hub_compartment_id" {} +variable "subscription_id" {} + + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_om_hub_multi_cloud_metadata" "test_om_hub_multi_cloud_metadata" { + #Required + compartment_id = var.om_hub_compartment_id + subscription_id = var.subscription_id +} + diff --git a/examples/multicloud/OmHubMultiCloudsMetadata/om_hub_multi_clouds_metadata.tf b/examples/multicloud/OmHubMultiCloudsMetadata/om_hub_multi_clouds_metadata.tf new file mode 100644 index 00000000000..5e9647672a3 --- /dev/null +++ b/examples/multicloud/OmHubMultiCloudsMetadata/om_hub_multi_clouds_metadata.tf @@ -0,0 +1,25 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "om_hub_compartment_id" {} + + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_om_hub_multi_clouds_metadata" "test_om_hub_multi_clouds_metadata" { + #Required + compartment_id = var.om_hub_compartment_id +} + diff --git a/examples/multicloud/ResourceAnchor/resource_anchor.tf b/examples/multicloud/ResourceAnchor/resource_anchor.tf new file mode 100644 index 00000000000..ad763115d18 --- /dev/null +++ b/examples/multicloud/ResourceAnchor/resource_anchor.tf @@ -0,0 +1,27 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "resource_anchor_id" {} +variable "subscription_id" {} +variable "subscription_service_name" {} + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_resource_anchor" "test_resource_anchor" { + #Required + resource_anchor_id = var.resource_anchor_id + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name +} diff --git a/examples/multicloud/ResourceAnchors/resource_anchors.tf b/examples/multicloud/ResourceAnchors/resource_anchors.tf new file mode 100644 index 00000000000..3f0ee7dc36f --- /dev/null +++ b/examples/multicloud/ResourceAnchors/resource_anchors.tf @@ -0,0 +1,25 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "subscription_id" {} +variable "subscription_service_name" {} + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_multicloud_resource_anchors" "test_resource_anchors" { + #Required + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name +} diff --git a/examples/ocvp/datastores/main.tf b/examples/ocvp/datastores/main.tf new file mode 100644 index 00000000000..9a2c1e44d11 --- /dev/null +++ b/examples/ocvp/datastores/main.tf @@ -0,0 +1,539 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. + +# VCN comes with default route table, security list and DHCP options + +variable "tenancy_ocid" { +} + +variable "compartment_ocid" { +} + +variable "region" { +} + +#variable "billing_donor_host_id" { +#} + +variable "config_file_profile" {} +variable "instance_shape" { + default = "BM.Standard2.52" +} + +variable "instance_ocpu_count" { + default = "12" +} + +variable "vmware_software_version" { + default = "7.0 update 3" +} + +provider "oci" { + region = var.region + tenancy_ocid = var.tenancy_ocid + auth = "SecurityToken" + config_file_profile = var.config_file_profile +} + +data "oci_core_services" "test_services" { +} + +data "oci_identity_availability_domains" "ADs" { + compartment_id = var.compartment_ocid +} + +data "oci_ocvp_supported_vmware_software_versions" "test_supported_vmware_software_versions" { + compartment_id = "${var.compartment_ocid}" +} + +resource "oci_core_vcn" "test_vcn_ocvp" { + cidr_block = "10.0.0.0/16" + compartment_id = var.compartment_ocid + display_name = "VmWareOCVP" + dns_label = "vmwareocvp" +} + +resource oci_core_nat_gateway test_nat_gateway_ocvp { + block_traffic = "false" + compartment_id = var.compartment_ocid + + display_name = "NAT Gateway OCVP" + freeform_tags = { + "VCN" = "VCN-2020-09-11T00:43:42" + } + vcn_id = oci_core_vcn.test_vcn_ocvp.id +} + +resource oci_core_route_table test_route_table_for_vsphere_vlan { + compartment_id = var.compartment_ocid + + display_name = "Route Table for VLAN-grk-vSphere" + freeform_tags = { + "VMware" = "VMware-2020-09-11T00:47:02" + } + route_rules { + #description = <> + destination = "0.0.0.0/0" + destination_type = "CIDR_BLOCK" + network_entity_id = oci_core_nat_gateway.test_nat_gateway_ocvp.id + } + vcn_id = oci_core_vcn.test_vcn_ocvp.id +} + +resource "oci_core_network_security_group" "test_nsg_allow_all" { + compartment_id = var.compartment_ocid + display_name = "nsg-allow-all" + vcn_id = oci_core_vcn.test_vcn_ocvp.id +} + +resource "oci_core_network_security_group_security_rule" "test_nsg_security_rule_1" { + destination_type = "" + direction = "INGRESS" + network_security_group_id = oci_core_network_security_group.test_nsg_allow_all.id + protocol = "all" + source = "10.0.0.0/16" + source_type = "CIDR_BLOCK" +} + +resource "oci_core_network_security_group_security_rule" "test_nsg_security_rule_2" { + destination = "0.0.0.0/0" + destination_type = "CIDR_BLOCK" + direction = "EGRESS" + network_security_group_id = oci_core_network_security_group.test_nsg_allow_all.id + protocol = "all" + source_type = "" +} + +resource "oci_core_service_gateway" "export_sgw" { + compartment_id = var.compartment_ocid + display_name = "sgw" + + services { + service_id = data.oci_core_services.test_services.services[0]["id"] + } + + vcn_id = oci_core_vcn.test_vcn_ocvp.id +} + +resource "oci_core_default_dhcp_options" "default_dhcp_options_ocvp" { + display_name = "Default DHCP Options for OCVP" + manage_default_resource_id = oci_core_vcn.test_vcn_ocvp.default_dhcp_options_id + + options { + custom_dns_servers = [] + server_type = "VcnLocalPlusInternet" + type = "DomainNameServer" + } + + options { + search_domain_names = ["vmwareocvp.oraclevcn.com"] + type = "SearchDomain" + } +} + +resource "oci_core_route_table" "private_rt" { + compartment_id = var.compartment_ocid + display_name = "private-rt" + + route_rules { + destination = data.oci_core_services.test_services.services[0]["cidr_block"] + destination_type = "SERVICE_CIDR_BLOCK" + network_entity_id = oci_core_service_gateway.export_sgw.id + } + + vcn_id = oci_core_vcn.test_vcn_ocvp.id +} + +resource "oci_core_security_list" "private_sl" { + compartment_id = var.compartment_ocid + display_name = "private-sl" + + egress_security_rules { + destination = "0.0.0.0/0" + destination_type = "CIDR_BLOCK" + protocol = "all" + stateless = "false" + } + + ingress_security_rules { + description = "TCP traffic for ports: 22 SSH Remote Login Protocol" + protocol = "6" + source = "10.0.0.0/16" + source_type = "CIDR_BLOCK" + stateless = "false" + + tcp_options { + max = "22" + min = "22" + } + } + + ingress_security_rules { + description = "ICMP traffic for: 3 Destination Unreachable" + + icmp_options { + code = "3" + type = "3" + } + + protocol = "1" + source = "10.0.0.0/16" + source_type = "CIDR_BLOCK" + stateless = "false" + } + + ingress_security_rules { + protocol = "all" + source = "0.0.0.0/0" + source_type = "CIDR_BLOCK" + stateless = "false" + } + + vcn_id = oci_core_vcn.test_vcn_ocvp.id +} + +resource "oci_core_default_security_list" "default_security_list_ocvp" { + display_name = "Default Security List for OCVP" + + egress_security_rules { + destination = "0.0.0.0/0" + destination_type = "CIDR_BLOCK" + protocol = "all" + stateless = "false" + } + + ingress_security_rules { + protocol = "6" + source = "0.0.0.0/0" + source_type = "CIDR_BLOCK" + stateless = "false" + + tcp_options { + max = "22" + min = "22" + } + } + + ingress_security_rules { + icmp_options { + code = "4" + type = "3" + } + + protocol = "1" + source = "0.0.0.0/0" + source_type = "CIDR_BLOCK" + stateless = "false" + } + + ingress_security_rules { + icmp_options { + code = "-1" + type = "3" + } + + protocol = "1" + source = "10.0.0.0/16" + source_type = "CIDR_BLOCK" + stateless = "false" + } + + manage_default_resource_id = oci_core_vcn.test_vcn_ocvp.default_security_list_id +} + +resource "oci_core_subnet" "test_provisioning_subnet" { + cidr_block = "10.0.103.128/25" + compartment_id = var.compartment_ocid + dhcp_options_id = oci_core_vcn.test_vcn_ocvp.default_dhcp_options_id + display_name = "provisioning-subnet" + dns_label = "provisioningsub" + prohibit_public_ip_on_vnic = "true" + route_table_id = oci_core_route_table.private_rt.id + security_list_ids = [oci_core_security_list.private_sl.id] + vcn_id = oci_core_vcn.test_vcn_ocvp.id +} + +resource "oci_core_vlan" "test_nsx_edge_uplink2_vlan" { + display_name = "NSX-Edge-UP2" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.103.0/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_nsx_edge_uplink1_vlan" { + display_name = "NSX-Edge-UP1" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.100.0/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_nsx_vtep_vlan" { + display_name = "NSX-vTep" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.101.0/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_nsx_edge_vtep_vlan" { + display_name = "NSX Edge-vTep" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.102.0/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_vsan_net_vlan" { + display_name = "vSAN-Net" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.101.128/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_vmotion_net_vlan" { + display_name = "vMotion-Net" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.102.128/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_vsphere_net_vlan" { + display_name = "vSphere-Net" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.100.128/26" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_route_table.test_route_table_for_vsphere_vlan.id +} + +resource "oci_core_vlan" "test_hcx_vlan" { + display_name = "hcx" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.100.192/26" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_provisioning_vlan" { + display_name = "provisioning-vlan" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.104.128/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_vlan" "test_replication_vlan" { + display_name = "replication-vlan" + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + cidr_block = "10.0.104.0/25" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn_ocvp.id + nsg_ids = [oci_core_network_security_group.test_nsg_allow_all.id] + route_table_id = oci_core_vcn.test_vcn_ocvp.default_route_table_id +} + +resource "oci_core_volume" "test_block_volume" { + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + compartment_id = var.compartment_ocid + display_name = "TestBlockVolume" + size_in_gbs = "4096" +} + +resource "oci_core_compute_capacity_reservation" "test_compute_capacity_reservation" { + #Required + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + compartment_id = var.compartment_ocid + + instance_reservation_configs { + #Required + instance_shape = var.instance_shape + reserved_count = 2 + fault_domain = "FAULT-DOMAIN-1" + } + instance_reservation_configs { + #Required + instance_shape = var.instance_shape + reserved_count = 1 + fault_domain = "FAULT-DOMAIN-2" + } + instance_reservation_configs { + #Required + instance_shape = var.instance_shape + reserved_count = 1 + fault_domain = "FAULT-DOMAIN-3" + } +} + +resource "oci_ocvp_datastore" "test_datastore" { + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + block_volume_ids = ["${oci_core_volume.test_block_volume.id}"] + compartment_id = var.compartment_ocid + display_name = "displayName" +} + +resource "oci_ocvp_datastore_cluster" "test_datastore_cluster" { + availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + compartment_id = var.compartment_ocid + datastore_cluster_type = "MANAGEMENT" + datastore_ids = ["${oci_ocvp_datastore.test_datastore.id}"] + display_name = "displayName" +} + +resource "oci_ocvp_sddc" "test_sddc" { + // Required + compartment_id = var.compartment_ocid + ssh_authorized_keys = "ssh-rsa KKKLK3NzaC1yc2EAAAADAQABAAABAQC+UC9MFNA55NIVtKPIBCNw7++ACXhD0hx+Zyj25JfHykjz/QU3Q5FAU3DxDbVXyubgXfb/GJnrKRY8O4QDdvnZZRvQFFEOaApThAmCAM5MuFUIHdFvlqP+0W+ZQnmtDhwVe2NCfcmOrMuaPEgOKO3DOW6I/qOOdO691Xe2S9NgT9HhN0ZfFtEODVgvYulgXuCCXsJs+NUqcHAOxxFUmwkbPvYi0P0e2DT8JKeiOOC8VKUEgvVx+GKmqasm+Y6zHFW7vv3g2GstE1aRs3mttHRoC/JPM86PRyIxeWXEMzyG5wHqUu4XZpDbnWNxi6ugxnAGiL3CrIFdCgRNgHz5qS1l MustWin" + vmware_software_version = var.vmware_software_version + initial_configuration { + initial_cluster_configurations { + // required + compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + esxi_hosts_count = 3 + vsphere_type = "MANAGEMENT" + + network_configuration { + nsx_edge_uplink1vlan_id = oci_core_vlan.test_nsx_edge_uplink1_vlan.id + nsx_edge_uplink2vlan_id = oci_core_vlan.test_nsx_edge_uplink2_vlan.id + nsx_edge_vtep_vlan_id = oci_core_vlan.test_nsx_edge_vtep_vlan.id + nsx_vtep_vlan_id = oci_core_vlan.test_nsx_vtep_vlan.id + provisioning_subnet_id = oci_core_subnet.test_provisioning_subnet.id + vmotion_vlan_id = oci_core_vlan.test_vmotion_net_vlan.id + vsan_vlan_id = oci_core_vlan.test_vsan_net_vlan.id + vsphere_vlan_id = oci_core_vlan.test_vsphere_net_vlan.id + provisioning_vlan_id = oci_core_vlan.test_provisioning_vlan.id + replication_vlan_id = oci_core_vlan.test_replication_vlan.id + hcx_vlan_id = oci_core_vlan.test_hcx_vlan.id + } + + // optional + initial_host_ocpu_count = var.instance_ocpu_count + initial_host_shape_name = var.instance_shape + instance_display_name_prefix = "prefix" + is_shielded_instance_enabled = true + datastore_cluster_ids = ["${oci_ocvp_datastore_cluster.test_datastore_cluster.id}"] + workload_network_cidr = "172.20.0.0/24" + } + } + + //optional + is_hcx_enabled = true + hcx_action = "upgrade" + refresh_hcx_license_status = true + #reserving_hcx_on_premise_license_keys = var.reserving_hcx_on_premise_license_keys + #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "${var.sddc_defined_tags_value}"} + #display_name = var.sddc_display_name + #freeform_tags = var.sddc_freeform_tags +} + +resource "oci_ocvp_cluster" "test_cluster" { + // Required + sddc_id = oci_ocvp_sddc.test_sddc.id + compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + esxi_hosts_count = "3" + vmware_software_version = var.vmware_software_version + network_configuration { + nsx_edge_uplink1vlan_id = oci_core_vlan.test_nsx_edge_uplink1_vlan.id + nsx_edge_uplink2vlan_id = oci_core_vlan.test_nsx_edge_uplink2_vlan.id + nsx_edge_vtep_vlan_id = oci_core_vlan.test_nsx_edge_vtep_vlan.id + nsx_vtep_vlan_id = oci_core_vlan.test_nsx_vtep_vlan.id + provisioning_subnet_id = oci_core_subnet.test_provisioning_subnet.id + vmotion_vlan_id = oci_core_vlan.test_vmotion_net_vlan.id + vsan_vlan_id = oci_core_vlan.test_vsan_net_vlan.id + vsphere_vlan_id = oci_core_vlan.test_vsphere_net_vlan.id + provisioning_vlan_id = oci_core_vlan.test_provisioning_vlan.id + replication_vlan_id = oci_core_vlan.test_replication_vlan.id + hcx_vlan_id = oci_core_vlan.test_hcx_vlan.id + } + + // optional + initial_commitment = "HOUR" + initial_host_ocpu_count = var.instance_ocpu_count + initial_host_shape_name = var.instance_shape + capacity_reservation_id = oci_core_compute_capacity_reservation.test_compute_capacity_reservation.id + is_shielded_instance_enabled = true + #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "${var.sddc_defined_tags_value}"} + #display_name = var.sddc_display_name + #freeform_tags = var.sddc_freeform_tags + #instance_display_name_prefix = "prefix" + #workload_network_cidr = "172.20.0.0/24" +} + + +resource "oci_ocvp_esxi_host" "test_esxi_host" { + #Required + cluster_id = oci_ocvp_cluster.test_cluster.id + #Optional + compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + host_ocpu_count = var.instance_ocpu_count + host_shape_name = var.instance_shape + #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "${var.esxihost_defined_tags_value}"} + #display_name = var.esxihost_display_name + #freeform_tags = var.esxihost_freeform_tags + #failed_esxi_host_id = var.failed_esxi_host_ocid + #billing_donor_host_id = var.billing_donor_host_id +} + +data "oci_ocvp_sddcs" "test_sddcs" { + compartment_id = var.compartment_ocid + compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] + display_name = "displayName" + + filter { + name = "id" + values = [oci_ocvp_sddc.test_sddc.id] + } + + state = "ACTIVE" +} + +data "oci_ocvp_sddc" "test_sddc" { + sddc_id = oci_ocvp_sddc.test_sddc.id +} + +data "oci_ocvp_clusters" "test_clusters" { + sddc_id = oci_ocvp_sddc.test_sddc.id + compartment_id = var.compartment_ocid +} + +data "oci_ocvp_cluster" "test_cluster" { + cluster_id = oci_ocvp_cluster.test_cluster.id +} + +data "oci_ocvp_esxi_hosts" "test_esxi_hosts" { + compute_instance_id = oci_ocvp_esxi_host.test_esxi_host.compute_instance_id + display_name = "displayName" + is_swap_billing_only = false + is_billing_donors_only = false + + filter { + name = "id" + values = [oci_ocvp_esxi_host.test_esxi_host.id] + } + + sddc_id = oci_ocvp_sddc.test_sddc.id + state = "ACTIVE" +} + +data "oci_ocvp_esxi_host" "test_esxi_host" { + esxi_host_id = oci_ocvp_esxi_host.test_esxi_host.id +} diff --git a/examples/ocvp/main.tf b/examples/ocvp/main.tf index 1dfab413a1d..51dec83c643 100644 --- a/examples/ocvp/main.tf +++ b/examples/ocvp/main.tf @@ -15,6 +15,17 @@ variable "region" { #} variable "config_file_profile" {} +variable "instance_shape" { + default = "BM.Standard2.52" +} + +variable "instance_ocpu_count" { + default = "12" +} + +variable "vmware_software_version" { + default = "7.0 update 3" +} provider "oci" { region = var.region @@ -34,18 +45,6 @@ data "oci_ocvp_supported_vmware_software_versions" "test_supported_vmware_softwa compartment_id = "${var.compartment_ocid}" } -data "oci_ocvp_supported_skus" "test_supported_skus" { - compartment_id = "${var.compartment_ocid}" -} - -data "oci_ocvp_supported_host_shapes" "test_supported_host_shapes" { - // Required - compartment_id = "${var.compartment_ocid}" - // Optional - name = "BM.Standard2.52" - sddc_type = "PRODUCTION" -} - resource "oci_core_vcn" "test_vcn_ocvp" { cidr_block = "10.0.0.0/16" compartment_id = var.compartment_ocid @@ -367,70 +366,29 @@ resource "oci_core_compute_capacity_reservation" "test_compute_capacity_reservat instance_reservation_configs { #Required - instance_shape = "BM.Standard2.52" + instance_shape = var.instance_shape reserved_count = 2 fault_domain = "FAULT-DOMAIN-1" } instance_reservation_configs { #Required - instance_shape = "BM.Standard2.52" + instance_shape = var.instance_shape reserved_count = 1 fault_domain = "FAULT-DOMAIN-2" } instance_reservation_configs { #Required - instance_shape = "BM.Standard2.52" + instance_shape = var.instance_shape reserved_count = 1 fault_domain = "FAULT-DOMAIN-3" } } -// SDDC resource with deprecated fields -resource "oci_ocvp_sddc" "test_sddc_deprecated" { - // Required - compartment_id = var.compartment_ocid - compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] - esxi_hosts_count = "3" - nsx_edge_uplink1vlan_id = oci_core_vlan.test_nsx_edge_uplink1_vlan.id - nsx_edge_uplink2vlan_id = oci_core_vlan.test_nsx_edge_uplink2_vlan.id - nsx_edge_vtep_vlan_id = oci_core_vlan.test_nsx_edge_vtep_vlan.id - nsx_vtep_vlan_id = oci_core_vlan.test_nsx_vtep_vlan.id - provisioning_subnet_id = oci_core_subnet.test_provisioning_subnet.id - ssh_authorized_keys = "ssh-rsa KKKLK3NzaC1yc2EAAAADAQABAAABAQC+UC9MFNA55NIVtKPIBCNw7++ACXhD0hx+Zyj25JfHykjz/QU3Q5FAU3DxDbVXyubgXfb/GJnrKRY8O4QDdvnZZRvQFFEOaApThAmCAM5MuFUIHdFvlqP+0W+ZQnmtDhwVe2NCfcmOrMuaPEgOKO3DOW6I/qOOdO691Xe2S9NgT9HhN0ZfFtEODVgvYulgXuCCXsJs+NUqcHAOxxFUmwkbPvYi0P0e2DT8JKeiOOC8VKUEgvVx+GKmqasm+Y6zHFW7vv3g2GstE1aRs3mttHRoC/JPM86PRyIxeWXEMzyG5wHqUu4XZpDbnWNxi6ugxnAGiL3CrIFdCgRNgHz5qS1l MustWin" - vmotion_vlan_id = oci_core_vlan.test_vmotion_net_vlan.id - vmware_software_version = "7.0 update 3" - vsan_vlan_id = oci_core_vlan.test_vsan_net_vlan.id - vsphere_vlan_id = oci_core_vlan.test_vsphere_net_vlan.id - // Optional - provisioning_vlan_id = oci_core_vlan.test_provisioning_vlan.id - replication_vlan_id = oci_core_vlan.test_replication_vlan.id - hcx_vlan_id = oci_core_vlan.test_hcx_vlan.id - is_hcx_enabled = true - initial_sku = "HOUR" - initial_host_ocpu_count = "12.0" - initial_host_shape_name = "BM.Standard2.52" - capacity_reservation_id = oci_core_compute_capacity_reservation.test_compute_capacity_reservation.id - datastores { - #Required - block_volume_ids = ["${oci_core_volume.test_block_volume.id}"] - datastore_type = "MANAGEMENT" - } - is_shielded_instance_enabled = false - hcx_action = "upgrade" - refresh_hcx_license_status = true - #reserving_hcx_on_premise_license_keys = var.reserving_hcx_on_premise_license_keys - #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "${var.sddc_defined_tags_value}"} - #display_name = var.sddc_display_name - #freeform_tags = var.sddc_freeform_tags - #instance_display_name_prefix = "prefix" - #workload_network_cidr = "172.20.0.0/24" -} - resource "oci_ocvp_sddc" "test_sddc" { // Required compartment_id = var.compartment_ocid ssh_authorized_keys = "ssh-rsa KKKLK3NzaC1yc2EAAAADAQABAAABAQC+UC9MFNA55NIVtKPIBCNw7++ACXhD0hx+Zyj25JfHykjz/QU3Q5FAU3DxDbVXyubgXfb/GJnrKRY8O4QDdvnZZRvQFFEOaApThAmCAM5MuFUIHdFvlqP+0W+ZQnmtDhwVe2NCfcmOrMuaPEgOKO3DOW6I/qOOdO691Xe2S9NgT9HhN0ZfFtEODVgvYulgXuCCXsJs+NUqcHAOxxFUmwkbPvYi0P0e2DT8JKeiOOC8VKUEgvVx+GKmqasm+Y6zHFW7vv3g2GstE1aRs3mttHRoC/JPM86PRyIxeWXEMzyG5wHqUu4XZpDbnWNxi6ugxnAGiL3CrIFdCgRNgHz5qS1l MustWin" - vmware_software_version = "7.0 update 3" + vmware_software_version = var.vmware_software_version initial_configuration { initial_cluster_configurations { // required @@ -453,8 +411,8 @@ resource "oci_ocvp_sddc" "test_sddc" { } // optional - initial_host_ocpu_count = "12.0" - initial_host_shape_name = "BM.Standard2.52" + initial_host_ocpu_count = var.instance_ocpu_count + initial_host_shape_name = var.instance_shape instance_display_name_prefix = "prefix" is_shielded_instance_enabled = true datastores { @@ -481,7 +439,7 @@ resource "oci_ocvp_cluster" "test_cluster" { sddc_id = oci_ocvp_sddc.test_sddc.id compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] esxi_hosts_count = "3" - vmware_software_version = "7.0 update 3" + vmware_software_version = var.vmware_software_version network_configuration { nsx_edge_uplink1vlan_id = oci_core_vlan.test_nsx_edge_uplink1_vlan.id nsx_edge_uplink2vlan_id = oci_core_vlan.test_nsx_edge_uplink2_vlan.id @@ -498,8 +456,8 @@ resource "oci_ocvp_cluster" "test_cluster" { // optional initial_commitment = "HOUR" - initial_host_ocpu_count = "12.0" - initial_host_shape_name = "BM.Standard2.52" + initial_host_ocpu_count = var.instance_ocpu_count + initial_host_shape_name = var.instance_shape capacity_reservation_id = oci_core_compute_capacity_reservation.test_compute_capacity_reservation.id is_shielded_instance_enabled = true #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "${var.sddc_defined_tags_value}"} @@ -509,31 +467,14 @@ resource "oci_ocvp_cluster" "test_cluster" { #workload_network_cidr = "172.20.0.0/24" } -// ESXi host resource with deprecated fields -resource "oci_ocvp_esxi_host" "test_esxi_host_deprecated" { - #Required - sddc_id = oci_ocvp_sddc.test_sddc.id - #Optional - compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] - current_sku = "HOUR" - host_ocpu_count = "12.0" - host_shape_name = "BM.Standard2.52" - next_sku = "HOUR" - #non_upgraded_esxi_host_id = data.oci_ocvp_esxi_hosts.non_upgraded_esxi_hosts.esxi_host_collection[0].id - #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "${var.esxihost_defined_tags_value}"} - #display_name = var.esxihost_display_name - #freeform_tags = var.esxihost_freeform_tags - #failed_esxi_host_id = var.failed_esxi_host_ocid - #billing_donor_host_id = var.billing_donor_host_id -} resource "oci_ocvp_esxi_host" "test_esxi_host" { #Required cluster_id = oci_ocvp_cluster.test_cluster.id #Optional compute_availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[1]["name"] - host_ocpu_count = "12.0" - host_shape_name = "BM.Standard2.52" + host_ocpu_count = var.instance_ocpu_count + host_shape_name = var.instance_shape #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "${var.esxihost_defined_tags_value}"} #display_name = var.esxihost_display_name #freeform_tags = var.esxihost_freeform_tags @@ -584,4 +525,4 @@ data "oci_ocvp_esxi_hosts" "test_esxi_hosts" { data "oci_ocvp_esxi_host" "test_esxi_host" { esxi_host_id = oci_ocvp_esxi_host.test_esxi_host.id -} \ No newline at end of file +} diff --git a/examples/resource_analytics/description.md b/examples/resource_analytics/description.md new file mode 100644 index 00000000000..69381af12ac --- /dev/null +++ b/examples/resource_analytics/description.md @@ -0,0 +1,4 @@ +# Overview +This is a Terraform configuration that creates a Resource Analytics Instance on Oracle Cloud Infrastructure. + +The Terraform code is used to create a Resource Analytics Instance, add a Tenancy Attachment, add Monitored Regions, and Enable OAC. Some steps are optional and can be removed. \ No newline at end of file diff --git a/examples/resource_analytics/main.tf b/examples/resource_analytics/main.tf new file mode 100644 index 00000000000..0ac46f7b7e9 --- /dev/null +++ b/examples/resource_analytics/main.tf @@ -0,0 +1,177 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_ocid" {} + +variable "resource_analytics_instance_subnet_id" { + default = "ocid1.subnet..." +} + +variable "resource_analytics_instance_adw_admin_password_password" { + default = "BEstrO0ng_#11" +} + +variable "resource_analytics_instance_adw_admin_password_vault_secret_id" { + default = "ocid1.vaultsecret..." +} + +variable "resource_analytics_instance_description" { + default = "Resource Analytics Instance created with Terraform" +} + +variable "resource_analytics_instance_display_name" { + default = "Default Resource Analytics Instance" +} + +variable "resource_analytics_instance_freeform_tags" { + default = { "CreatedWith" = "Terraform" } +} + +variable "resource_analytics_instance_is_mutual_tls_required" { + default = false +} + +variable "resource_analytics_instance_license_model" { + default = "LICENSE_INCLUDED" +} + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + + +### +# Create Resource Analytics Instance +### +resource "oci_resource_analytics_resource_analytics_instance" "test_resource_analytics_instance" { + #Required + timeouts { + create = "1h" + update = "1h" + delete = "1h" + } + + #Required + adw_admin_password { + #PlainTextPassword type + password_type = "PLAIN_TEXT" + password = var.resource_analytics_instance_adw_admin_password_password + + # OR + + #VaultSecretPassword type + # password_type = "VAULT_SECRET" + # secret_id = var.resource_analytics_instance_adw_admin_password_vault_secret_id + } + compartment_id = var.compartment_ocid + subnet_id = var.resource_analytics_instance_subnet_id + + #Optional + description = var.resource_analytics_instance_description + display_name = var.resource_analytics_instance_display_name + freeform_tags = var.resource_analytics_instance_freeform_tags + is_mutual_tls_required = var.resource_analytics_instance_is_mutual_tls_required + license_model = var.resource_analytics_instance_license_model +} + + +### +# Add a Tenancy Attachment to monitor additional tenancies (optional) +### +variable "added_tenancy_attachment_ocid" { + default = "ocid1.tenancy..." +} + +variable "added_tenancy_attachment_description" { + default = "Tenancy description" +} + +resource "oci_resource_analytics_tenancy_attachment" "test_tenancy_attachment" { + #Required + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id + tenancy_id = var.added_tenancy_attachment_ocid + + #Optional + description = var.added_tenancy_attachment_description +} + + +### +# Add all subscribed regions as Monitored Regions (or add at least one Monitored Region) +### +data "oci_identity_region_subscriptions" "test_region_subscriptions" { + #Required + tenancy_id = var.tenancy_ocid + + filter { + name = "state" + values = ["READY"] + } +} + +resource "oci_resource_analytics_monitored_region" "test_monitored_regions" { + depends_on = [oci_resource_analytics_tenancy_attachment.test_tenancy_attachment] + + for_each = toset([for region in data.oci_identity_region_subscriptions.test_region_subscriptions.region_subscriptions : region.region_name]) + + #Required + region_id = each.value + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id +} + + +### +# Enable OAC on Resource Analytics Instance (optional) +### +variable "resource_analytics_instance_oac_management_attachment_details_idcs_domain_id" { + default = "ocid1.domain..." +} + +variable "resource_analytics_instance_oac_management_attachment_details_license_model" { + default = "LICENSE_INCLUDED" +} + +variable "resource_analytics_instance_oac_management_attachment_type" { + default = "MANAGED" +} + +variable "resource_analytics_instance_oac_management_enable_oac" { + default = true +} + +resource "oci_resource_analytics_resource_analytics_instance_oac_management" "test_resource_analytics_instance_enable_oac" { + #Required + timeouts { + create = "2h" + update = "2h" + delete = "2h" + } + + #Required + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id + attachment_type = var.resource_analytics_instance_oac_management_attachment_type + enable_oac = var.resource_analytics_instance_oac_management_enable_oac + + #Required + attachment_details { + + #Required + idcs_domain_id = var.resource_analytics_instance_oac_management_attachment_details_idcs_domain_id + + #Optional + license_model = var.resource_analytics_instance_oac_management_attachment_details_license_model + #Private OAC + # network_details { + # subnet_id = oci_core_subnet.test_subnet.id + # } + } +} \ No newline at end of file diff --git a/examples/zips/adm.zip b/examples/zips/adm.zip index c5f9f9b39d4..5272b32226c 100644 Binary files a/examples/zips/adm.zip and b/examples/zips/adm.zip differ diff --git a/examples/zips/aiAnomalyDetection.zip b/examples/zips/aiAnomalyDetection.zip index f23b32609ef..2b741c43f2d 100644 Binary files a/examples/zips/aiAnomalyDetection.zip and b/examples/zips/aiAnomalyDetection.zip differ diff --git a/examples/zips/aiDocument.zip b/examples/zips/aiDocument.zip index c81712f7154..eab744549af 100644 Binary files a/examples/zips/aiDocument.zip and b/examples/zips/aiDocument.zip differ diff --git a/examples/zips/aiLanguage.zip b/examples/zips/aiLanguage.zip index e092b8ab329..a125139a0be 100644 Binary files a/examples/zips/aiLanguage.zip and b/examples/zips/aiLanguage.zip differ diff --git a/examples/zips/aiVision.zip b/examples/zips/aiVision.zip index 83fb1e08ae5..9be40ce480f 100644 Binary files a/examples/zips/aiVision.zip and b/examples/zips/aiVision.zip differ diff --git a/examples/zips/always_free.zip b/examples/zips/always_free.zip index 8eb5f1be242..127026d9e7c 100644 Binary files a/examples/zips/always_free.zip and b/examples/zips/always_free.zip differ diff --git a/examples/zips/analytics.zip b/examples/zips/analytics.zip index 3ecb50ca09b..27e774f6903 100644 Binary files a/examples/zips/analytics.zip and b/examples/zips/analytics.zip differ diff --git a/examples/zips/announcements_service.zip b/examples/zips/announcements_service.zip index 5947a268781..2ca18099cab 100644 Binary files a/examples/zips/announcements_service.zip and b/examples/zips/announcements_service.zip differ diff --git a/examples/zips/api_gateway.zip b/examples/zips/api_gateway.zip index 94db676f544..749d7924b25 100644 Binary files a/examples/zips/api_gateway.zip and b/examples/zips/api_gateway.zip differ diff --git a/examples/zips/api_platform.zip b/examples/zips/api_platform.zip index 634618448de..0b8ee43a6c9 100644 Binary files a/examples/zips/api_platform.zip and b/examples/zips/api_platform.zip differ diff --git a/examples/zips/apiaccesscontrol.zip b/examples/zips/apiaccesscontrol.zip index 27d81959f6b..f1f7cc7d06f 100644 Binary files a/examples/zips/apiaccesscontrol.zip and b/examples/zips/apiaccesscontrol.zip differ diff --git a/examples/zips/apm.zip b/examples/zips/apm.zip index c1fd3093af4..07f27c08913 100644 Binary files a/examples/zips/apm.zip and b/examples/zips/apm.zip differ diff --git a/examples/zips/appmgmt_control.zip b/examples/zips/appmgmt_control.zip index e8704316b3b..07ca74c9d73 100644 Binary files a/examples/zips/appmgmt_control.zip and b/examples/zips/appmgmt_control.zip differ diff --git a/examples/zips/artifacts.zip b/examples/zips/artifacts.zip index 355b24e3a86..ed86e35b156 100644 Binary files a/examples/zips/artifacts.zip and b/examples/zips/artifacts.zip differ diff --git a/examples/zips/audit.zip b/examples/zips/audit.zip index 1dfbf49d694..ed67633c529 100644 Binary files a/examples/zips/audit.zip and b/examples/zips/audit.zip differ diff --git a/examples/zips/autoscaling.zip b/examples/zips/autoscaling.zip index 3521915730c..2856765088c 100644 Binary files a/examples/zips/autoscaling.zip and b/examples/zips/autoscaling.zip differ diff --git a/examples/zips/bastion.zip b/examples/zips/bastion.zip index d39726b7f52..6a2d9310e6e 100644 Binary files a/examples/zips/bastion.zip and b/examples/zips/bastion.zip differ diff --git a/examples/zips/big_data_service.zip b/examples/zips/big_data_service.zip index 2442f7d36d3..9fa3f812137 100644 Binary files a/examples/zips/big_data_service.zip and b/examples/zips/big_data_service.zip differ diff --git a/examples/zips/blockchain.zip b/examples/zips/blockchain.zip index b8249935333..9a0e4a9132b 100644 Binary files a/examples/zips/blockchain.zip and b/examples/zips/blockchain.zip differ diff --git a/examples/zips/budget.zip b/examples/zips/budget.zip index 9758dec7e4b..f5518eb8223 100644 Binary files a/examples/zips/budget.zip and b/examples/zips/budget.zip differ diff --git a/examples/zips/capacity_management.zip b/examples/zips/capacity_management.zip index 8181ae35dc9..ffb48afc384 100644 Binary files a/examples/zips/capacity_management.zip and b/examples/zips/capacity_management.zip differ diff --git a/examples/zips/certificatesManagement.zip b/examples/zips/certificatesManagement.zip index 52488a6e785..1e9d9540c3a 100644 Binary files a/examples/zips/certificatesManagement.zip and b/examples/zips/certificatesManagement.zip differ diff --git a/examples/zips/cloudBridge.zip b/examples/zips/cloudBridge.zip index 5615310b979..4d5fd1076cd 100644 Binary files a/examples/zips/cloudBridge.zip and b/examples/zips/cloudBridge.zip differ diff --git a/examples/zips/cloudMigrations.zip b/examples/zips/cloudMigrations.zip index fc02ed1f9e5..cb70b343030 100644 Binary files a/examples/zips/cloudMigrations.zip and b/examples/zips/cloudMigrations.zip differ diff --git a/examples/zips/cloudguard.zip b/examples/zips/cloudguard.zip index 2f87f5c2d01..cad9c144f25 100644 Binary files a/examples/zips/cloudguard.zip and b/examples/zips/cloudguard.zip differ diff --git a/examples/zips/cluster_placement_groups.zip b/examples/zips/cluster_placement_groups.zip index 4f6f41fca79..f20b3cb685b 100644 Binary files a/examples/zips/cluster_placement_groups.zip and b/examples/zips/cluster_placement_groups.zip differ diff --git a/examples/zips/compute.zip b/examples/zips/compute.zip index a07de6f8cfb..d9a47ec59e3 100644 Binary files a/examples/zips/compute.zip and b/examples/zips/compute.zip differ diff --git a/examples/zips/computecloudatcustomer.zip b/examples/zips/computecloudatcustomer.zip index e73868b7469..d2b7ceb4b49 100644 Binary files a/examples/zips/computecloudatcustomer.zip and b/examples/zips/computecloudatcustomer.zip differ diff --git a/examples/zips/computeinstanceagent.zip b/examples/zips/computeinstanceagent.zip index 5ba776bbdc5..eeb083cea33 100644 Binary files a/examples/zips/computeinstanceagent.zip and b/examples/zips/computeinstanceagent.zip differ diff --git a/examples/zips/concepts.zip b/examples/zips/concepts.zip index 1dc92c55362..e0f7d272ffd 100644 Binary files a/examples/zips/concepts.zip and b/examples/zips/concepts.zip differ diff --git a/examples/zips/container_engine.zip b/examples/zips/container_engine.zip index 6a4d288a406..d230c3da545 100644 Binary files a/examples/zips/container_engine.zip and b/examples/zips/container_engine.zip differ diff --git a/examples/zips/container_instances.zip b/examples/zips/container_instances.zip index 83fd6248111..49b68fcc326 100644 Binary files a/examples/zips/container_instances.zip and b/examples/zips/container_instances.zip differ diff --git a/examples/zips/database.zip b/examples/zips/database.zip index ca2d79a9cfb..b03749800a4 100644 Binary files a/examples/zips/database.zip and b/examples/zips/database.zip differ diff --git a/examples/zips/databaseTools.zip b/examples/zips/databaseTools.zip index b1a1b58259b..d59509880f3 100644 Binary files a/examples/zips/databaseTools.zip and b/examples/zips/databaseTools.zip differ diff --git a/examples/zips/databasemanagement.zip b/examples/zips/databasemanagement.zip index cf764f2ef56..83b4275a799 100644 Binary files a/examples/zips/databasemanagement.zip and b/examples/zips/databasemanagement.zip differ diff --git a/examples/zips/databasemigration.zip b/examples/zips/databasemigration.zip index 82cbd5da9f3..307c6916647 100644 Binary files a/examples/zips/databasemigration.zip and b/examples/zips/databasemigration.zip differ diff --git a/examples/zips/datacatalog.zip b/examples/zips/datacatalog.zip index 0fa1edf71fb..7361d0332dc 100644 Binary files a/examples/zips/datacatalog.zip and b/examples/zips/datacatalog.zip differ diff --git a/examples/zips/dataflow.zip b/examples/zips/dataflow.zip index 0506f856e00..cc12efdbe9e 100644 Binary files a/examples/zips/dataflow.zip and b/examples/zips/dataflow.zip differ diff --git a/examples/zips/dataintegration.zip b/examples/zips/dataintegration.zip index d20672ff979..6e6ef530d76 100644 Binary files a/examples/zips/dataintegration.zip and b/examples/zips/dataintegration.zip differ diff --git a/examples/zips/datalabeling.zip b/examples/zips/datalabeling.zip index 2ac12ae0a8e..e1e13fe833b 100644 Binary files a/examples/zips/datalabeling.zip and b/examples/zips/datalabeling.zip differ diff --git a/examples/zips/datasafe.zip b/examples/zips/datasafe.zip index 0ae2bdedd70..fcf025720ff 100644 Binary files a/examples/zips/datasafe.zip and b/examples/zips/datasafe.zip differ diff --git a/examples/zips/datascience.zip b/examples/zips/datascience.zip index 10b0181b692..74f141183a5 100644 Binary files a/examples/zips/datascience.zip and b/examples/zips/datascience.zip differ diff --git a/examples/zips/dblm.zip b/examples/zips/dblm.zip index 9053369d743..ebd335f9ab5 100644 Binary files a/examples/zips/dblm.zip and b/examples/zips/dblm.zip differ diff --git a/examples/zips/dbmulticloud.zip b/examples/zips/dbmulticloud.zip index 06dfb3a80d5..de86eb3934f 100644 Binary files a/examples/zips/dbmulticloud.zip and b/examples/zips/dbmulticloud.zip differ diff --git a/examples/zips/delegation_management.zip b/examples/zips/delegation_management.zip index e8c39069f60..2f20b795e5a 100644 Binary files a/examples/zips/delegation_management.zip and b/examples/zips/delegation_management.zip differ diff --git a/examples/zips/demand_signal.zip b/examples/zips/demand_signal.zip index c07c9e6e1d0..4dfbfdc5a04 100644 Binary files a/examples/zips/demand_signal.zip and b/examples/zips/demand_signal.zip differ diff --git a/examples/zips/desktops.zip b/examples/zips/desktops.zip index 97d1203af63..0a42a4c8b80 100644 Binary files a/examples/zips/desktops.zip and b/examples/zips/desktops.zip differ diff --git a/examples/zips/devops.zip b/examples/zips/devops.zip index be9d7506e22..2f5da2ff667 100644 Binary files a/examples/zips/devops.zip and b/examples/zips/devops.zip differ diff --git a/examples/zips/disaster_recovery.zip b/examples/zips/disaster_recovery.zip index 100b132c3f4..d52f70bb171 100644 Binary files a/examples/zips/disaster_recovery.zip and b/examples/zips/disaster_recovery.zip differ diff --git a/examples/zips/dns.zip b/examples/zips/dns.zip index 300bb64f46a..e508de97a08 100644 Binary files a/examples/zips/dns.zip and b/examples/zips/dns.zip differ diff --git a/examples/zips/em_warehouse.zip b/examples/zips/em_warehouse.zip index 0754af1201b..ed954f9f34a 100644 Binary files a/examples/zips/em_warehouse.zip and b/examples/zips/em_warehouse.zip differ diff --git a/examples/zips/email.zip b/examples/zips/email.zip index 26d1f18b8d4..91822c1c009 100644 Binary files a/examples/zips/email.zip and b/examples/zips/email.zip differ diff --git a/examples/zips/events.zip b/examples/zips/events.zip index 71963adfb69..74244697e81 100644 Binary files a/examples/zips/events.zip and b/examples/zips/events.zip differ diff --git a/examples/zips/fast_connect.zip b/examples/zips/fast_connect.zip index 53f1361ce22..0ec7597195e 100644 Binary files a/examples/zips/fast_connect.zip and b/examples/zips/fast_connect.zip differ diff --git a/examples/zips/fleet_apps_management.zip b/examples/zips/fleet_apps_management.zip index ff603d69d7a..75df9fc3217 100644 Binary files a/examples/zips/fleet_apps_management.zip and b/examples/zips/fleet_apps_management.zip differ diff --git a/examples/zips/fleetsoftwareupdate.zip b/examples/zips/fleetsoftwareupdate.zip index 63b318c2a5e..720bb52f470 100644 Binary files a/examples/zips/fleetsoftwareupdate.zip and b/examples/zips/fleetsoftwareupdate.zip differ diff --git a/examples/zips/functions.zip b/examples/zips/functions.zip index ef42ab2a7df..98b2f72b631 100644 Binary files a/examples/zips/functions.zip and b/examples/zips/functions.zip differ diff --git a/examples/zips/fusionapps.zip b/examples/zips/fusionapps.zip index 6e60a92b341..9d4577b8b56 100644 Binary files a/examples/zips/fusionapps.zip and b/examples/zips/fusionapps.zip differ diff --git a/examples/zips/generative_ai.zip b/examples/zips/generative_ai.zip index 9bbc9fee4f9..4e6f8321c40 100644 Binary files a/examples/zips/generative_ai.zip and b/examples/zips/generative_ai.zip differ diff --git a/examples/zips/generative_ai_agent.zip b/examples/zips/generative_ai_agent.zip index 1d33053f72b..b02f655c07a 100644 Binary files a/examples/zips/generative_ai_agent.zip and b/examples/zips/generative_ai_agent.zip differ diff --git a/examples/zips/globally_distributed_database.zip b/examples/zips/globally_distributed_database.zip index 18991ae9fa1..fe8aa563cc3 100644 Binary files a/examples/zips/globally_distributed_database.zip and b/examples/zips/globally_distributed_database.zip differ diff --git a/examples/zips/goldengate.zip b/examples/zips/goldengate.zip index e58fdf4e853..b1a9efca8e0 100644 Binary files a/examples/zips/goldengate.zip and b/examples/zips/goldengate.zip differ diff --git a/examples/zips/health_checks.zip b/examples/zips/health_checks.zip index 3f2eda6a066..a52b8551515 100644 Binary files a/examples/zips/health_checks.zip and b/examples/zips/health_checks.zip differ diff --git a/examples/zips/id6.zip b/examples/zips/id6.zip index cb57fd831e2..87133302cf1 100644 Binary files a/examples/zips/id6.zip and b/examples/zips/id6.zip differ diff --git a/examples/zips/identity.zip b/examples/zips/identity.zip index 340dcc544c7..7c379e32907 100644 Binary files a/examples/zips/identity.zip and b/examples/zips/identity.zip differ diff --git a/examples/zips/identity_data_plane.zip b/examples/zips/identity_data_plane.zip index 877460b1c5f..bc2ea6c1c28 100644 Binary files a/examples/zips/identity_data_plane.zip and b/examples/zips/identity_data_plane.zip differ diff --git a/examples/zips/identity_domains.zip b/examples/zips/identity_domains.zip index e6a5bc7d8e2..e83b44a6b6f 100644 Binary files a/examples/zips/identity_domains.zip and b/examples/zips/identity_domains.zip differ diff --git a/examples/zips/integration.zip b/examples/zips/integration.zip index 5b064fe781e..7257237c2c1 100644 Binary files a/examples/zips/integration.zip and b/examples/zips/integration.zip differ diff --git a/examples/zips/jms.zip b/examples/zips/jms.zip index e0c2d5d20d3..fb5865dcc53 100644 Binary files a/examples/zips/jms.zip and b/examples/zips/jms.zip differ diff --git a/examples/zips/jms_java_downloads.zip b/examples/zips/jms_java_downloads.zip index 18bc322b0ac..27b98239f59 100644 Binary files a/examples/zips/jms_java_downloads.zip and b/examples/zips/jms_java_downloads.zip differ diff --git a/examples/zips/jms_utils.zip b/examples/zips/jms_utils.zip new file mode 100644 index 00000000000..01fbb9a4961 Binary files /dev/null and b/examples/zips/jms_utils.zip differ diff --git a/examples/zips/kms.zip b/examples/zips/kms.zip index 65b7adb6406..9b5de44d9ef 100644 Binary files a/examples/zips/kms.zip and b/examples/zips/kms.zip differ diff --git a/examples/zips/license_manager.zip b/examples/zips/license_manager.zip index 415ccb6d6b6..ad6980c2422 100644 Binary files a/examples/zips/license_manager.zip and b/examples/zips/license_manager.zip differ diff --git a/examples/zips/limits.zip b/examples/zips/limits.zip index db46d79c782..1507bd1298a 100644 Binary files a/examples/zips/limits.zip and b/examples/zips/limits.zip differ diff --git a/examples/zips/load_balancer.zip b/examples/zips/load_balancer.zip index 480383ea63b..cd1e4dcf7f2 100644 Binary files a/examples/zips/load_balancer.zip and b/examples/zips/load_balancer.zip differ diff --git a/examples/zips/log_analytics.zip b/examples/zips/log_analytics.zip index 85de96ded60..4b6c202a6ca 100644 Binary files a/examples/zips/log_analytics.zip and b/examples/zips/log_analytics.zip differ diff --git a/examples/zips/logging.zip b/examples/zips/logging.zip index f3f9413fb2b..80f3e1a0122 100644 Binary files a/examples/zips/logging.zip and b/examples/zips/logging.zip differ diff --git a/examples/zips/lustre_file_storage.zip b/examples/zips/lustre_file_storage.zip index 950c4b1b1eb..f1bd29b1c5d 100644 Binary files a/examples/zips/lustre_file_storage.zip and b/examples/zips/lustre_file_storage.zip differ diff --git a/examples/zips/managed_kafka.zip b/examples/zips/managed_kafka.zip index 91ea3ebe27a..48ede9e1321 100644 Binary files a/examples/zips/managed_kafka.zip and b/examples/zips/managed_kafka.zip differ diff --git a/examples/zips/management_agent.zip b/examples/zips/management_agent.zip index b653f6c1792..246f2026dec 100644 Binary files a/examples/zips/management_agent.zip and b/examples/zips/management_agent.zip differ diff --git a/examples/zips/management_dashboard.zip b/examples/zips/management_dashboard.zip index 30c302ff3d8..7f79e1ee47c 100644 Binary files a/examples/zips/management_dashboard.zip and b/examples/zips/management_dashboard.zip differ diff --git a/examples/zips/marketplace.zip b/examples/zips/marketplace.zip index e8e63cda642..3376646b354 100644 Binary files a/examples/zips/marketplace.zip and b/examples/zips/marketplace.zip differ diff --git a/examples/zips/media_services.zip b/examples/zips/media_services.zip index 685e63c1c9e..c3cbb290033 100644 Binary files a/examples/zips/media_services.zip and b/examples/zips/media_services.zip differ diff --git a/examples/zips/metering_computation.zip b/examples/zips/metering_computation.zip index ed7c5e11f69..3de80c3b4fd 100644 Binary files a/examples/zips/metering_computation.zip and b/examples/zips/metering_computation.zip differ diff --git a/examples/zips/monitoring.zip b/examples/zips/monitoring.zip index 444b06fa70b..556c2bc249d 100644 Binary files a/examples/zips/monitoring.zip and b/examples/zips/monitoring.zip differ diff --git a/examples/zips/mysql.zip b/examples/zips/mysql.zip index 911320db4c9..a95fd42c067 100644 Binary files a/examples/zips/mysql.zip and b/examples/zips/mysql.zip differ diff --git a/examples/zips/network_firewall.zip b/examples/zips/network_firewall.zip index 3016716dce3..9c256547ef2 100644 Binary files a/examples/zips/network_firewall.zip and b/examples/zips/network_firewall.zip differ diff --git a/examples/zips/network_load_balancer.zip b/examples/zips/network_load_balancer.zip index 1225c046206..a84b318a347 100644 Binary files a/examples/zips/network_load_balancer.zip and b/examples/zips/network_load_balancer.zip differ diff --git a/examples/zips/networking.zip b/examples/zips/networking.zip index c1375121d7f..0cf8f062c75 100644 Binary files a/examples/zips/networking.zip and b/examples/zips/networking.zip differ diff --git a/examples/zips/nosql.zip b/examples/zips/nosql.zip index 959a46464f5..a88aad75e00 100644 Binary files a/examples/zips/nosql.zip and b/examples/zips/nosql.zip differ diff --git a/examples/zips/notifications.zip b/examples/zips/notifications.zip index f024cbfa4f1..6a8b83dfdbc 100644 Binary files a/examples/zips/notifications.zip and b/examples/zips/notifications.zip differ diff --git a/examples/zips/object_storage.zip b/examples/zips/object_storage.zip index c81a2b322c4..07863272fef 100644 Binary files a/examples/zips/object_storage.zip and b/examples/zips/object_storage.zip differ diff --git a/examples/zips/ocvp.zip b/examples/zips/ocvp.zip index 2df97629086..0bb9f20328f 100644 Binary files a/examples/zips/ocvp.zip and b/examples/zips/ocvp.zip differ diff --git a/examples/zips/onesubscription.zip b/examples/zips/onesubscription.zip index 8bab3feb03c..b994339ee98 100644 Binary files a/examples/zips/onesubscription.zip and b/examples/zips/onesubscription.zip differ diff --git a/examples/zips/opa.zip b/examples/zips/opa.zip index 7c33c2c079f..1bc7e63ffb1 100644 Binary files a/examples/zips/opa.zip and b/examples/zips/opa.zip differ diff --git a/examples/zips/opensearch.zip b/examples/zips/opensearch.zip index 4fbc4ae3b7b..cb1b924550a 100644 Binary files a/examples/zips/opensearch.zip and b/examples/zips/opensearch.zip differ diff --git a/examples/zips/operator_access_control.zip b/examples/zips/operator_access_control.zip index 0051e8962be..aacf9b80e69 100644 Binary files a/examples/zips/operator_access_control.zip and b/examples/zips/operator_access_control.zip differ diff --git a/examples/zips/opsi.zip b/examples/zips/opsi.zip index c12c534654c..6677f1c5b90 100644 Binary files a/examples/zips/opsi.zip and b/examples/zips/opsi.zip differ diff --git a/examples/zips/optimizer.zip b/examples/zips/optimizer.zip index d855a85a56c..91c9dc08bd1 100644 Binary files a/examples/zips/optimizer.zip and b/examples/zips/optimizer.zip differ diff --git a/examples/zips/oracle_cloud_vmware_solution.zip b/examples/zips/oracle_cloud_vmware_solution.zip index 3d5e598ad8b..fc87853bdff 100644 Binary files a/examples/zips/oracle_cloud_vmware_solution.zip and b/examples/zips/oracle_cloud_vmware_solution.zip differ diff --git a/examples/zips/oracle_content_experience.zip b/examples/zips/oracle_content_experience.zip index 9014e81b2c4..7656f5677cb 100644 Binary files a/examples/zips/oracle_content_experience.zip and b/examples/zips/oracle_content_experience.zip differ diff --git a/examples/zips/oracle_digital_assistant.zip b/examples/zips/oracle_digital_assistant.zip index c695cdae759..d50b4a1a149 100644 Binary files a/examples/zips/oracle_digital_assistant.zip and b/examples/zips/oracle_digital_assistant.zip differ diff --git a/examples/zips/os_management_hub.zip b/examples/zips/os_management_hub.zip index 3ee44420bc9..e530ea43844 100644 Binary files a/examples/zips/os_management_hub.zip and b/examples/zips/os_management_hub.zip differ diff --git a/examples/zips/osmanagement.zip b/examples/zips/osmanagement.zip index f750581aebd..26829d73a88 100644 Binary files a/examples/zips/osmanagement.zip and b/examples/zips/osmanagement.zip differ diff --git a/examples/zips/osp_gateway.zip b/examples/zips/osp_gateway.zip index 24d93a6c116..e8d25266cb2 100644 Binary files a/examples/zips/osp_gateway.zip and b/examples/zips/osp_gateway.zip differ diff --git a/examples/zips/osub_billing_schedule.zip b/examples/zips/osub_billing_schedule.zip index 7cf40ea5cfd..ab704e659a8 100644 Binary files a/examples/zips/osub_billing_schedule.zip and b/examples/zips/osub_billing_schedule.zip differ diff --git a/examples/zips/osub_organization_subscription.zip b/examples/zips/osub_organization_subscription.zip index 4ce29dccaaf..0e4924fbabc 100644 Binary files a/examples/zips/osub_organization_subscription.zip and b/examples/zips/osub_organization_subscription.zip differ diff --git a/examples/zips/osub_subscription.zip b/examples/zips/osub_subscription.zip index 6e54ca091d6..107d2bb5ed2 100644 Binary files a/examples/zips/osub_subscription.zip and b/examples/zips/osub_subscription.zip differ diff --git a/examples/zips/osub_usage.zip b/examples/zips/osub_usage.zip index 35827d34c7b..c3ac395c161 100644 Binary files a/examples/zips/osub_usage.zip and b/examples/zips/osub_usage.zip differ diff --git a/examples/zips/pic.zip b/examples/zips/pic.zip index 2ab2b2cafe7..39227be055b 100644 Binary files a/examples/zips/pic.zip and b/examples/zips/pic.zip differ diff --git a/examples/zips/psql.zip b/examples/zips/psql.zip index 97521788843..8c892e84f9c 100644 Binary files a/examples/zips/psql.zip and b/examples/zips/psql.zip differ diff --git a/examples/zips/queue.zip b/examples/zips/queue.zip index b5fbe4763f3..aad002dfbc8 100644 Binary files a/examples/zips/queue.zip and b/examples/zips/queue.zip differ diff --git a/examples/zips/recovery.zip b/examples/zips/recovery.zip index 8eb9fff4bba..93a980f5bc8 100644 Binary files a/examples/zips/recovery.zip and b/examples/zips/recovery.zip differ diff --git a/examples/zips/redis.zip b/examples/zips/redis.zip index 09fabf4640f..8071929424e 100644 Binary files a/examples/zips/redis.zip and b/examples/zips/redis.zip differ diff --git a/examples/zips/resourcemanager.zip b/examples/zips/resourcemanager.zip index b23d733bfbe..60037af9f07 100644 Binary files a/examples/zips/resourcemanager.zip and b/examples/zips/resourcemanager.zip differ diff --git a/examples/zips/resourcescheduler.zip b/examples/zips/resourcescheduler.zip index ec5d8191ea8..90152180280 100644 Binary files a/examples/zips/resourcescheduler.zip and b/examples/zips/resourcescheduler.zip differ diff --git a/examples/zips/security_attribute.zip b/examples/zips/security_attribute.zip index 0d95805806f..f2c19384a63 100644 Binary files a/examples/zips/security_attribute.zip and b/examples/zips/security_attribute.zip differ diff --git a/examples/zips/serviceManagerProxy.zip b/examples/zips/serviceManagerProxy.zip index 691cd14217a..650bfddb6e4 100644 Binary files a/examples/zips/serviceManagerProxy.zip and b/examples/zips/serviceManagerProxy.zip differ diff --git a/examples/zips/service_catalog.zip b/examples/zips/service_catalog.zip index 7a9b44ac92b..443754918a6 100644 Binary files a/examples/zips/service_catalog.zip and b/examples/zips/service_catalog.zip differ diff --git a/examples/zips/service_connector_hub.zip b/examples/zips/service_connector_hub.zip index 7620f765f26..5d2209f5650 100644 Binary files a/examples/zips/service_connector_hub.zip and b/examples/zips/service_connector_hub.zip differ diff --git a/examples/zips/service_mesh.zip b/examples/zips/service_mesh.zip index cd7d6794eb0..65ed1f00380 100644 Binary files a/examples/zips/service_mesh.zip and b/examples/zips/service_mesh.zip differ diff --git a/examples/zips/stack_monitoring.zip b/examples/zips/stack_monitoring.zip index f8058a95b1c..0924ae9acf2 100644 Binary files a/examples/zips/stack_monitoring.zip and b/examples/zips/stack_monitoring.zip differ diff --git a/examples/zips/storage.zip b/examples/zips/storage.zip index a345d8708da..ed08618a74c 100644 Binary files a/examples/zips/storage.zip and b/examples/zips/storage.zip differ diff --git a/examples/zips/streaming.zip b/examples/zips/streaming.zip index f123842297b..6f5618908f1 100644 Binary files a/examples/zips/streaming.zip and b/examples/zips/streaming.zip differ diff --git a/examples/zips/tenantmanagercontrolplane.zip b/examples/zips/tenantmanagercontrolplane.zip index 68418002461..40e2cf76f99 100644 Binary files a/examples/zips/tenantmanagercontrolplane.zip and b/examples/zips/tenantmanagercontrolplane.zip differ diff --git a/examples/zips/usage_proxy.zip b/examples/zips/usage_proxy.zip index 5b07fc8ae60..26ffe61b089 100644 Binary files a/examples/zips/usage_proxy.zip and b/examples/zips/usage_proxy.zip differ diff --git a/examples/zips/vault_secret.zip b/examples/zips/vault_secret.zip index 2acb7f68b25..c943852628f 100644 Binary files a/examples/zips/vault_secret.zip and b/examples/zips/vault_secret.zip differ diff --git a/examples/zips/vbs_inst.zip b/examples/zips/vbs_inst.zip index 09bc840e9d3..feb6d5f15e9 100644 Binary files a/examples/zips/vbs_inst.zip and b/examples/zips/vbs_inst.zip differ diff --git a/examples/zips/visual_builder.zip b/examples/zips/visual_builder.zip index ba939b2e52d..412f5402def 100644 Binary files a/examples/zips/visual_builder.zip and b/examples/zips/visual_builder.zip differ diff --git a/examples/zips/vn_monitoring.zip b/examples/zips/vn_monitoring.zip index 60c2735be99..a9818faa1df 100644 Binary files a/examples/zips/vn_monitoring.zip and b/examples/zips/vn_monitoring.zip differ diff --git a/examples/zips/vulnerability_scanning_service.zip b/examples/zips/vulnerability_scanning_service.zip index 112e291e73d..2182be0a724 100644 Binary files a/examples/zips/vulnerability_scanning_service.zip and b/examples/zips/vulnerability_scanning_service.zip differ diff --git a/examples/zips/web_app_acceleration.zip b/examples/zips/web_app_acceleration.zip index 3011effc76e..23e8b59fa09 100644 Binary files a/examples/zips/web_app_acceleration.zip and b/examples/zips/web_app_acceleration.zip differ diff --git a/examples/zips/web_app_firewall.zip b/examples/zips/web_app_firewall.zip index ed7fdbf5465..1e979c777d1 100644 Binary files a/examples/zips/web_app_firewall.zip and b/examples/zips/web_app_firewall.zip differ diff --git a/examples/zips/web_application_acceleration_and_security.zip b/examples/zips/web_application_acceleration_and_security.zip index c00c09a2967..0a4e4b0eb79 100644 Binary files a/examples/zips/web_application_acceleration_and_security.zip and b/examples/zips/web_application_acceleration_and_security.zip differ diff --git a/examples/zips/wlms.zip b/examples/zips/wlms.zip index 29d9807d25c..641690a81a5 100644 Binary files a/examples/zips/wlms.zip and b/examples/zips/wlms.zip differ diff --git a/examples/zips/zpr.zip b/examples/zips/zpr.zip index e794e48fff8..6904dd68e98 100644 Binary files a/examples/zips/zpr.zip and b/examples/zips/zpr.zip differ diff --git a/go.mod b/go.mod index d80af1f9323..c0b25ff5927 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/hashicorp/terraform-plugin-mux v0.18.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1 github.com/hashicorp/terraform-plugin-testing v1.9.0 - github.com/oracle/oci-go-sdk/v65 v65.101.0 + github.com/oracle/oci-go-sdk/v65 v65.101.1 github.com/stretchr/testify v1.9.0 golang.org/x/mod v0.24.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 9f76a962a7d..719c33f5d84 100644 --- a/go.sum +++ b/go.sum @@ -152,6 +152,7 @@ github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3x github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -200,6 +201,8 @@ github.com/oracle/oci-go-sdk/v65 v65.100.1 h1:5Bj+O14s1GoyGfS3GCTP0jSfDTg7OjpOMa github.com/oracle/oci-go-sdk/v65 v65.100.1/go.mod h1:RGiXfpDDmRRlLtqlStTzeBjjdUNXyqm3KXKyLCm3A/Q= github.com/oracle/oci-go-sdk/v65 v65.101.0 h1:EErMOuw98JXi0P7DgPg5zjouCA5s61iWD5tFWNCVLHk= github.com/oracle/oci-go-sdk/v65 v65.101.0/go.mod h1:RGiXfpDDmRRlLtqlStTzeBjjdUNXyqm3KXKyLCm3A/Q= +github.com/oracle/oci-go-sdk/v65 v65.101.1 h1:ZsrZxvffhaB/RqEPmp5zoCS5KCQU1yY8m9B4KXc1404= +github.com/oracle/oci-go-sdk/v65 v65.101.1/go.mod h1:oB8jFGVc/7/zJ+DbleE8MzGHjhs2ioCz5stRTdZdIcY= github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4= github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= diff --git a/internal/client/multicloud_clients.go b/internal/client/multicloud_clients.go new file mode 100644 index 00000000000..cb17431b11c --- /dev/null +++ b/internal/client/multicloud_clients.go @@ -0,0 +1,97 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package client + +import ( + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" +) + +func init() { + RegisterOracleClient("oci_multicloud.MetadataClient", &OracleClient{InitClientFn: initMulticloudMetadataClient}) + RegisterOracleClient("oci_multicloud.MultiCloudsMetadataClient", &OracleClient{InitClientFn: initMulticloudMultiCloudsMetadataClient}) + RegisterOracleClient("oci_multicloud.OmhubNetworkAnchorClient", &OracleClient{InitClientFn: initMulticloudOmhubNetworkAnchorClient}) + RegisterOracleClient("oci_multicloud.OmhubResourceAnchorClient", &OracleClient{InitClientFn: initMulticloudOmhubResourceAnchorClient}) +} + +func initMulticloudMetadataClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_multicloud.NewMetadataClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) MetadataClient() *oci_multicloud.MetadataClient { + return m.GetClient("oci_multicloud.MetadataClient").(*oci_multicloud.MetadataClient) +} + +func initMulticloudMultiCloudsMetadataClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_multicloud.NewMultiCloudsMetadataClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) MultiCloudsMetadataClient() *oci_multicloud.MultiCloudsMetadataClient { + return m.GetClient("oci_multicloud.MultiCloudsMetadataClient").(*oci_multicloud.MultiCloudsMetadataClient) +} + +func initMulticloudOmhubNetworkAnchorClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_multicloud.NewOmhubNetworkAnchorClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) OmhubNetworkAnchorClient() *oci_multicloud.OmhubNetworkAnchorClient { + return m.GetClient("oci_multicloud.OmhubNetworkAnchorClient").(*oci_multicloud.OmhubNetworkAnchorClient) +} + +func initMulticloudOmhubResourceAnchorClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_multicloud.NewOmhubResourceAnchorClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) OmhubResourceAnchorClient() *oci_multicloud.OmhubResourceAnchorClient { + return m.GetClient("oci_multicloud.OmhubResourceAnchorClient").(*oci_multicloud.OmhubResourceAnchorClient) +} diff --git a/internal/client/ocvp_clients.go b/internal/client/ocvp_clients.go index a0f7d3dffa7..fae2213d9f4 100644 --- a/internal/client/ocvp_clients.go +++ b/internal/client/ocvp_clients.go @@ -11,6 +11,8 @@ import ( func init() { RegisterOracleClient("oci_ocvp.ClusterClient", &OracleClient{InitClientFn: initOcvpClusterClient}) + RegisterOracleClient("oci_ocvp.DatastoreClient", &OracleClient{InitClientFn: initOcvpDatastoreClient}) + RegisterOracleClient("oci_ocvp.DatastoreClusterClient", &OracleClient{InitClientFn: initOcvpDatastoreClusterClient}) RegisterOracleClient("oci_ocvp.EsxiHostClient", &OracleClient{InitClientFn: initOcvpEsxiHostClient}) RegisterOracleClient("oci_ocvp.WorkRequestClient", &OracleClient{InitClientFn: initOcvpWorkRequestClient}) RegisterOracleClient("oci_ocvp.SddcClient", &OracleClient{InitClientFn: initOcvpSddcClient}) @@ -36,6 +38,46 @@ func (m *OracleClients) ClusterClient() *oci_ocvp.ClusterClient { return m.GetClient("oci_ocvp.ClusterClient").(*oci_ocvp.ClusterClient) } +func initOcvpDatastoreClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_ocvp.NewDatastoreClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) DatastoreClient() *oci_ocvp.DatastoreClient { + return m.GetClient("oci_ocvp.DatastoreClient").(*oci_ocvp.DatastoreClient) +} + +func initOcvpDatastoreClusterClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_ocvp.NewDatastoreClusterClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) DatastoreClusterClient() *oci_ocvp.DatastoreClusterClient { + return m.GetClient("oci_ocvp.DatastoreClusterClient").(*oci_ocvp.DatastoreClusterClient) +} + func initOcvpEsxiHostClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { client, err := oci_ocvp.NewEsxiHostClientWithConfigurationProvider(configProvider) if err != nil { diff --git a/internal/client/resource_analytics_clients.go b/internal/client/resource_analytics_clients.go new file mode 100644 index 00000000000..9c549ca61f9 --- /dev/null +++ b/internal/client/resource_analytics_clients.go @@ -0,0 +1,106 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package client + +import ( + "net/http" + "strconv" + "strings" + + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" +) + +func init() { + RegisterOracleClient("oci_resource_analytics.MonitoredRegionClient", &OracleClient{InitClientFn: initResourceanalyticsMonitoredRegionClient}) + RegisterOracleClient("oci_resource_analytics.ResourceAnalyticsInstanceClient", &OracleClient{InitClientFn: initResourceanalyticsResourceAnalyticsInstanceClient}) + RegisterOracleClient("oci_resource_analytics.TenancyAttachmentClient", &OracleClient{InitClientFn: initResourceanalyticsTenancyAttachmentClient}) +} + +func initResourceanalyticsMonitoredRegionClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_resource_analytics.NewMonitoredRegionClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) MonitoredRegionClient() *oci_resource_analytics.MonitoredRegionClient { + return m.GetClient("oci_resource_analytics.MonitoredRegionClient").(*oci_resource_analytics.MonitoredRegionClient) +} + +func initResourceanalyticsResourceAnalyticsInstanceClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_resource_analytics.NewResourceAnalyticsInstanceClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + // Add interceptor to ensure Content-Length header is set for POST requests without body + // This fixes the issue where disableOac calls fail due to missing Content-Length header + client.Interceptor = func(request *http.Request) error { + if request.Method == "POST" && request.ContentLength <= 0 { + // For POST requests without a body (like disableOac), set Content-Length to 0 + if request.Header.Get("Content-Length") == "" { + request.Header.Set("Content-Length", "0") + request.ContentLength = 0 + } + } + // Also handle cases where we have a body but Content-Length is missing + if request.Method == "POST" && request.Body != nil { + if request.Header.Get("Content-Length") == "" && request.ContentLength > 0 { + request.Header.Set("Content-Length", strconv.FormatInt(request.ContentLength, 10)) + } + } + // Handle URL path specific cases for disableOac + if request.Method == "POST" && strings.Contains(request.URL.Path, "disableOac") { + if request.Header.Get("Content-Length") == "" { + request.Header.Set("Content-Length", "0") + request.ContentLength = 0 + } + } + return nil + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) ResourceAnalyticsInstanceClient() *oci_resource_analytics.ResourceAnalyticsInstanceClient { + return m.GetClient("oci_resource_analytics.ResourceAnalyticsInstanceClient").(*oci_resource_analytics.ResourceAnalyticsInstanceClient) +} + +func initResourceanalyticsTenancyAttachmentClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_resource_analytics.NewTenancyAttachmentClientWithConfigurationProvider(configProvider) + if err != nil { + return nil, err + } + err = configureClient(&client.BaseClient) + if err != nil { + return nil, err + } + + if serviceClientOverrides.HostUrlOverride != "" { + client.Host = serviceClientOverrides.HostUrlOverride + } + return &client, nil +} + +func (m *OracleClients) TenancyAttachmentClient() *oci_resource_analytics.TenancyAttachmentClient { + return m.GetClient("oci_resource_analytics.TenancyAttachmentClient").(*oci_resource_analytics.TenancyAttachmentClient) +} diff --git a/internal/globalvar/version.go b/internal/globalvar/version.go index e37d43dfddc..265ec533b57 100644 --- a/internal/globalvar/version.go +++ b/internal/globalvar/version.go @@ -7,8 +7,8 @@ import ( "log" ) -const Version = "7.20.0" -const ReleaseDate = "2025-09-23" +const Version = "7.21.0" +const ReleaseDate = "2025-10-01" func PrintVersion() { log.Printf("[INFO] terraform-provider-oci %s\n", Version) diff --git a/internal/integrationtest/core_compute_capacity_reservation_test.go b/internal/integrationtest/core_compute_capacity_reservation_test.go index 38c13313771..4c0cb689581 100644 --- a/internal/integrationtest/core_compute_capacity_reservation_test.go +++ b/internal/integrationtest/core_compute_capacity_reservation_test.go @@ -61,7 +61,7 @@ var ( "fault_domain": acctest.Representation{RepType: acctest.Optional, Create: `FAULT-DOMAIN-1`}, "cluster_placement_group_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.cluster_placement_group_id}`}, "reserved_count": acctest.Representation{RepType: acctest.Required, Create: `1`, Update: `2`}, - "instance_shape_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreComputeCapacityReservationInstanceReservationConfigsInstanceShapeConfigRepresentation}, + "instance_shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: CoreComputeCapacityReservationInstanceReservationConfigsInstanceShapeConfigRepresentation}, } CoreComputeCapacityReservationInstanceReservationConfigsRepresentation2 = map[string]interface{}{ @@ -80,9 +80,17 @@ var ( "instance_shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: CoreComputeCapacityReservationInstanceReservationConfigsInstanceShapeConfigRepresentation3}, } + CoreComputeCapacityReservationInstanceReservationConfigsRepresentation4 = map[string]interface{}{ + "instance_shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard.E5.Flex`}, + "fault_domain": acctest.Representation{RepType: acctest.Optional, Create: `FAULT-DOMAIN-1`}, + "cluster_placement_group_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.cluster_placement_group_id2}`}, + "reserved_count": acctest.Representation{RepType: acctest.Required, Create: `1`, Update: `2`}, + "instance_shape_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: CoreComputeCapacityReservationInstanceReservationConfigsInstanceShapeConfigRepresentation4}, + } + CoreComputeCapacityReservationInstanceReservationConfigsInstanceShapeConfigRepresentation = map[string]interface{}{ - "memory_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `15`}, - "ocpus": acctest.Representation{RepType: acctest.Optional, Create: `1`}, + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `15`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `1`}, } CoreComputeCapacityReservationInstanceReservationConfigsInstanceShapeConfigRepresentation2 = map[string]interface{}{ @@ -95,6 +103,11 @@ var ( "ocpus": acctest.Representation{RepType: acctest.Required, Create: `3`}, } + CoreComputeCapacityReservationInstanceReservationConfigsInstanceShapeConfigRepresentation4 = map[string]interface{}{ + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `23`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `4`}, + } + CoreComputeCapacityReservationResourceDependencies = AvailabilityDomainConfig + DefinedTagsDependencies ) @@ -166,7 +179,22 @@ func TestCoreComputeCapacityReservationResource_basic(t *testing.T) { { Config: config + compartmentIdVariableStr + clusterPlacementGroupIdStr + CoreComputeCapacityReservationResourceDependencies, }, - // Step 4: verify Create with optionals + // Step 4: Create a capacity reservation with 3 identical instance reservation configs, + // differing only in shape configs + { + Config: config + compartmentIdVariableStr + CoreComputeCapacityReservationResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_core_compute_capacity_reservation", "test_compute_capacity_reservation", acctest.Optional, acctest.Update, acctest.RepresentationCopyWithNewProperties(CoreComputeCapacityReservationRepresentation, map[string]interface{}{ + "instance_reservation_configs": []acctest.RepresentationGroup{{RepType: acctest.Optional, Group: CoreComputeCapacityReservationInstanceReservationConfigsRepresentation2}, {RepType: acctest.Optional, Group: CoreComputeCapacityReservationInstanceReservationConfigsRepresentation3}, {RepType: acctest.Optional, Group: CoreComputeCapacityReservationInstanceReservationConfigsRepresentation4}}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "instance_reservation_configs.#", "3"), + ), + }, + // Step 5: delete before next Create + { + Config: config + compartmentIdVariableStr + CoreComputeCapacityReservationResourceDependencies, + }, + // Step 6: verify Create with optionals { Config: config + compartmentIdVariableStr + clusterPlacementGroupIdStr + CoreComputeCapacityReservationResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_core_compute_capacity_reservation", "test_compute_capacity_reservation", acctest.Optional, acctest.Create, CoreComputeCapacityReservationRepresentation), @@ -201,7 +229,7 @@ func TestCoreComputeCapacityReservationResource_basic(t *testing.T) { ), }, - // Step 5: verify Update to the compartment (the compartment will be switched back in the next step) + // Step 7: verify Update to the compartment (the compartment will be switched back in the next step) { Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + clusterPlacementGroupIdStr + CoreComputeCapacityReservationResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_core_compute_capacity_reservation", "test_compute_capacity_reservation", acctest.Optional, acctest.Create, @@ -237,7 +265,7 @@ func TestCoreComputeCapacityReservationResource_basic(t *testing.T) { ), }, - // Step 6: verify updates to updatable parameters + // Step 8: verify updates to updatable parameters { Config: config + compartmentIdVariableStr + CoreComputeCapacityReservationResourceDependencies + clusterPlacementGroupIdStr + acctest.GenerateResourceFromRepresentationMap("oci_core_compute_capacity_reservation", "test_compute_capacity_reservation", acctest.Optional, acctest.Update, CoreComputeCapacityReservationRepresentation), @@ -269,7 +297,7 @@ func TestCoreComputeCapacityReservationResource_basic(t *testing.T) { }, ), }, - // Step 7: verify datasource + // Step 9: verify datasource { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_core_compute_capacity_reservations", "test_compute_capacity_reservations", acctest.Optional, acctest.Update, CoreCoreComputeCapacityReservationDataSourceRepresentation) + @@ -295,7 +323,7 @@ func TestCoreComputeCapacityReservationResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "compute_capacity_reservations.0.used_instance_count"), ), }, - // Step 8: verify singular datasource + // Step 10: verify singular datasource { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_core_compute_capacity_reservation", "test_compute_capacity_reservation", acctest.Required, acctest.Create, CoreCoreComputeCapacityReservationSingularDataSourceRepresentation) + diff --git a/internal/integrationtest/core_instance_configuration_test.go b/internal/integrationtest/core_instance_configuration_test.go index 4a3d5950369..4cea3620cdd 100644 --- a/internal/integrationtest/core_instance_configuration_test.go +++ b/internal/integrationtest/core_instance_configuration_test.go @@ -82,6 +82,36 @@ var ( "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTags}, } + CoreInstanceConfigurationRepresentationAie = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `TestInstanceConfiguration`}, + "instance_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceConfigurationInstanceDetailsRepresentationAie}, + } + + CoreInstanceConfigurationInstanceDetailsRepresentationAie = map[string]interface{}{ + "instance_type": acctest.Representation{RepType: acctest.Required, Create: `compute`}, + "launch_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceConfigurationInstanceDetailsLaunchDetailsAieRepresentation}, + } + + CoreInstanceConfigurationInstanceDetailsLaunchDetailsAieRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "shape": acctest.Representation{RepType: acctest.Optional, Create: `BM.GPU.A10.4`}, + "is_ai_enterprise_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + "source_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceConfigurationInstanceDetailsLaunchDetailsSourceDetailsAieRepresentation}, + "instance_options": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceConfigurationInstanceOptionsRepresentation}, + "create_vnic_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceConfigurationInstanceDetailsLaunchDetailsCreateVnicDetailsAieRepresentation}, + } + + CoreInstanceConfigurationInstanceDetailsLaunchDetailsSourceDetailsAieRepresentation = map[string]interface{}{ + "source_type": acctest.Representation{RepType: acctest.Required, Create: `image`}, + "image_id": acctest.Representation{RepType: acctest.Required, Create: `${var.image_ocid}`}, + } + + CoreInstanceConfigurationInstanceDetailsLaunchDetailsCreateVnicDetailsAieRepresentation = map[string]interface{}{ + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `Primaryvnic`}, + "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.subnet_ocid}`}, + } + CoreInstanceConfigurationFromInstanceRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "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")}`}, @@ -220,7 +250,7 @@ var ( []string{"dedicated_vm_host_id", "preferred_maintenance_action"}, ) CoreInstanceConfigurationInstanceOptionsRepresentation = map[string]interface{}{ - "are_legacy_imds_endpoints_disabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "are_legacy_imds_endpoints_disabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, } CoreInstanceConfigurationInstanceDetailsOptionsRepresentation = map[string]interface{}{ "launch_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceConfigurationInstanceDetailsLaunchDetailsRepresentation}, @@ -1175,6 +1205,79 @@ func TestCoreInstanceConfigurationResourceOptions_basic(t *testing.T) { }) } +func TestCoreInstanceConfigurationResourceAie_basic(t *testing.T) { + httpreplay.SetScenario("TestCoreInstanceConfigurationResourceAie_basic") + defer httpreplay.SaveScenario() + + 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_ocid\" { default = \"%s\" }\n", subnetId) + + imageId := utils.GetEnvSettingWithBlankDefault("image_ocid") + imageIdVariableStr := fmt.Sprintf("variable \"image_ocid\" { default = \"%s\" }\n", imageId) + + managementEndpoint := utils.GetEnvSettingWithBlankDefault("management_endpoint") + managementEndpointStr := fmt.Sprintf("variable \"management_endpoint\" { default = \"%s\" }\n", managementEndpoint) + + config := acctest.ProviderTestConfig() + compartmentIdVariableStr + AvailabilityDomainConfig + subnetIdVariableStr + imageIdVariableStr + managementEndpointStr + + resourceName := "oci_core_instance_configuration.test_instance_configuration" + singularDatasourceName := "data.oci_core_instance_configuration.test_instance_configuration" + + var resId string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "Create" step in the test. + acctest.SaveConfigContent(config+ + acctest.GenerateResourceFromRepresentationMap("oci_core_instance_configuration", "test_instance_configuration", acctest.Optional, acctest.Create, CoreInstanceConfigurationRepresentationAie), "core", "instanceConfiguration", t) + acctest.ResourceTest(t, testAccCheckCoreInstanceConfigurationDestroy, []resource.TestStep{ + // verify Create with optionals secondary_vnics to test ipv6 support + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_core_instance_configuration", "test_instance_configuration", acctest.Optional, acctest.Create, CoreInstanceConfigurationRepresentationAie), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "TestInstanceConfiguration"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "instance_details.0.instance_type", "compute"), + resource.TestCheckResourceAttr(resourceName, "instance_details.0.launch_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "instance_details.0.launch_details.0.is_ai_enterprise_enabled", "true"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + + 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 + }, + ), + }, + + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_core_instance_configuration", "test_instance_configuration", acctest.Required, acctest.Create, CoreCoreInstanceConfigurationSingularDataSourceRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_instance_configuration", "test_instance_configuration", acctest.Optional, acctest.Create, CoreInstanceConfigurationRepresentationAie), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "instance_configuration_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "TestInstanceConfiguration"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "instance_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "instance_details.0.instance_type", "compute"), + resource.TestCheckResourceAttr(singularDatasourceName, "instance_details.0.launch_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "instance_details.0.launch_details.0.is_ai_enterprise_enabled", "true"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + ), + }, + }) +} + // issue-routing-tag: core/computeManagement func TestCoreInstanceConfigurationResourceIpv6_basic(t *testing.T) { httpreplay.SetScenario("TestCoreInstanceConfigurationResourceIpv6_basic") diff --git a/internal/integrationtest/core_instance_test.go b/internal/integrationtest/core_instance_test.go index 3d4b58637d7..277bab7578a 100644 --- a/internal/integrationtest/core_instance_test.go +++ b/internal/integrationtest/core_instance_test.go @@ -252,7 +252,7 @@ var ( "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, } CoreInstanceInstanceOptionsRepresentation = map[string]interface{}{ - "are_legacy_imds_endpoints_disabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "are_legacy_imds_endpoints_disabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, } CoreInstanceLaunchOptionsRepresentation = map[string]interface{}{ "boot_volume_type": acctest.Representation{RepType: acctest.Optional, Create: `ISCSI`}, @@ -866,6 +866,17 @@ data "oci_kms_keys" "test_keys_dependency_RSA" { "licensing_configs": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceLicensingConfigsRepresentation}, "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, } + // ---- Launch with AIE flag ---- + InstanceRepresentationWithAieFlag = map[string]interface{}{ + "availability_domain": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "shape": acctest.Representation{RepType: acctest.Required, Create: `BM.GPU.A10.4`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_ocid}`}, + "image": acctest.Representation{RepType: acctest.Required, Create: `${var.image_ocid}`}, + "instance_options": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceInstanceOptionsRepresentation}, + "is_ai_enterprise_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + } InstanceSourceDetailsRepresentationWithImageFilters = map[string]interface{}{ "source_type": acctest.Representation{RepType: acctest.Required, Create: `image`}, "instance_source_image_filter_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstanceSourceDetailsInstanceSourceImageFilterDetailsRepresentation}, @@ -2263,6 +2274,119 @@ func TestAccResourceCoreInstance_UpdateLicensingConfig(t *testing.T) { }) } +func TestAccResourceCoreInstance_WithAieFlag(t *testing.T) { + httpreplay.SetScenario("TestAccResourceCoreInstance_WithAieFlag") + defer httpreplay.SaveScenario() + provider := acctest.TestAccProvider + + 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_ocid\" { default = \"%s\" }\n", subnetId) + + imageId := utils.GetEnvSettingWithBlankDefault("image_ocid") + imageIdVariableStr := fmt.Sprintf("variable \"image_ocid\" { default = \"%s\" }\n", imageId) + + managementEndpoint := utils.GetEnvSettingWithBlankDefault("management_endpoint") + managementEndpointStr := fmt.Sprintf("variable \"management_endpoint\" { default = \"%s\" }\n", managementEndpoint) + + config := acctest.ProviderTestConfig() + compartmentIdVariableStr + subnetIdVariableStr + imageIdVariableStr + managementEndpointStr + AvailabilityDomainConfig + CoreKeyResourceDependencyConfig + + resourceName := "oci_core_instance.test_instance" + datasourceName := "data.oci_core_instances.test_instances" + singularDatasourceName := "data.oci_core_instance.test_instance" + + var resId, resId2 string + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + Providers: map[string]*schema.Provider{ + "oci": provider, + }, + CheckDestroy: testAccCheckCoreInstanceDestroy, + Steps: []resource.TestStep{ + + // Step 0 - verify create + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_core_instance", "test_instance", acctest.Optional, acctest.Create, InstanceRepresentationWithAieFlag), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "shape", "BM.GPU.A10.4"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + resource.TestCheckResourceAttr(resourceName, "is_ai_enterprise_enabled", "false"), + 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 + }, + ), + }, + + // Step 1 - verify update + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_core_instance", "test_instance", acctest.Optional, acctest.Update, InstanceRepresentationWithAieFlag), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "shape", "BM.GPU.A10.4"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + resource.TestCheckResourceAttr(resourceName, "is_ai_enterprise_enabled", "true"), + 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 + }, + ), + }, + + // Step 2 - verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_core_instances", "test_instances", acctest.Optional, acctest.Update, CoreCoreInstanceDataSourceRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_instance", "test_instance", acctest.Optional, acctest.Update, InstanceRepresentationWithAieFlag), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "availability_domain"), + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "state", "RUNNING"), + resource.TestCheckResourceAttr(datasourceName, "instances.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "instances.0.compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "instances.0.shape", "BM.GPU.A10.4"), + resource.TestCheckResourceAttr(datasourceName, "instances.0.display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "instances.0.is_ai_enterprise_enabled", "true"), + ), + }, + + // Step 3 - verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_core_instance", "test_instance", acctest.Optional, acctest.Create, CoreCoreInstanceSingularDataSourceRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_instance", "test_instance", acctest.Optional, acctest.Update, InstanceRepresentationWithAieFlag), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "availability_domain"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "instance_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "image"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "shape", "BM.GPU.A10.4"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(singularDatasourceName, "is_ai_enterprise_enabled", "true"), + ), + }, + }, + }) +} + // issue-routing-tag: core/computeSharedOwnershipVmAndBm func TestCoreInstanceResource_capacityReservation(t *testing.T) { httpreplay.SetScenario("TestCoreInstanceResource_capacityReservation") diff --git a/internal/integrationtest/database_autonomous_container_database_resource_test.go b/internal/integrationtest/database_autonomous_container_database_resource_test.go index 8d573a14f04..eab5d7a4582 100644 --- a/internal/integrationtest/database_autonomous_container_database_resource_test.go +++ b/internal/integrationtest/database_autonomous_container_database_resource_test.go @@ -27,6 +27,10 @@ var ( ExaccACDResourceConfig = ACDECPUatabaseResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database", acctest.Optional, acctest.Update, ACDatabaseRepresentation) + // This is to be able to delete the LTB after the test run + ExaccACDResourceConfigWithoutRetentionLock = ACDECPUatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database", acctest.Optional, acctest.Create, ACDatabaseRepresentation) + ExaccACDRequiredOnlyResource = ExaccDatabaseAutonomousContainerDatabaseResourceFromAdsiDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database_from_adsi", acctest.Required, acctest.Create, ExaccACDatabaseFromAdsiRepresentation) @@ -62,8 +66,9 @@ 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: utils.GetEnvSettingWithDefault("exacc_acd_db_version", "19.26.0.1.0")}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: utils.GetEnvSettingWithDefault("exacc_acd_db_version", "19.27.0.1.0")}, "is_dst_file_update_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: DbaasIgnoreDefinedTagsRepresentation}, } ACDatabaseWithRABkpDesRepresentation = map[string]interface{}{ "db_split_threshold": acctest.Representation{RepType: acctest.Optional, Create: `8`}, @@ -83,7 +88,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: utils.GetEnvSettingWithDefault("exacc_acd_db_version", "19.26.0.1.0")}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: utils.GetEnvSettingWithDefault("exacc_acd_db_version", "19.27.0.1.0")}, "is_dst_file_update_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, } @@ -102,7 +107,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: utils.GetEnvSettingWithDefault("exacc_acd_db_version", "19.26.0.1.0")}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: utils.GetEnvSettingWithDefault("exacc_acd_db_version", "19.27.0.1.0")}, "is_dst_file_update_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, } @@ -139,16 +144,36 @@ var ( map[string]interface{}{"database_software_image_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_database_software_image.test_autonomous_database_software_image.id}`}}) ACDatabaseBackupConfigRepresentation = map[string]interface{}{ - "recovery_window_in_days": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, + "backup_destination_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ACDatabaseBackupConfigRepresentationWithImmutable}, + "recovery_window_in_days": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, + } + + ACDatabaseBackupConfigRepresentationWithImmutable = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `OBJECT_STORE`}, + "backup_retention_policy_on_terminate": acctest.Representation{RepType: acctest.Optional, Create: `RETAIN_FOR_72_HOURS`, Update: `RETAIN_PER_RETENTION_WINDOW`}, + "is_retention_lock_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, } autonomousContainerDatabaseBackupConfigBackupDestinationDetailsRepresentation = map[string]interface{}{ - "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`}, - "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.test_backup_destination.id}`}, - "internet_proxy": acctest.Representation{RepType: acctest.Optional, Create: `internetProxy`}, - "vpc_password": acctest.Representation{RepType: acctest.Optional, Create: `vpcPassword`, Update: `vpcPassword2`}, - "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, + "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.test_backup_destination.id}`}, + "internet_proxy": acctest.Representation{RepType: acctest.Optional, Create: `internetProxy`}, + "vpc_password": acctest.Representation{RepType: acctest.Optional, Create: `vpcPassword`, Update: `vpcPassword2`}, + "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, + "backup_retention_policy_on_terminate": acctest.Representation{RepType: acctest.Optional, Create: `RETAIN_FOR_72_HOURS`, Update: `RETAIN_PER_RETENTION_WINDOW`}, + "is_retention_lock_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + } + + autonomousContainerDatabaseBackupConfigBackupDestinationDetailsRepresentation1 = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.test_backup_destination.id}`}, + "internet_proxy": acctest.Representation{RepType: acctest.Optional, Create: `internetProxy`}, + "vpc_password": acctest.Representation{RepType: acctest.Optional, Create: `vpcPassword`, Update: `vpcPassword2`}, + "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, + "backup_retention_policy_on_terminate": acctest.Representation{RepType: acctest.Optional, Create: `RETAIN_PER_RETENTION_WINDOW`, Update: `RETAIN_FOR_72_HOURS`}, + "is_retention_lock_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `false`}, } + autonomousContainerDatabaseBackupConfigBackupDestinationDetailsRepresentationWithNoUpdate = map[string]interface{}{ "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`}, "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.test_backup_destination.id}`}, @@ -157,18 +182,22 @@ var ( "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, } autonomousContainerDatabaseBackupConfigBackupDestinationDetailsWithRAUpdateRepresentation = map[string]interface{}{ - "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`, Update: `RECOVERY_APPLIANCE`}, - "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.test_backup_destination.id}`, Update: `${oci_database_backup_destination.ra_backup_destination.id}`}, - "internet_proxy": acctest.Representation{RepType: acctest.Optional, Create: `internetProxy`}, - "vpc_password": acctest.Representation{RepType: acctest.Optional, Create: `vpcPassword`, Update: `vpcPassword2`}, - "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, + "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`, Update: `RECOVERY_APPLIANCE`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.test_backup_destination.id}`, Update: `${oci_database_backup_destination.ra_backup_destination.id}`}, + "internet_proxy": acctest.Representation{RepType: acctest.Optional, Create: `internetProxy`}, + "vpc_password": acctest.Representation{RepType: acctest.Optional, Create: `vpcPassword`, Update: `vpcPassword2`}, + "backup_retention_policy_on_terminate": acctest.Representation{RepType: acctest.Optional, Create: `RETAIN_PER_RETENTION_WINDOW`}, + "is_retention_lock_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, } autonomousContainerDatabaseBackupConfigBackupDestinationDetailsWithRARepresentation = map[string]interface{}{ - "type": acctest.Representation{RepType: acctest.Required, Create: `RECOVERY_APPLIANCE`}, - "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.ra_backup_destination.id}`}, - "internet_proxy": acctest.Representation{RepType: acctest.Optional, Create: `internetProxy`}, - "vpc_password": acctest.Representation{RepType: acctest.Optional, Create: `vpcPassword`}, - "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, + "type": acctest.Representation{RepType: acctest.Required, Create: `RECOVERY_APPLIANCE`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_backup_destination.ra_backup_destination.id}`}, + "internet_proxy": acctest.Representation{RepType: acctest.Optional, Create: `internetProxy`}, + "vpc_password": acctest.Representation{RepType: acctest.Optional, Create: `vpcPassword`}, + "vpc_user": acctest.Representation{RepType: acctest.Optional, Create: `bkupUser1`}, + "backup_retention_policy_on_terminate": acctest.Representation{RepType: acctest.Optional, Create: `RETAIN_PER_RETENTION_WINDOW`}, + "is_retention_lock_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, } acdBackupConfigLocalRepresentation = map[string]interface{}{ "backup_destination_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: map[string]interface{}{ @@ -184,7 +213,7 @@ var ( ACDECPUatabaseResourceDependencies = DatabaseAVMClusterWithSingleNetworkResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_backup_destination", "test_backup_destination", acctest.Optional, acctest.Create, backupDestinationNFSRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster", acctest.Required, acctest.Create, DatabaseECPUAutonomousVmClusterRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_database_key_store", "test_key_store", acctest.Optional, acctest.Create, DatabaseKeyStoreRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_database_key_store", "test_key_store", acctest.Optional, acctest.Create, DatabaseKeyStoreRepresentationWithIgnoreTagsChanges) + KmsVaultIdVariableStr + OkvSecretVariableStr dgDbUniqueName = utils.RandomString(10, utils.CharsetWithoutDigits) @@ -205,7 +234,7 @@ var ( acctest.GenerateResourceFromRepresentationMap("oci_database_backup_destination", "ra_backup_destination", acctest.Optional, acctest.Create, DatabaseBackupDestinationRepresentation) ExaccACDWithDGUpdateBkpDesRepresentation = map[string]interface{}{ - "db_version": acctest.Representation{RepType: acctest.Required, Create: utils.GetEnvSettingWithDefault("acd_db_version", "19.26.0.1.0")}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: utils.GetEnvSettingWithDefault("acd_db_version", "19.28.0.1.0")}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `ACD-DG-TF-TEST`}, "patch_model": acctest.Representation{RepType: acctest.Required, Create: `RELEASE_UPDATES`, Update: `RELEASE_UPDATE_REVISIONS`}, "autonomous_vm_cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id}`}, @@ -293,6 +322,8 @@ func TestDatabaseExaccAutonomousContainerDatabaseFromAdsi_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.type", "NFS"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.vpc_user", "bkupUser1"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.vpc_password", "vpcPassword"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_FOR_72_HOURS"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "db_unique_name", acbDBName2), resource.TestCheckResourceAttr(resourceName, "display_name", "containerdatabases3"), @@ -343,6 +374,8 @@ func TestDatabaseExaccAutonomousContainerDatabaseFromAdsi_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.internet_proxy", "internetProxy"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.type", "NFS"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.vpc_user", "bkupUser1"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "db_unique_name", acbDBName2), resource.TestCheckResourceAttr(resourceName, "display_name", "containerdatabases3"), @@ -506,6 +539,7 @@ func TestDatabaseAutonomousContainerDatabaseFromAdsi_basic(t *testing.T) { "backup_config.0.backup_destination_details.0.vpc_password", "is_automatic_failover_enabled", "state", + "time_of_last_backup", }, ResourceName: resourceName, }, @@ -761,6 +795,8 @@ func TestDatabaseExaccAutonomousContainerDatabase_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.type", "NFS"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.vpc_user", "bkupUser1"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.vpc_password", "vpcPassword"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_FOR_72_HOURS"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "db_split_threshold", "8"), resource.TestCheckResourceAttr(resourceName, "db_unique_name", acbDBName), @@ -817,6 +853,8 @@ func TestDatabaseExaccAutonomousContainerDatabase_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.internet_proxy", "internetProxy"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.type", "NFS"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.vpc_user", "bkupUser1"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "okv_end_point_group_name", "DUMMY_OKV_EPG_GROUP_2"), resource.TestCheckResourceAttr(resourceName, "db_split_threshold", "8"), @@ -875,6 +913,8 @@ func TestDatabaseExaccAutonomousContainerDatabase_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.backup_destination_details.0.internet_proxy", "internetProxy"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.backup_destination_details.0.type", "NFS"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.backup_destination_details.0.vpc_user", "bkupUser1"), + resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.db_split_threshold", "8"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.display_name", "containerdatabases2"), @@ -918,6 +958,8 @@ func TestDatabaseExaccAutonomousContainerDatabase_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.backup_destination_details.0.internet_proxy", "internetProxy"), resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.backup_destination_details.0.type", "NFS"), resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.backup_destination_details.0.vpc_user", "bkupUser1"), + resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(singularDatasourceName, "db_split_threshold", "8"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "containerdatabases2"), diff --git a/internal/integrationtest/database_autonomous_container_database_test.go b/internal/integrationtest/database_autonomous_container_database_test.go index 1d9a2eb2e55..722b5ed47d0 100644 --- a/internal/integrationtest/database_autonomous_container_database_test.go +++ b/internal/integrationtest/database_autonomous_container_database_test.go @@ -63,7 +63,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: utils.GetEnvSettingWithDefault("acd_db_version", "19.26.0.1.0")}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: utils.GetEnvSettingWithDefault("acd_db_version", "19.28.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}`}, @@ -91,7 +91,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: utils.GetEnvSettingWithDefault("acd_db_version", "19.24.0.1.0")}, + "db_version": acctest.Representation{RepType: acctest.Required, Create: utils.GetEnvSettingWithDefault("acd_db_version", "19.28.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}`}, @@ -111,6 +111,12 @@ var ( "backup_destination_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: autonomousContainerDatabaseBackupConfigBackupDestinationDetailsRepresentation}, "recovery_window_in_days": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, } + + DatabaseAutonomousContainerDatabaseBackupConfigRepresentationDisableRetentionOnUpdate = map[string]interface{}{ + "backup_destination_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: autonomousContainerDatabaseBackupConfigBackupDestinationDetailsRepresentation1}, + "recovery_window_in_days": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, + } + DatabaseAutonomousContainerDatabaseBackupConfigWithRAUpdateRepresentation = map[string]interface{}{ "backup_destination_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: autonomousContainerDatabaseBackupConfigBackupDestinationDetailsWithRAUpdateRepresentation}, "recovery_window_in_days": acctest.Representation{RepType: acctest.Optional, Create: `10`}, @@ -595,6 +601,8 @@ func TestDatabaseAutonomousContainerDatabaseResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "cloud_autonomous_vm_cluster_id"), resource.TestCheckResourceAttr(resourceName, "backup_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.recovery_window_in_days", "10"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_FOR_72_HOURS"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "customer_contacts.#", "1"), resource.TestCheckResourceAttr(resourceName, "customer_contacts.0.email", "test1@oracle.com"), @@ -669,6 +677,8 @@ func TestDatabaseAutonomousContainerDatabaseResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "cloud_autonomous_vm_cluster_id"), resource.TestCheckResourceAttr(resourceName, "backup_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.recovery_window_in_days", "10"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_FOR_72_HOURS"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), resource.TestCheckResourceAttr(resourceName, "customer_contacts.#", "1"), resource.TestCheckResourceAttr(resourceName, "customer_contacts.0.email", "test1@oracle.com"), @@ -734,6 +744,8 @@ func TestDatabaseAutonomousContainerDatabaseResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "cloud_autonomous_vm_cluster_id"), resource.TestCheckResourceAttr(resourceName, "backup_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.recovery_window_in_days", "11"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "customer_contacts.#", "1"), resource.TestCheckResourceAttr(resourceName, "customer_contacts.0.email", "test2@oracle.com"), @@ -801,6 +813,8 @@ func TestDatabaseAutonomousContainerDatabaseResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "cloud_autonomous_vm_cluster_id"), resource.TestCheckResourceAttr(resourceName, "backup_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.recovery_window_in_days", "11"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "db_split_threshold", "12"), resource.TestCheckResourceAttr(resourceName, "distribution_affinity", "MINIMUM_DISTRIBUTION"), @@ -853,6 +867,8 @@ func TestDatabaseAutonomousContainerDatabaseResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "autonomous_container_databases.0.available_cpus"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.#", "1"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.recovery_window_in_days", "11"), + resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.compartment_id", compartmentId), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_container_databases.0.compute_model"), resource.TestCheckResourceAttr(datasourceName, "autonomous_container_databases.0.customer_contacts.#", "1"), @@ -918,6 +934,8 @@ func TestDatabaseAutonomousContainerDatabaseResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "available_cpus"), resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.recovery_window_in_days", "11"), + resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(singularDatasourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(singularDatasourceName, "compute_model"), resource.TestCheckResourceAttr(singularDatasourceName, "customer_contacts.#", "1"), @@ -976,6 +994,8 @@ func TestDatabaseAutonomousContainerDatabaseResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "cloud_autonomous_vm_cluster_id"), resource.TestCheckResourceAttr(resourceName, "backup_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "backup_config.0.recovery_window_in_days", "11"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.is_retention_lock_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "backup_config.0.backup_destination_details.0.backup_retention_policy_on_terminate", "RETAIN_PER_RETENTION_WINDOW"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), @@ -1161,7 +1181,7 @@ func TestDatabaseAutonomousContainerDatabaseResource_OkvEpg(t *testing.T) { func testAccCheckDatabaseAutonomousContainerDatabaseDestroy(s *terraform.State) error { noResourceFound := true - client := acctest.TestAccProvider.Meta().(*client.OracleClients).DatabaseClient() + client := acctest.GetTestClients(&schema.ResourceData{}).DatabaseClient() for _, rs := range s.RootModule().Resources { if rs.Type == "oci_database_autonomous_container_database" { noResourceFound = false @@ -1269,7 +1289,7 @@ func TestDatabaseAutonomousContainerDatabaseResource_rotateKey(t *testing.T) { "key_version_id": acctest.Representation{RepType: acctest.Optional, Create: utils.GetEnvSettingWithBlankDefault("acd_key_version_id_2")}, })), Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttr(resourceName, "kms_key_version_id", utils.GetEnvSettingWithBlankDefault("acd_key_version_id")), + resource.TestCheckResourceAttr(resourceName, "kms_key_version_id", utils.GetEnvSettingWithBlankDefault("acd_key_version_id_2")), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") diff --git a/internal/integrationtest/database_autonomous_database_backup_test.go b/internal/integrationtest/database_autonomous_database_backup_test.go index a699a75106c..e28c983e298 100644 --- a/internal/integrationtest/database_autonomous_database_backup_test.go +++ b/internal/integrationtest/database_autonomous_database_backup_test.go @@ -50,6 +50,8 @@ var ( DatabaseDatabaseAutonomousDatabaseBackupDataSourceRepresentation = map[string]interface{}{ "autonomous_database_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_autonomous_database.test_autonomous_database.id}`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `Monthly Backup`}, + "infrastructure_type": acctest.Representation{RepType: acctest.Optional, Create: `CLOUD`}, + "key_store_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_key_store.test_key_store.id}`}, "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseBackupDataSourceFilterRepresentation}} DatabaseAutonomousDatabaseBackupDataSourceFilterRepresentation = map[string]interface{}{ @@ -68,6 +70,7 @@ var ( "retention_period_in_days": acctest.Representation{RepType: acctest.Optional, Create: `91`, Update: `94`}, "backup_destination_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ExaccAutonomousDatabaseBackupDestinationDetailsRepresentation}, } + DatabaseAutonomousDatabaseBackupRepresentation = map[string]interface{}{ "autonomous_database_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_database.test_autonomous_database.id}`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `Monthly Backup`}, @@ -83,12 +86,12 @@ var ( } DatabaseAutonomousDatabaseExaccRepresentation = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "cpu_core_count": acctest.Representation{RepType: acctest.Required, Create: `1`}, - "data_storage_size_in_tbs": acctest.Representation{RepType: acctest.Required, Create: `1`}, - "db_name": acctest.Representation{RepType: acctest.Required, Create: adbName}, - "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`, Update: `BEstrO0ng_#12`}, - //"autonomous_database_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_database.test_autonomous_database.id}`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`, Update: `6.0`}, + "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, + "data_storage_size_in_tbs": acctest.Representation{RepType: acctest.Required, Create: `1`}, + "db_name": acctest.Representation{RepType: acctest.Required, Create: adbName}, + "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`, Update: `BEstrO0ng_#12`}, "autonomous_container_database_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_container_database.test_autonomous_container_database.id}`}, "is_dedicated": acctest.Representation{RepType: acctest.Required, Create: `true`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: adbExaccName}, @@ -106,7 +109,7 @@ var ( "display_name": acctest.Representation{RepType: acctest.Required, Create: `nfs11`}, "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`}, "connection_string": acctest.Representation{RepType: acctest.Optional, Create: `connectionString`, Update: `connectionString2`}, - "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")}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, "mount_type_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ExaccBackupDestinationMountTypeDetailsRepresentation}, } @@ -134,18 +137,16 @@ var ( "key_store_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_database_key_store.test_key_store.id}`}, "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, "db_unique_name": acctest.Representation{RepType: acctest.Optional, Create: acbDBName}, - "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")}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, "maintenance_window_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseAutonomousContainerDatabaseMaintenanceWindowDetailsRepresentation}, "service_level_agreement_type": acctest.Representation{RepType: acctest.Optional, Create: `STANDARD`}, } - ExaccACDatabaseResourceConfig = ExaccACDatabaseResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database", acctest.Optional, acctest.Update, EXACCACDatabaseRepresentation) DatabaseAutonomousDatabaseBackupResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Required, acctest.Create, acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbBackupDbName}, DatabaseAutonomousDatabaseRepresentation)) - DatabaseAutonomousExaccDatabaseBackupResourceDependencies = ExaccACDatabaseResourceConfig + + DatabaseAutonomousExaccDatabaseBackupResourceDependencies = ExaccutonomousContainerDatabaseResourceDependenciesDbaasOnly + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Required, acctest.Create, acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: "testAdb"}, DatabaseAutonomousDatabaseExaccRepresentation)) ) @@ -263,7 +264,7 @@ func TestDatabaseAutonomousDatabaseBackupResource_basic(t *testing.T) { }, // verify resource import { - Config: config + AutonomousDatabaseBackupRequiredOnlyResource, + Config: config + compartmentIdVariableStr + AutonomousDatabaseBackupRequiredOnlyResource, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -316,6 +317,7 @@ func TestDatabaseAutonomousExaccBackupResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "display_name", "autonomousdatabasebackup"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "is_automatic"), + resource.TestCheckResourceAttrSet(resourceName, "infrastructure_type"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "type"), @@ -342,6 +344,7 @@ func TestDatabaseAutonomousExaccBackupResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "is_automatic"), resource.TestCheckResourceAttr(resourceName, "retention_period_in_days", "94"), resource.TestCheckResourceAttrSet(resourceName, "type"), + resource.TestCheckResourceAttrSet(resourceName, "infrastructure_type"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -359,11 +362,11 @@ func TestDatabaseAutonomousExaccBackupResource_basic(t *testing.T) { compartmentIdVariableStr + DatabaseAutonomousExaccDatabaseBackupResourceConfigForLongTermBackup, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "autonomous_database_backup_id"), - resource.TestCheckResourceAttrSet(singularDatasourceName, "autonomous_database_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "compartment_id"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "autonomousdatabasebackup"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "infrastructure_type"), resource.TestCheckResourceAttrSet(singularDatasourceName, "is_automatic"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_ended"), @@ -373,7 +376,7 @@ func TestDatabaseAutonomousExaccBackupResource_basic(t *testing.T) { }, // verify resource import { - Config: config + DatabaseAutonomousDatabaseBackupRequiredOnlyResource, + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseBackupRequiredOnlyResource, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ diff --git a/internal/integrationtest/database_autonomous_database_resource_test.go b/internal/integrationtest/database_autonomous_database_resource_test.go index 590f4044fef..a3158b4c2cc 100644 --- a/internal/integrationtest/database_autonomous_database_resource_test.go +++ b/internal/integrationtest/database_autonomous_database_resource_test.go @@ -45,6 +45,8 @@ var ( adbDbRefreshableCloneSourceADBName = utils.RandomString(1, utils.CharsetWithoutDigits) + utils.RandomString(13, utils.Charset) adbCrossCloneName = utils.RandomString(1, utils.CharsetWithoutDigits) + utils.RandomString(13, utils.Charset) adbCrossCloneNameWithOptionals = utils.RandomString(1, utils.CharsetWithoutDigits) + utils.RandomString(13, utils.Charset) + sourceId string + currentRegionString = utils.GetEnvSettingWithBlankDefault("region") AutonomousDatabaseDedicatedRequiredOnlyResource = AutonomousDatabaseDedicatedResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Required, acctest.Create, autonomousDatabaseDedicatedRepresentation) @@ -256,14 +258,33 @@ var ( })) autonomousDatabaseExaccRepresentation = acctest.RepresentationCopyWithNewProperties( - acctest.RepresentationCopyWithRemovedProperties(acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbExaccName}, DatabaseAutonomousDatabaseRepresentation), []string{"db_tools_details", "license_model", "whitelisted_ips", "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{"cpu_core_count", "db_tools_details", "license_model", "whitelisted_ips", "db_version", "is_auto_scaling_enabled", "operations_insights_status", "admin_password", "kms_key_id", "vault_id", "autonomous_maintenance_schedule_type", "customer_contacts", "scheduled_operations"}), 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}, "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`}, + "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `ECPU`}, }) + mongoDbautonomousDatabaseExaccRepresentation = acctest.RepresentationCopyWithNewProperties( + acctest.RepresentationCopyWithRemovedProperties(acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbExaccName}, DatabaseAutonomousDatabaseRepresentation), []string{"db_tools_details", "license_model", "whitelisted_ips", "db_version", "is_auto_scaling_enabled", "operations_insights_status", "admin_password", "kms_key_id", "vault_id", "autonomous_maintenance_schedule_type", "customer_contacts", "scheduled_operations", "cpu_core_count"}), + 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}, + "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, + "is_auto_scaling_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`}, + "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `ECPU`}, + }) + + EXACCDatabaseAutonomousDatabaseDbToolsDetailsRepresentationMongodbApi = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Update: `MONGODB_API`}, + "is_enabled": acctest.Representation{RepType: acctest.Optional, Update: `true`}, + } + developerAutonomousDatabaseExaccRepresentation = acctest.RepresentationCopyWithNewProperties( acctest.RepresentationCopyWithRemovedProperties(acctest.GetUpdatedRepresentationCopy("db_name", acctest.Representation{RepType: acctest.Required, Create: adbExaccName}, DatabaseAutonomousDatabaseRepresentation), []string{"db_tools_details", "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", "data_storage_size_in_tbs"}), map[string]interface{}{ @@ -311,8 +332,8 @@ var ( //"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`}, + "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `ECPU`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `16.0`, Update: `20.0`}, "in_memory_percentage": acctest.Representation{RepType: acctest.Optional, Create: `50`, Update: `60`}, }) @@ -322,20 +343,17 @@ 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: `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`}, + "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: `16.0`, Update: `20.0`}, + "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `ECPU`}, + "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`}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `2`}, }) autonomousDatabaseUpdateExaccRepresentation = map[string]interface{}{ "admin_password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, @@ -352,19 +370,14 @@ var ( "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, } - ATPDAutonomousContainerDatabaseResourceDependenciesDbaas = DatabaseCloudAutonomousVmClusterRequiredOnlyResource + KeyResourceDependencyConfigDbaas ExaccutonomousContainerDatabaseResourceDependenciesDbaasOnly = ACDatabaseResourceDependencies + kmsKeyIdCreateVariableStr + kmsKeyIdUpdateVariableStr + ExaccKeyResourceDependencyConfigDbaas + - acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database", acctest.Optional, acctest.Update, ACDatabaseRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_container_database", "test_autonomous_container_database", acctest.Optional, acctest.Update, acctest.RepresentationCopyWithNewProperties(ACDatabaseRepresentation, map[string]interface{}{ + "backup_config": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousContainerDatabaseBackupConfigRepresentationDisableRetentionOnUpdate}, + })) ExaccECPUAutonomousContainerDatabaseResourceDependenciesDbaasOnly = ACDECPUatabaseResourceDependencies + 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) - - autonomousDatabaseExaccResourceConfig = ExaccADBDatabaseResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, autonomousDatabaseUpdateExaccRepresentation) - ExaccADBDatabaseResourceDependencies = ExaccACDResourceConfig ExaccAutonomousDatabaseResourceFromBackupDependencies = ExaccAutonomousDatabaseResourceFromBackupDependenciesWithoutBkp + @@ -377,7 +390,8 @@ var ( }, }, })) - ExaccAutonomousDatabaseResourceFromBackupDependenciesWithoutBkp = ExaccACDResourceConfig + + + ExaccAutonomousDatabaseResourceFromBackupDependenciesWithoutBkp = ExaccACDResourceConfigWithoutRetentionLock + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, acctest.RepresentationCopyWithNewProperties(autonomousDatabaseExaccRepresentation, map[string]interface{}{ "db_name": acctest.Representation{RepType: acctest.Required, Create: adbBackupSourceName}, @@ -400,6 +414,9 @@ var ( vault_id = "${var.kms_vault_id}" } ` + DbaasIgnoreDefinedTagsRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}}, + } ExaccADBWithDataguardResourceDependencies = DatabaseAutonomousContainerExaccAutonomousContainerDatabaseDataguardAssociationResourceConfig @@ -944,36 +961,6 @@ func TestResourceDatabaseAutonomousDatabaseResource_preview(t *testing.T) { }, ), }, - - // verify updates to whitelisted_ips - { - Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, acctest.RepresentationCopyWithNewProperties(autonomousDatabasePreviewRepresentation, map[string]interface{}{"whitelisted_ips": acctest.Representation{RepType: acctest.Optional, Create: []string{"1.1.1.1/28", "1.1.1.29"}}})), - Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#12"), - resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttr(resourceName, "cpu_core_count", "1"), - resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), - resource.TestCheckResourceAttr(resourceName, "db_name", adbPreviewDbName), - resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), - resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), - resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), - resource.TestCheckResourceAttrSet(resourceName, "id"), - resource.TestCheckResourceAttr(resourceName, "is_auto_scaling_enabled", "false"), - resource.TestCheckResourceAttr(resourceName, "is_preview_version_with_service_terms_accepted", "true"), - resource.TestCheckResourceAttr(resourceName, "license_model", "LICENSE_INCLUDED"), - resource.TestCheckResourceAttrSet(resourceName, "state"), - resource.TestCheckResourceAttr(resourceName, "whitelisted_ips.#", "2"), - - 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 - }, - ), - }, // verify autoscaling { Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + @@ -2587,7 +2574,7 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource_dataGuard(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", "1"), + resource.TestCheckResourceAttr(resourceName, "compute_count", "2"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -2641,7 +2628,6 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource(t *testing.T) { 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, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), resource.TestCheckResourceAttrSet(resourceName, "db_version"), @@ -2675,7 +2661,6 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource(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, "cpu_core_count", "1"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -2698,6 +2683,90 @@ func TestResourceDatabaseExaccAutonomousDatabaseResource(t *testing.T) { }) } +func TestResourceDatabaseExaccAutonomousDatabaseResourceMangoDB(t *testing.T) { + shouldSkipEXACCtest := utils.GetEnvSettingWithDefault("TF_VAR_should_skip_exacc_test", "false") + + if shouldSkipEXACCtest == "true" { + t.Skip("Skipping TestResourceDatabaseExaccAutonomousDatabaseResourceMangoDB test.\n" + "Current TF_VAR_should_skip_exacc_test=" + shouldSkipEXACCtest) + } + + httpreplay.SetScenario("TestResourceDatabaseExaccAutonomousDatabaseResourceMangoDB") + 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 + ExaccADBDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, mongoDbautonomousDatabaseExaccRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + 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", "true"), + 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.TestCheckResourceAttrSet(resourceName, "memory_per_oracle_compute_unit_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 + }, + ), + }, + { + Config: config + compartmentIdVariableStr + ExaccADBDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Update, acctest.RepresentationCopyWithNewProperties(mongoDbautonomousDatabaseExaccRepresentation, map[string]interface{}{ + "db_tools_details": []acctest.RepresentationGroup{{RepType: acctest.Optional, Group: EXACCDatabaseAutonomousDatabaseDbToolsDetailsRepresentationMongodbApi}}})), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttrSet(resourceName, "autonomous_container_database_id"), + 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, "is_access_control_enabled", "false"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + acctest.CheckResourceSetContainsElementWithProperties(resourceName, "db_tools_details", map[string]string{ + "name": "MONGODB_API", + "is_enabled": "true", + }, nil), + + 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 TestAutonomousDatabaseExaccResourceCreateFromBackupAsPartialClone(t *testing.T) { shouldSkipEXACCtest := utils.GetEnvSettingWithDefault("TF_VAR_should_skip_exacc_test", "false") @@ -2726,7 +2795,7 @@ func TestAutonomousDatabaseExaccResourceCreateFromBackupAsPartialClone(t *testin 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", "4"), resource.TestCheckResourceAttr(resourceName, "clone_table_space_list.#", "3"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbBackupIdName), @@ -2803,7 +2872,7 @@ func TestResourceDatabaseInMemoryExaccAutonomousDatabaseResource_dataGuard(t *te 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.TestCheckResourceAttr(resourceName, "compute_count", "16"), resource.TestCheckResourceAttrSet(resourceName, "in_memory_area_in_gbs"), func(s *terraform.State) (err error) { @@ -2833,7 +2902,7 @@ func TestResourceDatabaseInMemoryExaccAutonomousDatabaseResource_dataGuard(t *te 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.TestCheckResourceAttr(resourceName, "compute_count", "20"), resource.TestCheckResourceAttrSet(resourceName, "state"), func(s *terraform.State) (err error) { @@ -2878,7 +2947,7 @@ func TestResourceDatabaseInMemoryExaccAutonomousDatabaseResource(t *testing.T) { 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, "compute_count", "16"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), resource.TestCheckResourceAttrSet(resourceName, "db_version"), @@ -2913,7 +2982,7 @@ func TestResourceDatabaseInMemoryExaccAutonomousDatabaseResource(t *testing.T) { 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, "compute_count", "20"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbExaccName), resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), @@ -3069,7 +3138,7 @@ func TestResourceDatabaseAutonomousDatabaseResource_switchover(t *testing.T) { 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", "2"), resource.TestCheckResourceAttr(resourceName, "data_safe_status", "NOT_REGISTERED"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttr(resourceName, "db_name", adbName), @@ -3101,7 +3170,7 @@ func TestResourceDatabaseAutonomousDatabaseResource_switchover(t *testing.T) { 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", "2"), resource.TestCheckResourceAttr(resourceName, "data_safe_status", "NOT_REGISTERED"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttrSet(resourceName, "db_version"), @@ -3139,7 +3208,7 @@ func TestResourceDatabaseAutonomousDatabaseResource_switchover(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#12"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttr(resourceName, "cpu_core_count", "1"), + resource.TestCheckResourceAttr(resourceName, "compute_count", "2"), resource.TestCheckResourceAttr(resourceName, "data_safe_status", "NOT_REGISTERED"), resource.TestCheckResourceAttr(resourceName, "data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttrSet(resourceName, "db_version"), @@ -4816,7 +4885,7 @@ func TestDatabaseAutonomousDatabaseResource_DeveloperDatabases(t *testing.T) { resourceName := "oci_database_autonomous_database.test_autonomous_database" // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "Create with optionals" step in the test. acctest.SaveConfigContent(config+compartmentIdVariableStr+DatabaseAutonomousDatabaseResourceDependencies+ - acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, DatabaseAutonomousDatabaseRepresentation), "database", "autonomousDatabase", t) + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, autonomousDatabaseRepresentationForDevTier), "database", "autonomousDatabase", t) acctest.ResourceTest(t, testAccCheckDatabaseAutonomousDatabaseDestroy, []resource.TestStep{ //0. Verify create Developer adb @@ -5308,3 +5377,162 @@ func TestDatabaseAutonomousDatabaseResource_dbTools(t *testing.T) { }, }) } + +func TestResourceDatabaseExaccAutonomousDatabaseResource_undelete(t *testing.T) { + httpreplay.SetScenario("TestResourceDatabaseExaccAutonomousDatabaseResource_undelete") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + initialRegion := os.Getenv("TF_VAR_region") + os.Setenv("TF_VAR_source_region", initialRegion) + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + resourceName := "oci_database_autonomous_database.test_autonomous_database" + //resourceNameUndelete := "oci_database_autonomous_database.test_autonomous_database_undelete" + + adbIdVariableStr := `variable "adb_id" { default = "" }` + "\n" + acctest.ResourceTest(t, testAccCheckDatabaseAutonomousDatabaseDestroy, []resource.TestStep{ + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + ExaccADBDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, autonomousDatabaseUpdateExaccRepresentation), + 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.TestCheckResourceAttrSet(resourceName, "state"), + + func(s *terraform.State) (err error) { + sourceId, err = acctest.FromInstanceState(s, resourceName, "id") + log.Printf("[DEBUG] Captured Autonomous DB ID for undelete: %s", sourceId) + adbIdVariableStr = fmt.Sprintf("variable \"adb_id\" { default = \"%s\" }\n", sourceId) + + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "false")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&sourceId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + //2. Delete before next Create + { + PreConfig: func() { + // here adbIdVariableStr is already populated from previous step + log.Printf("[DEBUG1] Using adb_id=%s for undelete, resid %s", adbIdVariableStr, sourceId) + }, + Config: config + compartmentIdVariableStr + adbIdVariableStr + ExaccADBDatabaseResourceDependencies, + }, + //3. undelete adb + { + PreConfig: func() { + err := triggerUndelete() + if err != nil { + t.Fatalf("Unable to disable replicate standby backups. Error: %v", err) + } + + err = deleteUndeletedAdb() + if err != nil { + t.Fatalf("Unable to disable replicate standby backups. Error: %v", err) + } + }, + Config: config + compartmentIdVariableStr + adbIdVariableStr, + }, + }) +} + +func TestResourceDatabaseAutonomousDatabaseDedicateResource_undelete(t *testing.T) { + httpreplay.SetScenario("TestResourceDatabaseAutonomousDatabaseDedicateResource_undelete") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + initialRegion := os.Getenv("TF_VAR_region") + os.Setenv("TF_VAR_source_region", initialRegion) + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + resourceName := "oci_database_autonomous_database.test_autonomous_database" + + adbIdVariableStr := `variable "adb_id" { default = "" }` + "\n" + acctest.ResourceTest(t, testAccCheckDatabaseAutonomousDatabaseDestroy, []resource.TestStep{ + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + AutonomousDatabaseDedicatedResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(autonomousDatabaseDedicatedRepresentation, []string{"in_memory_percentage"}), map[string]interface{}{ + "db_name": acctest.Representation{RepType: acctest.Required, Create: adbBackupSourceName}, + })), + 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.TestCheckResourceAttrSet(resourceName, "db_version"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + + func(s *terraform.State) (err error) { + sourceId, err = acctest.FromInstanceState(s, resourceName, "id") + log.Printf("[DEBUG] Captured Autonomous DB ID for undelete: %s", sourceId) + adbIdVariableStr = fmt.Sprintf("variable \"adb_id\" { default = \"%s\" }\n", sourceId) + + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "false")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&sourceId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + //2. Delete before next Create + { + PreConfig: func() { + // here adbIdVariableStr is already populated from previous step + log.Printf("[DEBUG1] Using adb_id=%s for undelete, resid %s", adbIdVariableStr, sourceId) + }, + Config: config + compartmentIdVariableStr + adbIdVariableStr + AutonomousDatabaseDedicatedResourceDependencies, + }, + //3. undelete adb + { + PreConfig: func() { + err := triggerUndelete() + if err != nil { + t.Fatalf("Unable to disable replicate standby backups. Error: %v", err) + } + + err = deleteUndeletedAdb() + if err != nil { + t.Fatalf("Unable to disable replicate standby backups. Error: %v", err) + } + }, + Config: config + compartmentIdVariableStr + adbIdVariableStr, + }, + }) +} + +func triggerUndelete() error { + err := triggerUndeleteAutonomousDatabase(acctest.GetTestClients(&schema.ResourceData{}), currentRegionString, compartmentId, sourceId) + if err != nil { + log.Printf("Unable to undelete database. Error: %v", err) + } + acctest.WaitTillCondition(acctest.TestAccProvider, &sourceId, adbWaitTillLifecycleStateAvailableCondition, 5*time.Minute, + getAdbFromSourceRegion, "database", true)() + return nil +} + +func deleteUndeletedAdb() error { + acctest.WaitTillCondition(acctest.TestAccProvider, &sourceId, adbWaitTillLifecycleStateAvailableCondition, 10*time.Minute, + getAdbFromSourceRegion, "database", true)() + + err := deleteAdbInRegion(acctest.GetTestClients(&schema.ResourceData{}), currentRegion, sourceId) + if err != nil { + log.Printf("[WARN] failed to delete undeleted ADB with the error %v", err) + return err + } + return nil +} diff --git a/internal/integrationtest/database_autonomous_database_software_image_test.go b/internal/integrationtest/database_autonomous_database_software_image_test.go index 8ff5a8170fe..54bd60e93f4 100644 --- a/internal/integrationtest/database_autonomous_database_software_image_test.go +++ b/internal/integrationtest/database_autonomous_database_software_image_test.go @@ -75,7 +75,7 @@ var ( "display_name": acctest.Representation{RepType: acctest.Required, Create: `image1` + randString}, "image_shape_family": acctest.Representation{RepType: acctest.Required, Create: `EXADATA_SHAPE`}, "source_cdb_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_container_database.test_autonomous_container_database.id}`}, - "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")}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, } @@ -84,7 +84,7 @@ var ( "display_name": acctest.Representation{RepType: acctest.Required, Create: `image1` + randString}, "image_shape_family": acctest.Representation{RepType: acctest.Required, Create: `EXACC_SHAPE`}, "source_cdb_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_container_database.test_autonomous_container_database.id}`}, - "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")}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, } @@ -265,7 +265,7 @@ func TestDatabaseExaccAutonomousDatabaseSoftwareImageResource_basic(t *testing.T }, // verify resource import { - Config: config + ExaccDatabaseAutonomousDatabaseSoftwareImageRequiredOnlyResource, + Config: config + compartmentIdVariableStr + ExaccDatabaseAutonomousDatabaseSoftwareImageRequiredOnlyResource, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ diff --git a/internal/integrationtest/database_autonomous_database_test.go b/internal/integrationtest/database_autonomous_database_test.go index d448a8db50a..879410c2be3 100644 --- a/internal/integrationtest/database_autonomous_database_test.go +++ b/internal/integrationtest/database_autonomous_database_test.go @@ -6,6 +6,7 @@ package integrationtest import ( "context" "fmt" + "os" "testing" "time" @@ -221,6 +222,14 @@ var ( "vault_id": acctest.Representation{RepType: acctest.Required, Update: kmsVaultId}, "autonomous_database_provider": acctest.Representation{RepType: acctest.Required, Update: `OCI`}, } + DatabaseAutonomousDatabaseEncryptionKeyGCPRepresentation = map[string]interface{}{ + "autonomous_database_provider": acctest.Representation{RepType: acctest.Required, Update: `GCP`}, + "key_name": acctest.Representation{RepType: acctest.Required, Create: `keyName`}, + "key_ring": acctest.Representation{RepType: acctest.Required, Update: `keyRing`}, + "location": acctest.Representation{RepType: acctest.Required, Update: `location`}, + "project": acctest.Representation{RepType: acctest.Required, Update: `project`}, + "kms_rest_endpoint": acctest.Representation{RepType: acctest.Optional, Update: `kmsRestEndpoint`}, + } DatabaseAutonomousDatabaseResourcePoolSummaryRepresentation = map[string]interface{}{ "is_disabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, "pool_size": acctest.Representation{RepType: acctest.Optional, Create: `128`, Update: `256`}, @@ -1829,6 +1838,76 @@ func TestDatabaseAutonomousDatabaseResource_basic(t *testing.T) { }) } +func TestDatabaseAutonomousDatabaseResourceEncryptionKey_basic(t *testing.T) { + shouldSkipADBStest := os.Getenv("TF_VAR_should_skip_adbs_test") + + if shouldSkipADBStest == "true" { + t.Skip("Skipping TestDatabaseAutonomousDatabaseResourceEncryptionKey_basic test.\n" + "Current TF_VAR_should_skip_adbs_test=" + shouldSkipADBStest) + } + + httpreplay.SetScenario("TestDatabaseAutonomousDatabaseResourceEncryptionKey_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_database_autonomous_database.test_autonomous_database_gcp_kms" + //datasourceName := "data.oci_database_autonomous_database_resource_pool_members.test_autonomous_database_resource_pool_members" + + var resId string + + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "Create with optionals" step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+DatabaseAutonomousDatabaseResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_gcp_kms", acctest.Optional, acctest.Create, acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseRepresentation, []string{"db_tools_details"})), "database", "autonomousDatabase", t) + + acctest.ResourceTest(t, testAccCheckDatabaseAutonomousDatabaseDestroy, []resource.TestStep{ + //0. Create ADB using default Oracle Managed key + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_gcp_kms", acctest.Required, acctest.Create, acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseRepresentation, []string{"db_tools_details"})), + 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_model", "OCPU"), + resource.TestCheckResourceAttr(resourceName, "db_name", adbName), + resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), + resource.TestCheckResourceAttr(resourceName, "encryption_key.#", "1"), + resource.TestCheckResourceAttr(resourceName, "encryption_key.0.autonomous_database_provider", "ORACLE_MANAGED"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + //1. Update ADB using GCP encryptionKey + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_gcp_kms", acctest.Required, acctest.Update, + acctest.RepresentationCopyWithRemovedProperties(acctest.RepresentationCopyWithNewProperties(DatabaseAutonomousDatabaseRepresentation, map[string]interface{}{ + "encryption_key": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseEncryptionKeyGCPRepresentation}, + }), []string{"admin_password", "db_tools_details"})), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "encryption_key.#", "1"), + resource.TestCheckResourceAttr(resourceName, "encryption_key.0.autonomous_database_provider", "GCP"), + resource.TestCheckResourceAttr(resourceName, "encryption_key.0.key_name", "keyName"), + resource.TestCheckResourceAttr(resourceName, "encryption_key.0.key_ring", "keyRing"), + resource.TestCheckResourceAttr(resourceName, "encryption_key.0.location", "location"), + resource.TestCheckResourceAttr(resourceName, "encryption_key.0.project", "project"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + fmt.Println(resId) + return err + }, + ), + }, + }) +} + func testAccCheckDatabaseAutonomousDatabaseDestroy(s *terraform.State) error { noResourceFound := true client := acctest.TestAccProvider.Meta().(*client.OracleClients).DatabaseClient() diff --git a/internal/integrationtest/database_autonomous_vm_cluster_resource_usage_test.go b/internal/integrationtest/database_autonomous_vm_cluster_resource_usage_test.go index c1f82e88921..e1347f13535 100644 --- a/internal/integrationtest/database_autonomous_vm_cluster_resource_usage_test.go +++ b/internal/integrationtest/database_autonomous_vm_cluster_resource_usage_test.go @@ -53,6 +53,7 @@ func TestDatabaseAutonomousVmClusterResourceUsageResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_storage_in_tbs"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "is_local_backup_enabled"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "memory_per_compute_unit_in_gbs"), resource.TestCheckResourceAttrSet(singularDatasourceName, "memory_per_oracle_compute_unit_in_gbs"), resource.TestCheckResourceAttrSet(singularDatasourceName, "memory_size_in_gbs"), resource.TestCheckResourceAttrSet(singularDatasourceName, "non_provisionable_autonomous_container_databases"), diff --git a/internal/integrationtest/database_autonomous_vm_cluster_test.go b/internal/integrationtest/database_autonomous_vm_cluster_test.go index 0ab666d8a26..a5ad28a18ea 100644 --- a/internal/integrationtest/database_autonomous_vm_cluster_test.go +++ b/internal/integrationtest/database_autonomous_vm_cluster_test.go @@ -66,6 +66,7 @@ var ( "memory_per_oracle_compute_unit_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `6`}, "time_zone": acctest.Representation{RepType: acctest.Optional, Create: `US/Pacific`}, "total_container_databases": acctest.Representation{RepType: acctest.Required, Create: `2`, Update: `2`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: DbaasIgnoreDefinedTagsRepresentation}, } DatabaseDevAutonomousVmClusterRepresentation = map[string]interface{}{ @@ -93,7 +94,7 @@ var ( DatabaseECPUAutonomousVmClusterRepresentation = acctest.RepresentationCopyWithNewProperties(DatabaseDevAutonomousVmClusterRepresentation, map[string]interface{}{ "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `ecpuAutonomousVmCluster`}, - "memory_per_oracle_compute_unit_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `6`}, + "memory_per_oracle_compute_unit_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `5`}, }) DatabaseOCPUAutonomousVmClusterRepresentation = acctest.RepresentationCopyWithNewProperties(DatabaseAutonomousVmClusterRepresentation, map[string]interface{}{ @@ -243,6 +244,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "maintenance_window_details.0.preference", "CUSTOM_PREFERENCE"), resource.TestCheckResourceAttr(resourceName, "maintenance_window_details.0.weeks_of_month.#", "1"), resource.TestCheckResourceAttr(resourceName, "memory_per_oracle_compute_unit_in_gbs", "6"), + resource.TestCheckResourceAttr(resourceName, "memory_per_compute_unit_in_gbs", "6"), resource.TestCheckResourceAttr(resourceName, "scan_listener_port_non_tls", "1600"), resource.TestCheckResourceAttr(resourceName, "scan_listener_port_tls", "3600"), resource.TestCheckResourceAttrSet(resourceName, "state"), @@ -293,6 +295,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "maintenance_window_details.0.preference", "CUSTOM_PREFERENCE"), resource.TestCheckResourceAttr(resourceName, "maintenance_window_details.0.weeks_of_month.#", "1"), resource.TestCheckResourceAttr(resourceName, "memory_per_oracle_compute_unit_in_gbs", "6"), + resource.TestCheckResourceAttr(resourceName, "memory_per_compute_unit_in_gbs", "6"), resource.TestCheckResourceAttr(resourceName, "scan_listener_port_non_tls", "1600"), resource.TestCheckResourceAttr(resourceName, "scan_listener_port_tls", "3600"), resource.TestCheckResourceAttrSet(resourceName, "state"), @@ -340,6 +343,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "scan_listener_port_non_tls", "1600"), resource.TestCheckResourceAttr(resourceName, "scan_listener_port_tls", "3600"), resource.TestCheckResourceAttr(resourceName, "memory_per_oracle_compute_unit_in_gbs", "6"), + resource.TestCheckResourceAttr(resourceName, "memory_per_compute_unit_in_gbs", "6"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttr(resourceName, "time_zone", "US/Pacific"), resource.TestCheckResourceAttr(resourceName, "total_container_databases", "2"), @@ -393,6 +397,8 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.license_model", "LICENSE_INCLUDED"), resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.maintenance_window.#", "1"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.max_acds_lowest_scaled_value"), + resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.memory_per_compute_unit_in_gbs"), + resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.memory_per_compute_unit_in_gbs", "6"), resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.memory_per_oracle_compute_unit_in_gbs", "6"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.memory_size_in_gbs"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.reclaimable_cpus"), @@ -444,6 +450,8 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "license_model", "LICENSE_INCLUDED"), resource.TestCheckResourceAttr(singularDatasourceName, "maintenance_window.#", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "max_acds_lowest_scaled_value"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "memory_per_compute_unit_in_gbs"), + resource.TestCheckResourceAttr(singularDatasourceName, "memory_per_compute_unit_in_gbs", "6"), resource.TestCheckResourceAttr(singularDatasourceName, "memory_per_oracle_compute_unit_in_gbs", "6"), resource.TestCheckResourceAttrSet(singularDatasourceName, "memory_size_in_gbs"), resource.TestCheckResourceAttrSet(singularDatasourceName, "reclaimable_cpus"), @@ -459,7 +467,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { }, // verify resource import { - Config: config + DatabaseAutonomousVmClusterRequiredOnlyResource, + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterRequiredOnlyResource, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -472,7 +480,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { func testAccCheckDatabaseAutonomousVmClusterDestroy(s *terraform.State) error { noResourceFound := true - client := acctest.TestAccProvider.Meta().(*client.OracleClients).DatabaseClient() + client := acctest.GetTestClients(&schema.ResourceData{}).DatabaseClient() for _, rs := range s.RootModule().Resources { if rs.Type == "oci_database_autonomous_vm_cluster" { noResourceFound = false diff --git a/internal/integrationtest/database_backup_destination_resource_test.go b/internal/integrationtest/database_backup_destination_resource_test.go index c1e7ad3cb34..95b3916c9d7 100644 --- a/internal/integrationtest/database_backup_destination_resource_test.go +++ b/internal/integrationtest/database_backup_destination_resource_test.go @@ -37,6 +37,7 @@ var ( "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, "mount_type_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: backupDestinationADBCCMountTypeDetailsRepresentation}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: DbaasIgnoreDefinedTagsRepresentation}, } backupDestinationADBCCNFSRepresentation = map[string]interface{}{ diff --git a/internal/integrationtest/database_backup_destination_test.go b/internal/integrationtest/database_backup_destination_test.go index ffb4cd779fe..cfc30256525 100644 --- a/internal/integrationtest/database_backup_destination_test.go +++ b/internal/integrationtest/database_backup_destination_test.go @@ -165,6 +165,8 @@ func TestDatabaseBackupDestinationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "backup_destinations.#", "1"), resource.TestCheckResourceAttr(datasourceName, "backup_destinations.0.associated_databases.#", "0"), + resource.TestCheckResourceAttrSet(datasourceName, "backup_destinations.0.associated_long_term_backup_count"), + resource.TestCheckResourceAttr(datasourceName, "backup_destinations.0.associated_long_term_backups.#", "0"), resource.TestCheckResourceAttr(datasourceName, "backup_destinations.0.compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "backup_destinations.0.connection_string", "connectionString2"), resource.TestCheckResourceAttr(datasourceName, "backup_destinations.0.display_name", "Recovery Appliance1"), @@ -184,8 +186,8 @@ func TestDatabaseBackupDestinationResource_basic(t *testing.T) { compartmentIdVariableStr + DatabaseBackupDestinationResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "backup_destination_id"), - resource.TestCheckResourceAttr(singularDatasourceName, "associated_databases.#", "0"), + resource.TestCheckResourceAttr(singularDatasourceName, "associated_long_term_backups.#", "0"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(singularDatasourceName, "connection_string", "connectionString2"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "Recovery Appliance1"), diff --git a/internal/integrationtest/database_cloud_autonomous_vm_cluster_resource_usage_test.go b/internal/integrationtest/database_cloud_autonomous_vm_cluster_resource_usage_test.go index 9709d56e835..cb48cc3bde1 100644 --- a/internal/integrationtest/database_cloud_autonomous_vm_cluster_resource_usage_test.go +++ b/internal/integrationtest/database_cloud_autonomous_vm_cluster_resource_usage_test.go @@ -20,11 +20,8 @@ var ( "cloud_autonomous_vm_cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id}`}, } - DatabaseCloudAutonomousVmClusterResourceUsageResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_database_cloud_autonomous_vm_cluster", "test_cloud_autonomous_vm_cluster", acctest.Required, acctest.Create, DatabaseCloudAutonomousVmClusterRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_database_cloud_exadata_infrastructure", "test_cloud_exadata_infrastructure", acctest.Required, acctest.Create, DatabaseCloudExadataInfrastructureRepresentation) + - AvailabilityDomainConfig + DatabaseCloudAutonomousVmClusterResourceUsageResourceConfig = DatabaseCloudAutonomousVmClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_cloud_autonomous_vm_cluster", "test_cloud_autonomous_vm_cluster", acctest.Required, acctest.Create, DatabaseCloudAutonomousVmClusterRepresentation) ) // issue-routing-tag: database/dbaas-atp-d @@ -51,7 +48,7 @@ func TestDatabaseCloudAutonomousVmClusterResourceUsageResource_basic(t *testing. resource.TestCheckResourceAttrSet(singularDatasourceName, "cloud_autonomous_vm_cluster_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "autonomous_data_storage_size_in_tbs"), - resource.TestCheckResourceAttr(singularDatasourceName, "autonomous_vm_resource_usage.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "autonomous_vm_resource_usage.#", "4"), resource.TestCheckResourceAttrSet(singularDatasourceName, "available_autonomous_data_storage_size_in_tbs"), resource.TestCheckResourceAttrSet(singularDatasourceName, "available_cpus"), resource.TestCheckResourceAttrSet(singularDatasourceName, "db_node_storage_size_in_gbs"), diff --git a/internal/integrationtest/database_cloud_autonomous_vm_cluster_test.go b/internal/integrationtest/database_cloud_autonomous_vm_cluster_test.go index a3752160597..77e00ca4a42 100644 --- a/internal/integrationtest/database_cloud_autonomous_vm_cluster_test.go +++ b/internal/integrationtest/database_cloud_autonomous_vm_cluster_test.go @@ -54,7 +54,7 @@ var ( "display_name": acctest.Representation{RepType: acctest.Required, Create: `CloudAutonomousVmCluster`, Update: `displayName2`}, "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.exadata_subnet.id}`}, "cluster_time_zone": acctest.Representation{RepType: acctest.Optional, Create: `Etc/UTC`}, - "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")}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `ECPU`}, "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, @@ -253,7 +253,6 @@ func TestDatabaseCloudAutonomousVmClusterResource_basic(t *testing.T) { { Config: config + compartmentIdVariableStr, }, - // verify Create with optionals { Config: config + compartmentIdVariableStr + DatabaseCloudAutonomousVmClusterResourceDependencies + @@ -484,7 +483,7 @@ func TestDatabaseCloudAutonomousVmClusterResource_basic(t *testing.T) { func testAccCheckDatabaseCloudAutonomousVmClusterDestroy(s *terraform.State) error { noResourceFound := true - client := acctest.TestAccProvider.Meta().(*client.OracleClients).DatabaseClient() + client := acctest.GetTestClients(&schema.ResourceData{}).DatabaseClient() for _, rs := range s.RootModule().Resources { if rs.Type == "oci_database_cloud_autonomous_vm_cluster" { noResourceFound = false diff --git a/internal/integrationtest/database_key_store_test.go b/internal/integrationtest/database_key_store_test.go index 069c7d530aa..61b75d15804 100644 --- a/internal/integrationtest/database_key_store_test.go +++ b/internal/integrationtest/database_key_store_test.go @@ -206,6 +206,9 @@ func TestDatabaseKeyStoreResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "key_stores.#", "1"), resource.TestCheckResourceAttr(datasourceName, "key_stores.0.associated_databases.#", "0"), + resource.TestCheckResourceAttrSet(datasourceName, "key_stores.0.associated_long_term_backup_count"), + resource.TestCheckResourceAttr(datasourceName, "key_stores.0.associated_long_term_backups.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "key_stores.0.compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "key_stores.0.display_name", "Key Store1"), resource.TestCheckResourceAttr(datasourceName, "key_stores.0.freeform_tags.%", "1"), @@ -227,8 +230,9 @@ func TestDatabaseKeyStoreResource_basic(t *testing.T) { compartmentIdVariableStr + DatabaseKeyStoreResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "key_store_id"), - resource.TestCheckResourceAttr(singularDatasourceName, "associated_databases.#", "0"), + resource.TestCheckResourceAttr(singularDatasourceName, "associated_long_term_backups.#", "0"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "associated_long_term_backup_count"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "Key Store1"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), @@ -254,7 +258,7 @@ func TestDatabaseKeyStoreResource_basic(t *testing.T) { func testAccCheckDatabaseKeyStoreDestroy(s *terraform.State) error { noResourceFound := true - client := acctest.TestAccProvider.Meta().(*client.OracleClients).DatabaseClient() + client := acctest.GetTestClients(&schema.ResourceData{}).DatabaseClient() for _, rs := range s.RootModule().Resources { if rs.Type == "oci_database_key_store" { noResourceFound = false diff --git a/internal/integrationtest/fleet_software_update_fsu_collection_test.go b/internal/integrationtest/fleet_software_update_fsu_collection_test.go index 592c239b38b..41a9d4908ae 100644 --- a/internal/integrationtest/fleet_software_update_fsu_collection_test.go +++ b/internal/integrationtest/fleet_software_update_fsu_collection_test.go @@ -31,6 +31,9 @@ var ( FleetSoftwareUpdateFsuCollectionGIRequiredOnlyResource = FleetSoftwareUpdateFsuCollectionResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Required, acctest.Create, FsuCollection_GI19_Representation) + FleetSoftwareUpdateFsuCollectionGUEST_OSRequiredOnlyResource = FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Required, acctest.Create, FsuCollection_GUEST_OS_Representation) + FsuCollection_DB19_ResourceConfig = FleetSoftwareUpdateFsuCollectionResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Update, FsuCollection_DB19_Representation) @@ -40,6 +43,9 @@ var ( FsuCollection_GI19_ResourceConfig = FleetSoftwareUpdateFsuCollectionResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Update, FsuCollection_GI19_Representation) + FsuCollection_GUEST_OS_ResourceConfig = FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Update, FsuCollection_GUEST_OS_Representation) + FsuCollection_GI23_ResourceConfig = FleetSoftwareUpdateFsuCollectionResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Update, FsuCollection_GI23_Representation) @@ -61,6 +67,13 @@ var ( "type": acctest.Representation{RepType: acctest.Optional, Create: `GI`}, "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: FleetSoftwareUpdateFsuCollectionDataSourceFilterRepresentation}} + FleetSoftwareUpdateFsuCollectionGUEST_OSDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `TF_TEST_Collection`, Update: `TF_TEST_Collection_Updated`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "type": acctest.Representation{RepType: acctest.Optional, Create: `GUEST_OS`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: FleetSoftwareUpdateFsuCollectionDataSourceFilterRepresentation}} + FleetSoftwareUpdateFsuCollectionDataSourceFilterRepresentation = map[string]interface{}{ "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_fleet_software_update_fsu_collection.test_fsu_collection.id}`}}, @@ -91,6 +104,16 @@ var ( "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreFsuCollectionDefinedTagsChangesRepresentation}, } + FsuCollection_GUEST_OS_Representation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "service_type": acctest.Representation{RepType: acctest.Required, Create: `EXACS`}, + "source_major_version": acctest.Representation{RepType: acctest.Required, Create: `EXA_OL_8`}, + "type": acctest.Representation{RepType: acctest.Required, Create: `GUEST_OS`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `TF_TEST_Collection`, Update: `TF_TEST_Collection_Updated`}, + "fleet_discovery": acctest.RepresentationGroup{RepType: acctest.Required, Group: fsuCollectionFleetDiscoveryGIRepresentation}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreFsuCollectionDefinedTagsChangesRepresentation}, + } + // https://docs.oracle.com/en-us/iaas/api/#/en/edsfu/20220528/datatypes/CreateGiFsuCollectionDetails FsuCollection_GI19_Representation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, @@ -112,6 +135,55 @@ var ( "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreFsuCollectionDefinedTagsChangesRepresentation}, } + FleetSoftwareUpdateFsuCollectionComponentsRepresentation = map[string]interface{}{ + "component_type": acctest.Representation{RepType: acctest.Required, Create: `GI`}, + "source_major_version": acctest.Representation{RepType: acctest.Required, Create: `EXA_OL_5`}, + "fleet_discovery": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FleetSoftwareUpdateFsuCollectionComponentsFleetDiscoveryRepresentation}, + "type": acctest.Representation{RepType: acctest.Required, Create: `DB`}, + "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")}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + } + + FleetSoftwareUpdateFsuCollectionComponentsFleetDiscoveryRepresentation = map[string]interface{}{ + "strategy": acctest.Representation{RepType: acctest.Required, Create: `SEARCH_QUERY`}, + "filters": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FleetSoftwareUpdateFsuCollectionComponentsFleetDiscoveryFiltersRepresentation}, + "fsu_discovery_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_fleet_software_update_fsu_discovery.test_fsu_discovery.id}`}, + "query": acctest.Representation{RepType: acctest.Optional, Create: `query`}, + "targets": acctest.Representation{RepType: acctest.Optional, Create: []string{`targets`}}, + } + FleetSoftwareUpdateFsuCollectionFleetDiscoveryFiltersRepresentation = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `COMPARTMENT_ID`}, + "entity_type": acctest.Representation{RepType: acctest.Optional, Create: `EXADATAINFRASTRUCTURE`}, + "exadata_releases": acctest.Representation{RepType: acctest.Optional, Create: []string{`exadataReleases`}}, + "identifiers": acctest.Representation{RepType: acctest.Optional, Create: []string{`identifiers`}}, + "mode": acctest.Representation{RepType: acctest.Optional, Create: `INCLUDE`}, + "names": acctest.Representation{RepType: acctest.Optional, Create: []string{`names`}}, + "operator": acctest.Representation{RepType: acctest.Optional, Create: `AND`}, + "tags": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FleetSoftwareUpdateFsuCollectionFleetDiscoveryFiltersTagsRepresentation}, + "versions": acctest.Representation{RepType: acctest.Optional, Create: []string{`versions`}}, + } + FleetSoftwareUpdateFsuCollectionComponentsFleetDiscoveryFiltersRepresentation = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `COMPARTMENT_ID`}, + "entity_type": acctest.Representation{RepType: acctest.Optional, Create: `EXADATAINFRASTRUCTURE`}, + "exadata_releases": acctest.Representation{RepType: acctest.Optional, Create: []string{`exadataReleases`}}, + "identifiers": acctest.Representation{RepType: acctest.Optional, Create: []string{`identifiers`}}, + "mode": acctest.Representation{RepType: acctest.Optional, Create: `INCLUDE`}, + "operator": acctest.Representation{RepType: acctest.Optional, Create: `AND`}, + "tags": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FleetSoftwareUpdateFsuCollectionComponentsFleetDiscoveryFiltersTagsRepresentation}, + "versions": acctest.Representation{RepType: acctest.Optional, Create: []string{`versions`}}, + } + FleetSoftwareUpdateFsuCollectionFleetDiscoveryFiltersTagsRepresentation = map[string]interface{}{ + "key": acctest.Representation{RepType: acctest.Optional, Create: `key`}, + "namespace": acctest.Representation{RepType: acctest.Optional, Create: `namespace`}, + "value": acctest.Representation{RepType: acctest.Optional, Create: `value`}, + } + FleetSoftwareUpdateFsuCollectionComponentsFleetDiscoveryFiltersTagsRepresentation = map[string]interface{}{ + "key": acctest.Representation{RepType: acctest.Optional, Create: `key`}, + "namespace": acctest.Representation{RepType: acctest.Optional, Create: `namespace`}, + "value": acctest.Representation{RepType: acctest.Optional, Create: `value`}, + } + // https://docs.oracle.com/en-us/iaas/api/#/en/edsfu/20220528/datatypes/DbFleetDiscoveryDetails fsuCollectionFleetDiscoveryDBRepresentation = map[string]interface{}{ "strategy": acctest.Representation{RepType: acctest.Required, Create: `TARGET_LIST`}, @@ -306,6 +378,183 @@ func TestFleetSoftwareUpdateFsuCollectionResource_DB_19(t *testing.T) { }) } +// TERSI-3985 +func TestFleetSoftwareUpdateFsuCollectionResource_GUEST_OS(t *testing.T) { + httpreplay.SetScenario("TestFleetSoftwareUpdateFsuCollectionGIResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + //compartment_id + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + compartmentIdU := utils.GetEnvSettingWithDefault("compartment_id_for_update", compartmentId) + compartmentIdUVariableStr := fmt.Sprintf("variable \"compartment_id_for_update\" { default = \"%s\" }\n", compartmentIdU) + + giTargetId1 := utils.GetEnvSettingWithBlankDefault("fsu_gi_19_target_1") + giTargetId1VariableStr := fmt.Sprintf("variable \"gi_target_1\" { default = \"%s\" }\n", giTargetId1) + + var variablesStr = compartmentIdVariableStr + giTargetId1VariableStr + + resourceName := "oci_fleet_software_update_fsu_collection.test_fsu_collection" + datasourceName := "data.oci_fleet_software_update_fsu_collections.test_fsu_collections" + singularDatasourceName := "data.oci_fleet_software_update_fsu_collection.test_fsu_collection" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + var testConfig = config + variablesStr + FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", + acctest.Optional, acctest.Create, FsuCollection_GUEST_OS_Representation) + acctest.SaveConfigContent(testConfig, "fleetsoftwareupdate", "fsuCollection", t) + fmt.Printf("FSU_TEST_LOG CONF:\n%s\n", testConfig) + + acctest.ResourceTest(t, testAccCheckFleetSoftwareUpdateFsuCollectionDestroy, []resource.TestStep{ + // verify Create + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", + acctest.Required, acctest.Create, FsuCollection_GUEST_OS_Representation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "service_type", "EXACS"), + resource.TestCheckResourceAttr(resourceName, "source_major_version", "EXA_OL_8"), + resource.TestCheckResourceAttr(resourceName, "type", "GUEST_OS"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCollectionResourceDependencies, + }, + // verify Create with optionals + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Create, FsuCollection_GUEST_OS_Representation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "TF_TEST_Collection"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "service_type", "EXACS"), + resource.TestCheckResourceAttr(resourceName, "source_major_version", "EXA_OL_8"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "type", "GUEST_OS"), + + 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 + }, + ), + }, + + // verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + variablesStr + compartmentIdUVariableStr + FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(FsuCollection_GUEST_OS_Representation, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "display_name", "TF_TEST_Collection"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "service_type", "EXACS"), + resource.TestCheckResourceAttr(resourceName, "source_major_version", "EXA_OL_8"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "type", "GUEST_OS"), + + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Update, FsuCollection_GUEST_OS_Representation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "TF_TEST_Collection_Updated"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "service_type", "EXACS"), + resource.TestCheckResourceAttr(resourceName, "source_major_version", "EXA_OL_8"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "type", "GUEST_OS"), + + 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 + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_fleet_software_update_fsu_collections", "test_fsu_collections", acctest.Optional, acctest.Update, FleetSoftwareUpdateFsuCollectionGUEST_OSDataSourceRepresentation) + + variablesStr + FleetSoftwareUpdateFsuCollectionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Optional, acctest.Update, FsuCollection_GUEST_OS_Representation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "display_name", "TF_TEST_Collection_Updated"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + resource.TestCheckResourceAttr(datasourceName, "type", "GUEST_OS"), + resource.TestCheckResourceAttr(datasourceName, "fsu_collection_summary_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "fsu_collection_summary_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Required, acctest.Create, FleetSoftwareUpdateFsuCollectionSingularDataSourceRepresentation) + + variablesStr + FsuCollection_GUEST_OS_ResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "fsu_collection_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "active_fsu_cycle.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "TF_TEST_Collection_Updated"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "service_type", "EXACS"), + resource.TestCheckResourceAttr(singularDatasourceName, "source_major_version", "EXA_OL_8"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "target_count"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + resource.TestCheckResourceAttr(singularDatasourceName, "type", "GUEST_OS"), + ), + }, + // verify resource import + { + Config: config + FleetSoftwareUpdateFsuCollectionGUEST_OSRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + func TestFleetSoftwareUpdateFsuCollectionResource_GI_19(t *testing.T) { httpreplay.SetScenario("TestFleetSoftwareUpdateFsuCollectionGIResource_basic") defer httpreplay.SaveScenario() diff --git a/internal/integrationtest/fleet_software_update_fsu_cycle_test.go b/internal/integrationtest/fleet_software_update_fsu_cycle_test.go index 1b5090d17ee..4855436bfab 100644 --- a/internal/integrationtest/fleet_software_update_fsu_cycle_test.go +++ b/internal/integrationtest/fleet_software_update_fsu_cycle_test.go @@ -37,6 +37,9 @@ var db_19_max_ver = "19.25.0.0.0" var db_23_min_ver = "23.3.0.0.0" var db_23_max_ver = "23.6.0.0.0" +var system_version_23_1_26_min_ver = "23.1.26.0.0.250516" +var system_version_24_1_12_min_ver = "24.1.12.0.0.250517" + var ( Patch_FsuCycleRequiredOnlyResource_DB_VersionType = FleetSoftwareUpdateFsuCycleDBResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Required, acctest.Create, Patch_FsuCycleRepresentation_DB_VersionType) @@ -57,6 +60,10 @@ var ( acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Required, acctest.Create, Patch_FsuCycleRepresentation_GI_ImageType) Patch_FsuCycleResourceConfig_GI_ImageType = FleetSoftwareUpdateFsuCycleGIResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Optional, acctest.Update, Patch_FsuCycleRepresentation_GI_ImageType) + Patch_FsuCycleRequiredOnlyResource_GUEST_OS_VersionType = FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Required, acctest.Create, Patch_FsuCycleRepresentation_GUEST_OS_VersionType) + Patch_FsuCycleResourceConfig_GUEST_OS_VersionType = FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Optional, acctest.Update, Patch_FsuCycleRepresentation_GUEST_OS_VersionType) FleetSoftwareUpdateFsuCycleSingularDataSourceRepresentation = map[string]interface{}{ "fsu_cycle_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_fleet_software_update_fsu_cycle.test_fsu_cycle.id}`}, @@ -82,6 +89,16 @@ var ( "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: FleetSoftwareUpdateFsuCycleDataSourceFilterRepresentation}, } + FleetSoftwareUpdateFsuCycle_GUEST_OS_DataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "collection_type": acctest.Representation{RepType: acctest.Optional, Create: `GUEST_OS`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `TF_TEST_Cycle`, Update: `TF_TEST_Cycle_Updated`}, + "fsu_collection_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_fleet_software_update_fsu_collection.test_fsu_collection.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "target_version": acctest.Representation{RepType: acctest.Optional, Create: `targetVersion`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: FleetSoftwareUpdateFsuCycleDataSourceFilterRepresentation}, + } + FleetSoftwareUpdateFsuCycleDataSourceFilterRepresentation = map[string]interface{}{ "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_fleet_software_update_fsu_cycle.test_fsu_cycle.id}`}}, @@ -160,6 +177,25 @@ var ( // UDX-22040-OPT-IN "diagnostics_collection": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DataCollectionModesRepresentation}, } + Patch_FsuCycleRepresentation_GUEST_OS_VersionType = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "fsu_collection_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_fleet_software_update_fsu_collection.test_fsu_collection.id}`}, + "goal_version_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: Patch_FsuCycleGoalVersionDetailsRepresentation_GUEST_OS_VersionType}, + "type": acctest.Representation{RepType: acctest.Required, Create: `PATCH`}, + "batching_strategy": acctest.RepresentationGroup{RepType: acctest.Optional, Group: Patch_BatchingStrategyRepresentation}, + "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")}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `TF_TEST_Cycle`, Update: `TF_TEST_Cycle_Updated`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + "is_keep_placement": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "max_drain_timeout_in_seconds": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreFsuCycleDefinedTagsChangesRepresentation}, + // UDX-22040-OPT-IN + "diagnostics_collection": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DataCollectionModesRepresentation}, + } + FleetSoftwareUpdateFsuCycleGoalVersionDetailsRepresentation = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `VERSION`, Update: `IMAGE_ID`}, + "components": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FleetSoftwareUpdateFsuCycleGoalVersionDetailsComponentsRepresentation}, + } Patch_FsuCycleGoalVersionDetailsRepresentation_DB_VersionType = map[string]interface{}{ "type": acctest.Representation{RepType: acctest.Required, Create: `VERSION`, Update: `VERSION`}, @@ -195,6 +231,12 @@ var ( "software_image_id": acctest.Representation{RepType: acctest.Required, Create: `${var.db_grid_software_image_1}`}, } + Patch_FsuCycleGoalVersionDetailsRepresentation_GUEST_OS_VersionType = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `VERSION`, Update: `VERSION`}, + "version": acctest.Representation{RepType: acctest.Required, Create: system_version_23_1_26_min_ver, Update: system_version_24_1_12_min_ver}, + "new_home_prefix": acctest.Representation{RepType: acctest.Optional, Create: nil, Update: nil}, + } + Patch_BatchingStrategyRepresentation = map[string]interface{}{ "type": acctest.Representation{RepType: acctest.Required, Create: `SEQUENTIAL`, Update: `FIFTY_FIFTY`}, "is_force_rolling": acctest.Representation{RepType: acctest.Required, Create: `true`, Update: `true`}, @@ -222,9 +264,23 @@ var ( "log_collection_mode": acctest.Representation{RepType: acctest.Optional, Create: `ENABLE`, Update: `NO_CHANGE`}, } FleetSoftwareUpdateFsuCycleUpgradeDetailsRepresentation = map[string]interface{}{ - "collection_type": acctest.Representation{RepType: acctest.Required, Create: `DB`, Update: `GI`}, - "is_recompile_invalid_objects": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, - "is_time_zone_upgrade": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "collection_type": acctest.Representation{RepType: acctest.Required, Create: `DB`, Update: `GI`}, + "is_ignore_post_upgrade_errors": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "is_ignore_prerequisites": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "is_recompile_invalid_objects": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "is_time_zone_upgrade": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "max_drain_timeout_in_seconds": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, + } + FleetSoftwareUpdateFsuCycleGoalVersionDetailsComponentsRepresentation = map[string]interface{}{ + "component_type": acctest.Representation{RepType: acctest.Required, Create: `GI`, Update: `GUEST_OS`}, + "goal_version_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: FleetSoftwareUpdateFsuCycleGoalVersionDetailsComponentsGoalVersionDetailsRepresentation}, + "home_policy": acctest.Representation{RepType: acctest.Optional, Create: `CREATE_NEW`, Update: `USE_EXISTING`}, + "new_home_prefix": acctest.Representation{RepType: acctest.Optional, Create: `newHomePrefix`, Update: `newHomePrefix2`}, + } + FleetSoftwareUpdateFsuCycleGoalVersionDetailsComponentsGoalVersionDetailsRepresentation = map[string]interface{}{ + "goal_software_image_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_image.test_image.id}`}, + "goal_type": acctest.Representation{RepType: acctest.Required, Create: `GUEST_OS_ORACLE_IMAGE`}, + "goal_version": acctest.Representation{RepType: acctest.Optional, Create: `goalVersion`, Update: `goalVersion2`}, } FleetSoftwareUpdateFsuCycleDBResourceDependencies = utils.OciImageIdsVariable + @@ -234,6 +290,9 @@ var ( FleetSoftwareUpdateFsuCycleGIResourceDependencies = utils.OciImageIdsVariable + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Required, acctest.Create, FsuCollection_GI19_Representation) + DefinedTagsDependencies + + FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_collection", "test_fsu_collection", acctest.Required, acctest.Create, FsuCollection_GUEST_OS_Representation) + + DefinedTagsDependencies ) // issue-routing-tag: fleet_software_update/default @@ -924,6 +983,216 @@ func Test_Patch_FsuCycleResource_GI_ImageIdDetails(t *testing.T) { }) } +func Test_Patch_FsuCycleResource_GUEST_OS_VersionDetails(t *testing.T) { + httpreplay.SetScenario("TestFleetSoftwareUpdateFsuCycleResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + compartmentIdU := utils.GetEnvSettingWithDefault("compartment_id_for_update", compartmentId) + compartmentIdUVariableStr := fmt.Sprintf("variable \"compartment_id_for_update\" { default = \"%s\" }\n", compartmentIdU) + + giTargetId1 := utils.GetEnvSettingWithBlankDefault("fsu_guestos_exaol8_target_1") + giTargetId1VariableStr := fmt.Sprintf("variable \"gi_target_1\" { default = \"%s\" }\n", giTargetId1) + + var variablesStr = compartmentIdVariableStr + giTargetId1VariableStr + + resourceName := "oci_fleet_software_update_fsu_cycle.test_fsu_cycle" + datasourceName := "data.oci_fleet_software_update_fsu_cycles.test_fsu_cycles" + singularDatasourceName := "data.oci_fleet_software_update_fsu_cycle.test_fsu_cycle" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+variablesStr+FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Optional, acctest.Create, Patch_FsuCycleRepresentation_GUEST_OS_VersionType), "fleetsoftwareupdate", "fsuCycle", t) + + acctest.ResourceTest(t, testAccCheckFleetSoftwareUpdateFsuCycleDestroy, []resource.TestStep{ + // verify Create + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Required, acctest.Create, Patch_FsuCycleRepresentation_GUEST_OS_VersionType), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "fsu_collection_id"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.type", "VERSION"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.version", system_version_23_1_26_min_ver), + resource.TestCheckResourceAttr(resourceName, "type", "PATCH"), + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies, + }, + // verify Create with optionals + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Optional, acctest.Create, Patch_FsuCycleRepresentation_GUEST_OS_VersionType), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "batching_strategy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "batching_strategy.0.is_force_rolling", "true"), + resource.TestCheckResourceAttr(resourceName, "batching_strategy.0.type", "SEQUENTIAL"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "TF_TEST_Cycle"), + resource.TestCheckResourceAttrSet(resourceName, "fsu_collection_id"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.type", "VERSION"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.version", system_version_23_1_26_min_ver), + resource.TestCheckResourceAttr(resourceName, "is_keep_placement", "false"), + resource.TestCheckResourceAttr(resourceName, "max_drain_timeout_in_seconds", "10"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "type", "PATCH"), + // UDX-22040-OPT-IN + resource.TestCheckResourceAttr(resourceName, "diagnostics_collection.#", "1"), + resource.TestCheckResourceAttr(resourceName, "diagnostics_collection.0.log_collection_mode", "ENABLE"), + + 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 + }, + ), + }, + + // verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + variablesStr + compartmentIdUVariableStr + FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(Patch_FsuCycleRepresentation_GUEST_OS_VersionType, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "batching_strategy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "batching_strategy.0.is_force_rolling", "true"), + resource.TestCheckResourceAttr(resourceName, "batching_strategy.0.type", "SEQUENTIAL"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "display_name", "TF_TEST_Cycle"), + resource.TestCheckResourceAttrSet(resourceName, "fsu_collection_id"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.type", "VERSION"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.version", system_version_23_1_26_min_ver), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_keep_placement", "false"), + resource.TestCheckResourceAttr(resourceName, "max_drain_timeout_in_seconds", "10"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "type", "PATCH"), + // UDX-22040-OPT-IN + resource.TestCheckResourceAttr(resourceName, "diagnostics_collection.#", "1"), + resource.TestCheckResourceAttr(resourceName, "diagnostics_collection.0.log_collection_mode", "ENABLE"), + + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + variablesStr + FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Optional, acctest.Update, Patch_FsuCycleRepresentation_GUEST_OS_VersionType), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "batching_strategy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "batching_strategy.0.is_force_rolling", "true"), + resource.TestCheckResourceAttr(resourceName, "batching_strategy.0.is_wait_for_batch_resume", "false"), + resource.TestCheckResourceAttr(resourceName, "batching_strategy.0.type", "FIFTY_FIFTY"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "TF_TEST_Cycle_Updated"), + resource.TestCheckResourceAttrSet(resourceName, "fsu_collection_id"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.type", "VERSION"), + resource.TestCheckResourceAttr(resourceName, "goal_version_details.0.version", system_version_24_1_12_min_ver), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_keep_placement", "true"), + resource.TestCheckResourceAttr(resourceName, "max_drain_timeout_in_seconds", "11"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "type", "PATCH"), + // UDX-22040-OPT-IN + resource.TestCheckResourceAttr(resourceName, "diagnostics_collection.#", "1"), + resource.TestCheckResourceAttr(resourceName, "diagnostics_collection.0.log_collection_mode", "NO_CHANGE"), + + 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 + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_fleet_software_update_fsu_cycles", "test_fsu_cycles", acctest.Optional, acctest.Update, FleetSoftwareUpdateFsuCycle_GUEST_OS_DataSourceRepresentation) + + variablesStr + FleetSoftwareUpdateFsuCycleGuestOsResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Optional, acctest.Update, Patch_FsuCycleRepresentation_GUEST_OS_VersionType), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "collection_type", "GUEST_OS"), + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "display_name", "TF_TEST_Cycle_Updated"), + resource.TestCheckResourceAttrSet(datasourceName, "fsu_collection_id"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + resource.TestCheckResourceAttr(datasourceName, "target_version", "targetVersion"), + resource.TestCheckResourceAttr(datasourceName, "fsu_cycle_summary_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "fsu_cycle_summary_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_fleet_software_update_fsu_cycle", "test_fsu_cycle", acctest.Required, acctest.Create, FleetSoftwareUpdateFsuCycleSingularDataSourceRepresentation) + + variablesStr + Patch_FsuCycleResourceConfig_GUEST_OS_VersionType, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "fsu_cycle_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "batching_strategy.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "batching_strategy.0.is_force_rolling", "true"), + resource.TestCheckResourceAttr(singularDatasourceName, "batching_strategy.0.is_wait_for_batch_resume", "false"), + resource.TestCheckResourceAttr(singularDatasourceName, "batching_strategy.0.type", "FIFTY_FIFTY"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "collection_type"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "TF_TEST_Cycle_Updated"), + resource.TestCheckResourceAttr(singularDatasourceName, "goal_version_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "goal_version_details.0.type", "VERSION"), + resource.TestCheckResourceAttr(singularDatasourceName, "goal_version_details.0.version", system_version_24_1_12_min_ver), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "is_keep_placement", "true"), + resource.TestCheckResourceAttr(singularDatasourceName, "max_drain_timeout_in_seconds", "11"), + resource.TestCheckResourceAttr(singularDatasourceName, "next_action_to_execute.#", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + resource.TestCheckResourceAttr(singularDatasourceName, "type", "PATCH"), + ), + }, + // verify resource import + { + Config: config + Patch_FsuCycleRequiredOnlyResource_GUEST_OS_VersionType, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"identity_domain", "defined_tags", "system_tags", "freeform_tags"}, + ResourceName: resourceName, + }, + }) +} + // UDX-22532-23AI-UPGRADE func Test_Upgrade_FsuCycleResource_DB_VersionDetails(t *testing.T) { httpreplay.SetScenario("TestFleetSoftwareUpdateFsuCycleResource_basic") diff --git a/internal/integrationtest/functions_function_test.go b/internal/integrationtest/functions_function_test.go index d295a76b95c..6bedf097428 100644 --- a/internal/integrationtest/functions_function_test.go +++ b/internal/integrationtest/functions_function_test.go @@ -58,19 +58,28 @@ var ( } FunctionsFunctionRepresentation = map[string]interface{}{ - "application_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_functions_application.test_application.id}`}, - "display_name": acctest.Representation{RepType: acctest.Required, Create: `ExampleFunction`}, - "memory_in_mbs": acctest.Representation{RepType: acctest.Required, Create: `128`, Update: `256`}, - "config": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"MY_FUNCTION_CONFIG": "ConfVal"}}, - "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{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "image": acctest.Representation{RepType: acctest.Required, Create: `${var.image}`, Update: `${var.image_for_update}`}, - "image_digest": acctest.Representation{RepType: acctest.Optional, Create: `${var.image_digest}`, Update: `${var.image_digest_for_update}`}, - "provisioned_concurrency_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FunctionsFunctionProvisionedConcurrencyConfigRepresentation}, - "source_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: FunctionsFunctionSourceDetailsRepresentation}, - "timeout_in_seconds": acctest.Representation{RepType: acctest.Optional, Create: `30`, Update: `31`}, - "trace_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FunctionsFunctionTraceConfigRepresentation}, - //"lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: fnDefinedTagsIgnoreRepresentation}, + "application_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_functions_application.test_application.id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `ExampleFunction`}, + "memory_in_mbs": acctest.Representation{RepType: acctest.Required, Create: `256`, Update: `512`}, + "config": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"MY_FUNCTION_CONFIG": "ConfVal"}}, + "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")}`}, + "detached_mode_timeout_in_seconds": acctest.Representation{RepType: acctest.Optional, Create: `301`, Update: `302`}, + "failure_destination": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FunctionsFunctionFailureDestinationRepresentation}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "image": acctest.Representation{RepType: acctest.Required, Create: `${var.image}`, Update: `${var.image_for_update}`}, + "image_digest": acctest.Representation{RepType: acctest.Optional, Create: `${var.image_digest}`, Update: `${var.image_digest_for_update}`}, + "provisioned_concurrency_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FunctionsFunctionProvisionedConcurrencyConfigRepresentation}, + "source_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: FunctionsFunctionSourceDetailsRepresentation}, + "success_destination": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FunctionsFunctionSuccessDestinationRepresentation}, + "timeout_in_seconds": acctest.Representation{RepType: acctest.Optional, Create: `30`, Update: `31`}, + "trace_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: FunctionsFunctionTraceConfigRepresentation}, + } + + FunctionsFunctionFailureDestinationRepresentation = map[string]interface{}{ + "kind": acctest.Representation{RepType: acctest.Required, Create: `QUEUE`, Update: `STREAM`}, + "channel_id": acctest.Representation{RepType: acctest.Optional, Create: `failure123`, Update: ``}, + "queue_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_queue_queue.test_queue.id}`, Update: ``}, + "stream_id": acctest.Representation{RepType: acctest.Optional, Create: ``, Update: `${oci_streaming_stream.test_stream.id}`}, } FunctionsFunctionImageSourceRepresentation = acctest.GetRepresentationCopyWithMultipleRemovedProperties([]string{"source_details"}, FunctionsFunctionRepresentation) @@ -89,17 +98,23 @@ var ( "pbf_listing_id": acctest.Representation{RepType: acctest.Required, Create: `${var.pbf_listing_id}`}, "source_type": acctest.Representation{RepType: acctest.Required, Create: `PRE_BUILT_FUNCTIONS`}, } + FunctionsFunctionSuccessDestinationRepresentation = map[string]interface{}{ + "kind": acctest.Representation{RepType: acctest.Required, Create: `QUEUE`, Update: `STREAM`}, + "channel_id": acctest.Representation{RepType: acctest.Optional, Create: `success123`, Update: ``}, + "queue_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_queue_queue.test_queue.id}`, Update: ``}, + "stream_id": acctest.Representation{RepType: acctest.Optional, Create: ``, Update: `${oci_streaming_stream.test_stream.id}`}, + } FunctionsFunctionTraceConfigRepresentation = map[string]interface{}{ "is_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, } - functionApplicationDisplayName = utils.RandomString(1, utils.CharsetWithoutDigits) + utils.RandomString(13, utils.Charset) - FunctionsFunctionResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_functions_application", "test_application", acctest.Required, acctest.Create, FunctionsApplicationRepresentation) + DefinedTagsDependencies + - KeyResourceDependencyConfig + KeyResourceDependencyConfig + + acctest.GenerateResourceFromRepresentationMap("oci_queue_queue", "test_queue", acctest.Required, acctest.Create, QueueQueueRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_streaming_stream", "test_stream", acctest.Required, acctest.Create, StreamingStreamRepresentation) ) // issue-routing-tag: functions/default @@ -152,7 +167,7 @@ func TestFunctionsFunctionResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "application_id"), resource.TestCheckResourceAttr(resourceName, "display_name", pbfFunctionDisplayName), resource.TestCheckResourceAttr(resourceName, "source_details.0.pbf_listing_id", pbfListingId), - resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "128"), + resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "256"), resource.TestCheckResourceAttr(resourceName, "config.%", "1"), func(s *terraform.State) (err error) { @@ -176,7 +191,7 @@ func TestFunctionsFunctionResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "source_details.0.pbf_listing_id", pbfListingId), - resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "128"), + resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "256"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.0.count", "40"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.0.strategy", "CONSTANT"), @@ -210,7 +225,7 @@ func TestFunctionsFunctionResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "application_id"), resource.TestCheckResourceAttr(resourceName, "display_name", "ExampleFunction"), resource.TestCheckResourceAttr(resourceName, "image", image), - resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "128"), + resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "256"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -229,15 +244,24 @@ func TestFunctionsFunctionResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(resourceName, "application_id"), resource.TestCheckResourceAttr(resourceName, "config.%", "1"), + resource.TestCheckResourceAttr(resourceName, "detached_mode_timeout_in_seconds", "301"), resource.TestCheckResourceAttr(resourceName, "display_name", "ExampleFunction"), + resource.TestCheckResourceAttr(resourceName, "failure_destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "failure_destination.0.kind", "QUEUE"), + resource.TestCheckResourceAttrSet(resourceName, "failure_destination.0.queue_id"), + resource.TestCheckResourceAttr(resourceName, "failure_destination.0.channel_id", "failure123"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "image", image), resource.TestCheckResourceAttr(resourceName, "image_digest", imageDigest), - resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "128"), + resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "256"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.0.count", "40"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.0.strategy", "CONSTANT"), + resource.TestCheckResourceAttr(resourceName, "success_destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "success_destination.0.kind", "QUEUE"), + resource.TestCheckResourceAttrSet(resourceName, "success_destination.0.queue_id"), + resource.TestCheckResourceAttr(resourceName, "success_destination.0.channel_id", "success123"), resource.TestCheckResourceAttr(resourceName, "timeout_in_seconds", "30"), resource.TestCheckResourceAttr(resourceName, "trace_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "trace_config.0.is_enabled", "false"), @@ -262,15 +286,22 @@ func TestFunctionsFunctionResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(resourceName, "application_id"), resource.TestCheckResourceAttr(resourceName, "config.%", "1"), + resource.TestCheckResourceAttr(resourceName, "detached_mode_timeout_in_seconds", "302"), resource.TestCheckResourceAttr(resourceName, "display_name", "ExampleFunction"), + resource.TestCheckResourceAttr(resourceName, "failure_destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "failure_destination.0.kind", "STREAM"), + resource.TestCheckResourceAttrSet(resourceName, "failure_destination.0.stream_id"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "image", imageU), resource.TestCheckResourceAttr(resourceName, "image_digest", imageDigestU), - resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "256"), + resource.TestCheckResourceAttr(resourceName, "memory_in_mbs", "512"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.0.count", "0"), resource.TestCheckResourceAttr(resourceName, "provisioned_concurrency_config.0.strategy", "NONE"), + resource.TestCheckResourceAttr(resourceName, "success_destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "success_destination.0.kind", "STREAM"), + resource.TestCheckResourceAttrSet(resourceName, "success_destination.0.stream_id"), resource.TestCheckResourceAttr(resourceName, "timeout_in_seconds", "31"), resource.TestCheckResourceAttr(resourceName, "trace_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "trace_config.0.is_enabled", "true"), @@ -299,18 +330,25 @@ func TestFunctionsFunctionResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "functions.#", "1"), resource.TestCheckResourceAttrSet(datasourceName, "functions.0.application_id"), resource.TestCheckResourceAttrSet(datasourceName, "functions.0.compartment_id"), + resource.TestCheckResourceAttr(datasourceName, "functions.0.detached_mode_timeout_in_seconds", "302"), resource.TestCheckResourceAttr(datasourceName, "functions.0.display_name", "ExampleFunction"), + resource.TestCheckResourceAttr(datasourceName, "functions.0.failure_destination.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "functions.0.failure_destination.0.kind", "STREAM"), + resource.TestCheckResourceAttrSet(datasourceName, "functions.0.failure_destination.0.stream_id"), resource.TestCheckResourceAttr(datasourceName, "functions.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "functions.0.id"), resource.TestCheckResourceAttr(datasourceName, "functions.0.image", imageU), resource.TestCheckResourceAttr(datasourceName, "functions.0.image_digest", imageDigestU), resource.TestCheckResourceAttrSet(datasourceName, "functions.0.invoke_endpoint"), - resource.TestCheckResourceAttr(datasourceName, "functions.0.memory_in_mbs", "256"), + resource.TestCheckResourceAttr(datasourceName, "functions.0.memory_in_mbs", "512"), resource.TestCheckResourceAttr(datasourceName, "functions.0.provisioned_concurrency_config.#", "1"), resource.TestCheckResourceAttr(datasourceName, "functions.0.provisioned_concurrency_config.0.count", "0"), resource.TestCheckResourceAttr(datasourceName, "functions.0.provisioned_concurrency_config.0.strategy", "NONE"), resource.TestCheckResourceAttr(datasourceName, "functions.0.shape", "GENERIC_X86"), resource.TestCheckResourceAttrSet(datasourceName, "functions.0.state"), + resource.TestCheckResourceAttr(datasourceName, "functions.0.success_destination.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "functions.0.success_destination.0.kind", "STREAM"), + resource.TestCheckResourceAttrSet(datasourceName, "functions.0.success_destination.0.stream_id"), resource.TestCheckResourceAttrSet(datasourceName, "functions.0.time_created"), resource.TestCheckResourceAttrSet(datasourceName, "functions.0.time_updated"), resource.TestCheckResourceAttr(datasourceName, "functions.0.timeout_in_seconds", "31"), @@ -328,18 +366,25 @@ func TestFunctionsFunctionResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "compartment_id"), resource.TestCheckResourceAttr(singularDatasourceName, "config.%", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "detached_mode_timeout_in_seconds", "302"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "ExampleFunction"), + resource.TestCheckResourceAttr(singularDatasourceName, "failure_destination.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "failure_destination.0.kind", "STREAM"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "failure_destination.0.stream_id"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), //resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttr(singularDatasourceName, "image", imageU), resource.TestCheckResourceAttr(singularDatasourceName, "image_digest", imageDigestU), resource.TestCheckResourceAttrSet(singularDatasourceName, "invoke_endpoint"), - resource.TestCheckResourceAttr(singularDatasourceName, "memory_in_mbs", "256"), + resource.TestCheckResourceAttr(singularDatasourceName, "memory_in_mbs", "512"), resource.TestCheckResourceAttr(singularDatasourceName, "provisioned_concurrency_config.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "provisioned_concurrency_config.0.count", "0"), resource.TestCheckResourceAttr(singularDatasourceName, "provisioned_concurrency_config.0.strategy", "NONE"), resource.TestCheckResourceAttr(singularDatasourceName, "shape", "GENERIC_X86"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttr(singularDatasourceName, "success_destination.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "success_destination.0.kind", "STREAM"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "success_destination.0.stream_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), resource.TestCheckResourceAttr(singularDatasourceName, "timeout_in_seconds", "31"), diff --git a/internal/integrationtest/generative_ai_dedicated_ai_cluster_test.go b/internal/integrationtest/generative_ai_dedicated_ai_cluster_test.go index e605b2a7924..005e948887c 100644 --- a/internal/integrationtest/generative_ai_dedicated_ai_cluster_test.go +++ b/internal/integrationtest/generative_ai_dedicated_ai_cluster_test.go @@ -51,7 +51,7 @@ var ( "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "type": acctest.Representation{RepType: acctest.Required, Create: `HOSTING`}, "unit_count": acctest.Representation{RepType: acctest.Required, Create: `1`, Update: `2`}, - "unit_shape": acctest.Representation{RepType: acctest.Required, Create: `SMALL_COHERE`}, + "unit_shape": acctest.Representation{RepType: acctest.Required, Create: `SMALL_COHERE_4`}, // "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")}`}, "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, @@ -64,7 +64,7 @@ var ( "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "type": acctest.Representation{RepType: acctest.Required, Create: `FINE_TUNING`}, "unit_count": acctest.Representation{RepType: acctest.Required, Create: `2`}, - "unit_shape": acctest.Representation{RepType: acctest.Required, Create: `SMALL_COHERE`}, + "unit_shape": acctest.Representation{RepType: acctest.Required, Create: `LARGE_COHERE_V2`}, // "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")}`}, "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, @@ -115,7 +115,7 @@ func TestGenerativeAiDedicatedAiClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "type", "HOSTING"), resource.TestCheckResourceAttr(resourceName, "unit_count", "1"), - resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE"), + resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE_4"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -142,7 +142,7 @@ func TestGenerativeAiDedicatedAiClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "time_created"), resource.TestCheckResourceAttr(resourceName, "type", "HOSTING"), resource.TestCheckResourceAttr(resourceName, "unit_count", "1"), - resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE"), + resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE_4"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -173,7 +173,7 @@ func TestGenerativeAiDedicatedAiClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "time_created"), resource.TestCheckResourceAttr(resourceName, "type", "HOSTING"), resource.TestCheckResourceAttr(resourceName, "unit_count", "1"), - resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE"), + resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE_4"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -199,7 +199,7 @@ func TestGenerativeAiDedicatedAiClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "time_created"), resource.TestCheckResourceAttr(resourceName, "type", "HOSTING"), resource.TestCheckResourceAttr(resourceName, "unit_count", "2"), - resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE"), + resource.TestCheckResourceAttr(resourceName, "unit_shape", "SMALL_COHERE_4"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -243,7 +243,7 @@ func TestGenerativeAiDedicatedAiClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), resource.TestCheckResourceAttr(singularDatasourceName, "type", "HOSTING"), resource.TestCheckResourceAttr(singularDatasourceName, "unit_count", "2"), - resource.TestCheckResourceAttr(singularDatasourceName, "unit_shape", "SMALL_COHERE"), + resource.TestCheckResourceAttr(singularDatasourceName, "unit_shape", "SMALL_COHERE_4"), ), }, // verify resource import diff --git a/internal/integrationtest/generative_ai_endpoint_test.go b/internal/integrationtest/generative_ai_endpoint_test.go index e226d987756..560d4735cba 100644 --- a/internal/integrationtest/generative_ai_endpoint_test.go +++ b/internal/integrationtest/generative_ai_endpoint_test.go @@ -70,9 +70,9 @@ var ( filtered_models = [ for item in data.oci_generative_ai_models.serving_models.model_collection[0].items : item if ( - (item.version == "14.2") + (item.version == "1.0") && length(item.capabilities) == 1 - && (item.display_name == "cohere.command-light") + && (item.display_name == "cohere.command-a-03-2025") ) ] @@ -81,7 +81,7 @@ var ( data "oci_generative_ai_models" "serving_models" { compartment_id = var.compartment_id - display_name = "cohere.command-light" + display_name = "cohere.command-a-03-2025" } ` ) diff --git a/internal/integrationtest/generative_ai_generative_ai_private_endpoint_test.go b/internal/integrationtest/generative_ai_generative_ai_private_endpoint_test.go new file mode 100644 index 00000000000..e9b5d4073e8 --- /dev/null +++ b/internal/integrationtest/generative_ai_generative_ai_private_endpoint_test.go @@ -0,0 +1,360 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_generative_ai "github.com/oracle/oci-go-sdk/v65/generativeai" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + tf_client "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "github.com/oracle/terraform-provider-oci/internal/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + GenerativeAiGenerativeAiPrivateEndpointRequiredOnlyResource = GenerativeAiGenerativeAiPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Required, acctest.Create, GenerativeAiGenerativeAiPrivateEndpointRepresentation) + + GenerativeAiGenerativeAiPrivateEndpointResourceConfig = GenerativeAiGenerativeAiPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Optional, acctest.Update, GenerativeAiGenerativeAiPrivateEndpointRepresentation) + + GenerativeAiGenerativeAiPrivateEndpointSingularDataSourceRepresentation = map[string]interface{}{ + "generative_ai_private_endpoint_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint.id}`}, + } + + GenerativeAiGenerativeAiPrivateEndpointDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `pe_1234`, Update: `displayName2`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: GenerativeAiGenerativeAiPrivateEndpointDataSourceFilterRepresentation}} + GenerativeAiGenerativeAiPrivateEndpointDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint.id}`}}, + } + + GenerativeAiGenerativeAiPrivateEndpointRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "dns_prefix": acctest.Representation{RepType: acctest.Required, Create: `dnsPrefix`, Update: `dnsPrefix2`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `pe_1234`, Update: `displayName2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "nsg_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${oci_core_network_security_group.test_network_security_group.id}`}, Update: []string{`${oci_core_network_security_group.test_network_security_group.id}`}}, + } + + GenerativeAiGenerativeAiPrivateEndpointResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_core_network_security_group", "test_network_security_group", acctest.Required, acctest.Create, CoreNetworkSecurityGroupRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) + + DefinedTagsDependencies +) + +// issue-routing-tag: generative_ai/default +func TestGenerativeAiGenerativeAiPrivateEndpointResource_basic(t *testing.T) { + httpreplay.SetScenario("TestGenerativeAiGenerativeAiPrivateEndpointResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + compartmentIdU := utils.GetEnvSettingWithDefault("compartment_id_for_update", compartmentId) + compartmentIdUVariableStr := fmt.Sprintf("variable \"compartment_id_for_update\" { default = \"%s\" }\n", compartmentIdU) + + resourceName := "oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint" + datasourceName := "data.oci_generative_ai_generative_ai_private_endpoints.test_generative_ai_private_endpoints" + singularDatasourceName := "data.oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+GenerativeAiGenerativeAiPrivateEndpointResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Optional, acctest.Create, GenerativeAiGenerativeAiPrivateEndpointRepresentation), "generativeai", "generativeAiPrivateEndpoint", t) + + acctest.ResourceTest(t, testAccCheckGenerativeAiGenerativeAiPrivateEndpointDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + GenerativeAiGenerativeAiPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Required, acctest.Create, GenerativeAiGenerativeAiPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "dns_prefix", "dnsPrefix"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + GenerativeAiGenerativeAiPrivateEndpointResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + GenerativeAiGenerativeAiPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Optional, acctest.Create, GenerativeAiGenerativeAiPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "display_name", "pe_1234"), + resource.TestCheckResourceAttr(resourceName, "dns_prefix", "dnsPrefix"), + resource.TestCheckResourceAttrSet(resourceName, "fqdn"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "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 + }, + ), + }, + + // verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + GenerativeAiGenerativeAiPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(GenerativeAiGenerativeAiPrivateEndpointRepresentation, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "display_name", "pe_1234"), + resource.TestCheckResourceAttr(resourceName, "dns_prefix", "dnsPrefix"), + resource.TestCheckResourceAttrSet(resourceName, "fqdn"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + GenerativeAiGenerativeAiPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Optional, acctest.Update, GenerativeAiGenerativeAiPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description2"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "dns_prefix", "dnsPrefix2"), + resource.TestCheckResourceAttrSet(resourceName, "fqdn"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + + 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 + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoints", "test_generative_ai_private_endpoints", acctest.Optional, acctest.Update, GenerativeAiGenerativeAiPrivateEndpointDataSourceRepresentation) + + compartmentIdVariableStr + GenerativeAiGenerativeAiPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Optional, acctest.Update, GenerativeAiGenerativeAiPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttrSet(datasourceName, "id"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + + resource.TestCheckResourceAttr(datasourceName, "generative_ai_private_endpoint_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "generative_ai_private_endpoint_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_generative_ai_generative_ai_private_endpoint", "test_generative_ai_private_endpoint", acctest.Required, acctest.Create, GenerativeAiGenerativeAiPrivateEndpointSingularDataSourceRepresentation) + + compartmentIdVariableStr + GenerativeAiGenerativeAiPrivateEndpointResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "generative_ai_private_endpoint_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "fqdn"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "private_endpoint_ip"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + ), + }, + // verify resource import + { + Config: config + GenerativeAiGenerativeAiPrivateEndpointRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "compartment_id", + "defined_tags", + "dns_prefix", + "lifecycle_details", + "previous_state", + "subnet_id", + "system_tags", + "time_created", + "time_updated", + }, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckGenerativeAiGenerativeAiPrivateEndpointDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).GenerativeAiClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_generative_ai_generative_ai_private_endpoint" { + noResourceFound = false + request := oci_generative_ai.GetGenerativeAiPrivateEndpointRequest{} + + tmp := rs.Primary.ID + request.GenerativeAiPrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "generative_ai") + + response, err := client.GetGenerativeAiPrivateEndpoint(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.LifecycleState)]; !ok { + //resource lifecycle state is not in expected deleted lifecycle states. + return fmt.Errorf("resource lifecycle state: %s is not in expected deleted lifecycle states", response.LifecycleState) + } + //resource lifecycle state is in expected deleted lifecycle states. continue with next one. + continue + } + + //Verify that exception is for '404 not found'. + if failure, isServiceError := common.IsServiceError(err); !isServiceError || failure.GetHTTPStatusCode() != 404 { + return err + } + } + } + if noResourceFound { + return fmt.Errorf("at least one resource was expected from the state file, but could not be found") + } + + return nil +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("GenerativeAiGenerativeAiPrivateEndpoint") { + resource.AddTestSweepers("GenerativeAiGenerativeAiPrivateEndpoint", &resource.Sweeper{ + Name: "GenerativeAiGenerativeAiPrivateEndpoint", + Dependencies: acctest.DependencyGraph["generativeAiPrivateEndpoint"], + F: sweepGenerativeAiGenerativeAiPrivateEndpointResource, + }) + } +} + +func sweepGenerativeAiGenerativeAiPrivateEndpointResource(compartment string) error { + generativeAiClient := acctest.GetTestClients(&schema.ResourceData{}).GenerativeAiClient() + generativeAiPrivateEndpointIds, err := getGenerativeAiGenerativeAiPrivateEndpointIds(compartment) + if err != nil { + return err + } + for _, generativeAiPrivateEndpointId := range generativeAiPrivateEndpointIds { + if ok := acctest.SweeperDefaultResourceId[generativeAiPrivateEndpointId]; !ok { + deleteGenerativeAiPrivateEndpointRequest := oci_generative_ai.DeleteGenerativeAiPrivateEndpointRequest{} + + deleteGenerativeAiPrivateEndpointRequest.GenerativeAiPrivateEndpointId = &generativeAiPrivateEndpointId + + deleteGenerativeAiPrivateEndpointRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "generative_ai") + _, error := generativeAiClient.DeleteGenerativeAiPrivateEndpoint(context.Background(), deleteGenerativeAiPrivateEndpointRequest) + if error != nil { + fmt.Printf("Error deleting GenerativeAiPrivateEndpoint %s %s, It is possible that the resource is already deleted. Please verify manually \n", generativeAiPrivateEndpointId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &generativeAiPrivateEndpointId, GenerativeAiGenerativeAiPrivateEndpointSweepWaitCondition, time.Duration(3*time.Minute), + GenerativeAiGenerativeAiPrivateEndpointSweepResponseFetchOperation, "generative_ai", true) + } + } + return nil +} + +func getGenerativeAiGenerativeAiPrivateEndpointIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "GenerativeAiPrivateEndpointId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + generativeAiClient := acctest.GetTestClients(&schema.ResourceData{}).GenerativeAiClient() + + listGenerativeAiPrivateEndpointsRequest := oci_generative_ai.ListGenerativeAiPrivateEndpointsRequest{} + listGenerativeAiPrivateEndpointsRequest.CompartmentId = &compartmentId + listGenerativeAiPrivateEndpointsRequest.LifecycleState = oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateActive + listGenerativeAiPrivateEndpointsResponse, err := generativeAiClient.ListGenerativeAiPrivateEndpoints(context.Background(), listGenerativeAiPrivateEndpointsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting GenerativeAiPrivateEndpoint list for compartment id : %s , %s \n", compartmentId, err) + } + for _, generativeAiPrivateEndpoint := range listGenerativeAiPrivateEndpointsResponse.Items { + id := *generativeAiPrivateEndpoint.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "GenerativeAiPrivateEndpointId", id) + } + return resourceIds, nil +} + +func GenerativeAiGenerativeAiPrivateEndpointSweepWaitCondition(response common.OCIOperationResponse) bool { + // Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required. + if generativeAiPrivateEndpointResponse, ok := response.Response.(oci_generative_ai.GetGenerativeAiPrivateEndpointResponse); ok { + return generativeAiPrivateEndpointResponse.LifecycleState != oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateDeleted + } + return false +} + +func GenerativeAiGenerativeAiPrivateEndpointSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.GenerativeAiClient().GetGenerativeAiPrivateEndpoint(context.Background(), oci_generative_ai.GetGenerativeAiPrivateEndpointRequest{ + GenerativeAiPrivateEndpointId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/helpers_autonomous_database.go b/internal/integrationtest/helpers_autonomous_database.go index f5b79883e58..0c06f74f986 100644 --- a/internal/integrationtest/helpers_autonomous_database.go +++ b/internal/integrationtest/helpers_autonomous_database.go @@ -250,3 +250,23 @@ func createDatabaseClient(clients *tf_client.OracleClients, region string) (clie databaseClient.SetRegion(region) return databaseClient, nil } + +func triggerUndeleteAutonomousDatabase(clients *tf_client.OracleClients, region string, compartmentId string, autonomousDatabaseId string) error { + databaseClient, err := createDatabaseClient(clients, region) + if err != nil { + return err + } + + if autonomousDatabaseId != "" { + CreateAutonomousDatabaseRequest := oci_database.CreateAutonomousDatabaseRequest{} + undeleteAutonomousRequest := oci_database.UndeleteAutonomousDatabaseDetails{} + undeleteAutonomousRequest.SourceId = &autonomousDatabaseId + undeleteAutonomousRequest.CompartmentId = &compartmentId + CreateAutonomousDatabaseRequest.CreateAutonomousDatabaseDetails = undeleteAutonomousRequest + _, err := databaseClient.CreateAutonomousDatabase(context.Background(), CreateAutonomousDatabaseRequest) + if err != nil { + return fmt.Errorf("failed to undelete source autonomous database resource with error : %v", err) + } + } + return nil +} diff --git a/internal/integrationtest/multicloud_external_location_mapping_metadata_test.go b/internal/integrationtest/multicloud_external_location_mapping_metadata_test.go new file mode 100644 index 00000000000..2af140ac0ea --- /dev/null +++ b/internal/integrationtest/multicloud_external_location_mapping_metadata_test.go @@ -0,0 +1,70 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudExternalLocationMappingMetadataDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "subscription_service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_service_name_list}`}, + "subscription_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.subscription_id}`}, + } + + MulticloudExternalLocationMappingMetadataResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudExternalLocationMappingMetadataResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudExternalLocationMappingMetadataResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("TF_VAR_compartment_id") + + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" {}\n") + subscriptionServiceNameVariableStr := fmt.Sprintf("variable \"subscription_service_name_list\" { \n type = list(string)\n }\n") + + datasourceName := "data.oci_multicloud_external_location_mapping_metadata.test_external_location_mapping_metadata" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + compartmentIdVariableStr + subscriptionServiceNameVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_external_location_mapping_metadata", "test_external_location_mapping_metadata", acctest.Required, acctest.Create, MulticloudExternalLocationMappingMetadataDataSourceRepresentation) + + MulticloudExternalLocationMappingMetadataResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "subscription_service_name.#"), + + resource.TestCheckResourceAttr(datasourceName, "external_location_mapping_metadatum_summary_collection.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.#"), + + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.oci_logical_ad"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.oci_physical_ad"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.oci_region"), + + resource.TestCheckResourceAttr(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.external_location.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.external_location.0.csp_physical_az"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.external_location.0.csp_physical_az_display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.external_location.0.csp_region"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.external_location.0.csp_region_display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_mapping_metadatum_summary_collection.0.items.0.external_location.0.service_name"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_external_location_summaries_metadata_test.go b/internal/integrationtest/multicloud_external_location_summaries_metadata_test.go new file mode 100644 index 00000000000..65e01cc82d2 --- /dev/null +++ b/internal/integrationtest/multicloud_external_location_summaries_metadata_test.go @@ -0,0 +1,65 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudExternalLocationSummariesMetadataDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "subscription_service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_service_name}`}, + } + + MulticloudExternalLocationSummariesMetadataResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudExternalLocationSummariesMetadataResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudExternalLocationSummariesMetadataResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("TF_VAR_compartment_id") + subscriptionServiceName := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_service_name") + + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" {}\n") + subscriptionServiceNameVariableStr := fmt.Sprintf("variable \"subscription_service_name\" {}\n") + + datasourceName := "data.oci_multicloud_external_location_summaries_metadata.test_external_location_summaries_metadata" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + compartmentIdVariableStr + subscriptionServiceNameVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_external_location_summaries_metadata", "test_external_location_summaries_metadata", acctest.Required, acctest.Create, MulticloudExternalLocationSummariesMetadataDataSourceRepresentation) + + MulticloudExternalLocationSummariesMetadataResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "subscription_service_name", subscriptionServiceName), + + resource.TestCheckResourceAttr(datasourceName, "external_location_summaries_metadatum_summary_collection.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_summaries_metadatum_summary_collection.0.items.#"), + + resource.TestCheckResourceAttr(datasourceName, "external_location_summaries_metadatum_summary_collection.0.items.0.external_location.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_summaries_metadatum_summary_collection.0.items.0.external_location.0.csp_region"), + resource.TestCheckResourceAttrSet(datasourceName, "external_location_summaries_metadatum_summary_collection.0.items.0.external_location.0.csp_region_display_name"), + + resource.TestCheckResourceAttrSet(datasourceName, "external_location_summaries_metadatum_summary_collection.0.items.0.oci_region"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_external_locations_metadata_test.go b/internal/integrationtest/multicloud_external_locations_metadata_test.go new file mode 100644 index 00000000000..8ce0706437c --- /dev/null +++ b/internal/integrationtest/multicloud_external_locations_metadata_test.go @@ -0,0 +1,79 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudExternalLocationsMetadataDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "subscription_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_id}`}, + "subscription_service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_service_name}`}, + } + + MulticloudExternalLocationsMetadataResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudExternalLocationsMetadataResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudExternalLocationsMetadataResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("TF_VAR_compartment_id") + subscriptiontId := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_id") + subscriptionServiceName := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_service_name") + + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" {}\n") + subscriptionIdVariableStr := fmt.Sprintf("variable \"subscription_id\" {}\n") + subscriptionServiceNameVariableStr := fmt.Sprintf("variable \"subscription_service_name\" {}\n") + + datasourceName := "data.oci_multicloud_external_locations_metadata.test_external_locations_metadata" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + compartmentIdVariableStr + subscriptionIdVariableStr + subscriptionServiceNameVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_external_locations_metadata", "test_external_locations_metadata", acctest.Required, acctest.Create, MulticloudExternalLocationsMetadataDataSourceRepresentation) + + MulticloudExternalLocationsMetadataResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "subscription_id", subscriptiontId), + resource.TestCheckResourceAttr(datasourceName, "subscription_service_name", subscriptionServiceName), + + resource.TestCheckResourceAttr(datasourceName, "external_locations_metadatum_collection.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.#"), + + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.cpg_id"), + resource.TestCheckResourceAttr(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_logical_az"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_physical_az"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_physical_az_display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_region"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_region_display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.service_name"), + resource.TestCheckResourceAttr(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_zone_key_reference_id.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_zone_key_reference_id.0.key_name"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.external_location.0.csp_zone_key_reference_id.0.key_value"), + + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.oci_logical_ad"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.oci_physical_ad"), + resource.TestCheckResourceAttrSet(datasourceName, "external_locations_metadatum_collection.0.items.0.oci_region"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_network_anchor_test.go b/internal/integrationtest/multicloud_network_anchor_test.go new file mode 100644 index 00000000000..659cc9e3905 --- /dev/null +++ b/internal/integrationtest/multicloud_network_anchor_test.go @@ -0,0 +1,93 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudNetworkAnchorDataSourceRepresentation = map[string]interface{}{ + "network_anchor_id": acctest.Representation{RepType: acctest.Required, Create: `${var.network_anchor_id}`}, + "subscription_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_id}`}, + "subscription_service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_service_name}`}, + } + + MulticloudNetworkAnchorResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudNetworkAnchorResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudNetworkAnchorResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + networkAnchorId := utils.GetEnvSettingWithBlankDefault("TF_VAR_network_anchor_id") + subscriptionId := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_id") + subscriptionServiceName := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_service_name") + + networkAnchorIdVariableStr := fmt.Sprintf("variable \"network_anchor_id\" {}\n") + subscriptionIdVariableStr := fmt.Sprintf("variable \"subscription_id\" {}\n") + subscriptionServiceNameVariableStr := fmt.Sprintf("variable \"subscription_service_name\" {}\n") + + datasourceName := "data.oci_multicloud_network_anchor.test_network_anchor" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + { + Config: config + networkAnchorIdVariableStr + subscriptionIdVariableStr + subscriptionServiceNameVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_network_anchor", "test_network_anchor", acctest.Required, acctest.Create, MulticloudNetworkAnchorDataSourceRepresentation) + + MulticloudNetworkAnchorResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "network_anchor_id", networkAnchorId), + resource.TestCheckResourceAttr(datasourceName, "subscription_id", subscriptionId), + resource.TestCheckResourceAttr(datasourceName, "subscription_service_name", subscriptionServiceName), + + resource.TestCheckResourceAttrSet(datasourceName, "id"), + resource.TestCheckResourceAttrSet(datasourceName, "display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_id"), + resource.TestCheckResourceAttrSet(datasourceName, "time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "time_updated"), + // Commented as lifecycleState was renamed to networkAnchorLifecycleState + // resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_lifecycle_state"), + resource.TestCheckResourceAttrSet(datasourceName, "freeform_tags.%"), + resource.TestCheckResourceAttrSet(datasourceName, "defined_tags.%"), + resource.TestCheckResourceAttrSet(datasourceName, "system_tags.%"), + + resource.TestCheckResourceAttr(datasourceName, "oci_metadata_item.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.network_anchor_connection_status"), + + resource.TestCheckResourceAttr(datasourceName, "oci_metadata_item.0.vcn.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.vcn.0.vcn_id"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.vcn.0.cidr_blocks.#"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.vcn.0.backup_cidr_blocks.#"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.vcn.0.dns_label"), + + resource.TestCheckResourceAttr(datasourceName, "oci_metadata_item.0.dns.#", "1"), + + resource.TestCheckResourceAttr(datasourceName, "oci_metadata_item.0.subnets.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.subnets.0.type"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.subnets.0.subnet_id"), + resource.TestCheckResourceAttrSet(datasourceName, "oci_metadata_item.0.subnets.0.label"), + + resource.TestCheckResourceAttr(datasourceName, "cloud_service_provider_metadata_item.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.region"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.odb_network_id"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.cidr_blocks.#"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.network_anchor_uri"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_network_anchors_test.go b/internal/integrationtest/multicloud_network_anchors_test.go new file mode 100644 index 00000000000..d800194f18b --- /dev/null +++ b/internal/integrationtest/multicloud_network_anchors_test.go @@ -0,0 +1,79 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudNetworkAnchorsDataSourceRepresentation = map[string]interface{}{ + "subscription_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_id}`}, + "subscription_service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_service_name}`}, + "external_location": acctest.Representation{RepType: acctest.Required, Create: `${var.network_anchor_external_location}`}, + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.network_anchor_compartment_id}`}, + } + + MulticloudNetworkAnchorsResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudNetworkAnchorsResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudNetworkAnchorsResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + subscriptionId := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_id") + subscriptionServiceName := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_service_name") + externalLocation := utils.GetEnvSettingWithBlankDefault("TF_VAR_network_anchor_external_location") + compartmentId := utils.GetEnvSettingWithBlankDefault("TF_VAR_network_anchor_compartment_id") + + subscriptionIdVariableStr := fmt.Sprintf("variable \"subscription_id\" {}\n") + subscriptionServiceNameVariableStr := fmt.Sprintf("variable \"subscription_service_name\" {}\n") + externalLocationVariableStr := fmt.Sprintf("variable \"network_anchor_external_location\" {}\n") + compartmentIdVariableStr := fmt.Sprintf("variable \"network_anchor_compartment_id\" {}\n") + + datasourceName := "data.oci_multicloud_network_anchors.test_network_anchors" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + { + Config: config + subscriptionIdVariableStr + subscriptionServiceNameVariableStr + externalLocationVariableStr + compartmentIdVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_network_anchors", "test_network_anchors", acctest.Optional, acctest.Create, MulticloudNetworkAnchorsDataSourceRepresentation) + + MulticloudNetworkAnchorsResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "subscription_id", subscriptionId), + resource.TestCheckResourceAttr(datasourceName, "subscription_service_name", subscriptionServiceName), + resource.TestCheckResourceAttr(datasourceName, "external_location", externalLocation), + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + + resource.TestCheckResourceAttr(datasourceName, "network_anchor_collection.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.#"), + + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.resource_anchor_id"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.vcn_id"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.time_updated"), + // Commented as lifecycleState was renamed to networkAnchorLifecycleState + // resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.network_anchor_lifecycle_state"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.freeform_tags.%"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.defined_tags.%"), + resource.TestCheckResourceAttrSet(datasourceName, "network_anchor_collection.0.items.0.system_tags.%"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_om_hub_multi_cloud_metadata_test.go b/internal/integrationtest/multicloud_om_hub_multi_cloud_metadata_test.go new file mode 100644 index 00000000000..8c12b80a2c7 --- /dev/null +++ b/internal/integrationtest/multicloud_om_hub_multi_cloud_metadata_test.go @@ -0,0 +1,57 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudOmHubMultiCloudMetadataDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.om_hub_compartment_id}`}, + "subscription_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_id}`}, + } + + MulticloudOmHubMultiCloudMetadataResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudOmHubMultiCloudMetadataResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudOmHubMultiCloudMetadataResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("TF_VAR_om_hub_compartment_id") + subscriptionId := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_id") + + compartmentIdVariableStr := fmt.Sprintf("variable \"om_hub_compartment_id\" {}\n") + subscriptionIdVariableStr := fmt.Sprintf("variable \"subscription_id\" {}\n") + + datasourceName := "data.oci_multicloud_om_hub_multi_cloud_metadata.test_om_hub_multi_cloud_metadata" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_om_hub_multi_cloud_metadata", "test_om_hub_multi_cloud_metadata", acctest.Required, acctest.Create, MulticloudOmHubMultiCloudMetadataDataSourceRepresentation) + + subscriptionIdVariableStr + compartmentIdVariableStr + MulticloudOmHubMultiCloudMetadataResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "subscription_id", subscriptionId), + resource.TestCheckResourceAttrSet(datasourceName, "base_compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "base_subscription_id"), + resource.TestCheckResourceAttrSet(datasourceName, "time_created"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_om_hub_multi_clouds_metadata_test.go b/internal/integrationtest/multicloud_om_hub_multi_clouds_metadata_test.go new file mode 100644 index 00000000000..10534a8b801 --- /dev/null +++ b/internal/integrationtest/multicloud_om_hub_multi_clouds_metadata_test.go @@ -0,0 +1,55 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudOmHubMultiCloudsMetadataDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.om_hub_compartment_id}`}, + } + + MulticloudOmHubMultiCloudsMetadataResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudOmHubMultiCloudsMetadataResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudOmHubMultiCloudsMetadataResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("TF_VAR_om_hub_compartment_id") + + compartmentIdVariableStr := fmt.Sprintf("variable \"om_hub_compartment_id\" {}\n") + + datasourceName := "data.oci_multicloud_om_hub_multi_clouds_metadata.test_om_hub_multi_clouds_metadata" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_om_hub_multi_clouds_metadata", "test_om_hub_multi_clouds_metadata", acctest.Required, acctest.Create, MulticloudOmHubMultiCloudsMetadataDataSourceRepresentation) + + compartmentIdVariableStr + MulticloudOmHubMultiCloudsMetadataResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "multi_cloud_metadata_collection.#"), + resource.TestCheckResourceAttrSet(datasourceName, "multi_cloud_metadata_collection.0.items.#"), + resource.TestCheckResourceAttrSet(datasourceName, "multi_cloud_metadata_collection.0.items.0.compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "multi_cloud_metadata_collection.0.items.0.subscription_id"), + resource.TestCheckResourceAttrSet(datasourceName, "multi_cloud_metadata_collection.0.items.0.time_created"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_resource_anchor_test.go b/internal/integrationtest/multicloud_resource_anchor_test.go new file mode 100644 index 00000000000..ac82b20fb98 --- /dev/null +++ b/internal/integrationtest/multicloud_resource_anchor_test.go @@ -0,0 +1,80 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudResourceAnchorDataSourceRepresentation = map[string]interface{}{ + "resource_anchor_id": acctest.Representation{RepType: acctest.Required, Create: `${var.resource_anchor_id}`}, + "subscription_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_id}`}, + "subscription_service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_service_name}`}, + } + + MulticloudResourceAnchorResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudResourceAnchorResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudResourceAnchorResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + resourceAnchorId := utils.GetEnvSettingWithBlankDefault("TF_VAR_resource_anchor_id") + subscriptionId := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_id") + subscriptionServiceName := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_service_name") + + resourceAnchorIdVariableStr := fmt.Sprintf("variable \"resource_anchor_id\" {}\n") + subscriptionIdVariableStr := fmt.Sprintf("variable \"subscription_id\" {}\n") + subscriptionServiceNameVariableStr := fmt.Sprintf("variable \"subscription_service_name\" {}\n") + + datasourceName := "data.oci_multicloud_resource_anchor.test_resource_anchor" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + { + Config: config + resourceAnchorIdVariableStr + subscriptionIdVariableStr + subscriptionServiceNameVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_resource_anchor", "test_resource_anchor", acctest.Required, acctest.Create, MulticloudResourceAnchorDataSourceRepresentation) + + MulticloudResourceAnchorResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "resource_anchor_id", resourceAnchorId), + resource.TestCheckResourceAttr(datasourceName, "subscription_id", subscriptionId), + resource.TestCheckResourceAttr(datasourceName, "subscription_service_name", subscriptionServiceName), + + resource.TestCheckResourceAttrSet(datasourceName, "compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "id"), + resource.TestCheckResourceAttrSet(datasourceName, "lifecycle_details"), + resource.TestCheckResourceAttrSet(datasourceName, "linked_compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "region"), + resource.TestCheckResourceAttrSet(datasourceName, "lifecycle_state"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_subscription_id"), + resource.TestCheckResourceAttrSet(datasourceName, "subscription_type"), + resource.TestCheckResourceAttrSet(datasourceName, "system_tags.%"), + resource.TestCheckResourceAttrSet(datasourceName, "time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "time_updated"), + + // Checks for subscription_service_name: "ORACLEDBATAZURE" + resource.TestCheckResourceAttr(datasourceName, "cloud_service_provider_metadata_item.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.resource_anchor_name"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.resource_anchor_uri"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.resource_group"), + resource.TestCheckResourceAttrSet(datasourceName, "cloud_service_provider_metadata_item.0.subscription"), + resource.TestCheckResourceAttr(datasourceName, "cloud_service_provider_metadata_item.0.subscription_type", "ORACLEDBATAZURE"), + ), + }, + }) +} diff --git a/internal/integrationtest/multicloud_resource_anchors_test.go b/internal/integrationtest/multicloud_resource_anchors_test.go new file mode 100644 index 00000000000..39148ec0491 --- /dev/null +++ b/internal/integrationtest/multicloud_resource_anchors_test.go @@ -0,0 +1,68 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + MulticloudResourceAnchorsDataSourceRepresentation = map[string]interface{}{ + "subscription_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_id}`}, + "subscription_service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.subscription_service_name}`}, + } + + MulticloudResourceAnchorsResourceConfig = "" +) + +// issue-routing-tag: multicloud/default +func TestMulticloudResourceAnchorsResource_basic(t *testing.T) { + httpreplay.SetScenario("TestMulticloudResourceAnchorsResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + subscriptionId := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_id") + subscriptionServiceName := utils.GetEnvSettingWithBlankDefault("TF_VAR_subscription_service_name") + + subscriptionIdVariableStr := fmt.Sprintf("variable \"subscription_id\" {}\n") + subscriptionServiceNameVariableStr := fmt.Sprintf("variable \"subscription_service_name\" {}\n") + + datasourceName := "data.oci_multicloud_resource_anchors.test_resource_anchors" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + subscriptionIdVariableStr + subscriptionServiceNameVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_multicloud_resource_anchors", "test_resource_anchors", acctest.Required, acctest.Create, MulticloudResourceAnchorsDataSourceRepresentation) + + MulticloudResourceAnchorsResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "subscription_id", subscriptionId), + resource.TestCheckResourceAttr(datasourceName, "subscription_service_name", subscriptionServiceName), + + resource.TestCheckResourceAttr(datasourceName, "resource_anchor_collection.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.#"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.lifecycle_details"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.lifecycle_state"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.subscription_id"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.system_tags.%"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "resource_anchor_collection.0.items.0.time_updated"), + ), + }, + }) +} diff --git a/internal/integrationtest/ocvp_cluster_test.go b/internal/integrationtest/ocvp_cluster_test.go index 0eaf14239c0..d4d6630d139 100644 --- a/internal/integrationtest/ocvp_cluster_test.go +++ b/internal/integrationtest/ocvp_cluster_test.go @@ -46,6 +46,12 @@ var ( "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_ocvp_cluster.test_cluster.id}`}}, } + // clusterInitialHostShapeName = "BM.Standard3.64" + // clusterInitialHostOcpuCount = "16" + + clusterInitialHostShapeName = "BM.Standard2.52" + clusterInitialHostOcpuCount = "12" + OcvpClusterRepresentation = map[string]interface{}{ "compute_availability_domain": acctest.Representation{RepType: acctest.Required, Create: `${lookup(data.oci_identity_availability_domains.ADs.availability_domains[1],"name")}`}, "esxi_hosts_count": acctest.Representation{RepType: acctest.Required, Create: `1`}, @@ -58,14 +64,20 @@ var ( "esxi_software_version": acctest.Representation{RepType: acctest.Optional, Create: `esxi7u3k-21313628-1`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, "initial_commitment": acctest.Representation{RepType: acctest.Optional, Create: `HOUR`}, - "initial_host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: `12`}, - "initial_host_shape_name": acctest.Representation{RepType: acctest.Optional, Create: `BM.Standard2.52`}, + "initial_host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: clusterInitialHostOcpuCount}, + "initial_host_shape_name": acctest.Representation{RepType: acctest.Required, Create: clusterInitialHostShapeName}, "instance_display_name_prefix": acctest.Representation{RepType: acctest.Optional, Create: `tf-test-`}, "is_shielded_instance_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, "vmware_software_version": acctest.Representation{RepType: acctest.Optional, Create: noInstanceVmwareVersionV7}, "workload_network_cidr": acctest.Representation{RepType: acctest.Optional, Create: `172.20.0.0/24`}, "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagsChangesRepresentation}, } + + OcvpClusterWithDatastoreClustersRepresentation = acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(OcvpClusterRepresentation, []string{"datastores"}), map[string]interface{}{ + "attach_datastore_cluster_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${oci_ocvp_datastore_cluster.test_datastore_clusters[0].id}`}, Update: []string{`${oci_ocvp_datastore_cluster.test_datastore_clusters[1].id}`}}, + "detach_datastore_cluster_ids": acctest.Representation{RepType: acctest.Optional, Create: nil, Update: []string{`${oci_ocvp_datastore_cluster.test_datastore_clusters[0].id}`}}, + }) + OcvpClusterNetworkConfigurationRepresentation = map[string]interface{}{ "nsx_edge_vtep_vlan_id": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_ocvp_cluster.v7_sddc_management_cluster.network_configuration.0.nsx_edge_vtep_vlan_id}`}, "nsx_vtep_vlan_id": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_ocvp_cluster.v7_sddc_management_cluster.network_configuration.0.nsx_vtep_vlan_id}`}, @@ -95,17 +107,17 @@ var ( availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[1],"name")}" display_name = "tf-esxi-host-test-capacity-reservation" instance_reservation_configs { - instance_shape = "BM.Standard2.52" + instance_shape = "` + clusterInitialHostShapeName + `" reserved_count = 1 fault_domain = "FAULT-DOMAIN-1" } instance_reservation_configs { - instance_shape = "BM.Standard2.52" + instance_shape = "` + clusterInitialHostShapeName + `" reserved_count = 1 fault_domain = "FAULT-DOMAIN-2" } instance_reservation_configs { - instance_shape = "BM.Standard2.52" + instance_shape = "` + clusterInitialHostShapeName + `" reserved_count = 1 fault_domain = "FAULT-DOMAIN-3" } @@ -167,6 +179,7 @@ func TestOcvpClusterResource_basic(t *testing.T) { { Config: config + compartmentIdVariableStr + OcvpClusterResourceDependencies, }, + // verify Create with optionals { Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies + @@ -175,6 +188,7 @@ func TestOcvpClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "capacity_reservation_id"), resource.TestCheckResourceAttrSet(resourceName, "compartment_id"), resource.TestCheckResourceAttrSet(resourceName, "compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_ids.#", "1"), resource.TestCheckResourceAttr(resourceName, "datastores.#", "1"), resource.TestCheckResourceAttr(resourceName, "datastores.0.block_volume_ids.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "datastores.0.capacity"), @@ -185,7 +199,7 @@ func TestOcvpClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "initial_commitment", "HOUR"), - resource.TestCheckResourceAttr(resourceName, "initial_host_ocpu_count", "12"), + resource.TestCheckResourceAttr(resourceName, "initial_host_ocpu_count", clusterInitialHostOcpuCount), resource.TestCheckResourceAttrSet(resourceName, "initial_host_shape_name"), resource.TestCheckResourceAttr(resourceName, "instance_display_name_prefix", "tf-test-"), resource.TestCheckResourceAttr(resourceName, "is_shielded_instance_enabled", "false"), @@ -227,6 +241,7 @@ func TestOcvpClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "capacity_reservation_id"), resource.TestCheckResourceAttrSet(resourceName, "compartment_id"), resource.TestCheckResourceAttrSet(resourceName, "compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_ids.#", "1"), resource.TestCheckResourceAttr(resourceName, "datastores.#", "1"), resource.TestCheckResourceAttr(resourceName, "datastores.0.block_volume_ids.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "datastores.0.capacity"), @@ -236,7 +251,113 @@ func TestOcvpClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "initial_commitment", "HOUR"), - resource.TestCheckResourceAttr(resourceName, "initial_host_ocpu_count", "12"), + resource.TestCheckResourceAttr(resourceName, "initial_host_ocpu_count", clusterInitialHostOcpuCount), + resource.TestCheckResourceAttrSet(resourceName, "initial_host_shape_name"), + resource.TestCheckResourceAttr(resourceName, "instance_display_name_prefix", "tf-test-"), + resource.TestCheckResourceAttr(resourceName, "is_shielded_instance_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.hcx_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_edge_uplink1vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_edge_uplink2vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_edge_vtep_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_vtep_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.provisioning_subnet_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.provisioning_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.replication_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.vmotion_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.vsan_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.vsphere_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "sddc_id"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "vmware_software_version", noInstanceVmwareVersionV7), + resource.TestCheckResourceAttrSet(resourceName, "vsphere_type"), + resource.TestCheckResourceAttr(resourceName, "workload_network_cidr", "172.20.0.0/24"), + + 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 + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies, + }, + + // verify Create with optionals with datastore clusters + { + Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies + ocvpEsxiHostDatastoreClusterResources + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_cluster", "test_cluster", acctest.Optional, acctest.Create, OcvpClusterWithDatastoreClustersRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "capacity_reservation_id"), + resource.TestCheckResourceAttrSet(resourceName, "compartment_id"), + resource.TestCheckResourceAttrSet(resourceName, "compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "attach_datastore_cluster_ids.#", "1"), + resource.TestCheckNoResourceAttr(resourceName, "detach_datastore_cluster_ids"), + resource.TestCheckResourceAttr(resourceName, "datastores.#", "0"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "esxi_hosts_count", "1"), + resource.TestCheckResourceAttr(resourceName, "esxi_software_version", "esxi7u3k-21313628-1"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "initial_commitment", "HOUR"), + resource.TestCheckResourceAttr(resourceName, "initial_host_ocpu_count", clusterInitialHostOcpuCount), + resource.TestCheckResourceAttrSet(resourceName, "initial_host_shape_name"), + resource.TestCheckResourceAttr(resourceName, "instance_display_name_prefix", "tf-test-"), + resource.TestCheckResourceAttr(resourceName, "is_shielded_instance_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.hcx_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_edge_uplink1vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_edge_uplink2vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_edge_vtep_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.nsx_vtep_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.provisioning_subnet_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.provisioning_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.replication_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.vmotion_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.vsan_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "network_configuration.0.vsphere_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "sddc_id"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "vmware_software_version", noInstanceVmwareVersionV7), + resource.TestCheckResourceAttrSet(resourceName, "vsphere_type"), + resource.TestCheckResourceAttr(resourceName, "workload_network_cidr", "172.20.0.0/24"), + + 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 + }, + ), + }, + + // verify updates to updatable parameters with datastore clusters + { + Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies + ocvpEsxiHostDatastoreClusterResources + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_cluster", "test_cluster", acctest.Optional, acctest.Update, OcvpClusterWithDatastoreClustersRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "capacity_reservation_id"), + resource.TestCheckResourceAttrSet(resourceName, "compartment_id"), + resource.TestCheckResourceAttrSet(resourceName, "compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "attach_datastore_cluster_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "detach_datastore_cluster_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "datastores.#", "0"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "esxi_hosts_count", "1"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "initial_commitment", "HOUR"), + resource.TestCheckResourceAttr(resourceName, "initial_host_ocpu_count", clusterInitialHostOcpuCount), resource.TestCheckResourceAttrSet(resourceName, "initial_host_shape_name"), resource.TestCheckResourceAttr(resourceName, "instance_display_name_prefix", "tf-test-"), resource.TestCheckResourceAttr(resourceName, "is_shielded_instance_enabled", "false"), @@ -269,9 +390,9 @@ func TestOcvpClusterResource_basic(t *testing.T) { }, // verify datasource { - Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies + + Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies + ocvpEsxiHostDatastoreClusterResources + acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_clusters", "test_clusters", acctest.Optional, acctest.Update, OcvpClusterDataSourceRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_ocvp_cluster", "test_cluster", acctest.Optional, acctest.Update, OcvpClusterRepresentation), + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_cluster", "test_cluster", acctest.Optional, acctest.Update, OcvpClusterWithDatastoreClustersRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), @@ -284,25 +405,23 @@ func TestOcvpClusterResource_basic(t *testing.T) { }, // verify singular datasource { - Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_ocvp_cluster", "test_cluster", acctest.Optional, acctest.Update, OcvpClusterRepresentation) + + Config: config + compartmentIdVariableStr + OcvpClusterOptionalResourceDependencies + ocvpEsxiHostDatastoreClusterResources + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_cluster", "test_cluster", acctest.Optional, acctest.Update, OcvpClusterWithDatastoreClustersRepresentation) + acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_cluster", "test_cluster", acctest.Required, acctest.Create, OcvpClusterSingularDataSourceRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "cluster_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "compartment_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "compute_availability_domain"), + resource.TestCheckResourceAttr(singularDatasourceName, "datastore_cluster_ids.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "datastores.#", "1"), - resource.TestCheckResourceAttr(singularDatasourceName, "datastores.0.block_volume_ids.#", "1"), - resource.TestCheckResourceAttrSet(singularDatasourceName, "datastores.0.capacity"), - resource.TestCheckResourceAttr(singularDatasourceName, "datastores.0.datastore_type", "WORKLOAD"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(singularDatasourceName, "esxi_hosts_count", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "esxi_software_version", "esxi7u3k-21313628-1"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_commitment", "HOUR"), - resource.TestCheckResourceAttr(singularDatasourceName, "initial_host_ocpu_count", "12"), + resource.TestCheckResourceAttr(singularDatasourceName, "initial_host_ocpu_count", clusterInitialHostOcpuCount), resource.TestCheckResourceAttr(singularDatasourceName, "instance_display_name_prefix", "tf-test-"), resource.TestCheckResourceAttr(singularDatasourceName, "is_shielded_instance_enabled", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "network_configuration.#", "1"), @@ -323,7 +442,7 @@ func TestOcvpClusterResource_basic(t *testing.T) { Config: config + OcvpClusterRequiredOnlyResource, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{}, + ImportStateVerifyIgnore: []string{"attach_datastore_cluster_ids", "detach_datastore_cluster_ids"}, ResourceName: resourceName, }, }) diff --git a/internal/integrationtest/ocvp_datastore_cluster_test.go b/internal/integrationtest/ocvp_datastore_cluster_test.go new file mode 100644 index 00000000000..3f10ea54df7 --- /dev/null +++ b/internal/integrationtest/ocvp_datastore_cluster_test.go @@ -0,0 +1,365 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + tf_client "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "github.com/oracle/terraform-provider-oci/internal/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + OcvpDatastoreClusterRequiredOnlyResource = OcvpDatastoreClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Required, acctest.Create, OcvpDatastoreClusterRepresentation) + + OcvpDatastoreClusterResourceConfig = OcvpDatastoreClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Optional, acctest.Update, OcvpDatastoreClusterRepresentation) + + OcvpDatastoreClusterSingularDataSourceRepresentation = map[string]interface{}{ + "datastore_cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_ocvp_datastore_cluster.test_datastore_cluster.id}`}, + } + + OcvpDatastoreClusterDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "datastore_cluster_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_ocvp_datastore_cluster.test_datastore_cluster.id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `Active`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: OcvpDatastoreClusterDataSourceFilterRepresentation}} + OcvpDatastoreClusterDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_ocvp_datastore_cluster.test_datastore_cluster.id}`}}, + } + + OcvpDatastoreClusterRepresentation = map[string]interface{}{ + "availability_domain": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "datastore_cluster_type": acctest.Representation{RepType: acctest.Required, Create: `MANAGEMENT`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `displayName`, Update: `displayName2`}, + "datastore_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${oci_ocvp_datastore.test_datastore_1.id}`}, Update: []string{`${oci_ocvp_datastore.test_datastore_1.id}`, `${oci_ocvp_datastore.test_datastore_2.id}`}}, + "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{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagsChangesRepresentation}, + } + + OcvpDatastoreClusterResourceDependencies = OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore_1", acctest.Required, acctest.Create, + OcvpDatastoreRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore_2", acctest.Required, acctest.Create, + acctest.GetUpdatedRepresentationCopy("block_volume_ids", acctest.Representation{ + RepType: acctest.Required, Create: []string{`${oci_core_volume.test_volumes[0].id}`, `${oci_core_volume.test_volumes[1].id}`}, + }, OcvpDatastoreRepresentation)) + /* + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Required, acctest.Create, OcvpDatastoreClusterRepresentation) + */ +) + +// issue-routing-tag: ocvp/default +func TestOcvpDatastoreClusterResource_basic(t *testing.T) { + httpreplay.SetScenario("TestOcvpDatastoreClusterResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + compartmentIdU := utils.GetEnvSettingWithDefault("compartment_id_for_update", compartmentId) + compartmentIdUVariableStr := fmt.Sprintf("variable \"compartment_id_for_update\" { default = \"%s\" }\n", compartmentIdU) + + resourceName := "oci_ocvp_datastore_cluster.test_datastore_cluster" + datasourceName := "data.oci_ocvp_datastore_clusters.test_datastore_clusters" + singularDatasourceName := "data.oci_ocvp_datastore_cluster.test_datastore_cluster" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+OcvpDatastoreClusterResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Optional, acctest.Create, OcvpDatastoreClusterRepresentation), "ocvp", "datastoreCluster", t) + + acctest.ResourceTest(t, testAccCheckOcvpDatastoreClusterDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + OcvpDatastoreClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Required, acctest.Create, OcvpDatastoreClusterRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_type", "MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + OcvpDatastoreClusterResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + OcvpDatastoreClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Optional, acctest.Create, OcvpDatastoreClusterRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_type", "MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "datastore_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + 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 + }, + ), + }, + + // verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + OcvpDatastoreClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(OcvpDatastoreClusterRepresentation, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_type", "MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "datastore_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + OcvpDatastoreClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Optional, acctest.Update, OcvpDatastoreClusterRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_type", "MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "datastore_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + 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 + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_datastore_clusters", "test_datastore_clusters", acctest.Optional, acctest.Update, OcvpDatastoreClusterDataSourceRepresentation) + + compartmentIdVariableStr + OcvpDatastoreClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Optional, acctest.Update, OcvpDatastoreClusterRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "datastore_cluster_id"), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "state", "Active"), + + resource.TestCheckResourceAttr(datasourceName, "datastore_cluster_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "datastore_cluster_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_datastore_cluster", "test_datastore_cluster", acctest.Required, acctest.Create, OcvpDatastoreClusterSingularDataSourceRepresentation) + + compartmentIdVariableStr + OcvpDatastoreClusterResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "datastore_cluster_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "availability_domain"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "datastore_cluster_type", "MANAGEMENT"), + resource.TestCheckResourceAttr(singularDatasourceName, "datastore_ids.#", "2"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(singularDatasourceName, "esxi_host_ids.#", "0"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // verify resource import + { + Config: config + OcvpDatastoreClusterRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckOcvpDatastoreClusterDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).DatastoreClusterClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_ocvp_datastore_cluster" { + noResourceFound = false + request := oci_ocvp.GetDatastoreClusterRequest{} + + tmp := rs.Primary.ID + request.DatastoreClusterId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "ocvp") + + response, err := client.GetDatastoreCluster(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_ocvp.LifecycleStatesDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.LifecycleState)]; !ok { + //resource lifecycle state is not in expected deleted lifecycle states. + return fmt.Errorf("resource lifecycle state: %s is not in expected deleted lifecycle states", response.LifecycleState) + } + //resource lifecycle state is in expected deleted lifecycle states. continue with next one. + continue + } + + //Verify that exception is for '404 not found'. + if failure, isServiceError := common.IsServiceError(err); !isServiceError || failure.GetHTTPStatusCode() != 404 { + return err + } + } + } + if noResourceFound { + return fmt.Errorf("at least one resource was expected from the state file, but could not be found") + } + + return nil +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("OcvpDatastoreCluster") { + resource.AddTestSweepers("OcvpDatastoreCluster", &resource.Sweeper{ + Name: "OcvpDatastoreCluster", + Dependencies: acctest.DependencyGraph["datastoreCluster"], + F: sweepOcvpDatastoreClusterResource, + }) + } +} + +func sweepOcvpDatastoreClusterResource(compartment string) error { + datastoreClusterClient := acctest.GetTestClients(&schema.ResourceData{}).DatastoreClusterClient() + datastoreClusterIds, err := getOcvpDatastoreClusterIds(compartment) + if err != nil { + return err + } + for _, datastoreClusterId := range datastoreClusterIds { + if ok := acctest.SweeperDefaultResourceId[datastoreClusterId]; !ok { + deleteDatastoreClusterRequest := oci_ocvp.DeleteDatastoreClusterRequest{} + + deleteDatastoreClusterRequest.DatastoreClusterId = &datastoreClusterId + + deleteDatastoreClusterRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "ocvp") + _, error := datastoreClusterClient.DeleteDatastoreCluster(context.Background(), deleteDatastoreClusterRequest) + if error != nil { + fmt.Printf("Error deleting DatastoreCluster %s %s, It is possible that the resource is already deleted. Please verify manually \n", datastoreClusterId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &datastoreClusterId, OcvpDatastoreClusterSweepWaitCondition, time.Duration(3*time.Minute), + OcvpDatastoreClusterSweepResponseFetchOperation, "ocvp", true) + } + } + return nil +} + +func getOcvpDatastoreClusterIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "DatastoreClusterId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + datastoreClusterClient := acctest.GetTestClients(&schema.ResourceData{}).DatastoreClusterClient() + + listDatastoreClustersRequest := oci_ocvp.ListDatastoreClustersRequest{} + listDatastoreClustersRequest.CompartmentId = &compartmentId + listDatastoreClustersRequest.LifecycleState = oci_ocvp.ListDatastoreClustersLifecycleStateActive + listDatastoreClustersResponse, err := datastoreClusterClient.ListDatastoreClusters(context.Background(), listDatastoreClustersRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting DatastoreCluster list for compartment id : %s , %s \n", compartmentId, err) + } + for _, datastoreCluster := range listDatastoreClustersResponse.Items { + id := *datastoreCluster.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "DatastoreClusterId", id) + } + return resourceIds, nil +} + +func OcvpDatastoreClusterSweepWaitCondition(response common.OCIOperationResponse) bool { + // Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required. + if datastoreClusterResponse, ok := response.Response.(oci_ocvp.GetDatastoreClusterResponse); ok { + return datastoreClusterResponse.LifecycleState != oci_ocvp.LifecycleStatesDeleted + } + return false +} + +func OcvpDatastoreClusterSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.DatastoreClusterClient().GetDatastoreCluster(context.Background(), oci_ocvp.GetDatastoreClusterRequest{ + DatastoreClusterId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/ocvp_datastore_test.go b/internal/integrationtest/ocvp_datastore_test.go new file mode 100644 index 00000000000..a11d20906a9 --- /dev/null +++ b/internal/integrationtest/ocvp_datastore_test.go @@ -0,0 +1,379 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + tf_client "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "github.com/oracle/terraform-provider-oci/internal/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + OcvpDatastoreRequiredOnlyResource = OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Required, acctest.Create, OcvpDatastoreRepresentation) + + OcvpDatastoreResourceConfig = OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Optional, acctest.Update, OcvpDatastoreRepresentationForUpdate) + + OcvpDatastoreSingularDataSourceRepresentation = map[string]interface{}{ + "datastore_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_ocvp_datastore.test_datastore.id}`}, + } + + OcvpDatastoreDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "datastore_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_ocvp_datastore.test_datastore.id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `Active`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: OcvpDatastoreDataSourceFilterRepresentation}} + OcvpDatastoreDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_ocvp_datastore.test_datastore.id}`}}, + } + + OcvpDatastoreRepresentation = map[string]interface{}{ + "availability_domain": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}`}, + "block_volume_ids": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_core_volume.test_volumes[0].id}`}}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `displayName`, Update: `displayName2`}, + "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{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagsChangesRepresentation}, + } + + OcvpDatastoreRepresentationForUpdate = acctest.GetUpdatedRepresentationCopy("block_volume_ids", acctest.Representation{ + RepType: acctest.Required, Create: []string{`${oci_core_volume.test_volumes[0].id}`, `${oci_core_volume.test_volumes[1].id}`}, + }, OcvpDatastoreRepresentation) + + OcvpDatastoreResourceDependencies = AvailabilityDomainConfig + DefinedTagsDependencies + ` +resource "oci_core_volume" "test_volumes" { + count = 2 + display_name = "test_volume_${count.index}" + availability_domain = "${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}" + compartment_id = var.compartment_id + size_in_gbs = 50 +} +` +) + +// issue-routing-tag: ocvp/default +func TestOcvpDatastoreResource_basic(t *testing.T) { + httpreplay.SetScenario("TestOcvpDatastoreResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + compartmentIdU := utils.GetEnvSettingWithDefault("compartment_id_for_update", compartmentId) + compartmentIdUVariableStr := fmt.Sprintf("variable \"compartment_id_for_update\" { default = \"%s\" }\n", compartmentIdU) + + resourceName := "oci_ocvp_datastore.test_datastore" + datasourceName := "data.oci_ocvp_datastores.test_datastores" + singularDatasourceName := "data.oci_ocvp_datastore.test_datastore" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+OcvpDatastoreResourceDependencies, "ocvp", "datastore", t) + + acctest.ResourceTest(t, testAccCheckOcvpDatastoreDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Required, acctest.Create, OcvpDatastoreRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "block_volume_ids.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_ids.0"), + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "block_volume_details.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_details.0.id"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + OcvpDatastoreResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Optional, acctest.Create, OcvpDatastoreRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "block_volume_ids.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_ids.0"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "block_volume_details.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_details.0.id"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + 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 + }, + ), + }, + + // verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(OcvpDatastoreRepresentation, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "block_volume_ids.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_ids.0"), + resource.TestCheckResourceAttr(resourceName, "block_volume_details.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_details.0.id"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Optional, acctest.Update, OcvpDatastoreRepresentationForUpdate), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "block_volume_ids.#", "2"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_ids.1"), + resource.TestCheckResourceAttr(resourceName, "block_volume_details.#", "2"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_details.1.id"), + 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, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + 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 + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_datastores", "test_datastores", acctest.Optional, acctest.Update, OcvpDatastoreDataSourceRepresentation) + + compartmentIdVariableStr + OcvpDatastoreResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Optional, acctest.Update, OcvpDatastoreRepresentationForUpdate), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "datastore_id"), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "state", "Active"), + + resource.TestCheckResourceAttr(datasourceName, "datastore_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "datastore_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_datastore", "test_datastore", acctest.Required, acctest.Create, OcvpDatastoreSingularDataSourceRepresentation) + + compartmentIdVariableStr + OcvpDatastoreResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "datastore_id"), + + resource.TestCheckResourceAttrSet(singularDatasourceName, "availability_domain"), + resource.TestCheckResourceAttr(singularDatasourceName, "block_volume_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "block_volume_details.#", "2"), + resource.TestCheckResourceAttrSet(resourceName, "block_volume_details.1.id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "capacity_in_gbs"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // verify resource import + { + Config: config + OcvpDatastoreRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckOcvpDatastoreDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).DatastoreClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_ocvp_datastore" { + noResourceFound = false + request := oci_ocvp.GetDatastoreRequest{} + + tmp := rs.Primary.ID + request.DatastoreId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "ocvp") + + response, err := client.GetDatastore(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_ocvp.LifecycleStatesDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.LifecycleState)]; !ok { + //resource lifecycle state is not in expected deleted lifecycle states. + return fmt.Errorf("resource lifecycle state: %s is not in expected deleted lifecycle states", response.LifecycleState) + } + //resource lifecycle state is in expected deleted lifecycle states. continue with next one. + continue + } + + //Verify that exception is for '404 not found'. + if failure, isServiceError := common.IsServiceError(err); !isServiceError || failure.GetHTTPStatusCode() != 404 { + return err + } + } + } + if noResourceFound { + return fmt.Errorf("at least one resource was expected from the state file, but could not be found") + } + + return nil +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("OcvpDatastore") { + resource.AddTestSweepers("OcvpDatastore", &resource.Sweeper{ + Name: "OcvpDatastore", + Dependencies: acctest.DependencyGraph["datastore"], + F: sweepOcvpDatastoreResource, + }) + } +} + +func sweepOcvpDatastoreResource(compartment string) error { + datastoreClient := acctest.GetTestClients(&schema.ResourceData{}).DatastoreClient() + datastoreIds, err := getOcvpDatastoreIds(compartment) + if err != nil { + return err + } + for _, datastoreId := range datastoreIds { + if ok := acctest.SweeperDefaultResourceId[datastoreId]; !ok { + deleteDatastoreRequest := oci_ocvp.DeleteDatastoreRequest{} + + deleteDatastoreRequest.DatastoreId = &datastoreId + + deleteDatastoreRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "ocvp") + _, error := datastoreClient.DeleteDatastore(context.Background(), deleteDatastoreRequest) + if error != nil { + fmt.Printf("Error deleting Datastore %s %s, It is possible that the resource is already deleted. Please verify manually \n", datastoreId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &datastoreId, OcvpDatastoreSweepWaitCondition, time.Duration(3*time.Minute), + OcvpDatastoreSweepResponseFetchOperation, "ocvp", true) + } + } + return nil +} + +func getOcvpDatastoreIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "DatastoreId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + datastoreClient := acctest.GetTestClients(&schema.ResourceData{}).DatastoreClient() + + listDatastoresRequest := oci_ocvp.ListDatastoresRequest{} + listDatastoresRequest.CompartmentId = &compartmentId + listDatastoresRequest.LifecycleState = oci_ocvp.ListDatastoresLifecycleStateActive + listDatastoresResponse, err := datastoreClient.ListDatastores(context.Background(), listDatastoresRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting Datastore list for compartment id : %s , %s \n", compartmentId, err) + } + for _, datastore := range listDatastoresResponse.Items { + id := *datastore.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "DatastoreId", id) + } + return resourceIds, nil +} + +func OcvpDatastoreSweepWaitCondition(response common.OCIOperationResponse) bool { + // Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required. + if datastoreResponse, ok := response.Response.(oci_ocvp.GetDatastoreResponse); ok { + return datastoreResponse.LifecycleState != oci_ocvp.LifecycleStatesDeleted + } + return false +} + +func OcvpDatastoreSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.DatastoreClient().GetDatastore(context.Background(), oci_ocvp.GetDatastoreRequest{ + DatastoreId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/ocvp_esxi_host_test.go b/internal/integrationtest/ocvp_esxi_host_test.go index ebce0f8ae0e..49b7e7921e4 100644 --- a/internal/integrationtest/ocvp_esxi_host_test.go +++ b/internal/integrationtest/ocvp_esxi_host_test.go @@ -57,20 +57,37 @@ var ( "is_swap_billing_only": acctest.Representation{RepType: acctest.Optional, Create: `true`}, } + donorHostsHourlyDataSourceRepresentation = map[string]interface{}{ + "is_billing_donors_only": acctest.Representation{RepType: acctest.Required, Create: `true`}, + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "filter": []acctest.RepresentationGroup{ + {RepType: acctest.Required, Group: map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `host_shape_name`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{esxiShapeName}}, + }}, + {RepType: acctest.Required, Group: map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `current_sku`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`HOUR`}}, + }}, + }, + } + esxiShapeName = "VM.Standard.E4.Flex" - esxiOcpuCount = "8" + esxiOcpuCount = "4" esxiName = fmt.Sprintf("host%d", time.Now().Unix()) esxiUpdateName = fmt.Sprintf("host%d", time.Now().Unix()+1) OcvpEsxiHostRepresentation = map[string]interface{}{ - "cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_ocvp_clusters.test_clusters_v7_management.cluster_collection[0].items[0].id}`}, - "capacity_reservation_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_core_compute_capacity_reservation.test_esxi_host_compute_capacity_reservation.id}`}, - "compute_availability_domain": acctest.Representation{RepType: acctest.Optional, Create: `${lookup(data.oci_identity_availability_domains.ADs.availability_domains[1],"name")}`}, - "display_name": acctest.Representation{RepType: acctest.Optional, Create: esxiName, Update: esxiUpdateName}, - "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: esxiOcpuCount}, - "host_shape_name": acctest.Representation{RepType: acctest.Optional, Create: esxiShapeName}, - "esxi_software_version": acctest.Representation{RepType: acctest.Optional, Create: `esxi7u3k-21313628-1`}, + "cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_ocvp_clusters.test_clusters_v7_management.cluster_collection[0].items[0].id}`}, + "capacity_reservation_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_core_compute_capacity_reservation.test_esxi_host_compute_capacity_reservation.id}`}, + "compute_availability_domain": acctest.Representation{RepType: acctest.Optional, Create: `${lookup(data.oci_identity_availability_domains.ADs.availability_domains[1],"name")}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: esxiName, Update: esxiUpdateName}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: esxiOcpuCount}, + "host_shape_name": acctest.Representation{RepType: acctest.Optional, Create: esxiShapeName}, + "esxi_software_version": acctest.Representation{RepType: acctest.Optional, Create: `esxi7u3k-21313628-1`}, + "attach_datastore_cluster_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${oci_ocvp_datastore_cluster.test_datastore_clusters[0].id}`, `${oci_ocvp_datastore_cluster.test_datastore_clusters[1].id}`}, Update: []string{}}, + "detach_datastore_cluster_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{}, Update: []string{`${oci_ocvp_datastore_cluster.test_datastore_clusters[0].id}`}}, } ocvpEsxiHostCapacityReservationResource = ` @@ -115,6 +132,30 @@ resource "oci_core_compute_capacity_reservation" "test_esxi_host_compute_capacit } } } +` + ocvpEsxiHostDatastoreClusterResources = ` +resource "oci_core_volume" "test_volumes" { + count = 2 + display_name = "test_volume_${count.index}" + availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[1],"name")}" + compartment_id = var.compartment_id + size_in_gbs = 50 +} +resource "oci_ocvp_datastore" "test_datastores" { + count = 2 + compartment_id = var.compartment_id + availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[1],"name")}" + display_name = "test_datastore_${count.index}" + block_volume_ids = [oci_core_volume.test_volumes[count.index].id] +} +resource "oci_ocvp_datastore_cluster" "test_datastore_clusters" { + count = 2 + compartment_id = var.compartment_id + availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[1],"name")}" + datastore_cluster_type = "WORKLOAD" + display_name = "test_datastore_cluster_${count.index}" + datastore_ids = [oci_ocvp_datastore.test_datastores[count.index].id] +} ` EsxiHostResourceDependencies = sddcDataSourceDependencies + ` @@ -132,7 +173,7 @@ data "oci_ocvp_clusters" "test_clusters_v7_management" { } ` - EsxiHostOptionalResourceDependencies = EsxiHostResourceDependencies + ocvpAvailabilityDomainDependency + ocvpEsxiHostCapacityReservationResource + EsxiHostOptionalResourceDependencies = EsxiHostResourceDependencies + ocvpAvailabilityDomainDependency + ocvpEsxiHostCapacityReservationResource + ocvpEsxiHostDatastoreClusterResources ) // issue-routing-tag: ocvp/default @@ -195,10 +236,14 @@ func TestOcvpEsxiHostResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet("data.oci_ocvp_esxi_hosts.swap_billing_esxi_hosts", "id"), ), }, - // delete before next Create and verify donor host data source + // delete before next Create + { + Config: config + compartmentIdVariableStr + EsxiHostResourceDependencies, + }, + // verify donor host data source { Config: config + compartmentIdVariableStr + EsxiHostResourceDependencies + - acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_esxi_hosts", "test_esxi_hosts", acctest.Optional, acctest.Create, donorHostsDataSourceRepresentation), + acctest.GenerateDataSourceFromRepresentationMap("oci_ocvp_esxi_hosts", "test_esxi_hosts", acctest.Optional, acctest.Create, donorHostsHourlyDataSourceRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(datasourceName, "compartment_id"), resource.TestCheckResourceAttr(datasourceName, "is_billing_donors_only", "true"), @@ -209,7 +254,6 @@ func TestOcvpEsxiHostResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "id"), ), }, - // verify Create with optionals { Config: config + compartmentIdVariableStr + EsxiHostOptionalResourceDependencies + @@ -235,6 +279,10 @@ func TestOcvpEsxiHostResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "time_updated"), resource.TestCheckResourceAttr(resourceName, "vmware_software_version", noInstanceVmwareVersionV7), resource.TestCheckResourceAttrSet(resourceName, "is_billing_continuation_in_progress"), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "attach_datastore_cluster_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "detach_datastore_cluster_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "datastore_attachments.#", "2"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -270,6 +318,10 @@ func TestOcvpEsxiHostResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "time_created"), resource.TestCheckResourceAttrSet(resourceName, "time_updated"), resource.TestCheckResourceAttr(resourceName, "vmware_software_version", noInstanceVmwareVersionV7), + resource.TestCheckResourceAttr(resourceName, "datastore_cluster_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "attach_datastore_cluster_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "detach_datastore_cluster_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "datastore_attachments.#", "1"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -320,6 +372,8 @@ func TestOcvpEsxiHostResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "compartment_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "compute_availability_domain"), resource.TestCheckResourceAttrSet(singularDatasourceName, "current_commitment"), + resource.TestCheckResourceAttr(singularDatasourceName, "datastore_attachments.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "datastore_cluster_ids.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "esxi_software_version", "esxi7u3k-21313628-1"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "next_commitment"), @@ -341,7 +395,7 @@ func TestOcvpEsxiHostResource_basic(t *testing.T) { Config: config + OcvpEsxiHostRequiredOnlyResource, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{}, + ImportStateVerifyIgnore: []string{"attach_datastore_cluster_ids", "detach_datastore_cluster_ids"}, ResourceName: resourceName, }, }) diff --git a/internal/integrationtest/ocvp_sddc_test.go b/internal/integrationtest/ocvp_sddc_test.go index ce9fa094724..7b06390c933 100644 --- a/internal/integrationtest/ocvp_sddc_test.go +++ b/internal/integrationtest/ocvp_sddc_test.go @@ -69,6 +69,9 @@ var ( esxiSoftwareVersion = `esxi6.7-19195723-2` esxiSoftwareVersionUpdated = `esxi7u3k-21313628-1` + sddcInitialHostShapeName = "BM.Standard2.52" + sddcInitialHostOcpuCount = "12" + OcvpSddcRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "initial_configuration": acctest.RepresentationGroup{RepType: acctest.Required, Group: OcvpSddcInitialConfigurationRepresentation}, @@ -81,7 +84,7 @@ var ( "is_single_host_sddc": acctest.Representation{RepType: acctest.Optional, Create: `false`}, "is_hcx_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, "hcx_action": acctest.Representation{RepType: acctest.Optional, Create: ocvp.UpgradeHcxAction}, - "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagsChangesRepresentation}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreTagsChangesRepresentation}, } OcvpSddcInitialConfigurationRepresentation = map[string]interface{}{ "initial_cluster_configurations": acctest.RepresentationGroup{RepType: acctest.Required, Group: OcvpSddcInitialConfigurationInitialClusterConfigurationsRepresentation}, @@ -100,8 +103,8 @@ var ( "datastores": acctest.RepresentationGroup{RepType: acctest.Optional, Group: OcvpSddcDatastoresRepresentation}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: "displayName"}, "initial_commitment": acctest.Representation{RepType: acctest.Optional, Create: `HOUR`}, - "initial_host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: `12`}, - "initial_host_shape_name": acctest.Representation{RepType: acctest.Optional, Create: `BM.Standard2.52`}, + "initial_host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: sddcInitialHostOcpuCount}, + "initial_host_shape_name": acctest.Representation{RepType: acctest.Optional, Create: sddcInitialHostShapeName}, "instance_display_name_prefix": acctest.Representation{RepType: acctest.Optional, Create: `tf-test-`}, "is_shielded_instance_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, "workload_network_cidr": acctest.Representation{RepType: acctest.Optional, Create: `172.20.0.0/24`}, @@ -116,13 +119,19 @@ var ( "datastores": acctest.RepresentationGroup{RepType: acctest.Optional, Group: OcvpSddcDatastoresRepresentation}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: "displayName"}, "initial_commitment": acctest.Representation{RepType: acctest.Optional, Create: `HOUR`}, - "initial_host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: `12`}, - "initial_host_shape_name": acctest.Representation{RepType: acctest.Optional, Create: `BM.Standard2.52`}, + "initial_host_ocpu_count": acctest.Representation{RepType: acctest.Optional, Create: sddcInitialHostOcpuCount}, + "initial_host_shape_name": acctest.Representation{RepType: acctest.Optional, Create: sddcInitialHostShapeName}, "instance_display_name_prefix": acctest.Representation{RepType: acctest.Optional, Create: `tf-test-`}, "is_shielded_instance_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, "workload_network_cidr": acctest.Representation{RepType: acctest.Optional, Create: `172.20.0.0/24`}, } + OcvpSddcInitialConfigurationInitialClusterConfigurationsUpdateRepresentationWithDatastoreCluster = acctest.RepresentationCopyWithNewProperties( + acctest.RepresentationCopyWithRemovedProperties(OcvpSddcInitialConfigurationInitialClusterConfigurationsUpdateRepresentation, []string{"datastores"}), + map[string]interface{}{ + "datastore_cluster_ids": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_ocvp_datastore_cluster.test_datastore_cluster.id}`}}, + }) + OcvpSddcInitialConfigurationInitialClusterConfigurationsNetworkConfigurationRepresentation = map[string]interface{}{ "nsx_edge_vtep_vlan_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_vlan.test_nsx_edge_vtep_vlan.id}`}, "nsx_vtep_vlan_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_vlan.test_nsx_vtep_vlan.id}`}, @@ -154,6 +163,9 @@ var ( ignoreDefinedTagsChangesRepresentation = map[string]interface{}{ "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}}, } + ignoreTagsChangesRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`, `system_tags`}}, + } OcvpSddcDatastoresRepresentation = map[string]interface{}{ "block_volume_ids": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_core_volume.test_volume.id}`}}, "datastore_type": acctest.Representation{RepType: acctest.Required, Create: `MANAGEMENT`}, @@ -164,6 +176,11 @@ var ( "esxi_software_version": acctest.Representation{RepType: acctest.Required, Create: esxiSoftwareVersionUpdated}, }) + sddcV7RepresentationWithDatastoreCluster = acctest.GetUpdatedRepresentationCopy( + "initial_configuration.initial_cluster_configurations", + acctest.RepresentationGroup{RepType: acctest.Required, Group: OcvpSddcInitialConfigurationInitialClusterConfigurationsUpdateRepresentationWithDatastoreCluster}, + sddcV7Representation) + sddcUpgradedRepresentation = acctest.RepresentationCopyWithNewProperties(OcvpSddcRepresentation, map[string]interface{}{ "vmware_software_version": acctest.Representation{RepType: acctest.Required, Create: noInstanceVmwareVersionV7}, "initial_configuration": acctest.RepresentationGroup{RepType: acctest.Required, Group: OcvpSddcInitialConfigurationUpdateRepresentation}, @@ -485,21 +502,38 @@ resource "oci_core_compute_capacity_reservation" "test_compute_capacity_reservat availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" display_name = "tf-esxi-host-test-capacity-reservation" instance_reservation_configs { - instance_shape = "BM.Standard2.52" + instance_shape = "` + sddcInitialHostShapeName + `" reserved_count = 1 fault_domain = "FAULT-DOMAIN-1" } instance_reservation_configs { - instance_shape = "BM.Standard2.52" + instance_shape = "` + sddcInitialHostShapeName + `" reserved_count = 1 fault_domain = "FAULT-DOMAIN-2" } instance_reservation_configs { - instance_shape = "BM.Standard2.52" + instance_shape = "` + sddcInitialHostShapeName + `" reserved_count = 1 fault_domain = "FAULT-DOMAIN-3" } } +` + + OcvsSddcDatastoreClusterResource = ` +resource "oci_ocvp_datastore" "test_datastore" { + compartment_id = var.compartment_id + availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" + display_name = "test_datastore" + block_volume_ids = [oci_core_volume.test_volume.id] +} + +resource "oci_ocvp_datastore_cluster" "test_datastore_cluster" { + compartment_id = var.compartment_id + availability_domain = "${lookup(data.oci_identity_availability_domains.ADs.availability_domains[0],"name")}" + display_name = "test_datastore_cluster" + datastore_cluster_type = "MANAGEMENT" + datastore_ids = [oci_ocvp_datastore.test_datastore.id] +} ` OcvpSddcOptionalResourceDependencies = OcvpSddcResourceDependencies + OcvpSddcCapacityReservationResource @@ -658,6 +692,70 @@ func TestOcvpSddcResource_basic(t *testing.T) { { Config: config + compartmentIdVariableStr + OcvpSddcResourceDependencies, }, + // verify Create with optionals using datastore cluster + { + Config: config + compartmentIdVariableStr + OcvpSddcOptionalResourceDependencies + OcvsSddcDatastoreClusterResource + + acctest.GenerateResourceFromRepresentationMap("oci_ocvp_sddc", "test_sddc", acctest.Optional, acctest.Create, sddcV7RepresentationWithDatastoreCluster), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "clusters_count"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", sddcDisplayName1), + resource.TestCheckResourceAttr(resourceName, "vmware_software_version", noInstanceVmwareVersionV7), + resource.TestCheckResourceAttr(resourceName, "ssh_authorized_keys", sshKey), + resource.TestCheckResourceAttr(resourceName, "esxi_software_version", esxiSoftwareVersionUpdated), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "hcx_mode", "ENTERPRISE"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.capacity_reservation_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastore_cluster_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.#", "0"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.esxi_hosts_count", "3"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_commitment", "HOUR"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", sddcInitialHostOcpuCount), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_shape_name"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.instance_display_name_prefix", "tf-test-"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.is_shielded_instance_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.hcx_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.nsx_edge_uplink1vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.nsx_edge_uplink2vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.nsx_edge_vtep_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.nsx_vtep_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.provisioning_subnet_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.provisioning_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.replication_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.vmotion_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.vsan_vlan_id"), + resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.0.vsphere_vlan_id"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.vsphere_type", "MANAGEMENT"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.workload_network_cidr", "172.20.0.0/24"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.actual_esxi_hosts_count", "3"), + resource.TestCheckResourceAttr(resourceName, "is_single_host_sddc", "false"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "vcenter_fqdn"), + resource.TestCheckResourceAttrSet(resourceName, "nsx_manager_fqdn"), + resource.TestCheckResourceAttrSet(resourceName, "nsx_manager_private_ip_id"), + resource.TestCheckResourceAttrSet(resourceName, "vcenter_private_ip_id"), + resource.TestCheckResourceAttrSet(resourceName, "hcx_on_prem_licenses.#"), + resource.TestCheckResourceAttr(resourceName, "is_hcx_pending_downgrade", "false"), + resource.TestCheckResourceAttr(resourceName, "is_hcx_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "hcx_action", ocvp.UpgradeHcxAction), + 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 + }, + ), + }, + // verify Create with optionals { Config: config + compartmentIdVariableStr + OcvpSddcOptionalResourceDependencies + @@ -676,13 +774,14 @@ func TestOcvpSddcResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.capacity_reservation_id"), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastore_cluster_ids.#", "0"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.#", "1"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.block_volume_ids.#", "1"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.datastore_type", "MANAGEMENT"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.esxi_hosts_count", "3"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_commitment", "HOUR"), - resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", "12"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", sddcInitialHostOcpuCount), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_shape_name"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.instance_display_name_prefix", "tf-test-"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.is_shielded_instance_enabled", "false"), @@ -744,13 +843,14 @@ func TestOcvpSddcResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.capacity_reservation_id"), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastore_cluster_ids.#", "0"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.#", "1"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.block_volume_ids.#", "1"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.datastore_type", "MANAGEMENT"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.esxi_hosts_count", "3"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_commitment", "HOUR"), - resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", "12"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", sddcInitialHostOcpuCount), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_shape_name"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.instance_display_name_prefix", "tf-test-"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.is_shielded_instance_enabled", "false"), @@ -808,13 +908,14 @@ func TestOcvpSddcResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.capacity_reservation_id"), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.compute_availability_domain"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastore_cluster_ids.#", "0"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.#", "1"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.block_volume_ids.#", "1"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.datastore_type", "MANAGEMENT"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.esxi_hosts_count", "3"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_commitment", "HOUR"), - resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", "12"), + resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", sddcInitialHostOcpuCount), resource.TestCheckResourceAttrSet(resourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_shape_name"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.instance_display_name_prefix", "tf-test-"), resource.TestCheckResourceAttr(resourceName, "initial_configuration.0.initial_cluster_configurations.0.is_shielded_instance_enabled", "false"), @@ -889,13 +990,14 @@ func TestOcvpSddcResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.#", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.compute_availability_domain"), + resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.datastore_cluster_ids.#", "0"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.block_volume_ids.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.datastores.0.datastore_type", "MANAGEMENT"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.display_name", "displayName"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.esxi_hosts_count", "3"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_commitment", "HOUR"), - resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", "12"), + resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.initial_host_ocpu_count", sddcInitialHostOcpuCount), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.instance_display_name_prefix", "tf-test-"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.is_shielded_instance_enabled", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "initial_configuration.0.initial_cluster_configurations.0.network_configuration.#", "1"), diff --git a/internal/integrationtest/psql_db_system_test.go b/internal/integrationtest/psql_db_system_test.go index 8e508364823..9c58c68036e 100644 --- a/internal/integrationtest/psql_db_system_test.go +++ b/internal/integrationtest/psql_db_system_test.go @@ -199,7 +199,7 @@ var ( } PsqlDbSystemMonthlyManagementPolicyBackupPolicyRepresentation = map[string]interface{}{ "backup_start": acctest.Representation{RepType: acctest.Optional, Create: `02:00`, Update: `03:00`}, - "kind": acctest.Representation{RepType: acctest.Optional, Create: `MONTHLY`}, + "kind": acctest.Representation{RepType: acctest.Optional, Create: `MONTHLY`, Update: `NONE`}, "retention_days": acctest.Representation{RepType: acctest.Optional, Create: `1`, Update: `2`}, "days_of_the_month": acctest.Representation{RepType: acctest.Optional, Create: []string{`1`}, Update: []string{`2`}}, } diff --git a/internal/integrationtest/resource_analytics_monitored_region_test.go b/internal/integrationtest/resource_analytics_monitored_region_test.go new file mode 100644 index 00000000000..57c599a2260 --- /dev/null +++ b/internal/integrationtest/resource_analytics_monitored_region_test.go @@ -0,0 +1,213 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + tf_client "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "github.com/oracle/terraform-provider-oci/internal/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ResourceAnalyticsMonitoredRegionResourceConfig = ResourceAnalyticsMonitoredRegionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_monitored_region", "test_monitored_region", acctest.Optional, acctest.Update, ResourceAnalyticsMonitoredRegionRepresentation) + + ResourceAnalyticsMonitoredRegionRepresentation = map[string]interface{}{ + "region_id": acctest.Representation{RepType: acctest.Required, Create: `${var.monitor_region}`}, + "resource_analytics_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id}`}, + } + + ResourceAnalyticsMonitoredRegionResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceRepresentation) +) + +// issue-routing-tag: resource_analytics/default +func TestResourceAnalyticsMonitoredRegionResource_basic(t *testing.T) { + httpreplay.SetScenario("TestResourceAnalyticsMonitoredRegionResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + subnetId := utils.GetEnvSettingWithBlankDefault("subnet_id") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) + + monitorRegion := utils.GetEnvSettingWithBlankDefault("monitor_region") + monitorRegionStr := fmt.Sprintf("variable \"monitor_region\" { default = \"%s\" }\n", monitorRegion) + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + defaultVariablesStr := monitorRegionStr + subnetIdVariableStr + fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_resource_analytics_monitored_region.test_monitored_region" + + var resId string + // Save TF content to Create resource with only required properties. This has to be exactly the same as the config part in the create step in the test. + acctest.SaveConfigContent(config+defaultVariablesStr+ResourceAnalyticsMonitoredRegionResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_monitored_region", "test_monitored_region", acctest.Required, acctest.Create, ResourceAnalyticsMonitoredRegionRepresentation), "resourceanalytics", "monitoredRegion", t) + + acctest.ResourceTest(t, testAccCheckResourceAnalyticsMonitoredRegionDestroy, []resource.TestStep{ + // STEP 0 - verify Create + { + ExpectNonEmptyPlan: true, + Config: config + defaultVariablesStr + ResourceAnalyticsMonitoredRegionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_monitored_region", "test_monitored_region", acctest.Required, acctest.Create, ResourceAnalyticsMonitoredRegionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "region_id"), + resource.TestCheckResourceAttrSet(resourceName, "resource_analytics_instance_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 + }, + ), + }, + // STEP 1 - verify resource import + { + Config: config + ResourceAnalyticsMonitoredRegionResourceConfig, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckResourceAnalyticsMonitoredRegionDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).MonitoredRegionClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_resource_analytics_monitored_region" { + noResourceFound = false + request := oci_resource_analytics.GetMonitoredRegionRequest{} + + tmp := rs.Primary.ID + request.MonitoredRegionId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "resource_analytics") + + response, err := client.GetMonitoredRegion(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_resource_analytics.MonitoredRegionLifecycleStateDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.LifecycleState)]; !ok { + //resource lifecycle state is not in expected deleted lifecycle states. + return fmt.Errorf("resource lifecycle state: %s is not in expected deleted lifecycle states", response.LifecycleState) + } + //resource lifecycle state is in expected deleted lifecycle states. continue with next one. + continue + } + + //Verify that exception is for '404 not found'. + if failure, isServiceError := common.IsServiceError(err); !isServiceError || failure.GetHTTPStatusCode() != 404 { + return err + } + } + } + if noResourceFound { + return fmt.Errorf("at least one resource was expected from the state file, but could not be found") + } + + return nil +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("ResourceAnalyticsMonitoredRegion") { + resource.AddTestSweepers("ResourceAnalyticsMonitoredRegion", &resource.Sweeper{ + Name: "ResourceAnalyticsMonitoredRegion", + Dependencies: acctest.DependencyGraph["monitoredRegion"], + F: sweepResourceAnalyticsMonitoredRegionResource, + }) + } +} + +func sweepResourceAnalyticsMonitoredRegionResource(compartment string) error { + monitoredRegionClient := acctest.GetTestClients(&schema.ResourceData{}).MonitoredRegionClient() + monitoredRegionIds, err := getResourceAnalyticsMonitoredRegionIds(compartment) + if err != nil { + return err + } + for _, monitoredRegionId := range monitoredRegionIds { + if ok := acctest.SweeperDefaultResourceId[monitoredRegionId]; !ok { + deleteMonitoredRegionRequest := oci_resource_analytics.DeleteMonitoredRegionRequest{} + + deleteMonitoredRegionRequest.MonitoredRegionId = &monitoredRegionId + + deleteMonitoredRegionRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "resource_analytics") + _, error := monitoredRegionClient.DeleteMonitoredRegion(context.Background(), deleteMonitoredRegionRequest) + if error != nil { + fmt.Printf("Error deleting MonitoredRegion %s %s, It is possible that the resource is already deleted. Please verify manually \n", monitoredRegionId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &monitoredRegionId, ResourceAnalyticsMonitoredRegionSweepWaitCondition, time.Duration(3*time.Minute), + ResourceAnalyticsMonitoredRegionSweepResponseFetchOperation, "resource_analytics", true) + } + } + return nil +} + +func getResourceAnalyticsMonitoredRegionIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "MonitoredRegionId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + monitoredRegionClient := acctest.GetTestClients(&schema.ResourceData{}).MonitoredRegionClient() + + listMonitoredRegionsRequest := oci_resource_analytics.ListMonitoredRegionsRequest{} + //listMonitoredRegionsRequest.CompartmentId = &compartmentId + listMonitoredRegionsRequest.LifecycleState = oci_resource_analytics.MonitoredRegionLifecycleStateActive + listMonitoredRegionsResponse, err := monitoredRegionClient.ListMonitoredRegions(context.Background(), listMonitoredRegionsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting MonitoredRegion list for compartment id : %s , %s \n", compartmentId, err) + } + for _, monitoredRegion := range listMonitoredRegionsResponse.Items { + id := *monitoredRegion.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "MonitoredRegionId", id) + } + return resourceIds, nil +} + +func ResourceAnalyticsMonitoredRegionSweepWaitCondition(response common.OCIOperationResponse) bool { + // Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required. + if monitoredRegionResponse, ok := response.Response.(oci_resource_analytics.GetMonitoredRegionResponse); ok { + return monitoredRegionResponse.LifecycleState != oci_resource_analytics.MonitoredRegionLifecycleStateDeleted + } + return false +} + +func ResourceAnalyticsMonitoredRegionSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.MonitoredRegionClient().GetMonitoredRegion(context.Background(), oci_resource_analytics.GetMonitoredRegionRequest{ + MonitoredRegionId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management_test.go b/internal/integrationtest/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management_test.go new file mode 100644 index 00000000000..b256b843824 --- /dev/null +++ b/internal/integrationtest/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management_test.go @@ -0,0 +1,128 @@ +// Copyright (c) 2017, 2024, 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-testing/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 ( + ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation = map[string]interface{}{ + "attachment_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: ResourceAnalyticsResourceAnalyticsInstanceOacManagementAttachmentDetailsRepresentation}, + "attachment_type": acctest.Representation{RepType: acctest.Required, Create: `MANAGED`}, + "resource_analytics_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id}`}, + "enable_oac": acctest.Representation{RepType: acctest.Required, Create: `true`, Update: `false`}, + } + ResourceAnalyticsResourceAnalyticsInstanceOacManagementAttachmentDetailsRepresentation = map[string]interface{}{ + "idcs_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${var.idcs_domain_id}`}, + "license_model": acctest.Representation{RepType: acctest.Optional, Create: `LICENSE_INCLUDED`}, + "network_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ResourceAnalyticsResourceAnalyticsInstanceOacManagementAttachmentDetailsNetworkDetailsRepresentation}, + "nsg_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${var.nsg_id}`}}, + "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.subnet_id}`}, + } + ResourceAnalyticsResourceAnalyticsInstanceOacManagementAttachmentDetailsNetworkDetailsRepresentation = map[string]interface{}{ + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`}, + "nsg_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${var.nsg_id}`}}, + } + + ResourceAnalyticsInstanceOacManagementResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceRepresentation) +) + +// issue-routing-tag: resource_analytics/default +func TestResourceAnalyticsResourceAnalyticsInstanceOacManagementResource_basic(t *testing.T) { + httpreplay.SetScenario("TestResourceAnalyticsResourceAnalyticsInstanceOacManagementResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + subnetId := utils.GetEnvSettingWithBlankDefault("subnet_id") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) + + idcsDomainId := utils.GetEnvSettingWithBlankDefault("idcs_domain_id") + idcsDomainIdStr := fmt.Sprintf("variable \"idcs_domain_id\" { default = \"%s\" }\n", idcsDomainId) + + nsgId := utils.GetEnvSettingWithBlankDefault("nsg_id") + nsgIdStr := fmt.Sprintf("variable \"nsg_id\" { default = \"%s\" }\n", nsgId) + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + defaultVarsStr := nsgIdStr + subnetIdVariableStr + idcsDomainIdStr + fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_resource_analytics_resource_analytics_instance_oac_management.test_resource_analytics_instance_oac_management" + parentResourceName := "oci_resource_analytics_resource_analytics_instance_oac_management.test_resource_analytics_instance_oac_management" + // Save TF content to Create resource with only required properties. This has to be exactly the same as the config part in the create step in the test. + acctest.SaveConfigContent(config+defaultVarsStr+ResourceAnalyticsInstanceOacManagementResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation), "resourceanalytics", "resourceAnalyticsInstanceOacManagement", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // Step 0 - create with enable + { + PreConfig: func() { + fmt.Printf("-=- PreConfig Step 0: %s", config+defaultVarsStr+ResourceAnalyticsInstanceOacManagementResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation)) + }, + Config: config + defaultVarsStr + ResourceAnalyticsInstanceOacManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "attachment_details.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "attachment_details.0.idcs_domain_id"), + resource.TestCheckResourceAttr(resourceName, "attachment_type", "MANAGED"), + resource.TestCheckResourceAttrSet(resourceName, "resource_analytics_instance_id"), + ), + }, + // Step 1 - verify enable + { + PreConfig: func() { + fmt.Printf("-=- PreConfig Step 1: %s", config+defaultVarsStr+ResourceAnalyticsInstanceOacManagementResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation)) + }, + Config: config + defaultVarsStr + ResourceAnalyticsInstanceOacManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(parentResourceName, "enable_oac", "true"), + ), + }, + // Step 2 - delete before next Create + { + Config: config + defaultVarsStr + ResourceAnalyticsInstanceOacManagementResourceDependencies, + }, + // Step 3 - create with enable and optional fields + { + Config: config + defaultVarsStr + ResourceAnalyticsInstanceOacManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Optional, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "attachment_details.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "attachment_details.0.idcs_domain_id"), + resource.TestCheckResourceAttr(resourceName, "attachment_type", "MANAGED"), + resource.TestCheckResourceAttrSet(resourceName, "resource_analytics_instance_id"), + ), + }, + // Step 4 - update to disable + { + Config: config + defaultVarsStr + ResourceAnalyticsInstanceOacManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Optional, acctest.Update, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "attachment_details.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "attachment_details.0.idcs_domain_id"), + resource.TestCheckResourceAttr(resourceName, "attachment_type", "MANAGED"), + resource.TestCheckResourceAttrSet(resourceName, "resource_analytics_instance_id"), + ), + }, + // Step 5 - verify disable + { + Config: config + defaultVarsStr + ResourceAnalyticsInstanceOacManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance_oac_management", "test_resource_analytics_instance_oac_management", acctest.Optional, acctest.Update, ResourceAnalyticsResourceAnalyticsInstanceOacManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(parentResourceName, "enable_oac", "false"), + ), + }, + }) +} diff --git a/internal/integrationtest/resource_analytics_resource_analytics_instance_test.go b/internal/integrationtest/resource_analytics_resource_analytics_instance_test.go new file mode 100644 index 00000000000..d338f30dd9a --- /dev/null +++ b/internal/integrationtest/resource_analytics_resource_analytics_instance_test.go @@ -0,0 +1,376 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + tf_client "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ResourceAnalyticsResourceAnalyticsInstanceRequiredOnlyResource = ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceRepresentation) + + ResourceAnalyticsResourceAnalyticsInstanceResourceConfig = ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Optional, acctest.Update, ResourceAnalyticsResourceAnalyticsInstanceRepresentation) + + ResourceAnalyticsResourceAnalyticsInstanceSingularDataSourceRepresentation = map[string]interface{}{ + "resource_analytics_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id}`}, + } + + ResourceAnalyticsResourceAnalyticsInstanceDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `asim-ra-test`, Update: `asim-ra-test2`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ResourceAnalyticsResourceAnalyticsInstanceDataSourceFilterRepresentation}} + ResourceAnalyticsResourceAnalyticsInstanceDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id}`}}, + } + + ResourceAnalyticsResourceAnalyticsInstanceRepresentation = map[string]interface{}{ + "adw_admin_password": acctest.RepresentationGroup{RepType: acctest.Required, Group: ResourceAnalyticsResourceAnalyticsInstanceAdwAdminPasswordRepresentation}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_id}`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `asim-ra-test`, Update: `asim-ra-test2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "is_mutual_tls_required": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "license_model": acctest.Representation{RepType: acctest.Optional, Create: `LICENSE_INCLUDED`}, + } + ResourceAnalyticsResourceAnalyticsInstanceAdwAdminPasswordRepresentation = map[string]interface{}{ + "password_type": acctest.Representation{RepType: acctest.Required, Create: `PLAIN_TEXT`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `BEstrO0ng_#11`}, + } + + ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies = "" +) + +// issue-routing-tag: resource_analytics/default +func TestResourceAnalyticsResourceAnalyticsInstanceResource_basic(t *testing.T) { + httpreplay.SetScenario("TestResourceAnalyticsResourceAnalyticsInstanceResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + subnetId := utils.GetEnvSettingWithBlankDefault("subnet_id") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + defaultVariablesStr := subnetIdVariableStr + fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + compartmentIdU := utils.GetEnvSettingWithDefault("compartment_id_for_update", compartmentId) + compartmentIdUVariableStr := fmt.Sprintf("variable \"compartment_id_for_update\" { default = \"%s\" }\n", compartmentIdU) + + resourceName := "oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance" + datasourceName := "data.oci_resource_analytics_resource_analytics_instances.test_resource_analytics_instances" + singularDatasourceName := "data.oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+defaultVariablesStr+ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Optional, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceRepresentation), "resourceanalytics", "resourceAnalyticsInstance", t) + + acctest.ResourceTest(t, testAccCheckResourceAnalyticsResourceAnalyticsInstanceDestroy, []resource.TestStep{ + // STEP 0 (1/8)-- verify Create + { + Config: config + defaultVariablesStr + ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.#", "1"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password_type", "PLAIN_TEXT"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // STEP 1 (2/8)- delete before next Create + { + Config: config + defaultVariablesStr + ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies, + }, + // STEP 2 (3/8)- verify Create with optionals + { + Config: config + defaultVariablesStr + ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Optional, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.#", "1"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password_type", "PLAIN_TEXT"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "display_name", "asim-ra-test"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_mutual_tls_required", "false"), + resource.TestCheckResourceAttr(resourceName, "license_model", "LICENSE_INCLUDED"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + + 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 + }, + ), + }, + + // STEP 3 (4/8)- verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + defaultVariablesStr + compartmentIdUVariableStr + ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(ResourceAnalyticsResourceAnalyticsInstanceRepresentation, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.#", "1"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password_type", "PLAIN_TEXT"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "display_name", "asim-ra-test"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_mutual_tls_required", "false"), + resource.TestCheckResourceAttr(resourceName, "license_model", "LICENSE_INCLUDED"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + + 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 + }, + ), + }, + + // STEP 4 (5/8)- verify updates to updatable parameters + { + Config: config + defaultVariablesStr + ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Optional, acctest.Update, ResourceAnalyticsResourceAnalyticsInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.#", "1"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "adw_admin_password.0.password_type", "PLAIN_TEXT"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description2"), + resource.TestCheckResourceAttr(resourceName, "display_name", "asim-ra-test2"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "is_mutual_tls_required", "false"), + resource.TestCheckResourceAttr(resourceName, "license_model", "LICENSE_INCLUDED"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + + 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 + }, + ), + }, + // STEP 5 (6/8)- verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instances", "test_resource_analytics_instances", acctest.Optional, acctest.Update, ResourceAnalyticsResourceAnalyticsInstanceDataSourceRepresentation) + + defaultVariablesStr + ResourceAnalyticsResourceAnalyticsInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Optional, acctest.Update, ResourceAnalyticsResourceAnalyticsInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "display_name", "asim-ra-test2"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + + resource.TestCheckResourceAttr(datasourceName, "resource_analytics_instance_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "resource_analytics_instance_collection.0.items.#", "1"), + ), + }, + // STEP 6 (7/8)- verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_resource_analytics_resource_analytics_instance", "test_resource_analytics_instance", acctest.Required, acctest.Create, ResourceAnalyticsResourceAnalyticsInstanceSingularDataSourceRepresentation) + + defaultVariablesStr + ResourceAnalyticsResourceAnalyticsInstanceResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "resource_analytics_instance_id"), + + resource.TestCheckResourceAttrSet(singularDatasourceName, "adw_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "asim-ra-test2"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // STEP 7 (8/8)- verify resource import + { + Config: config + ResourceAnalyticsResourceAnalyticsInstanceRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "adw_admin_password", + "is_mutual_tls_required", + "license_model", + "nsg_ids", + "subnet_id", + }, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckResourceAnalyticsResourceAnalyticsInstanceDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).ResourceAnalyticsInstanceClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_resource_analytics_resource_analytics_instance" { + noResourceFound = false + request := oci_resource_analytics.GetResourceAnalyticsInstanceRequest{} + + tmp := rs.Primary.ID + request.ResourceAnalyticsInstanceId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "resource_analytics") + + response, err := client.GetResourceAnalyticsInstance(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.LifecycleState)]; !ok { + //resource lifecycle state is not in expected deleted lifecycle states. + return fmt.Errorf("resource lifecycle state: %s is not in expected deleted lifecycle states", response.LifecycleState) + } + //resource lifecycle state is in expected deleted lifecycle states. continue with next one. + continue + } + + //Verify that exception is for '404 not found'. + if failure, isServiceError := common.IsServiceError(err); !isServiceError || failure.GetHTTPStatusCode() != 404 { + return err + } + } + } + if noResourceFound { + return fmt.Errorf("at least one resource was expected from the state file, but could not be found") + } + + return nil +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("ResourceAnalyticsResourceAnalyticsInstance") { + resource.AddTestSweepers("ResourceAnalyticsResourceAnalyticsInstance", &resource.Sweeper{ + Name: "ResourceAnalyticsResourceAnalyticsInstance", + Dependencies: acctest.DependencyGraph["resourceAnalyticsInstance"], + F: sweepResourceAnalyticsResourceAnalyticsInstanceResource, + }) + } +} + +func sweepResourceAnalyticsResourceAnalyticsInstanceResource(compartment string) error { + resourceAnalyticsInstanceClient := acctest.GetTestClients(&schema.ResourceData{}).ResourceAnalyticsInstanceClient() + resourceAnalyticsInstanceIds, err := getResourceAnalyticsResourceAnalyticsInstanceIds(compartment) + if err != nil { + return err + } + for _, resourceAnalyticsInstanceId := range resourceAnalyticsInstanceIds { + if ok := acctest.SweeperDefaultResourceId[resourceAnalyticsInstanceId]; !ok { + deleteResourceAnalyticsInstanceRequest := oci_resource_analytics.DeleteResourceAnalyticsInstanceRequest{} + + deleteResourceAnalyticsInstanceRequest.ResourceAnalyticsInstanceId = &resourceAnalyticsInstanceId + + deleteResourceAnalyticsInstanceRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "resource_analytics") + _, error := resourceAnalyticsInstanceClient.DeleteResourceAnalyticsInstance(context.Background(), deleteResourceAnalyticsInstanceRequest) + if error != nil { + fmt.Printf("Error deleting ResourceAnalyticsInstance %s %s, It is possible that the resource is already deleted. Please verify manually \n", resourceAnalyticsInstanceId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &resourceAnalyticsInstanceId, ResourceAnalyticsResourceAnalyticsInstanceSweepWaitCondition, time.Duration(3*time.Minute), + ResourceAnalyticsResourceAnalyticsInstanceSweepResponseFetchOperation, "resource_analytics", true) + } + } + return nil +} + +func getResourceAnalyticsResourceAnalyticsInstanceIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ResourceAnalyticsInstanceId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + resourceAnalyticsInstanceClient := acctest.GetTestClients(&schema.ResourceData{}).ResourceAnalyticsInstanceClient() + + listResourceAnalyticsInstancesRequest := oci_resource_analytics.ListResourceAnalyticsInstancesRequest{} + listResourceAnalyticsInstancesRequest.CompartmentId = &compartmentId + listResourceAnalyticsInstancesRequest.LifecycleState = oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateNeedsAttention + listResourceAnalyticsInstancesResponse, err := resourceAnalyticsInstanceClient.ListResourceAnalyticsInstances(context.Background(), listResourceAnalyticsInstancesRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting ResourceAnalyticsInstance list for compartment id : %s , %s \n", compartmentId, err) + } + for _, resourceAnalyticsInstance := range listResourceAnalyticsInstancesResponse.Items { + id := *resourceAnalyticsInstance.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ResourceAnalyticsInstanceId", id) + } + return resourceIds, nil +} + +func ResourceAnalyticsResourceAnalyticsInstanceSweepWaitCondition(response common.OCIOperationResponse) bool { + // Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required. + if resourceAnalyticsInstanceResponse, ok := response.Response.(oci_resource_analytics.GetResourceAnalyticsInstanceResponse); ok { + return resourceAnalyticsInstanceResponse.LifecycleState != oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateDeleted + } + return false +} + +func ResourceAnalyticsResourceAnalyticsInstanceSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.ResourceAnalyticsInstanceClient().GetResourceAnalyticsInstance(context.Background(), oci_resource_analytics.GetResourceAnalyticsInstanceRequest{ + ResourceAnalyticsInstanceId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/resource_analytics_tenancy_attachment_test.go b/internal/integrationtest/resource_analytics_tenancy_attachment_test.go new file mode 100644 index 00000000000..7a6bb26c51b --- /dev/null +++ b/internal/integrationtest/resource_analytics_tenancy_attachment_test.go @@ -0,0 +1,313 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + tf_client "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "github.com/oracle/terraform-provider-oci/internal/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ResourceAnalyticsTenancyAttachmentRequiredOnlyResource = ResourceAnalyticsTenancyAttachmentResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Required, acctest.Create, ResourceAnalyticsTenancyAttachmentRepresentation) + + ResourceAnalyticsTenancyAttachmentResourceConfig = ResourceAnalyticsTenancyAttachmentResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Optional, acctest.Update, ResourceAnalyticsTenancyAttachmentRepresentation) + + ResourceAnalyticsTenancyAttachmentSingularDataSourceRepresentation = map[string]interface{}{ + "tenancy_attachment_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_resource_analytics_tenancy_attachment.test_tenancy_attachment.id}`}, + } + + ResourceAnalyticsTenancyAttachmentDataSourceRepresentation = map[string]interface{}{ + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_resource_analytics_tenancy_attachment.test_tenancy_attachment.id}`}, + "resource_analytics_instance_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ResourceAnalyticsTenancyAttachmentDataSourceFilterRepresentation}} + ResourceAnalyticsTenancyAttachmentDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_resource_analytics_tenancy_attachment.test_tenancy_attachment.id}`}}, + } + + ResourceAnalyticsTenancyAttachmentRepresentation = map[string]interface{}{ + "resource_analytics_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id}`}, + "tenancy_id": acctest.Representation{RepType: acctest.Required, Create: `${var.tenancy_ta2_ocid}`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, + } + + ResourceAnalyticsTenancyAttachmentResourceDependencies = ResourceAnalyticsResourceAnalyticsInstanceRequiredOnlyResource +) + +// issue-routing-tag: resource_analytics/default +func TestResourceAnalyticsTenancyAttachmentResource_basic(t *testing.T) { + httpreplay.SetScenario("TestResourceAnalyticsTenancyAttachmentResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + subnetId := utils.GetEnvSettingWithBlankDefault("subnet_id") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + tenancy2 := utils.GetEnvSettingWithBlankDefault("tenancy_ta2_ocid") + defaultVarsStr := subnetIdVariableStr + compartmentIdStr + fmt.Sprintf("variable \"tenancy_ta2_ocid\" { default = \"%s\" }\n", tenancy2) + + resourceName := "oci_resource_analytics_tenancy_attachment.test_tenancy_attachment" + datasourceName := "data.oci_resource_analytics_tenancy_attachments.test_tenancy_attachments" + singularDatasourceName := "data.oci_resource_analytics_tenancy_attachment.test_tenancy_attachment" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+defaultVarsStr+ResourceAnalyticsTenancyAttachmentResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Optional, acctest.Create, ResourceAnalyticsTenancyAttachmentRepresentation), "resourceanalytics", "tenancyAttachment", t) + + acctest.ResourceTest(t, testAccCheckResourceAnalyticsTenancyAttachmentDestroy, []resource.TestStep{ + // STEP 0 - verify Create + { + ExpectNonEmptyPlan: true, + Config: config + defaultVarsStr + ResourceAnalyticsTenancyAttachmentResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Required, acctest.Create, ResourceAnalyticsTenancyAttachmentRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "resource_analytics_instance_id"), + resource.TestCheckResourceAttrSet(resourceName, "tenancy_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // STEP 1 - delete before next Create + { + Config: config + defaultVarsStr + ResourceAnalyticsTenancyAttachmentResourceDependencies, + }, + // STEP 2 - verify Create with optionals + { + ExpectNonEmptyPlan: true, + Config: config + defaultVarsStr + ResourceAnalyticsTenancyAttachmentResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Optional, acctest.Create, ResourceAnalyticsTenancyAttachmentRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "is_reporting_tenancy"), + resource.TestCheckResourceAttrSet(resourceName, "resource_analytics_instance_id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "tenancy_id"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + + 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 + }, + ), + }, + + // STEP 3 - verify updates to updatable parameters + { + ExpectNonEmptyPlan: true, + Config: config + defaultVarsStr + ResourceAnalyticsTenancyAttachmentResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Optional, acctest.Update, ResourceAnalyticsTenancyAttachmentRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "description", "description2"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "is_reporting_tenancy"), + resource.TestCheckResourceAttrSet(resourceName, "resource_analytics_instance_id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "tenancy_id"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + + 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 + }, + ), + }, + // STEP 4 - verify datasource + { + ExpectNonEmptyPlan: true, + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_resource_analytics_tenancy_attachments", "test_tenancy_attachments", acctest.Optional, acctest.Update, ResourceAnalyticsTenancyAttachmentDataSourceRepresentation) + + defaultVarsStr + ResourceAnalyticsTenancyAttachmentResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Optional, acctest.Update, ResourceAnalyticsTenancyAttachmentRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "resource_analytics_instance_id"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + + resource.TestCheckResourceAttr(datasourceName, "tenancy_attachment_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "tenancy_attachment_collection.0.items.#", "1"), + ), + }, + // STEP 5 - verify singular datasource + { + ExpectNonEmptyPlan: true, + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_resource_analytics_tenancy_attachment", "test_tenancy_attachment", acctest.Required, acctest.Create, ResourceAnalyticsTenancyAttachmentSingularDataSourceRepresentation) + + defaultVarsStr + ResourceAnalyticsTenancyAttachmentResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "tenancy_attachment_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "is_reporting_tenancy"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // STEP 6 - verify resource import + { + Config: config + ResourceAnalyticsTenancyAttachmentRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckResourceAnalyticsTenancyAttachmentDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).TenancyAttachmentClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_resource_analytics_tenancy_attachment" { + noResourceFound = false + request := oci_resource_analytics.GetTenancyAttachmentRequest{} + + tmp := rs.Primary.ID + request.TenancyAttachmentId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "resource_analytics") + + response, err := client.GetTenancyAttachment(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_resource_analytics.TenancyAttachmentLifecycleStateDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.LifecycleState)]; !ok { + //resource lifecycle state is not in expected deleted lifecycle states. + return fmt.Errorf("resource lifecycle state: %s is not in expected deleted lifecycle states", response.LifecycleState) + } + //resource lifecycle state is in expected deleted lifecycle states. continue with next one. + continue + } + + //Verify that exception is for '404 not found'. + if failure, isServiceError := common.IsServiceError(err); !isServiceError || failure.GetHTTPStatusCode() != 404 { + return err + } + } + } + if noResourceFound { + return fmt.Errorf("at least one resource was expected from the state file, but could not be found") + } + + return nil +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("ResourceAnalyticsTenancyAttachment") { + resource.AddTestSweepers("ResourceAnalyticsTenancyAttachment", &resource.Sweeper{ + Name: "ResourceAnalyticsTenancyAttachment", + Dependencies: acctest.DependencyGraph["tenancyAttachment"], + F: sweepResourceAnalyticsTenancyAttachmentResource, + }) + } +} + +func sweepResourceAnalyticsTenancyAttachmentResource(compartment string) error { + tenancyAttachmentClient := acctest.GetTestClients(&schema.ResourceData{}).TenancyAttachmentClient() + tenancyAttachmentIds, err := getResourceAnalyticsTenancyAttachmentIds(compartment) + if err != nil { + return err + } + for _, tenancyAttachmentId := range tenancyAttachmentIds { + if ok := acctest.SweeperDefaultResourceId[tenancyAttachmentId]; !ok { + deleteTenancyAttachmentRequest := oci_resource_analytics.DeleteTenancyAttachmentRequest{} + + deleteTenancyAttachmentRequest.TenancyAttachmentId = &tenancyAttachmentId + + deleteTenancyAttachmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "resource_analytics") + _, error := tenancyAttachmentClient.DeleteTenancyAttachment(context.Background(), deleteTenancyAttachmentRequest) + if error != nil { + fmt.Printf("Error deleting TenancyAttachment %s %s, It is possible that the resource is already deleted. Please verify manually \n", tenancyAttachmentId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &tenancyAttachmentId, ResourceAnalyticsTenancyAttachmentSweepWaitCondition, time.Duration(3*time.Minute), + ResourceAnalyticsTenancyAttachmentSweepResponseFetchOperation, "resource_analytics", true) + } + } + return nil +} + +func getResourceAnalyticsTenancyAttachmentIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "TenancyAttachmentId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + tenancyAttachmentClient := acctest.GetTestClients(&schema.ResourceData{}).TenancyAttachmentClient() + + listTenancyAttachmentsRequest := oci_resource_analytics.ListTenancyAttachmentsRequest{} + //listTenancyAttachmentsRequest.CompartmentId = &compartmentId + listTenancyAttachmentsRequest.LifecycleState = oci_resource_analytics.TenancyAttachmentLifecycleStateNeedsAttention + listTenancyAttachmentsResponse, err := tenancyAttachmentClient.ListTenancyAttachments(context.Background(), listTenancyAttachmentsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting TenancyAttachment list for compartment id : %s , %s \n", compartmentId, err) + } + for _, tenancyAttachment := range listTenancyAttachmentsResponse.Items { + id := *tenancyAttachment.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "TenancyAttachmentId", id) + } + return resourceIds, nil +} + +func ResourceAnalyticsTenancyAttachmentSweepWaitCondition(response common.OCIOperationResponse) bool { + // Only stop if the resource is available beyond 3 mins. As there could be an issue for the sweeper to delete the resource and manual intervention required. + if tenancyAttachmentResponse, ok := response.Response.(oci_resource_analytics.GetTenancyAttachmentResponse); ok { + return tenancyAttachmentResponse.LifecycleState != oci_resource_analytics.TenancyAttachmentLifecycleStateDeleted + } + return false +} + +func ResourceAnalyticsTenancyAttachmentSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.TenancyAttachmentClient().GetTenancyAttachment(context.Background(), oci_resource_analytics.GetTenancyAttachmentRequest{ + TenancyAttachmentId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/provider/register_datasource.go b/internal/provider/register_datasource.go index e24767ffcb8..2df1c22e977 100644 --- a/internal/provider/register_datasource.go +++ b/internal/provider/register_datasource.go @@ -89,6 +89,7 @@ import ( tf_media_services "github.com/oracle/terraform-provider-oci/internal/service/media_services" tf_metering_computation "github.com/oracle/terraform-provider-oci/internal/service/metering_computation" tf_monitoring "github.com/oracle/terraform-provider-oci/internal/service/monitoring" + tf_multicloud "github.com/oracle/terraform-provider-oci/internal/service/multicloud" tf_mysql "github.com/oracle/terraform-provider-oci/internal/service/mysql" tf_network_firewall "github.com/oracle/terraform-provider-oci/internal/service/network_firewall" tf_network_load_balancer "github.com/oracle/terraform-provider-oci/internal/service/network_load_balancer" @@ -114,6 +115,7 @@ import ( tf_queue "github.com/oracle/terraform-provider-oci/internal/service/queue" tf_recovery "github.com/oracle/terraform-provider-oci/internal/service/recovery" tf_redis "github.com/oracle/terraform-provider-oci/internal/service/redis" + tf_resource_analytics "github.com/oracle/terraform-provider-oci/internal/service/resource_analytics" tf_resource_scheduler "github.com/oracle/terraform-provider-oci/internal/service/resource_scheduler" tf_resourcemanager "github.com/oracle/terraform-provider-oci/internal/service/resourcemanager" tf_sch "github.com/oracle/terraform-provider-oci/internal/service/sch" @@ -393,6 +395,9 @@ func init() { if common.CheckForEnabledServices("monitoring") { tf_monitoring.RegisterDatasource() } + if common.CheckForEnabledServices("multicloud") { + tf_multicloud.RegisterDatasource() + } if common.CheckForEnabledServices("mysql") { tf_mysql.RegisterDatasource() } @@ -468,6 +473,9 @@ func init() { if common.CheckForEnabledServices("redis") { tf_redis.RegisterDatasource() } + if common.CheckForEnabledServices("resourceanalytics") { + tf_resource_analytics.RegisterDatasource() + } if common.CheckForEnabledServices("resourcescheduler") { tf_resource_scheduler.RegisterDatasource() } diff --git a/internal/provider/register_resource.go b/internal/provider/register_resource.go index 80819f35bb6..fd1660e8d46 100644 --- a/internal/provider/register_resource.go +++ b/internal/provider/register_resource.go @@ -89,6 +89,7 @@ import ( tf_media_services "github.com/oracle/terraform-provider-oci/internal/service/media_services" tf_metering_computation "github.com/oracle/terraform-provider-oci/internal/service/metering_computation" tf_monitoring "github.com/oracle/terraform-provider-oci/internal/service/monitoring" + tf_multicloud "github.com/oracle/terraform-provider-oci/internal/service/multicloud" tf_mysql "github.com/oracle/terraform-provider-oci/internal/service/mysql" tf_network_firewall "github.com/oracle/terraform-provider-oci/internal/service/network_firewall" tf_network_load_balancer "github.com/oracle/terraform-provider-oci/internal/service/network_load_balancer" @@ -114,6 +115,7 @@ import ( tf_queue "github.com/oracle/terraform-provider-oci/internal/service/queue" tf_recovery "github.com/oracle/terraform-provider-oci/internal/service/recovery" tf_redis "github.com/oracle/terraform-provider-oci/internal/service/redis" + tf_resource_analytics "github.com/oracle/terraform-provider-oci/internal/service/resource_analytics" tf_resource_scheduler "github.com/oracle/terraform-provider-oci/internal/service/resource_scheduler" tf_resourcemanager "github.com/oracle/terraform-provider-oci/internal/service/resourcemanager" tf_sch "github.com/oracle/terraform-provider-oci/internal/service/sch" @@ -393,6 +395,9 @@ func init() { if common.CheckForEnabledServices("monitoring") { tf_monitoring.RegisterResource() } + if common.CheckForEnabledServices("multicloud") { + tf_multicloud.RegisterResource() + } if common.CheckForEnabledServices("mysql") { tf_mysql.RegisterResource() } @@ -468,6 +473,9 @@ func init() { if common.CheckForEnabledServices("redis") { tf_redis.RegisterResource() } + if common.CheckForEnabledServices("resourceanalytics") { + tf_resource_analytics.RegisterResource() + } if common.CheckForEnabledServices("resourcescheduler") { tf_resource_scheduler.RegisterResource() } diff --git a/internal/service/core/core_compute_capacity_reservation_resource.go b/internal/service/core/core_compute_capacity_reservation_resource.go index 1d4d667a5f9..697d8fbf4f1 100644 --- a/internal/service/core/core_compute_capacity_reservation_resource.go +++ b/internal/service/core/core_compute_capacity_reservation_resource.go @@ -719,6 +719,21 @@ func instanceReservationConfigsHashCodeForSets(v interface{}) int { } } + if instanceShapeConfig, ok := m["instance_shape_config"]; ok && instanceShapeConfig != "" { + if instanceShapeConfigList, ok := instanceShapeConfig.([]interface{}); ok && len(instanceShapeConfigList) > 0 { + buf.WriteString("instance_shape_config-") + for _, instanceShapeConfigMapInterface := range instanceShapeConfigList { + instanceShapeConfigMap := instanceShapeConfigMapInterface.(map[string]interface{}) + if memoryInGbs, ok := instanceShapeConfigMap["memory_in_gbs"]; ok { + buf.WriteString(fmt.Sprintf("%v-", memoryInGbs)) + } + if ocpus, ok := instanceShapeConfigMap["ocpus"]; ok { + buf.WriteString(fmt.Sprintf("%v-", ocpus)) + } + } + } + } + if clusterPlacementGroupId, ok := m["cluster_placement_group_id"]; ok && clusterPlacementGroupId != "" { buf.WriteString(fmt.Sprintf("%v-", clusterPlacementGroupId)) } diff --git a/internal/service/core/core_instance_configuration_resource.go b/internal/service/core/core_instance_configuration_resource.go index 70bf160e608..974c3841fe9 100644 --- a/internal/service/core/core_instance_configuration_resource.go +++ b/internal/service/core/core_instance_configuration_resource.go @@ -679,6 +679,12 @@ func CoreInstanceConfigurationResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_ai_enterprise_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "is_pv_encryption_in_transit_enabled": { Type: schema.TypeBool, Optional: true, @@ -1745,6 +1751,12 @@ func CoreInstanceConfigurationResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_ai_enterprise_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "is_pv_encryption_in_transit_enabled": { Type: schema.TypeBool, Optional: true, @@ -3985,6 +3997,11 @@ func (s *CoreInstanceConfigurationResourceCrud) mapToInstanceConfigurationLaunch result.IpxeScript = &tmp } + if isAIEnterpriseEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_ai_enterprise_enabled")); ok { + tmp := isAIEnterpriseEnabled.(bool) + result.IsAIEnterpriseEnabled = &tmp + } + if isPvEncryptionInTransitEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_pv_encryption_in_transit_enabled")); ok { tmp := isPvEncryptionInTransitEnabled.(bool) result.IsPvEncryptionInTransitEnabled = &tmp @@ -4160,6 +4177,10 @@ func InstanceConfigurationLaunchInstanceDetailsToMap(obj *oci_core.InstanceConfi result["ipxe_script"] = string(*obj.IpxeScript) } + if obj.IsAIEnterpriseEnabled != nil { + result["is_ai_enterprise_enabled"] = bool(*obj.IsAIEnterpriseEnabled) + } + if obj.IsPvEncryptionInTransitEnabled != nil { result["is_pv_encryption_in_transit_enabled"] = bool(*obj.IsPvEncryptionInTransitEnabled) } diff --git a/internal/service/core/core_instance_data_source.go b/internal/service/core/core_instance_data_source.go index 8ebcb6f8be5..baab45f75af 100644 --- a/internal/service/core/core_instance_data_source.go +++ b/internal/service/core/core_instance_data_source.go @@ -140,6 +140,10 @@ func (s *CoreInstanceDataSourceCrud) SetData() error { s.D.Set("ipxe_script", *s.Res.IpxeScript) } + if s.Res.IsAIEnterpriseEnabled != nil { + s.D.Set("is_ai_enterprise_enabled", *s.Res.IsAIEnterpriseEnabled) + } + if s.Res.IsCrossNumaNode != nil { s.D.Set("is_cross_numa_node", *s.Res.IsCrossNumaNode) } diff --git a/internal/service/core/core_instance_resource.go b/internal/service/core/core_instance_resource.go index 9798bc062a4..ffba63724ba 100644 --- a/internal/service/core/core_instance_resource.go +++ b/internal/service/core/core_instance_resource.go @@ -371,6 +371,11 @@ func CoreInstanceResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_ai_enterprise_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, "is_pv_encryption_in_transit_enabled": { Type: schema.TypeBool, Optional: true, @@ -1321,6 +1326,11 @@ func (s *CoreInstanceResourceCrud) Create() error { request.IpxeScript = &tmp } + if isAIEnterpriseEnabled, ok := s.D.GetOkExists("is_ai_enterprise_enabled"); ok { + tmp := isAIEnterpriseEnabled.(bool) + request.IsAIEnterpriseEnabled = &tmp + } + if isPvEncryptionInTransitEnabled, ok := s.D.GetOkExists("is_pv_encryption_in_transit_enabled"); ok { tmp := isPvEncryptionInTransitEnabled.(bool) request.IsPvEncryptionInTransitEnabled = &tmp @@ -1592,6 +1602,11 @@ func (s *CoreInstanceResourceCrud) Update() error { } } + if isAIEnterpriseEnabled, ok := s.D.GetOkExists("is_ai_enterprise_enabled"); ok { + tmp := isAIEnterpriseEnabled.(bool) + request.IsAIEnterpriseEnabled = &tmp + } + if licensingConfigs, ok := s.D.GetOkExists("licensing_configs"); ok { interfaces := licensingConfigs.([]interface{}) tmp := make([]oci_core.UpdateInstanceLicensingConfig, len(interfaces)) @@ -1809,6 +1824,10 @@ func (s *CoreInstanceResourceCrud) SetData() error { s.D.Set("ipxe_script", *s.Res.IpxeScript) } + if s.Res.IsAIEnterpriseEnabled != nil { + s.D.Set("is_ai_enterprise_enabled", *s.Res.IsAIEnterpriseEnabled) + } + if s.Res.IsCrossNumaNode != nil { s.D.Set("is_cross_numa_node", *s.Res.IsCrossNumaNode) } diff --git a/internal/service/core/core_instances_data_source.go b/internal/service/core/core_instances_data_source.go index 1f26c89a0d9..f9b32b02202 100644 --- a/internal/service/core/core_instances_data_source.go +++ b/internal/service/core/core_instances_data_source.go @@ -206,6 +206,10 @@ func (s *CoreInstancesDataSourceCrud) SetData() error { instance["ipxe_script"] = *r.IpxeScript } + if r.IsAIEnterpriseEnabled != nil { + instance["is_ai_enterprise_enabled"] = *r.IsAIEnterpriseEnabled + } + if r.IsCrossNumaNode != nil { instance["is_cross_numa_node"] = *r.IsCrossNumaNode } diff --git a/internal/service/database/database_autonomous_container_database_add_standby_resource.go b/internal/service/database/database_autonomous_container_database_add_standby_resource.go index 25dee37a6b1..678ae1b6fb2 100644 --- a/internal/service/database/database_autonomous_container_database_add_standby_resource.go +++ b/internal/service/database/database_autonomous_container_database_add_standby_resource.go @@ -75,6 +75,12 @@ func DatabaseAutonomousContainerDatabaseAddStandbyResource() *schema.Resource { }, // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Optional: true, @@ -87,6 +93,12 @@ func DatabaseAutonomousContainerDatabaseAddStandbyResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "internet_proxy": { Type: schema.TypeString, Optional: true, @@ -202,6 +214,10 @@ func DatabaseAutonomousContainerDatabaseAddStandbyResource() *schema.Resource { // Optional // Computed + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Computed: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Computed: true, @@ -210,6 +226,10 @@ func DatabaseAutonomousContainerDatabaseAddStandbyResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Computed: true, + }, "internet_proxy": { Type: schema.TypeString, Computed: true, @@ -620,6 +640,10 @@ func DatabaseAutonomousContainerDatabaseAddStandbyResource() *schema.Resource { }, }, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "memory_per_oracle_compute_unit_in_gbs": { Type: schema.TypeInt, Computed: true, @@ -1042,6 +1066,10 @@ func (s *DatabaseAutonomousContainerDatabaseAddStandbyResourceCrud) SetData() er s.D.Set("maintenance_window", nil) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } @@ -1224,6 +1252,10 @@ func (s *DatabaseAutonomousContainerDatabaseAddStandbyResourceCrud) AutonomousDa func (s *DatabaseAutonomousContainerDatabaseAddStandbyResourceCrud) mapToBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + if dbrsPolicyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "dbrs_policy_id")); ok { tmp := dbrsPolicyId.(string) result.DbrsPolicyId = &tmp @@ -1239,6 +1271,11 @@ func (s *DatabaseAutonomousContainerDatabaseAddStandbyResourceCrud) mapToBackupD result.InternetProxy = &tmp } + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { result.Type = oci_database.BackupDestinationDetailsTypeEnum(type_.(string)) } @@ -1259,6 +1296,8 @@ func (s *DatabaseAutonomousContainerDatabaseAddStandbyResourceCrud) mapToBackupD func (s *DatabaseAutonomousContainerDatabaseAddStandbyResourceCrud) BackupDestinationDetailsToMap(obj oci_database.BackupDestinationDetails) map[string]interface{} { result := map[string]interface{}{} + result["backup_retention_policy_on_terminate"] = string(obj.BackupRetentionPolicyOnTerminate) + if obj.DbrsPolicyId != nil { result["dbrs_policy_id"] = string(*obj.DbrsPolicyId) } @@ -1277,6 +1316,10 @@ func (s *DatabaseAutonomousContainerDatabaseAddStandbyResourceCrud) BackupDestin result["vpc_password"] = string(*obj.VpcPassword) } + if obj.IsRetentionLockEnabled != nil { + result["is_retention_lock_enabled"] = bool(*obj.IsRetentionLockEnabled) + } + if obj.VpcUser != nil { result["vpc_user"] = string(*obj.VpcUser) } diff --git a/internal/service/database/database_autonomous_container_database_data_source.go b/internal/service/database/database_autonomous_container_database_data_source.go index 1c6a0341543..a2965595ae7 100644 --- a/internal/service/database/database_autonomous_container_database_data_source.go +++ b/internal/service/database/database_autonomous_container_database_data_source.go @@ -216,6 +216,10 @@ func (s *DatabaseAutonomousContainerDatabaseDataSourceCrud) SetData() error { s.D.Set("maintenance_window", nil) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } diff --git a/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go b/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go index bf9a6f9483c..38dbbc94a41 100644 --- a/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go +++ b/internal/service/database/database_autonomous_container_database_dataguard_association_resource.go @@ -88,6 +88,12 @@ func DatabaseAutonomousContainerDatabaseDataguardAssociationResource() *schema.R }, // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Optional: true, @@ -112,6 +118,12 @@ func DatabaseAutonomousContainerDatabaseDataguardAssociationResource() *schema.R Computed: true, ForceNew: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "remote_region": { Type: schema.TypeString, Optional: true, @@ -619,6 +631,10 @@ func (s *DatabaseAutonomousContainerDatabaseDataguardAssociationResourceCrud) Mi func (s *DatabaseAutonomousContainerDatabaseDataguardAssociationResourceCrud) mapToBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + if dbrsPolicyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "dbrs_policy_id")); ok { tmp := dbrsPolicyId.(string) result.DbrsPolicyId = &tmp @@ -639,6 +655,11 @@ func (s *DatabaseAutonomousContainerDatabaseDataguardAssociationResourceCrud) ma result.IsRemote = &tmp } + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + if remoteRegion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "remote_region")); ok { tmp := remoteRegion.(string) result.RemoteRegion = &tmp diff --git a/internal/service/database/database_autonomous_container_database_resource.go b/internal/service/database/database_autonomous_container_database_resource.go index fb8b7d72ef6..ac7e1d21de6 100644 --- a/internal/service/database/database_autonomous_container_database_resource.go +++ b/internal/service/database/database_autonomous_container_database_resource.go @@ -88,6 +88,11 @@ func DatabaseAutonomousContainerDatabaseResource() *schema.Resource { }, // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "id": { Type: schema.TypeString, Optional: true, @@ -103,6 +108,11 @@ func DatabaseAutonomousContainerDatabaseResource() *schema.Resource { Optional: true, Computed: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, "remote_region": { Type: schema.TypeString, Optional: true, @@ -405,6 +415,18 @@ func DatabaseAutonomousContainerDatabaseResource() *schema.Resource { }, // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "id": { Type: schema.TypeString, Optional: true, @@ -574,6 +596,14 @@ func DatabaseAutonomousContainerDatabaseResource() *schema.Resource { Type: schema.TypeString, }, }, + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Computed: true, + }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Computed: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Computed: true, @@ -975,6 +1005,10 @@ func DatabaseAutonomousContainerDatabaseResource() *schema.Resource { }, }, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "memory_per_oracle_compute_unit_in_gbs": { Type: schema.TypeInt, Computed: true, @@ -1602,6 +1636,10 @@ func (s *DatabaseAutonomousContainerDatabaseResourceCrud) SetData() error { s.D.Set("maintenance_window", nil) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } @@ -1882,8 +1920,11 @@ func BackupDestinationConfigurationSummaryToMap(obj oci_database.BackupDestinati for i, attachTime := range obj.BackupDestinationAttachHistory { stringHistory[i] = attachTime.String() } + result["backup_destination_attach_history"] = stringHistory + result["backup_retention_policy_on_terminate"] = string(obj.BackupRetentionPolicyOnTerminate) + if obj.DbrsPolicyId != nil { result["dbrs_policy_id"] = string(*obj.DbrsPolicyId) } @@ -1892,6 +1933,10 @@ func BackupDestinationConfigurationSummaryToMap(obj oci_database.BackupDestinati result["id"] = string(*obj.Id) } + if obj.IsRetentionLockEnabled != nil { + result["is_retention_lock_enabled"] = bool(*obj.IsRetentionLockEnabled) + } + if obj.InternetProxy != nil { result["internet_proxy"] = string(*obj.InternetProxy) } @@ -2014,6 +2059,10 @@ func (s *DatabaseAutonomousContainerDatabaseResourceCrud) AutonomousDatabaseKeyH func (s *DatabaseAutonomousContainerDatabaseResourceCrud) mapToBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + if id, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "id")); ok { tmp := id.(string) result.Id = &tmp @@ -2029,6 +2078,11 @@ func (s *DatabaseAutonomousContainerDatabaseResourceCrud) mapToBackupDestination result.IsRemote = &tmp } + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + if remoteRegion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "remote_region")); ok { tmp := remoteRegion.(string) result.RemoteRegion = &tmp @@ -2054,6 +2108,8 @@ func (s *DatabaseAutonomousContainerDatabaseResourceCrud) mapToBackupDestination func AutonomousContainerDatabaseBackupDestinationDetailsToMap(obj oci_database.BackupDestinationDetails, s *DatabaseAutonomousContainerDatabaseResourceCrud, dataSource bool, fieldKeyFormat string) map[string]interface{} { result := map[string]interface{}{} + result["backup_retention_policy_on_terminate"] = string(obj.BackupRetentionPolicyOnTerminate) + if obj.Id != nil { result["id"] = string(*obj.Id) } @@ -2066,6 +2122,10 @@ func AutonomousContainerDatabaseBackupDestinationDetailsToMap(obj oci_database.B result["is_remote"] = bool(*obj.IsRemote) } + if obj.IsRetentionLockEnabled != nil { + result["is_retention_lock_enabled"] = bool(*obj.IsRetentionLockEnabled) + } + if obj.RemoteRegion != nil { result["remote_region"] = string(*obj.RemoteRegion) } diff --git a/internal/service/database/database_autonomous_container_databases_data_source.go b/internal/service/database/database_autonomous_container_databases_data_source.go index 198ada55f2d..8f2d6b0ef29 100644 --- a/internal/service/database/database_autonomous_container_databases_data_source.go +++ b/internal/service/database/database_autonomous_container_databases_data_source.go @@ -313,6 +313,10 @@ func (s *DatabaseAutonomousContainerDatabasesDataSourceCrud) SetData() error { autonomousContainerDatabase["maintenance_window"] = nil } + if r.MemoryPerComputeUnitInGBs != nil { + autonomousContainerDatabase["memory_per_compute_unit_in_gbs"] = *r.MemoryPerComputeUnitInGBs + } + if r.MemoryPerOracleComputeUnitInGBs != nil { autonomousContainerDatabase["memory_per_oracle_compute_unit_in_gbs"] = *r.MemoryPerOracleComputeUnitInGBs } diff --git a/internal/service/database/database_autonomous_database_backup_data_source.go b/internal/service/database/database_autonomous_database_backup_data_source.go index 2e39ed9b6f3..400ba9a693b 100644 --- a/internal/service/database/database_autonomous_database_backup_data_source.go +++ b/internal/service/database/database_autonomous_database_backup_data_source.go @@ -92,6 +92,8 @@ func (s *DatabaseAutonomousDatabaseBackupDataSourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + s.D.Set("infrastructure_type", s.Res.InfrastructureType) + if s.Res.IsAutomatic != nil { s.D.Set("is_automatic", *s.Res.IsAutomatic) } @@ -120,6 +122,10 @@ func (s *DatabaseAutonomousDatabaseBackupDataSourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + if s.Res.Region != nil { + s.D.Set("region", *s.Res.Region) + } + if s.Res.RetentionPeriodInDays != nil { s.D.Set("retention_period_in_days", *s.Res.RetentionPeriodInDays) } @@ -128,6 +134,12 @@ func (s *DatabaseAutonomousDatabaseBackupDataSourceCrud) SetData() error { s.D.Set("size_in_tbs", *s.Res.SizeInTBs) } + if s.Res.SourceDatabaseDetails != nil { + s.D.Set("source_database_details", []interface{}{SourceDatabaseDetailsToMap(s.Res.SourceDatabaseDetails)}) + } else { + s.D.Set("source_database_details", nil) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeAvailableTill != nil { diff --git a/internal/service/database/database_autonomous_database_backup_resource.go b/internal/service/database/database_autonomous_database_backup_resource.go index 90f3c5efa9b..795cd72821e 100644 --- a/internal/service/database/database_autonomous_database_backup_resource.go +++ b/internal/service/database/database_autonomous_database_backup_resource.go @@ -69,6 +69,12 @@ func DatabaseAutonomousDatabaseBackupResource() *schema.Resource { }, // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "id": { Type: schema.TypeString, Optional: true, @@ -87,6 +93,12 @@ func DatabaseAutonomousDatabaseBackupResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "remote_region": { Type: schema.TypeString, Optional: true, @@ -121,6 +133,10 @@ func DatabaseAutonomousDatabaseBackupResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "infrastructure_type": { + Type: schema.TypeString, + Computed: true, + }, "is_automatic": { Type: schema.TypeBool, Computed: true, @@ -149,10 +165,85 @@ func DatabaseAutonomousDatabaseBackupResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "region": { + Type: schema.TypeString, + Computed: true, + }, "size_in_tbs": { Type: schema.TypeFloat, Computed: true, }, + "source_database_details": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "autonomous_container_database_customer_contacts": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "email": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "autonomous_container_database_display_name": { + Type: schema.TypeString, + Computed: true, + }, + "autonomous_container_database_dst_file_version": { + Type: schema.TypeString, + Computed: true, + }, + "autonomous_container_database_name": { + Type: schema.TypeString, + Computed: true, + }, + "autonomous_database_customer_contacts": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "email": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "autonomous_database_name": { + Type: schema.TypeString, + Computed: true, + }, + "autonomous_vm_cluster_display_name": { + Type: schema.TypeString, + Computed: true, + }, + "db_workload": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "state": { Type: schema.TypeString, Computed: true, @@ -402,6 +493,8 @@ func (s *DatabaseAutonomousDatabaseBackupResourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + s.D.Set("infrastructure_type", s.Res.InfrastructureType) + if s.Res.IsAutomatic != nil { s.D.Set("is_automatic", *s.Res.IsAutomatic) } @@ -430,6 +523,10 @@ func (s *DatabaseAutonomousDatabaseBackupResourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + if s.Res.Region != nil { + s.D.Set("region", *s.Res.Region) + } + if s.Res.RetentionPeriodInDays != nil { s.D.Set("retention_period_in_days", *s.Res.RetentionPeriodInDays) } @@ -438,6 +535,12 @@ func (s *DatabaseAutonomousDatabaseBackupResourceCrud) SetData() error { s.D.Set("size_in_tbs", *s.Res.SizeInTBs) } + if s.Res.SourceDatabaseDetails != nil { + s.D.Set("source_database_details", []interface{}{SourceDatabaseDetailsToMap(s.Res.SourceDatabaseDetails)}) + } else { + s.D.Set("source_database_details", nil) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeAvailableTill != nil { @@ -464,6 +567,10 @@ func (s *DatabaseAutonomousDatabaseBackupResourceCrud) SetData() error { func (s *DatabaseAutonomousDatabaseBackupResourceCrud) mapToAutonomousBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + if id, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "id")); ok { tmp := id.(string) result.Id = &tmp @@ -479,6 +586,11 @@ func (s *DatabaseAutonomousDatabaseBackupResourceCrud) mapToAutonomousBackupDest result.IsRemote = &tmp } + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + if remoteRegion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "remote_region")); ok { tmp := remoteRegion.(string) result.RemoteRegion = &tmp @@ -504,6 +616,8 @@ func (s *DatabaseAutonomousDatabaseBackupResourceCrud) mapToAutonomousBackupDest func AutonomousBackupDestinationDetailsToMap(obj *oci_database.BackupDestinationDetails) map[string]interface{} { result := map[string]interface{}{} + result["backup_retention_policy_on_terminate"] = string(obj.BackupRetentionPolicyOnTerminate) + if obj.Id != nil { result["id"] = string(*obj.Id) } @@ -516,6 +630,10 @@ func AutonomousBackupDestinationDetailsToMap(obj *oci_database.BackupDestination result["is_remote"] = bool(*obj.IsRemote) } + if obj.IsRetentionLockEnabled != nil { + result["is_retention_lock_enabled"] = bool(*obj.IsRetentionLockEnabled) + } + if obj.RemoteRegion != nil { result["remote_region"] = string(*obj.RemoteRegion) } @@ -532,3 +650,53 @@ func AutonomousBackupDestinationDetailsToMap(obj *oci_database.BackupDestination return result } + +func CustomerContactToMap(obj oci_database.CustomerContact) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Email != nil { + result["email"] = string(*obj.Email) + } + + return result +} + +func SourceDatabaseDetailsToMap(obj *oci_database.SourceDatabaseDetails) map[string]interface{} { + result := map[string]interface{}{} + + autonomousContainerDatabaseCustomerContacts := []interface{}{} + for _, item := range obj.AutonomousContainerDatabaseCustomerContacts { + autonomousContainerDatabaseCustomerContacts = append(autonomousContainerDatabaseCustomerContacts, CustomerContactToMap(item)) + } + result["autonomous_container_database_customer_contacts"] = autonomousContainerDatabaseCustomerContacts + + if obj.AutonomousContainerDatabaseDisplayName != nil { + result["autonomous_container_database_display_name"] = string(*obj.AutonomousContainerDatabaseDisplayName) + } + + if obj.AutonomousContainerDatabaseDstFileVersion != nil { + result["autonomous_container_database_dst_file_version"] = string(*obj.AutonomousContainerDatabaseDstFileVersion) + } + + if obj.AutonomousContainerDatabaseName != nil { + result["autonomous_container_database_name"] = string(*obj.AutonomousContainerDatabaseName) + } + + autonomousDatabaseCustomerContacts := []interface{}{} + for _, item := range obj.AutonomousDatabaseCustomerContacts { + autonomousDatabaseCustomerContacts = append(autonomousDatabaseCustomerContacts, CustomerContactToMap(item)) + } + result["autonomous_database_customer_contacts"] = autonomousDatabaseCustomerContacts + + if obj.AutonomousDatabaseName != nil { + result["autonomous_database_name"] = string(*obj.AutonomousDatabaseName) + } + + if obj.AutonomousVmClusterDisplayName != nil { + result["autonomous_vm_cluster_display_name"] = string(*obj.AutonomousVmClusterDisplayName) + } + + result["db_workload"] = string(obj.DbWorkload) + + return result +} diff --git a/internal/service/database/database_autonomous_database_backups_data_source.go b/internal/service/database/database_autonomous_database_backups_data_source.go index 0b3ed4f3315..44309fa9cf3 100644 --- a/internal/service/database/database_autonomous_database_backups_data_source.go +++ b/internal/service/database/database_autonomous_database_backups_data_source.go @@ -22,6 +22,10 @@ func DatabaseAutonomousDatabaseBackupsDataSource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "backup_destination_id": { + Type: schema.TypeString, + Optional: true, + }, "compartment_id": { Type: schema.TypeString, Optional: true, @@ -30,6 +34,14 @@ func DatabaseAutonomousDatabaseBackupsDataSource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "infrastructure_type": { + Type: schema.TypeString, + Optional: true, + }, + "key_store_id": { + Type: schema.TypeString, + Optional: true, + }, "state": { Type: schema.TypeString, Optional: true, @@ -73,6 +85,11 @@ func (s *DatabaseAutonomousDatabaseBackupsDataSourceCrud) Get() error { request.AutonomousDatabaseId = &tmp } + if backupDestinationId, ok := s.D.GetOkExists("backup_destination_id"); ok { + tmp := backupDestinationId.(string) + request.BackupDestinationId = &tmp + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { tmp := compartmentId.(string) request.CompartmentId = &tmp @@ -83,6 +100,15 @@ func (s *DatabaseAutonomousDatabaseBackupsDataSourceCrud) Get() error { request.DisplayName = &tmp } + if infrastructureType, ok := s.D.GetOkExists("infrastructure_type"); ok { + request.InfrastructureType = oci_database.AutonomousDatabaseBackupSummaryInfrastructureTypeEnum(infrastructureType.(string)) + } + + if keyStoreId, ok := s.D.GetOkExists("key_store_id"); ok { + tmp := keyStoreId.(string) + request.KeyStoreId = &tmp + } + if state, ok := s.D.GetOkExists("state"); ok { request.LifecycleState = oci_database.AutonomousDatabaseBackupSummaryLifecycleStateEnum(state.(string)) } @@ -157,6 +183,8 @@ func (s *DatabaseAutonomousDatabaseBackupsDataSourceCrud) SetData() error { autonomousDatabaseBackup["id"] = *r.Id } + autonomousDatabaseBackup["infrastructure_type"] = r.InfrastructureType + if r.IsAutomatic != nil { autonomousDatabaseBackup["is_automatic"] = *r.IsAutomatic } @@ -185,6 +213,10 @@ func (s *DatabaseAutonomousDatabaseBackupsDataSourceCrud) SetData() error { autonomousDatabaseBackup["lifecycle_details"] = *r.LifecycleDetails } + if r.Region != nil { + autonomousDatabaseBackup["region"] = *r.Region + } + if r.RetentionPeriodInDays != nil { autonomousDatabaseBackup["retention_period_in_days"] = *r.RetentionPeriodInDays } @@ -193,6 +225,12 @@ func (s *DatabaseAutonomousDatabaseBackupsDataSourceCrud) SetData() error { autonomousDatabaseBackup["size_in_tbs"] = *r.SizeInTBs } + if r.SourceDatabaseDetails != nil { + autonomousDatabaseBackup["source_database_details"] = []interface{}{SourceDatabaseDetailsToMap(r.SourceDatabaseDetails)} + } else { + autonomousDatabaseBackup["source_database_details"] = nil + } + autonomousDatabaseBackup["state"] = r.LifecycleState if r.TimeAvailableTill != nil { diff --git a/internal/service/database/database_autonomous_database_data_source.go b/internal/service/database/database_autonomous_database_data_source.go index 05faa4dc1dc..cf08e8d356f 100644 --- a/internal/service/database/database_autonomous_database_data_source.go +++ b/internal/service/database/database_autonomous_database_data_source.go @@ -71,6 +71,8 @@ func (s *DatabaseAutonomousDatabaseDataSourceCrud) SetData() error { s.D.Set("actual_used_data_storage_size_in_tbs", *s.Res.ActualUsedDataStorageSizeInTBs) } + s.D.Set("additional_attributes", s.Res.AdditionalAttributes) + if s.Res.AllocatedStorageSizeInTBs != nil { s.D.Set("allocated_storage_size_in_tbs", *s.Res.AllocatedStorageSizeInTBs) } @@ -235,14 +237,6 @@ func (s *DatabaseAutonomousDatabaseDataSourceCrud) SetData() error { s.D.Set("in_memory_percentage", *s.Res.InMemoryPercentage) } - 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 { @@ -351,6 +345,14 @@ func (s *DatabaseAutonomousDatabaseDataSourceCrud) SetData() error { s.D.Set("long_term_backup_schedule", nil) } + if s.Res.MaintenanceTargetComponent != nil { + s.D.Set("maintenance_target_component", *s.Res.MaintenanceTargetComponent) + } + + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } @@ -501,10 +503,6 @@ func (s *DatabaseAutonomousDatabaseDataSourceCrud) SetData() error { s.D.Set("time_maintenance_end", s.Res.TimeMaintenanceEnd.String()) } - if s.Res.MaintenanceTargetComponent != nil { - s.D.Set("maintenance_target_component", *s.Res.MaintenanceTargetComponent) - } - if s.Res.TimeOfAutoRefreshStart != nil { s.D.Set("time_of_auto_refresh_start", s.Res.TimeOfAutoRefreshStart.Format(time.RFC3339Nano)) } diff --git a/internal/service/database/database_autonomous_database_resource.go b/internal/service/database/database_autonomous_database_resource.go index b0fae2b48c0..df61a24ae31 100644 --- a/internal/service/database/database_autonomous_database_resource.go +++ b/internal/service/database/database_autonomous_database_resource.go @@ -280,6 +280,7 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { ValidateFunc: validation.StringInSlice([]string{ "AWS", "AZURE", + "GCP", "OCI", "OKV", "ORACLE_MANAGED", @@ -315,11 +316,26 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Optional: true, Computed: true, }, + "key_ring": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "kms_key_id": { Type: schema.TypeString, Optional: true, Computed: true, }, + "kms_rest_endpoint": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "location": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "okv_kms_key": { Type: schema.TypeString, Optional: true, @@ -330,6 +346,11 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Optional: true, Computed: true, }, + "project": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "service_endpoint_uri": { Type: schema.TypeString, Optional: true, @@ -511,7 +532,6 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Optional: true, Computed: true, MaxItems: 1, - MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required @@ -714,6 +734,11 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Type: schema.TypeFloat, Computed: true, }, + "additional_attributes": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "allocated_storage_size_in_tbs": { Type: schema.TypeFloat, Computed: true, @@ -973,10 +998,22 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "key_ring": { + Type: schema.TypeString, + Computed: true, + }, "kms_key_id": { Type: schema.TypeString, Computed: true, }, + "kms_rest_endpoint": { + Type: schema.TypeString, + Computed: true, + }, + "location": { + Type: schema.TypeString, + Computed: true, + }, "okv_kms_key": { Type: schema.TypeString, Computed: true, @@ -985,6 +1022,10 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "project": { + Type: schema.TypeString, + Computed: true, + }, "service_endpoint_uri": { Type: schema.TypeString, Computed: true, @@ -1177,6 +1218,10 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "memory_per_oracle_compute_unit_in_gbs": { Type: schema.TypeInt, Computed: true, @@ -2402,6 +2447,8 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) SetData() error { s.D.Set("actual_used_data_storage_size_in_tbs", *s.Res.ActualUsedDataStorageSizeInTBs) } + s.D.Set("additional_attributes", s.Res.AdditionalAttributes) + if s.Res.AllocatedStorageSizeInTBs != nil { s.D.Set("allocated_storage_size_in_tbs", *s.Res.AllocatedStorageSizeInTBs) } @@ -2689,6 +2736,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) SetData() error { // s.D.Set("max_cpu_core_count", *s.Res.MaxCpuCoreCount) //} + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } @@ -3054,6 +3105,29 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) mapToAutonomousDatabaseEncrypti details.VaultUri = &tmp } baseObject = details + case strings.ToLower("GCP"): + details := oci_database.GcpKeyDetails{} + if keyName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "key_name")); ok { + tmp := keyName.(string) + details.KeyName = &tmp + } + if keyRing, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "key_ring")); ok { + tmp := keyRing.(string) + details.KeyRing = &tmp + } + if kmsRestEndpoint, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "kms_rest_endpoint")); ok { + tmp := kmsRestEndpoint.(string) + details.KmsRestEndpoint = &tmp + } + if location, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "location")); ok { + tmp := location.(string) + details.Location = &tmp + } + if project, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "project")); ok { + tmp := project.(string) + details.Project = &tmp + } + baseObject = details case strings.ToLower("OCI"): details := oci_database.OciKeyDetails{} if kmsKeyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "kms_key_id")); ok { @@ -3128,6 +3202,28 @@ func AutonomousDatabaseEncryptionKeyDetailsToMap(obj *oci_database.AutonomousDat if v.VaultUri != nil { result["vault_uri"] = string(*v.VaultUri) } + case oci_database.GcpKeyDetails: + result["autonomous_database_provider"] = "GCP" + + if v.KeyName != nil { + result["key_name"] = string(*v.KeyName) + } + + if v.KeyRing != nil { + result["key_ring"] = string(*v.KeyRing) + } + + if v.KmsRestEndpoint != nil { + result["kms_rest_endpoint"] = string(*v.KmsRestEndpoint) + } + + if v.Location != nil { + result["location"] = string(*v.Location) + } + + if v.Project != nil { + result["project"] = string(*v.Project) + } case oci_database.OciKeyDetails: result["autonomous_database_provider"] = "OCI" @@ -3260,16 +3356,6 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) mapToCustomerContact(fieldKeyFo return result, nil } -func CustomerContactToMap(obj oci_database.CustomerContact) map[string]interface{} { - result := map[string]interface{}{} - - if obj.Email != nil { - result["email"] = string(*obj.Email) - } - - return result -} - func DatabaseConnectionStringProfileToMap(obj oci_database.DatabaseConnectionStringProfile) map[string]interface{} { result := map[string]interface{}{} 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 dc2d320adb3..a25ff722a58 100644 --- a/internal/service/database/database_autonomous_databases_clones_data_source.go +++ b/internal/service/database/database_autonomous_databases_clones_data_source.go @@ -53,6 +53,11 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeFloat, Computed: true, }, + "additional_attributes": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "allocated_storage_size_in_tbs": { Type: schema.TypeFloat, Computed: true, @@ -438,10 +443,22 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "key_ring": { + Type: schema.TypeString, + Computed: true, + }, "kms_key_id": { Type: schema.TypeString, Computed: true, }, + "kms_rest_endpoint": { + Type: schema.TypeString, + Computed: true, + }, + "location": { + Type: schema.TypeString, + Computed: true, + }, "okv_kms_key": { Type: schema.TypeString, Computed: true, @@ -450,6 +467,10 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "project": { + Type: schema.TypeString, + Computed: true, + }, "service_endpoint_uri": { Type: schema.TypeString, Computed: true, @@ -517,10 +538,22 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "key_ring": { + Type: schema.TypeString, + Computed: true, + }, "kms_key_id": { Type: schema.TypeString, Computed: true, }, + "kms_rest_endpoint": { + Type: schema.TypeString, + Computed: true, + }, + "location": { + Type: schema.TypeString, + Computed: true, + }, "okv_kms_key": { Type: schema.TypeString, Computed: true, @@ -529,6 +562,10 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "project": { + Type: schema.TypeString, + Computed: true, + }, "service_endpoint_uri": { Type: schema.TypeString, Computed: true, @@ -750,6 +787,10 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "long_term_backup_schedule": { Type: schema.TypeList, Computed: true, @@ -1288,6 +1329,8 @@ func (s *DatabaseAutonomousDatabasesClonesDataSourceCrud) SetData() error { autonomousDatabasesClone["actual_used_data_storage_size_in_tbs"] = *r.ActualUsedDataStorageSizeInTBs } + autonomousDatabasesClone["additional_attributes"] = r.AdditionalAttributes + if r.AllocatedStorageSizeInTBs != nil { autonomousDatabasesClone["allocated_storage_size_in_tbs"] = *r.AllocatedStorageSizeInTBs } @@ -1567,6 +1610,10 @@ func (s *DatabaseAutonomousDatabasesClonesDataSourceCrud) SetData() error { // autonomousDatabasesClone["max_cpu_core_count"] = *r.MaxCpuCoreCount //} + if r.MemoryPerComputeUnitInGBs != nil { + autonomousDatabasesClone["memory_per_compute_unit_in_gbs"] = *r.MemoryPerComputeUnitInGBs + } + if r.MemoryPerOracleComputeUnitInGBs != nil { autonomousDatabasesClone["memory_per_oracle_compute_unit_in_gbs"] = *r.MemoryPerOracleComputeUnitInGBs } diff --git a/internal/service/database/database_autonomous_databases_data_source.go b/internal/service/database/database_autonomous_databases_data_source.go index 575bb552047..3b1f6a8bbb6 100644 --- a/internal/service/database/database_autonomous_databases_data_source.go +++ b/internal/service/database/database_autonomous_databases_data_source.go @@ -202,6 +202,8 @@ func (s *DatabaseAutonomousDatabasesDataSourceCrud) SetData() error { autonomousDatabase["actual_used_data_storage_size_in_tbs"] = *r.ActualUsedDataStorageSizeInTBs } + autonomousDatabase["additional_attributes"] = r.AdditionalAttributes + if r.AllocatedStorageSizeInTBs != nil { autonomousDatabase["allocated_storage_size_in_tbs"] = *r.AllocatedStorageSizeInTBs } diff --git a/internal/service/database/database_autonomous_vm_cluster_data_source.go b/internal/service/database/database_autonomous_vm_cluster_data_source.go index d67a27dfeff..852cfc6bfe1 100644 --- a/internal/service/database/database_autonomous_vm_cluster_data_source.go +++ b/internal/service/database/database_autonomous_vm_cluster_data_source.go @@ -172,6 +172,10 @@ func (s *DatabaseAutonomousVmClusterDataSourceCrud) SetData() error { s.D.Set("max_acds_lowest_scaled_value", *s.Res.MaxAcdsLowestScaledValue) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } diff --git a/internal/service/database/database_autonomous_vm_cluster_resource.go b/internal/service/database/database_autonomous_vm_cluster_resource.go index c1f4dd23124..1b7d1e9b7be 100644 --- a/internal/service/database/database_autonomous_vm_cluster_resource.go +++ b/internal/service/database/database_autonomous_vm_cluster_resource.go @@ -393,6 +393,10 @@ func DatabaseAutonomousVmClusterResource() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "memory_size_in_gbs": { Type: schema.TypeInt, Computed: true, @@ -871,6 +875,10 @@ func (s *DatabaseAutonomousVmClusterResourceCrud) SetData() error { s.D.Set("max_acds_lowest_scaled_value", *s.Res.MaxAcdsLowestScaledValue) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } diff --git a/internal/service/database/database_autonomous_vm_cluster_resource_usage_data_source.go b/internal/service/database/database_autonomous_vm_cluster_resource_usage_data_source.go index 4776e568be7..38fce9740ee 100644 --- a/internal/service/database/database_autonomous_vm_cluster_resource_usage_data_source.go +++ b/internal/service/database/database_autonomous_vm_cluster_resource_usage_data_source.go @@ -132,6 +132,10 @@ func DatabaseAutonomousVmClusterResourceUsageDataSource() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "memory_per_oracle_compute_unit_in_gbs": { Type: schema.TypeInt, Computed: true, @@ -262,6 +266,10 @@ func (s *DatabaseAutonomousVmClusterResourceUsageDataSourceCrud) SetData() error s.D.Set("is_local_backup_enabled", *s.Res.IsLocalBackupEnabled) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } diff --git a/internal/service/database/database_autonomous_vm_clusters_data_source.go b/internal/service/database/database_autonomous_vm_clusters_data_source.go index 08e8f9883ff..8abee347b01 100644 --- a/internal/service/database/database_autonomous_vm_clusters_data_source.go +++ b/internal/service/database/database_autonomous_vm_clusters_data_source.go @@ -225,6 +225,10 @@ func (s *DatabaseAutonomousVmClustersDataSourceCrud) SetData() error { autonomousVmCluster["max_acds_lowest_scaled_value"] = *r.MaxAcdsLowestScaledValue } + if r.MemoryPerComputeUnitInGBs != nil { + autonomousVmCluster["memory_per_compute_unit_in_gbs"] = *r.MemoryPerComputeUnitInGBs + } + if r.MemoryPerOracleComputeUnitInGBs != nil { autonomousVmCluster["memory_per_oracle_compute_unit_in_gbs"] = *r.MemoryPerOracleComputeUnitInGBs } diff --git a/internal/service/database/database_backup_destination_data_source.go b/internal/service/database/database_backup_destination_data_source.go index e3100f37bbc..57f706115a0 100644 --- a/internal/service/database/database_backup_destination_data_source.go +++ b/internal/service/database/database_backup_destination_data_source.go @@ -72,6 +72,16 @@ func (s *DatabaseBackupDestinationDataSourceCrud) SetData() error { } s.D.Set("associated_databases", associatedDatabases) + if s.Res.AssociatedLongTermBackupCount != nil { + s.D.Set("associated_long_term_backup_count", *s.Res.AssociatedLongTermBackupCount) + } + + associatedLongTermBackups := []interface{}{} + for _, item := range s.Res.AssociatedLongTermBackups { + associatedLongTermBackups = append(associatedLongTermBackups, AssociatedLongTermBackupToMap(item)) + } + s.D.Set("associated_long_term_backups", associatedLongTermBackups) + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/database/database_backup_destination_resource.go b/internal/service/database/database_backup_destination_resource.go index f3202ac0d90..c035bf07835 100644 --- a/internal/service/database/database_backup_destination_resource.go +++ b/internal/service/database/database_backup_destination_resource.go @@ -150,6 +150,31 @@ func DatabaseBackupDestinationResource() *schema.Resource { }, }, }, + "associated_long_term_backup_count": { + Type: schema.TypeInt, + Computed: true, + }, + "associated_long_term_backups": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "lifecycle_details": { Type: schema.TypeString, Computed: true, @@ -386,6 +411,16 @@ func (s *DatabaseBackupDestinationResourceCrud) SetData() error { } s.D.Set("associated_databases", associatedDatabases) + if s.Res.AssociatedLongTermBackupCount != nil { + s.D.Set("associated_long_term_backup_count", *s.Res.AssociatedLongTermBackupCount) + } + + associatedLongTermBackups := []interface{}{} + for _, item := range s.Res.AssociatedLongTermBackups { + associatedLongTermBackups = append(associatedLongTermBackups, AssociatedLongTermBackupToMap(item)) + } + s.D.Set("associated_long_term_backups", associatedLongTermBackups) + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } @@ -474,6 +509,20 @@ func AssociatedDatabaseDetailsToMap(obj oci_database.AssociatedDatabaseDetails) return result } +func AssociatedLongTermBackupToMap(obj oci_database.AssociatedLongTermBackup) map[string]interface{} { + result := map[string]interface{}{} + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + return result +} + func (s *DatabaseBackupDestinationResourceCrud) mapToMountTypeDetails(fieldKeyFormat string) (oci_database.MountTypeDetails, error) { var baseObject oci_database.MountTypeDetails //discriminator diff --git a/internal/service/database/database_backup_destinations_data_source.go b/internal/service/database/database_backup_destinations_data_source.go index 40248efbb04..d5b57b6f470 100644 --- a/internal/service/database/database_backup_destinations_data_source.go +++ b/internal/service/database/database_backup_destinations_data_source.go @@ -108,6 +108,16 @@ func (s *DatabaseBackupDestinationsDataSourceCrud) SetData() error { } backupDestination["associated_databases"] = associatedDatabases + if r.AssociatedLongTermBackupCount != nil { + backupDestination["associated_long_term_backup_count"] = *r.AssociatedLongTermBackupCount + } + + associatedLongTermBackups := []interface{}{} + for _, item := range r.AssociatedLongTermBackups { + associatedLongTermBackups = append(associatedLongTermBackups, AssociatedLongTermBackupToMap(item)) + } + backupDestination["associated_long_term_backups"] = associatedLongTermBackups + if r.ConnectionString != nil { backupDestination["connection_string"] = *r.ConnectionString } diff --git a/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go b/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go index 40f54416f0f..02e1c8f2fac 100644 --- a/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go +++ b/internal/service/database/database_cloud_autonomous_vm_cluster_data_source.go @@ -180,6 +180,10 @@ func (s *DatabaseCloudAutonomousVmClusterDataSourceCrud) SetData() error { s.D.Set("max_acds_lowest_scaled_value", *s.Res.MaxAcdsLowestScaledValue) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } diff --git a/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go b/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go index f4996f7ad10..88e208c75f6 100644 --- a/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go +++ b/internal/service/database/database_cloud_autonomous_vm_cluster_resource.go @@ -428,6 +428,10 @@ func DatabaseCloudAutonomousVmClusterResource() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "memory_size_in_gbs": { Type: schema.TypeInt, Computed: true, @@ -1067,6 +1071,10 @@ func (s *DatabaseCloudAutonomousVmClusterResourceCrud) SetData() error { s.D.Set("max_acds_lowest_scaled_value", *s.Res.MaxAcdsLowestScaledValue) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } diff --git a/internal/service/database/database_cloud_autonomous_vm_cluster_resource_usage_data_source.go b/internal/service/database/database_cloud_autonomous_vm_cluster_resource_usage_data_source.go index 475e26cbbac..123c817e867 100644 --- a/internal/service/database/database_cloud_autonomous_vm_cluster_resource_usage_data_source.go +++ b/internal/service/database/database_cloud_autonomous_vm_cluster_resource_usage_data_source.go @@ -128,6 +128,10 @@ func DatabaseCloudAutonomousVmClusterResourceUsageDataSource() *schema.Resource Type: schema.TypeFloat, Computed: true, }, + "memory_per_compute_unit_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, "memory_per_oracle_compute_unit_in_gbs": { Type: schema.TypeInt, Computed: true, @@ -254,6 +258,10 @@ func (s *DatabaseCloudAutonomousVmClusterResourceUsageDataSourceCrud) SetData() s.D.Set("exadata_storage_in_tbs", *s.Res.ExadataStorageInTBs) } + if s.Res.MemoryPerComputeUnitInGBs != nil { + s.D.Set("memory_per_compute_unit_in_gbs", *s.Res.MemoryPerComputeUnitInGBs) + } + if s.Res.MemoryPerOracleComputeUnitInGBs != nil { s.D.Set("memory_per_oracle_compute_unit_in_gbs", *s.Res.MemoryPerOracleComputeUnitInGBs) } diff --git a/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go b/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go index 3e1ccfb6c26..6d1410c7ad7 100644 --- a/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go +++ b/internal/service/database/database_cloud_autonomous_vm_clusters_data_source.go @@ -246,6 +246,10 @@ func (s *DatabaseCloudAutonomousVmClustersDataSourceCrud) SetData() error { cloudAutonomousVmCluster["max_acds_lowest_scaled_value"] = *r.MaxAcdsLowestScaledValue } + if r.MemoryPerComputeUnitInGBs != nil { + cloudAutonomousVmCluster["memory_per_compute_unit_in_gbs"] = *r.MemoryPerComputeUnitInGBs + } + if r.MemoryPerOracleComputeUnitInGBs != nil { cloudAutonomousVmCluster["memory_per_oracle_compute_unit_in_gbs"] = *r.MemoryPerOracleComputeUnitInGBs } diff --git a/internal/service/database/database_database_resource.go b/internal/service/database/database_database_resource.go index 64120609006..91318d5e1ae 100644 --- a/internal/service/database/database_database_resource.go +++ b/internal/service/database/database_database_resource.go @@ -140,6 +140,11 @@ func DatabaseDatabaseResource() *schema.Resource { // Required // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Optional: true, @@ -156,6 +161,12 @@ func DatabaseDatabaseResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "remote_region": { Type: schema.TypeString, Optional: true, @@ -624,6 +635,10 @@ func DatabaseDatabaseResource() *schema.Resource { // Optional // Computed + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Computed: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Computed: true, @@ -636,6 +651,10 @@ func DatabaseDatabaseResource() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Computed: true, + }, "remote_region": { Type: schema.TypeString, Computed: true, @@ -1142,6 +1161,10 @@ func (s *DatabaseDatabaseResourceCrud) ChangeKeyStoreType() error { func (s *DatabaseDatabaseResourceCrud) mapToBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + if dbrsPolicyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "dbrs_policy_id")); ok { tmp := dbrsPolicyId.(string) result.DbrsPolicyId = &tmp @@ -1162,6 +1185,11 @@ func (s *DatabaseDatabaseResourceCrud) mapToBackupDestinationDetails(fieldKeyFor result.IsRemote = &tmp } + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + if remoteRegion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "remote_region")); ok { tmp := remoteRegion.(string) result.RemoteRegion = &tmp @@ -1186,7 +1214,6 @@ func (s *DatabaseDatabaseResourceCrud) mapToBackupDestinationDetails(fieldKeyFor func (s *DatabaseDatabaseResourceCrud) mapToUpdateBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} - fields := map[string]func(string){ "dbrs_policy_id": func(val string) { tmp := val; result.DbrsPolicyId = &tmp }, "id": func(val string) { tmp := val; result.Id = &tmp }, @@ -1210,6 +1237,17 @@ func (s *DatabaseDatabaseResourceCrud) mapToUpdateBackupDestinationDetails(field } } + // handle bool field + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + + // handle enum field + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + return result, nil } @@ -1252,6 +1290,8 @@ func (s *DatabaseDatabaseResourceCrud) DatabaseBackupConfigToMap(obj *oci_databa func (s *DatabaseDatabaseResourceCrud) BackupDestinationDetailsToMap(obj oci_database.BackupDestinationDetails) map[string]interface{} { result := map[string]interface{}{} + result["backup_retention_policy_on_terminate"] = string(obj.BackupRetentionPolicyOnTerminate) + if obj.DbrsPolicyId != nil { result["dbrs_policy_id"] = string(*obj.DbrsPolicyId) } @@ -1268,6 +1308,10 @@ func (s *DatabaseDatabaseResourceCrud) BackupDestinationDetailsToMap(obj oci_dat result["is_remote"] = bool(*obj.IsRemote) } + if obj.IsRetentionLockEnabled != nil { + result["is_retention_lock_enabled"] = bool(*obj.IsRetentionLockEnabled) + } + if obj.RemoteRegion != nil { result["remote_region"] = string(*obj.RemoteRegion) } @@ -1288,6 +1332,8 @@ func (s *DatabaseDatabaseResourceCrud) BackupDestinationDetailsToMap(obj oci_dat func BackupDestinationDetailsToMap(obj oci_database.BackupDestinationDetails) map[string]interface{} { result := map[string]interface{}{} + result["backup_retention_policy_on_terminate"] = string(obj.BackupRetentionPolicyOnTerminate) + if obj.DbrsPolicyId != nil { result["dbrs_policy_id"] = string(*obj.DbrsPolicyId) } @@ -1304,6 +1350,10 @@ func BackupDestinationDetailsToMap(obj oci_database.BackupDestinationDetails) ma result["is_remote"] = bool(*obj.IsRemote) } + if obj.IsRetentionLockEnabled != nil { + result["is_retention_lock_enabled"] = bool(*obj.IsRetentionLockEnabled) + } + if obj.RemoteRegion != nil { result["remote_region"] = string(*obj.RemoteRegion) } diff --git a/internal/service/database/database_database_upgrade_resource.go b/internal/service/database/database_database_upgrade_resource.go index bdaf1966c70..bd7d56fb841 100644 --- a/internal/service/database/database_database_upgrade_resource.go +++ b/internal/service/database/database_database_upgrade_resource.go @@ -232,6 +232,10 @@ func DatabaseDatabaseUpgradeResource() *schema.Resource { // Optional // Computed + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Computed: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Computed: true, @@ -248,6 +252,10 @@ func DatabaseDatabaseUpgradeResource() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Computed: true, + }, "remote_region": { Type: schema.TypeString, Computed: true, diff --git a/internal/service/database/database_db_home_resource.go b/internal/service/database/database_db_home_resource.go index 43776935634..2bccba442c3 100644 --- a/internal/service/database/database_db_home_resource.go +++ b/internal/service/database/database_db_home_resource.go @@ -136,6 +136,12 @@ func DatabaseDbHomeResource() *schema.Resource { // Required // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Optional: true, @@ -154,6 +160,12 @@ func DatabaseDbHomeResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "remote_region": { Type: schema.TypeString, Optional: true, @@ -1107,6 +1119,10 @@ func (s *DatabaseDbHomeResourceCrud) ChangeEncryptionKeyLocation(fieldKeyFormat func (s *DatabaseDbHomeResourceCrud) mapToBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + if dbrsPolicyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "dbrs_policy_id")); ok { tmp := dbrsPolicyId.(string) result.DbrsPolicyId = &tmp @@ -1127,6 +1143,11 @@ func (s *DatabaseDbHomeResourceCrud) mapToBackupDestinationDetails(fieldKeyForma result.IsRemote = &tmp } + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + if remoteRegion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "remote_region")); ok { tmp := remoteRegion.(string) result.RemoteRegion = &tmp diff --git a/internal/service/database/database_db_system_resource.go b/internal/service/database/database_db_system_resource.go index 1d2980a3ae4..9f517d8cc18 100644 --- a/internal/service/database/database_db_system_resource.go +++ b/internal/service/database/database_db_system_resource.go @@ -150,6 +150,12 @@ func DatabaseDbSystemResource() *schema.Resource { // Required // Optional + "backup_retention_policy_on_terminate": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "dbrs_policy_id": { Type: schema.TypeString, Optional: true, @@ -168,6 +174,12 @@ func DatabaseDbSystemResource() *schema.Resource { Computed: true, ForceNew: true, }, + "is_retention_lock_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, "remote_region": { Type: schema.TypeString, Optional: true, @@ -1602,6 +1614,10 @@ func (s *DatabaseDbSystemResourceCrud) SetData() error { func (s *DatabaseDbSystemResourceCrud) mapToBackupDestinationDetails(fieldKeyFormat string) (oci_database.BackupDestinationDetails, error) { result := oci_database.BackupDestinationDetails{} + if backupRetentionPolicyOnTerminate, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "backup_retention_policy_on_terminate")); ok { + result.BackupRetentionPolicyOnTerminate = oci_database.BackupDestinationDetailsBackupRetentionPolicyOnTerminateEnum(backupRetentionPolicyOnTerminate.(string)) + } + if dbrsPolicyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "dbrs_policy_id")); ok { tmp := dbrsPolicyId.(string) result.DbrsPolicyId = &tmp @@ -1622,6 +1638,11 @@ func (s *DatabaseDbSystemResourceCrud) mapToBackupDestinationDetails(fieldKeyFor result.IsRemote = &tmp } + if isRetentionLockEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_retention_lock_enabled")); ok { + tmp := isRetentionLockEnabled.(bool) + result.IsRetentionLockEnabled = &tmp + } + if remoteRegion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "remote_region")); ok { tmp := remoteRegion.(string) result.RemoteRegion = &tmp diff --git a/internal/service/database/database_key_store_data_source.go b/internal/service/database/database_key_store_data_source.go index a75b3d6d765..f7ad2a558a5 100644 --- a/internal/service/database/database_key_store_data_source.go +++ b/internal/service/database/database_key_store_data_source.go @@ -72,6 +72,16 @@ func (s *DatabaseKeyStoreDataSourceCrud) SetData() error { } s.D.Set("associated_databases", associatedDatabases) + if s.Res.AssociatedLongTermBackupCount != nil { + s.D.Set("associated_long_term_backup_count", *s.Res.AssociatedLongTermBackupCount) + } + + associatedLongTermBackups := []interface{}{} + for _, item := range s.Res.AssociatedLongTermBackups { + associatedLongTermBackups = append(associatedLongTermBackups, AssociatedLongTermBackupToMap(item)) + } + s.D.Set("associated_long_term_backups", associatedLongTermBackups) + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/database/database_key_store_resource.go b/internal/service/database/database_key_store_resource.go index 10e4b2216a1..0ca1fb0f2be 100644 --- a/internal/service/database/database_key_store_resource.go +++ b/internal/service/database/database_key_store_resource.go @@ -128,6 +128,31 @@ func DatabaseKeyStoreResource() *schema.Resource { }, }, }, + "associated_long_term_backup_count": { + Type: schema.TypeInt, + Computed: true, + }, + "associated_long_term_backups": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "lifecycle_details": { Type: schema.TypeString, Computed: true, @@ -366,6 +391,16 @@ func (s *DatabaseKeyStoreResourceCrud) SetData() error { } s.D.Set("associated_databases", associatedDatabases) + if s.Res.AssociatedLongTermBackupCount != nil { + s.D.Set("associated_long_term_backup_count", *s.Res.AssociatedLongTermBackupCount) + } + + associatedLongTermBackups := []interface{}{} + for _, item := range s.Res.AssociatedLongTermBackups { + associatedLongTermBackups = append(associatedLongTermBackups, AssociatedLongTermBackupToMap(item)) + } + s.D.Set("associated_long_term_backups", associatedLongTermBackups) + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/database/database_key_stores_data_source.go b/internal/service/database/database_key_stores_data_source.go index 8b3fec9510e..31efe54145c 100644 --- a/internal/service/database/database_key_stores_data_source.go +++ b/internal/service/database/database_key_stores_data_source.go @@ -99,6 +99,16 @@ func (s *DatabaseKeyStoresDataSourceCrud) SetData() error { } keyStore["associated_databases"] = associatedDatabases + if r.AssociatedLongTermBackupCount != nil { + keyStore["associated_long_term_backup_count"] = *r.AssociatedLongTermBackupCount + } + + associatedLongTermBackups := []interface{}{} + for _, item := range r.AssociatedLongTermBackups { + associatedLongTermBackups = append(associatedLongTermBackups, AssociatedLongTermBackupToMap(item)) + } + keyStore["associated_long_term_backups"] = associatedLongTermBackups + if r.DefinedTags != nil { keyStore["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) } diff --git a/internal/service/fleet_software_update/fleet_software_update_fsu_collection_data_source.go b/internal/service/fleet_software_update/fleet_software_update_fsu_collection_data_source.go index 51f4d2dd1fe..889cea7d85d 100644 --- a/internal/service/fleet_software_update/fleet_software_update_fsu_collection_data_source.go +++ b/internal/service/fleet_software_update/fleet_software_update_fsu_collection_data_source.go @@ -128,6 +128,62 @@ func (s *FleetSoftwareUpdateFsuCollectionDataSourceCrud) SetData() error { s.D.Set("time_created", v.TimeCreated.String()) } + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + case oci_fleet_software_update.ExadbStackCollection: + s.D.Set("type", "EXADB_STACK") + + components := []interface{}{} + for _, item := range v.Components { + components = append(components, SoftwareComponentDetailsToMap(item)) + } + s.D.Set("components", components) + + if v.ActiveFsuCycle != nil { + s.D.Set("active_fsu_cycle", []interface{}{ActiveCycleDetailsToMap(v.ActiveFsuCycle)}) + } else { + s.D.Set("active_fsu_cycle", nil) + } + + if v.CompartmentId != nil { + s.D.Set("compartment_id", *v.CompartmentId) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + if v.DisplayName != nil { + s.D.Set("display_name", *v.DisplayName) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.LastCompletedFsuCycleId != nil { + s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId) + } + + if v.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *v.LifecycleDetails) + } + + s.D.Set("service_type", v.ServiceType) + + s.D.Set("state", v.LifecycleState) + + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) + } + + if v.TargetCount != nil { + s.D.Set("target_count", *v.TargetCount) + } + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } @@ -190,6 +246,68 @@ func (s *FleetSoftwareUpdateFsuCollectionDataSourceCrud) SetData() error { s.D.Set("time_created", v.TimeCreated.String()) } + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + case oci_fleet_software_update.GuestOsCollection: + s.D.Set("type", "GUEST_OS") + + if v.FleetDiscovery != nil { + fleetDiscoveryArray := []interface{}{} + if fleetDiscoveryMap := GuestOsFleetDiscoveryDetailsToMap(&v.FleetDiscovery); fleetDiscoveryMap != nil { + fleetDiscoveryArray = append(fleetDiscoveryArray, fleetDiscoveryMap) + } + s.D.Set("fleet_discovery", fleetDiscoveryArray) + } else { + s.D.Set("fleet_discovery", nil) + } + + s.D.Set("source_major_version", v.SourceMajorVersion) + + if v.ActiveFsuCycle != nil { + s.D.Set("active_fsu_cycle", []interface{}{ActiveCycleDetailsToMap(v.ActiveFsuCycle)}) + } else { + s.D.Set("active_fsu_cycle", nil) + } + + if v.CompartmentId != nil { + s.D.Set("compartment_id", *v.CompartmentId) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + if v.DisplayName != nil { + s.D.Set("display_name", *v.DisplayName) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.LastCompletedFsuCycleId != nil { + s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId) + } + + if v.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *v.LifecycleDetails) + } + + s.D.Set("service_type", v.ServiceType) + + s.D.Set("state", v.LifecycleState) + + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) + } + + if v.TargetCount != nil { + s.D.Set("target_count", *v.TargetCount) + } + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } diff --git a/internal/service/fleet_software_update/fleet_software_update_fsu_collection_resource.go b/internal/service/fleet_software_update/fleet_software_update_fsu_collection_resource.go index 895e2f086ef..a2a651f60d9 100644 --- a/internal/service/fleet_software_update/fleet_software_update_fsu_collection_resource.go +++ b/internal/service/fleet_software_update/fleet_software_update_fsu_collection_resource.go @@ -47,11 +47,6 @@ func FleetSoftwareUpdateFsuCollectionResource() *schema.Resource { Required: true, ForceNew: true, }, - "source_major_version": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, "type": { Type: schema.TypeString, Required: true, @@ -59,11 +54,200 @@ func FleetSoftwareUpdateFsuCollectionResource() *schema.Resource { DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ "DB", + "EXADB_STACK", "GI", + "GUEST_OS", }, true), }, // Optional + "components": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "component_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "GI", + "GUEST_OS", + }, true), + }, + "source_major_version": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "fleet_discovery": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "strategy": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "DISCOVERY_RESULTS", + "FILTERS", + "SEARCH_QUERY", + "TARGET_LIST", + }, true), + }, + + // Optional + "filters": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "COMPARTMENT_ID", + "DEFINED_TAG", + "EXADATA_RELEASE_VERSION", + "FREEFORM_TAG", + "RESOURCE_ID", + "VERSION", + }, true), + }, + + // Optional + "entity_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "exadata_releases": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "identifiers": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "mode": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "operator": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "tags": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "namespace": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "versions": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + // Computed + }, + }, + }, + "fsu_discovery_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "query": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "targets": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, "defined_tags": { Type: schema.TypeMap, Optional: true, @@ -119,6 +303,7 @@ func FleetSoftwareUpdateFsuCollectionResource() *schema.Resource { "DB_NAME", "DB_UNIQUE_NAME", "DEFINED_TAG", + "EXADATA_RELEASE_VERSION", "FREEFORM_TAG", "RESOURCE_ID", "VERSION", @@ -132,6 +317,15 @@ func FleetSoftwareUpdateFsuCollectionResource() *schema.Resource { Computed: true, ForceNew: true, }, + "exadata_releases": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "identifiers": { Type: schema.TypeList, Optional: true, @@ -170,19 +364,21 @@ func FleetSoftwareUpdateFsuCollectionResource() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required + + // Optional "key": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, ForceNew: true, }, - "value": { + "namespace": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, ForceNew: true, }, - - // Optional - "namespace": { + "value": { Type: schema.TypeString, Optional: true, Computed: true, @@ -239,6 +435,12 @@ func FleetSoftwareUpdateFsuCollectionResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "source_major_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, // Computed "active_fsu_cycle": { @@ -649,6 +851,66 @@ func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) SetData() error { s.D.Set("time_created", v.TimeCreated.String()) } + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + case oci_fleet_software_update.ExadbStackCollection: + s.D.Set("type", "EXADB_STACK") + + components := []interface{}{} + for _, item := range v.Components { + components = append(components, SoftwareComponentDetailsToMap(item)) + } + s.D.Set("components", components) + + if v.ActiveFsuCycle != nil { + s.D.Set("active_fsu_cycle", []interface{}{ActiveCycleDetailsToMap(v.ActiveFsuCycle)}) + } else { + s.D.Set("active_fsu_cycle", nil) + } + + if v.CompartmentId != nil { + s.D.Set("compartment_id", *v.CompartmentId) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + if v.DisplayName != nil { + s.D.Set("display_name", *v.DisplayName) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.Id != nil { + s.D.Set("id", *v.Id) + } + + if v.LastCompletedFsuCycleId != nil { + s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId) + } + + if v.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *v.LifecycleDetails) + } + + s.D.Set("service_type", v.ServiceType) + + s.D.Set("state", v.LifecycleState) + + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) + } + + if v.TargetCount != nil { + s.D.Set("target_count", *v.TargetCount) + } + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } @@ -718,55 +980,205 @@ func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) SetData() error { if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } - default: - log.Printf("[WARN] Received 'type' of unknown type %v", *s.Res) - return nil - } - return nil -} + case oci_fleet_software_update.GuestOsCollection: + s.D.Set("type", "GUEST_OS") -func ActiveCycleDetailsToMap(obj *oci_fleet_software_update.ActiveCycleDetails) map[string]interface{} { - result := map[string]interface{}{} + if v.FleetDiscovery != nil { + fleetDiscoveryArray := []interface{}{} + if fleetDiscoveryMap := GuestOsFleetDiscoveryDetailsToMap(&v.FleetDiscovery); fleetDiscoveryMap != nil { + fleetDiscoveryArray = append(fleetDiscoveryArray, fleetDiscoveryMap) + } + s.D.Set("fleet_discovery", fleetDiscoveryArray) + } else { + s.D.Set("fleet_discovery", nil) + } - if obj.DisplayName != nil { - result["display_name"] = string(*obj.DisplayName) - } + s.D.Set("source_major_version", v.SourceMajorVersion) - if obj.Id != nil { - result["id"] = string(*obj.Id) - } + if v.ActiveFsuCycle != nil { + s.D.Set("active_fsu_cycle", []interface{}{ActiveCycleDetailsToMap(v.ActiveFsuCycle)}) + } else { + s.D.Set("active_fsu_cycle", nil) + } - return result -} + if v.CompartmentId != nil { + s.D.Set("compartment_id", *v.CompartmentId) + } -func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) mapToDbFleetDiscoveryDetails(fieldKeyFormat string) (oci_fleet_software_update.DbFleetDiscoveryDetails, error) { - var baseObject oci_fleet_software_update.DbFleetDiscoveryDetails - //discriminator - strategyRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "strategy")) - var strategy string - if ok { - strategy = strategyRaw.(string) - } else { - strategy = "" // default value - } - switch strings.ToLower(strategy) { - case strings.ToLower("DISCOVERY_RESULTS"): - details := oci_fleet_software_update.DbDiscoveryResults{} - if fsuDiscoveryId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "fsu_discovery_id")); ok { - tmp := fsuDiscoveryId.(string) - details.FsuDiscoveryId = &tmp + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) } - baseObject = details - case strings.ToLower("FILTERS"): - details := oci_fleet_software_update.DbFiltersDiscovery{} - if filters, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "filters")); ok { - interfaces := filters.([]interface{}) - tmp := make([]oci_fleet_software_update.DbFleetDiscoveryFilter, len(interfaces)) - for i := range interfaces { - stateDataIndex := i - fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "filters"), stateDataIndex) - converted, err := s.mapToDbFleetDiscoveryFilter(fieldKeyFormatNextLevel) - if err != nil { + + if v.DisplayName != nil { + s.D.Set("display_name", *v.DisplayName) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.Id != nil { + s.D.Set("id", *v.Id) + } + + if v.LastCompletedFsuCycleId != nil { + s.D.Set("last_completed_fsu_cycle_id", *v.LastCompletedFsuCycleId) + } + + if v.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *v.LifecycleDetails) + } + + s.D.Set("service_type", v.ServiceType) + + s.D.Set("state", v.LifecycleState) + + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) + } + + if v.TargetCount != nil { + s.D.Set("target_count", *v.TargetCount) + } + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + default: + log.Printf("[WARN] Received 'type' of unknown type %v", *s.Res) + return nil + } + return nil +} + +func ActiveCycleDetailsToMap(obj *oci_fleet_software_update.ActiveCycleDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) mapToCreateSoftwareComponentDetails(fieldKeyFormat string) (oci_fleet_software_update.CreateSoftwareComponentDetails, error) { + var baseObject oci_fleet_software_update.CreateSoftwareComponentDetails + //discriminator + componentTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "component_type")) + var componentType string + if ok { + componentType = componentTypeRaw.(string) + } else { + componentType = "" // default value + } + switch strings.ToLower(componentType) { + case strings.ToLower("GI"): + details := oci_fleet_software_update.CreateGiSoftwareComponentDetails{} + if fleetDiscovery, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "fleet_discovery")); ok { + if tmpList := fleetDiscovery.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "fleet_discovery"), 0) + tmp, err := s.mapToGiFleetDiscoveryDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert fleet_discovery, encountered error: %v", err) + } + details.FleetDiscovery = tmp + } + } + if sourceMajorVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_major_version")); ok { + details.SourceMajorVersion = oci_fleet_software_update.GiSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + baseObject = details + case strings.ToLower("GUEST_OS"): + details := oci_fleet_software_update.CreateGuestOsSoftwareComponentDetails{} + if fleetDiscovery, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "fleet_discovery")); ok { + if tmpList := fleetDiscovery.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "fleet_discovery"), 0) + tmp, err := s.mapToGuestOsFleetDiscoveryDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert fleet_discovery, encountered error: %v", err) + } + details.FleetDiscovery = tmp + } + } + if sourceMajorVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_major_version")); ok { + details.SourceMajorVersion = oci_fleet_software_update.GuestOsSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + baseObject = details + default: + return nil, fmt.Errorf("unknown component_type '%v' was specified", componentType) + } + return baseObject, nil +} + +func CreateSoftwareComponentDetailsToMap(obj oci_fleet_software_update.CreateSoftwareComponentDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (obj).(type) { + case oci_fleet_software_update.CreateGiSoftwareComponentDetails: + result["component_type"] = "GI" + + if v.FleetDiscovery != nil { + fleetDiscoveryArray := []interface{}{} + if fleetDiscoveryMap := GiFleetDiscoveryDetailsToMap(&v.FleetDiscovery); fleetDiscoveryMap != nil { + fleetDiscoveryArray = append(fleetDiscoveryArray, fleetDiscoveryMap) + } + result["fleet_discovery"] = fleetDiscoveryArray + } + + result["source_major_version"] = string(v.SourceMajorVersion) + case oci_fleet_software_update.CreateGuestOsSoftwareComponentDetails: + result["component_type"] = "GUEST_OS" + + if v.FleetDiscovery != nil { + fleetDiscoveryArray := []interface{}{} + if fleetDiscoveryMap := GuestOsFleetDiscoveryDetailsToMap(&v.FleetDiscovery); fleetDiscoveryMap != nil { + fleetDiscoveryArray = append(fleetDiscoveryArray, fleetDiscoveryMap) + } + result["fleet_discovery"] = fleetDiscoveryArray + } + + result["source_major_version"] = string(v.SourceMajorVersion) + default: + log.Printf("[WARN] Received 'component_type' of unknown type %v", obj) + return nil + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) mapToDbFleetDiscoveryDetails(fieldKeyFormat string) (oci_fleet_software_update.DbFleetDiscoveryDetails, error) { + var baseObject oci_fleet_software_update.DbFleetDiscoveryDetails + //discriminator + strategyRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "strategy")) + var strategy string + if ok { + strategy = strategyRaw.(string) + } else { + strategy = "" // default value + } + switch strings.ToLower(strategy) { + case strings.ToLower("DISCOVERY_RESULTS"): + details := oci_fleet_software_update.DbDiscoveryResults{} + if fsuDiscoveryId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "fsu_discovery_id")); ok { + tmp := fsuDiscoveryId.(string) + details.FsuDiscoveryId = &tmp + } + baseObject = details + case strings.ToLower("FILTERS"): + details := oci_fleet_software_update.DbFiltersDiscovery{} + if filters, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "filters")); ok { + interfaces := filters.([]interface{}) + tmp := make([]oci_fleet_software_update.DbFleetDiscoveryFilter, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "filters"), stateDataIndex) + converted, err := s.mapToDbFleetDiscoveryFilter(fieldKeyFormatNextLevel) + if err != nil { return details, err } tmp[i] = converted @@ -1186,6 +1598,48 @@ func FsuCollectionSummaryToMap(obj oci_fleet_software_update.FsuCollectionSummar result["time_created"] = v.TimeCreated.String() } + if v.TimeUpdated != nil { + result["time_updated"] = v.TimeUpdated.String() + } + case oci_fleet_software_update.ExadbStackFsuCollectionSummary: + result["type"] = "EXADB_STACK" + + components := []interface{}{} + for _, item := range v.Components { + components = append(components, SoftwareComponentSummaryToMap(item)) + } + result["components"] = components + result["id"] = string(*v.Id) + + if v.ActiveFsuCycle != nil { + result["active_fsu_cycle"] = []interface{}{ActiveCycleDetailsToMap(v.ActiveFsuCycle)} + } else { + result["active_fsu_cycle"] = nil + } + + result["compartment_id"] = string(*v.CompartmentId) + if v.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) + } + + if v.DisplayName != nil { + result["display_name"] = string(*v.DisplayName) + } + + result["freeform_tags"] = v.FreeformTags + + if v.LifecycleDetails != nil { + result["lifecycle_details"] = string(*v.LifecycleDetails) + } + result["service_type"] = string(v.ServiceType) + result["state"] = string(v.LifecycleState) + if v.TargetCount != nil { + result["target_count"] = *v.TargetCount + } + if v.TimeCreated != nil { + result["time_created"] = v.TimeCreated.String() + } + if v.TimeUpdated != nil { result["time_updated"] = v.TimeUpdated.String() } @@ -1225,6 +1679,44 @@ func FsuCollectionSummaryToMap(obj oci_fleet_software_update.FsuCollectionSummar result["time_created"] = v.TimeCreated.String() } + if v.TimeUpdated != nil { + result["time_updated"] = v.TimeUpdated.String() + } + case oci_fleet_software_update.GuestOsFsuCollectionSummary: + result["type"] = "GUEST_OS" + + result["source_major_version"] = string(v.SourceMajorVersion) + result["id"] = string(*v.Id) + + if v.ActiveFsuCycle != nil { + result["active_fsu_cycle"] = []interface{}{ActiveCycleDetailsToMap(v.ActiveFsuCycle)} + } else { + result["active_fsu_cycle"] = nil + } + + result["compartment_id"] = string(*v.CompartmentId) + if v.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) + } + + if v.DisplayName != nil { + result["display_name"] = string(*v.DisplayName) + } + + result["freeform_tags"] = v.FreeformTags + + if v.LifecycleDetails != nil { + result["lifecycle_details"] = string(*v.LifecycleDetails) + } + result["service_type"] = string(v.ServiceType) + result["state"] = string(v.LifecycleState) + if v.TargetCount != nil { + result["target_count"] = *v.TargetCount + } + if v.TimeCreated != nil { + result["time_created"] = v.TimeCreated.String() + } + if v.TimeUpdated != nil { result["time_updated"] = v.TimeUpdated.String() } @@ -1511,32 +2003,514 @@ func GiFleetDiscoveryFilterToMap(obj oci_fleet_software_update.GiFleetDiscoveryF return result } -func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) populateTopLevelPolymorphicCreateFsuCollectionRequest(request *oci_fleet_software_update.CreateFsuCollectionRequest) error { +func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) mapToGuestOsFleetDiscoveryDetails(fieldKeyFormat string) (oci_fleet_software_update.GuestOsFleetDiscoveryDetails, error) { + var baseObject oci_fleet_software_update.GuestOsFleetDiscoveryDetails //discriminator - typeRaw, ok := s.D.GetOkExists("type") - var type_ string + strategyRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "strategy")) + var strategy string if ok { - type_ = typeRaw.(string) + strategy = strategyRaw.(string) } else { - type_ = "" // default value + strategy = "" // default value } - switch strings.ToLower(type_) { - case strings.ToLower("DB"): - details := oci_fleet_software_update.CreateDbFsuCollectionDetails{} - if fleetDiscovery, ok := s.D.GetOkExists("fleet_discovery"); ok { - if tmpList := fleetDiscovery.([]interface{}); len(tmpList) > 0 { - fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "fleet_discovery", 0) - tmp, err := s.mapToDbFleetDiscoveryDetails(fieldKeyFormat) + switch strings.ToLower(strategy) { + case strings.ToLower("DISCOVERY_RESULTS"): + details := oci_fleet_software_update.GuestOsDiscoveryResults{} + if fsuDiscoveryId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "fsu_discovery_id")); ok { + tmp := fsuDiscoveryId.(string) + details.FsuDiscoveryId = &tmp + } + baseObject = details + case strings.ToLower("FILTERS"): + details := oci_fleet_software_update.GuestOsFiltersDiscovery{} + if filters, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "filters")); ok { + interfaces := filters.([]interface{}) + tmp := make([]oci_fleet_software_update.GuestOsFleetDiscoveryFilter, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "filters"), stateDataIndex) + converted, err := s.mapToGuestOsFleetDiscoveryFilter(fieldKeyFormatNextLevel) if err != nil { - return err + return details, err } - details.FleetDiscovery = tmp + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "filters")) { + details.Filters = tmp } } - if sourceMajorVersion, ok := s.D.GetOkExists("source_major_version"); ok { - details.SourceMajorVersion = oci_fleet_software_update.DbSourceMajorVersionsEnum(sourceMajorVersion.(string)) + baseObject = details + case strings.ToLower("SEARCH_QUERY"): + details := oci_fleet_software_update.GuestOsSearchQueryDiscovery{} + if query, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "query")); ok { + tmp := query.(string) + details.Query = &tmp } - if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + baseObject = details + case strings.ToLower("TARGET_LIST"): + details := oci_fleet_software_update.GuestOsTargetListDiscovery{} + if targets, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "targets")); ok { + interfaces := targets.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "targets")) { + details.Targets = tmp + } + } + baseObject = details + default: + return nil, fmt.Errorf("unknown strategy '%v' was specified", strategy) + } + return baseObject, nil +} + +func GuestOsFleetDiscoveryDetailsToMap(obj *oci_fleet_software_update.GuestOsFleetDiscoveryDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_fleet_software_update.GuestOsDiscoveryResults: + result["strategy"] = "DISCOVERY_RESULTS" + + if v.FsuDiscoveryId != nil { + result["fsu_discovery_id"] = string(*v.FsuDiscoveryId) + } + case oci_fleet_software_update.GuestOsFiltersDiscovery: + result["strategy"] = "FILTERS" + + filters := []interface{}{} + for _, item := range v.Filters { + filters = append(filters, GuestOsFleetDiscoveryFilterToMap(item)) + } + result["filters"] = filters + case oci_fleet_software_update.GuestOsSearchQueryDiscovery: + result["strategy"] = "SEARCH_QUERY" + + if v.Query != nil { + result["query"] = string(*v.Query) + } + case oci_fleet_software_update.GuestOsTargetListDiscovery: + result["strategy"] = "TARGET_LIST" + + result["targets"] = v.Targets + default: + log.Printf("[WARN] Received 'strategy' of unknown type %v", *obj) + return nil + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) mapToGuestOsFleetDiscoveryFilter(fieldKeyFormat string) (oci_fleet_software_update.GuestOsFleetDiscoveryFilter, error) { + var baseObject oci_fleet_software_update.GuestOsFleetDiscoveryFilter + //discriminator + typeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")) + var type_ string + if ok { + type_ = typeRaw.(string) + } else { + type_ = "" // default value + } + switch strings.ToLower(type_) { + case strings.ToLower("COMPARTMENT_ID"): + details := oci_fleet_software_update.GuestOsCompartmentIdFilter{} + if identifiers, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "identifiers")); ok { + interfaces := identifiers.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "identifiers")) { + details.Identifiers = tmp + } + } + if mode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "mode")); ok { + details.Mode = oci_fleet_software_update.GuestOsFleetDiscoveryFilterModeEnum(mode.(string)) + } + baseObject = details + case strings.ToLower("DEFINED_TAG"): + details := oci_fleet_software_update.GuestOsDefinedTagsFilter{} + if operator, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "operator")); ok { + details.Operator = oci_fleet_software_update.FleetDiscoveryOperatorsEnum(operator.(string)) + } + if tags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "tags")); ok { + interfaces := tags.([]interface{}) + tmp := make([]oci_fleet_software_update.DefinedTagFilterEntry, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "tags"), stateDataIndex) + converted, err := s.mapToDefinedTagFilterEntry(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "tags")) { + details.Tags = tmp + } + } + if mode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "mode")); ok { + details.Mode = oci_fleet_software_update.GuestOsFleetDiscoveryFilterModeEnum(mode.(string)) + } + baseObject = details + case strings.ToLower("EXADATA_RELEASE_VERSION"): + details := oci_fleet_software_update.GuestOsExadataReleaseVersionFilter{} + if exadataReleases, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "exadata_releases")); ok { + interfaces := exadataReleases.([]interface{}) + + // Create a new slice of the correct enum type + exadataEnums := make([]oci_fleet_software_update.ExadataReleaseVersionsEnum, 0, len(interfaces)) + + for _, item := range interfaces { + if item != nil { + // Convert the interface to a string + versionString := item.(string) + + // Use the GetMappingExadataReleaseVersionsEnum function to get the enum + if enum, ok := oci_fleet_software_update.GetMappingExadataReleaseVersionsEnum(versionString); ok { + exadataEnums = append(exadataEnums, enum) + } + // You might want to handle the case where the mapping fails (ok is false) + // For example, log an error or skip the item + } + } + + if len(exadataEnums) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "exadata_releases")) { + // Assign the new slice with the correct type + details.ExadataReleases = exadataEnums + } + } + + if mode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "mode")); ok { + details.Mode = oci_fleet_software_update.GuestOsFleetDiscoveryFilterModeEnum(mode.(string)) + } + baseObject = details + case strings.ToLower("FREEFORM_TAG"): + details := oci_fleet_software_update.GuestOsFreeformTagsFilter{} + if operator, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "operator")); ok { + details.Operator = oci_fleet_software_update.FleetDiscoveryOperatorsEnum(operator.(string)) + } + if tags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "tags")); ok { + interfaces := tags.([]interface{}) + tmp := make([]oci_fleet_software_update.FreeformTagFilterEntry, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "tags"), stateDataIndex) + converted, err := s.mapToFreeformTagFilterEntry(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "tags")) { + details.Tags = tmp + } + } + if mode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "mode")); ok { + details.Mode = oci_fleet_software_update.GuestOsFleetDiscoveryFilterModeEnum(mode.(string)) + } + baseObject = details + case strings.ToLower("RESOURCE_ID"): + details := oci_fleet_software_update.GuestOsResourceIdFilter{} + if entityType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "entity_type")); ok { + details.EntityType = oci_fleet_software_update.GuestOsResourceIdFilterEntityTypeEnum(entityType.(string)) + } + if identifiers, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "identifiers")); ok { + interfaces := identifiers.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "identifiers")) { + details.Identifiers = tmp + } + } + if operator, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "operator")); ok { + details.Operator = oci_fleet_software_update.FleetDiscoveryOperatorsEnum(operator.(string)) + } + if mode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "mode")); ok { + details.Mode = oci_fleet_software_update.GuestOsFleetDiscoveryFilterModeEnum(mode.(string)) + } + baseObject = details + case strings.ToLower("VERSION"): + details := oci_fleet_software_update.GuestOsVersionFilter{} + if versions, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "versions")); ok { + interfaces := versions.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "versions")) { + details.Versions = tmp + } + } + if mode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "mode")); ok { + details.Mode = oci_fleet_software_update.GuestOsFleetDiscoveryFilterModeEnum(mode.(string)) + } + baseObject = details + default: + return nil, fmt.Errorf("unknown type '%v' was specified", type_) + } + return baseObject, nil +} + +func GuestOsFleetDiscoveryFilterToMap(obj oci_fleet_software_update.GuestOsFleetDiscoveryFilter) map[string]interface{} { + result := map[string]interface{}{} + switch v := (obj).(type) { + case oci_fleet_software_update.GuestOsCompartmentIdFilter: + result["type"] = "COMPARTMENT_ID" + + result["identifiers"] = v.Identifiers + case oci_fleet_software_update.GuestOsDefinedTagsFilter: + result["type"] = "DEFINED_TAG" + + result["operator"] = string(v.Operator) + + tags := []interface{}{} + for _, item := range v.Tags { + tags = append(tags, DefinedTagFilterEntryToMap(item)) + } + result["tags"] = tags + case oci_fleet_software_update.GuestOsExadataReleaseVersionFilter: + result["type"] = "EXADATA_RELEASE_VERSION" + + result["exadata_releases"] = v.ExadataReleases + case oci_fleet_software_update.GuestOsFreeformTagsFilter: + result["type"] = "FREEFORM_TAG" + + result["operator"] = string(v.Operator) + + tags := []interface{}{} + for _, item := range v.Tags { + tags = append(tags, FreeformTagFilterEntryToMap(item)) + } + result["tags"] = tags + case oci_fleet_software_update.GuestOsResourceIdFilter: + result["type"] = "RESOURCE_ID" + + result["entity_type"] = string(v.EntityType) + + result["identifiers"] = v.Identifiers + + result["operator"] = string(v.Operator) + case oci_fleet_software_update.GuestOsVersionFilter: + result["type"] = "VERSION" + + result["versions"] = v.Versions + default: + log.Printf("[WARN] Received 'type' of unknown type %v", obj) + return nil + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) mapToSoftwareComponentDetails(fieldKeyFormat string) (oci_fleet_software_update.SoftwareComponentDetails, error) { + var baseObject oci_fleet_software_update.SoftwareComponentDetails + //discriminator + componentTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "component_type")) + var componentType string + if ok { + componentType = componentTypeRaw.(string) + } else { + componentType = "" // default value + } + switch strings.ToLower(componentType) { + case strings.ToLower("GI"): + details := oci_fleet_software_update.GiSoftwareComponentDetails{} + if fleetDiscovery, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "fleet_discovery")); ok { + if tmpList := fleetDiscovery.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "fleet_discovery"), 0) + tmp, err := s.mapToGiFleetDiscoveryDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert fleet_discovery, encountered error: %v", err) + } + details.FleetDiscovery = tmp + } + } + if sourceMajorVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_major_version")); ok { + details.SourceMajorVersion = oci_fleet_software_update.GiSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + baseObject = details + case strings.ToLower("GUEST_OS"): + details := oci_fleet_software_update.GuestOsSoftwareComponentDetails{} + if fleetDiscovery, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "fleet_discovery")); ok { + if tmpList := fleetDiscovery.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "fleet_discovery"), 0) + tmp, err := s.mapToGuestOsFleetDiscoveryDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert fleet_discovery, encountered error: %v", err) + } + details.FleetDiscovery = tmp + } + } + if sourceMajorVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_major_version")); ok { + details.SourceMajorVersion = oci_fleet_software_update.GuestOsSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + baseObject = details + default: + return nil, fmt.Errorf("unknown component_type '%v' was specified", componentType) + } + return baseObject, nil +} + +func SoftwareComponentDetailsToMap(obj oci_fleet_software_update.SoftwareComponentDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (obj).(type) { + case oci_fleet_software_update.GiSoftwareComponentDetails: + result["component_type"] = "GI" + + if v.FleetDiscovery != nil { + fleetDiscoveryArray := []interface{}{} + if fleetDiscoveryMap := GiFleetDiscoveryDetailsToMap(&v.FleetDiscovery); fleetDiscoveryMap != nil { + fleetDiscoveryArray = append(fleetDiscoveryArray, fleetDiscoveryMap) + } + result["fleet_discovery"] = fleetDiscoveryArray + } + + result["source_major_version"] = string(v.SourceMajorVersion) + case oci_fleet_software_update.GuestOsSoftwareComponentDetails: + result["component_type"] = "GUEST_OS" + + if v.FleetDiscovery != nil { + fleetDiscoveryArray := []interface{}{} + if fleetDiscoveryMap := GuestOsFleetDiscoveryDetailsToMap(&v.FleetDiscovery); fleetDiscoveryMap != nil { + fleetDiscoveryArray = append(fleetDiscoveryArray, fleetDiscoveryMap) + } + result["fleet_discovery"] = fleetDiscoveryArray + } + + result["source_major_version"] = string(v.SourceMajorVersion) + default: + log.Printf("[WARN] Received 'component_type' of unknown type %v", obj) + return nil + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) mapToSoftwareComponentSummary(fieldKeyFormat string) (oci_fleet_software_update.SoftwareComponentSummary, error) { + var baseObject oci_fleet_software_update.SoftwareComponentSummary + //discriminator + componentTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "component_type")) + var componentType string + if ok { + componentType = componentTypeRaw.(string) + } else { + componentType = "" // default value + } + switch strings.ToLower(componentType) { + case strings.ToLower("GI"): + details := oci_fleet_software_update.GiSoftwareComponentSummary{} + if sourceMajorVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_major_version")); ok { + details.SourceMajorVersion = oci_fleet_software_update.GiSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + baseObject = details + case strings.ToLower("GUEST_OS"): + details := oci_fleet_software_update.GuestOsSoftwareComponentSummary{} + if sourceMajorVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_major_version")); ok { + details.SourceMajorVersion = oci_fleet_software_update.GuestOsSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + baseObject = details + default: + return nil, fmt.Errorf("unknown component_type '%v' was specified", componentType) + } + return baseObject, nil +} + +func SoftwareComponentSummaryToMap(obj oci_fleet_software_update.SoftwareComponentSummary) map[string]interface{} { + result := map[string]interface{}{} + switch v := (obj).(type) { + case oci_fleet_software_update.GiSoftwareComponentSummary: + result["component_type"] = "GI" + + result["source_major_version"] = string(v.SourceMajorVersion) + case oci_fleet_software_update.GuestOsSoftwareComponentSummary: + result["component_type"] = "GUEST_OS" + + result["source_major_version"] = string(v.SourceMajorVersion) + default: + log.Printf("[WARN] Received 'component_type' of unknown type %v", obj) + return nil + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) populateTopLevelPolymorphicCreateFsuCollectionRequest(request *oci_fleet_software_update.CreateFsuCollectionRequest) error { + //discriminator + typeRaw, ok := s.D.GetOkExists("type") + var type_ string + if ok { + type_ = typeRaw.(string) + } else { + type_ = "" // default value + } + switch strings.ToLower(type_) { + case strings.ToLower("DB"): + details := oci_fleet_software_update.CreateDbFsuCollectionDetails{} + if fleetDiscovery, ok := s.D.GetOkExists("fleet_discovery"); ok { + if tmpList := fleetDiscovery.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "fleet_discovery", 0) + tmp, err := s.mapToDbFleetDiscoveryDetails(fieldKeyFormat) + if err != nil { + return err + } + details.FleetDiscovery = tmp + } + } + if sourceMajorVersion, ok := s.D.GetOkExists("source_major_version"); ok { + details.SourceMajorVersion = oci_fleet_software_update.DbSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + details.CompartmentId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if serviceType, ok := s.D.GetOkExists("service_type"); ok { + details.ServiceType = oci_fleet_software_update.CollectionServiceTypesEnum(serviceType.(string)) + } + request.CreateFsuCollectionDetails = details + case strings.ToLower("EXADB_STACK"): + details := oci_fleet_software_update.CreateExadbStackFsuCollectionDetails{} + if components, ok := s.D.GetOkExists("components"); ok { + interfaces := components.([]interface{}) + tmp := make([]oci_fleet_software_update.CreateSoftwareComponentDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "components", stateDataIndex) + converted, err := s.mapToCreateSoftwareComponentDetails(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("components") { + details.Components = tmp + } + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { tmp := compartmentId.(string) details.CompartmentId = &tmp } @@ -1595,6 +2569,43 @@ func (s *FleetSoftwareUpdateFsuCollectionResourceCrud) populateTopLevelPolymorph details.ServiceType = oci_fleet_software_update.CollectionServiceTypesEnum(serviceType.(string)) } request.CreateFsuCollectionDetails = details + case strings.ToLower("GUEST_OS"): + details := oci_fleet_software_update.CreateGuestOsFsuCollectionDetails{} + if fleetDiscovery, ok := s.D.GetOkExists("fleet_discovery"); ok { + if tmpList := fleetDiscovery.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "fleet_discovery", 0) + tmp, err := s.mapToGuestOsFleetDiscoveryDetails(fieldKeyFormat) + if err != nil { + return err + } + details.FleetDiscovery = tmp + } + } + if sourceMajorVersion, ok := s.D.GetOkExists("source_major_version"); ok { + details.SourceMajorVersion = oci_fleet_software_update.GuestOsSourceMajorVersionsEnum(sourceMajorVersion.(string)) + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + details.CompartmentId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if serviceType, ok := s.D.GetOkExists("service_type"); ok { + details.ServiceType = oci_fleet_software_update.CollectionServiceTypesEnum(serviceType.(string)) + } + request.CreateFsuCollectionDetails = details default: return fmt.Errorf("unknown type '%v' was specified", type_) } diff --git a/internal/service/fleet_software_update/fleet_software_update_fsu_cycle_resource.go b/internal/service/fleet_software_update/fleet_software_update_fsu_cycle_resource.go index 329469622e0..57ffabd515d 100644 --- a/internal/service/fleet_software_update/fleet_software_update_fsu_cycle_resource.go +++ b/internal/service/fleet_software_update/fleet_software_update_fsu_cycle_resource.go @@ -55,12 +55,80 @@ func FleetSoftwareUpdateFsuCycleResource() *schema.Resource { Required: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ + "EXADB_STACK", "IMAGE_ID", "VERSION", }, true), }, // Optional + "components": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "component_type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "GI", + "GUEST_OS", + }, true), + }, + "goal_version_details": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "goal_software_image_id": { + Type: schema.TypeString, + Required: true, + }, + "goal_type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "GI_CUSTOM_IMAGE", + "GI_ORACLE_IMAGE", + "GUEST_OS_ORACLE_IMAGE", + }, true), + }, + + // Optional + "goal_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + + // Optional + "home_policy": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "new_home_prefix": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, "home_policy": { Type: schema.TypeString, Optional: true, @@ -287,6 +355,16 @@ func FleetSoftwareUpdateFsuCycleResource() *schema.Resource { }, // Optional + "is_ignore_post_upgrade_errors": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + "is_ignore_prerequisites": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, "is_recompile_invalid_objects": { Type: schema.TypeBool, Optional: true, @@ -297,6 +375,11 @@ func FleetSoftwareUpdateFsuCycleResource() *schema.Resource { Optional: true, Computed: true, }, + "max_drain_timeout_in_seconds": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, // Computed }, @@ -1219,6 +1302,32 @@ func (s *FleetSoftwareUpdateFsuCycleResourceCrud) mapToFsuGoalVersionDetails(fie type_ = "" // default value } switch strings.ToLower(type_) { + case strings.ToLower("EXADB_STACK"): + details := oci_fleet_software_update.ExadbStackFsuGoalVersionDetails{} + if components, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "components")); ok { + interfaces := components.([]interface{}) + tmp := make([]oci_fleet_software_update.GoalSoftwareComponentDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "components"), stateDataIndex) + converted, err := s.mapToGoalSoftwareComponentDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "components")) { + details.Components = tmp + } + } + if homePolicy, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "home_policy")); ok { + details.HomePolicy = oci_fleet_software_update.FsuGoalVersionDetailsHomePolicyEnum(homePolicy.(string)) + } + if newHomePrefix, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "new_home_prefix")); ok { + tmp := newHomePrefix.(string) + details.NewHomePrefix = &tmp + } + baseObject = details case strings.ToLower("IMAGE_ID"): details := oci_fleet_software_update.ImageIdFsuTargetDetails{} if softwareImageId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "software_image_id")); ok { @@ -1244,7 +1353,9 @@ func (s *FleetSoftwareUpdateFsuCycleResourceCrud) mapToFsuGoalVersionDetails(fie } if newHomePrefix, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "new_home_prefix")); ok { tmp := newHomePrefix.(string) - details.NewHomePrefix = &tmp + if tmp != "" { + details.NewHomePrefix = &tmp + } } baseObject = details default: @@ -1256,6 +1367,20 @@ func (s *FleetSoftwareUpdateFsuCycleResourceCrud) mapToFsuGoalVersionDetails(fie func FsuGoalVersionDetailsToMap(obj *oci_fleet_software_update.FsuGoalVersionDetails) map[string]interface{} { result := map[string]interface{}{} switch v := (*obj).(type) { + case oci_fleet_software_update.ExadbStackFsuGoalVersionDetails: + result["type"] = "EXADB_STACK" + + components := []interface{}{} + for _, item := range v.Components { + components = append(components, GoalSoftwareComponentDetailsToMap(item)) + } + result["components"] = components + + result["home_policy"] = string(v.HomePolicy) + + if v.NewHomePrefix != nil { + result["new_home_prefix"] = string(*v.NewHomePrefix) + } case oci_fleet_software_update.ImageIdFsuTargetDetails: result["type"] = "IMAGE_ID" @@ -1287,6 +1412,188 @@ func FsuGoalVersionDetailsToMap(obj *oci_fleet_software_update.FsuGoalVersionDet return result } +func (s *FleetSoftwareUpdateFsuCycleResourceCrud) mapToGiGoalVersionDetails(fieldKeyFormat string) (oci_fleet_software_update.GiGoalVersionDetails, error) { + var baseObject oci_fleet_software_update.GiGoalVersionDetails + //discriminator + goalTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "goal_type")) + var goalType string + if ok { + goalType = goalTypeRaw.(string) + } else { + goalType = "" // default value + } + switch strings.ToLower(goalType) { + case strings.ToLower("GI_CUSTOM_IMAGE"): + details := oci_fleet_software_update.CustomGiGoalVersionDetails{} + if goalSoftwareImageId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "goal_software_image_id")); ok { + tmp := goalSoftwareImageId.(string) + details.GoalSoftwareImageId = &tmp + } + baseObject = details + case strings.ToLower("GI_ORACLE_IMAGE"): + details := oci_fleet_software_update.OracleGiGoalVersionDetails{} + if goalVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "goal_version")); ok { + tmp := goalVersion.(string) + details.GoalVersion = &tmp + } + baseObject = details + default: + return nil, fmt.Errorf("unknown goal_type '%v' was specified", goalType) + } + return baseObject, nil +} + +func GiGoalVersionDetailsToMap(obj *oci_fleet_software_update.GiGoalVersionDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_fleet_software_update.CustomGiGoalVersionDetails: + result["goal_type"] = "GI_CUSTOM_IMAGE" + + if v.GoalSoftwareImageId != nil { + result["goal_software_image_id"] = string(*v.GoalSoftwareImageId) + } + case oci_fleet_software_update.OracleGiGoalVersionDetails: + result["goal_type"] = "GI_ORACLE_IMAGE" + + if v.GoalVersion != nil { + result["goal_version"] = string(*v.GoalVersion) + } + default: + log.Printf("[WARN] Received 'goal_type' of unknown type %v", *obj) + return nil + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCycleResourceCrud) mapToGoalSoftwareComponentDetails(fieldKeyFormat string) (oci_fleet_software_update.GoalSoftwareComponentDetails, error) { + var baseObject oci_fleet_software_update.GoalSoftwareComponentDetails + //discriminator + componentTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "component_type")) + var componentType string + if ok { + componentType = componentTypeRaw.(string) + } else { + componentType = "" // default value + } + switch strings.ToLower(componentType) { + case strings.ToLower("GI"): + details := oci_fleet_software_update.GiGoalSoftwareComponentDetails{} + if goalVersionDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "goal_version_details")); ok { + if tmpList := goalVersionDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "goal_version_details"), 0) + tmp, err := s.mapToGiGoalVersionDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert goal_version_details, encountered error: %v", err) + } + details.GoalVersionDetails = tmp + } + } + if homePolicy, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "home_policy")); ok { + details.HomePolicy = oci_fleet_software_update.GiGoalSoftwareComponentDetailsHomePolicyEnum(homePolicy.(string)) + } + if newHomePrefix, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "new_home_prefix")); ok { + tmp := newHomePrefix.(string) + details.NewHomePrefix = &tmp + } + baseObject = details + case strings.ToLower("GUEST_OS"): + details := oci_fleet_software_update.GuestOsGoalSoftwareComponentDetails{} + if goalVersionDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "goal_version_details")); ok { + if tmpList := goalVersionDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "goal_version_details"), 0) + tmp, err := s.mapToGuestOsGoalVersionDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert goal_version_details, encountered error: %v", err) + } + details.GoalVersionDetails = tmp + } + } + baseObject = details + default: + return nil, fmt.Errorf("unknown component_type '%v' was specified", componentType) + } + return baseObject, nil +} + +func GoalSoftwareComponentDetailsToMap(obj oci_fleet_software_update.GoalSoftwareComponentDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (obj).(type) { + case oci_fleet_software_update.GiGoalSoftwareComponentDetails: + result["component_type"] = "GI" + + if v.GoalVersionDetails != nil { + goalVersionDetailsArray := []interface{}{} + if goalVersionDetailsMap := GiGoalVersionDetailsToMap(&v.GoalVersionDetails); goalVersionDetailsMap != nil { + goalVersionDetailsArray = append(goalVersionDetailsArray, goalVersionDetailsMap) + } + result["goal_version_details"] = goalVersionDetailsArray + } + + result["home_policy"] = string(v.HomePolicy) + + if v.NewHomePrefix != nil { + result["new_home_prefix"] = string(*v.NewHomePrefix) + } + case oci_fleet_software_update.GuestOsGoalSoftwareComponentDetails: + result["component_type"] = "GUEST_OS" + + if v.GoalVersionDetails != nil { + goalVersionDetailsArray := []interface{}{} + if goalVersionDetailsMap := GuestOsGoalVersionDetailsToMap(&v.GoalVersionDetails); goalVersionDetailsMap != nil { + goalVersionDetailsArray = append(goalVersionDetailsArray, goalVersionDetailsMap) + } + result["goal_version_details"] = goalVersionDetailsArray + } + default: + log.Printf("[WARN] Received 'component_type' of unknown type %v", obj) + return nil + } + + return result +} + +func (s *FleetSoftwareUpdateFsuCycleResourceCrud) mapToGuestOsGoalVersionDetails(fieldKeyFormat string) (oci_fleet_software_update.GuestOsGoalVersionDetails, error) { + var baseObject oci_fleet_software_update.GuestOsGoalVersionDetails + //discriminator + goalTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "goal_type")) + var goalType string + if ok { + goalType = goalTypeRaw.(string) + } else { + goalType = "" // default value + } + switch strings.ToLower(goalType) { + case strings.ToLower("GUEST_OS_ORACLE_IMAGE"): + details := oci_fleet_software_update.OracleGuestOsGoalVersionDetails{} + if goalVersion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "goal_version")); ok { + tmp := goalVersion.(string) + details.GoalVersion = &tmp + } + baseObject = details + default: + return nil, fmt.Errorf("unknown goal_type '%v' was specified", goalType) + } + return baseObject, nil +} + +func GuestOsGoalVersionDetailsToMap(obj *oci_fleet_software_update.GuestOsGoalVersionDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_fleet_software_update.OracleGuestOsGoalVersionDetails: + result["goal_type"] = "GUEST_OS_ORACLE_IMAGE" + + if v.GoalVersion != nil { + result["goal_version"] = string(*v.GoalVersion) + } + default: + log.Printf("[WARN] Received 'goal_type' of unknown type %v", *obj) + return nil + } + + return result +} + func NextActionToExecuteDetailsToMap(obj oci_fleet_software_update.NextActionToExecuteDetails) map[string]interface{} { result := map[string]interface{}{} @@ -1320,9 +1627,21 @@ func (s *FleetSoftwareUpdateFsuCycleResourceCrud) mapToUpgradeDetails(fieldKeyFo tmp := isTimeZoneUpgrade.(bool) details.IsTimeZoneUpgrade = &tmp } + if maxDrainTimeoutInSeconds, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "max_drain_timeout_in_seconds")); ok { + tmp := maxDrainTimeoutInSeconds.(int) + details.MaxDrainTimeoutInSeconds = &tmp + } baseObject = details case strings.ToLower("GI"): details := oci_fleet_software_update.UpgradeGiCollectionDetails{} + if isIgnorePostUpgradeErrors, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_ignore_post_upgrade_errors")); ok { + tmp := isIgnorePostUpgradeErrors.(bool) + details.IsIgnorePostUpgradeErrors = &tmp + } + if isIgnorePrerequisites, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_ignore_prerequisites")); ok { + tmp := isIgnorePrerequisites.(bool) + details.IsIgnorePrerequisites = &tmp + } baseObject = details default: return nil, fmt.Errorf("unknown collection_type '%v' was specified", collectionType) @@ -1343,8 +1662,20 @@ func UpgradeDetailsToMap(obj *oci_fleet_software_update.UpgradeDetails) map[stri if v.IsTimeZoneUpgrade != nil { result["is_time_zone_upgrade"] = bool(*v.IsTimeZoneUpgrade) } + + if v.MaxDrainTimeoutInSeconds != nil { + result["max_drain_timeout_in_seconds"] = int(*v.MaxDrainTimeoutInSeconds) + } case oci_fleet_software_update.UpgradeGiCollectionDetails: result["collection_type"] = "GI" + + if v.IsIgnorePostUpgradeErrors != nil { + result["is_ignore_post_upgrade_errors"] = bool(*v.IsIgnorePostUpgradeErrors) + } + + if v.IsIgnorePrerequisites != nil { + result["is_ignore_prerequisites"] = bool(*v.IsIgnorePrerequisites) + } default: log.Printf("[WARN] Received 'collection_type' of unknown type %v", *obj) return nil diff --git a/internal/service/functions/functions_function_data_source.go b/internal/service/functions/functions_function_data_source.go index 7d9eedec803..6f4b381692c 100644 --- a/internal/service/functions/functions_function_data_source.go +++ b/internal/service/functions/functions_function_data_source.go @@ -81,10 +81,24 @@ func (s *FunctionsFunctionDataSourceCrud) SetData() error { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } + if s.Res.DetachedModeTimeoutInSeconds != nil { + s.D.Set("detached_mode_timeout_in_seconds", *s.Res.DetachedModeTimeoutInSeconds) + } + if s.Res.DisplayName != nil { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.FailureDestination != nil { + failureDestinationArray := []interface{}{} + if failureDestinationMap := FailureDestinationDetailsToMap(&s.Res.FailureDestination); failureDestinationMap != nil { + failureDestinationArray = append(failureDestinationArray, failureDestinationMap) + } + s.D.Set("failure_destination", failureDestinationArray) + } else { + s.D.Set("failure_destination", nil) + } + s.D.Set("freeform_tags", s.Res.FreeformTags) if s.Res.Image != nil { @@ -127,6 +141,16 @@ func (s *FunctionsFunctionDataSourceCrud) SetData() error { s.D.Set("state", s.Res.LifecycleState) + if s.Res.SuccessDestination != nil { + successDestinationArray := []interface{}{} + if successDestinationMap := SuccessDestinationDetailsToMap(&s.Res.SuccessDestination); successDestinationMap != nil { + successDestinationArray = append(successDestinationArray, successDestinationMap) + } + s.D.Set("success_destination", successDestinationArray) + } else { + s.D.Set("success_destination", nil) + } + if s.Res.TimeCreated != nil { s.D.Set("time_created", s.Res.TimeCreated.String()) } diff --git a/internal/service/functions/functions_function_resource.go b/internal/service/functions/functions_function_resource.go index 078af5ca251..850376afc2c 100644 --- a/internal/service/functions/functions_function_resource.go +++ b/internal/service/functions/functions_function_resource.go @@ -116,6 +116,58 @@ func FunctionsFunctionResource() *schema.Resource { DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, Elem: schema.TypeString, }, + "detached_mode_timeout_in_seconds": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "failure_destination": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "kind": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "NONE", + "NOTIFICATION", + "QUEUE", + "STREAM", + }, true), + }, + + // Optional + "channel_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "queue_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "stream_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "topic_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, "freeform_tags": { Type: schema.TypeMap, Optional: true, @@ -197,6 +249,53 @@ func FunctionsFunctionResource() *schema.Resource { }, }, }, + "success_destination": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "kind": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "NONE", + "NOTIFICATION", + "QUEUE", + "STREAM", + }, true), + }, + + // Optional + "channel_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "queue_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "stream_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "topic_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, "timeout_in_seconds": { Type: schema.TypeInt, Optional: true, @@ -355,11 +454,27 @@ func (s *FunctionsFunctionResourceCrud) Create() error { request.DefinedTags = convertedDefinedTags } + if detachedModeTimeoutInSeconds, ok := s.D.GetOkExists("detached_mode_timeout_in_seconds"); ok { + tmp := detachedModeTimeoutInSeconds.(int) + request.DetachedModeTimeoutInSeconds = &tmp + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { tmp := displayName.(string) request.DisplayName = &tmp } + if failureDestination, ok := s.D.GetOkExists("failure_destination"); ok { + if tmpList := failureDestination.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "failure_destination", 0) + tmp, err := s.mapToFailureDestinationDetails(fieldKeyFormat) + if err != nil { + return err + } + request.FailureDestination = tmp + } + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } @@ -409,6 +524,17 @@ func (s *FunctionsFunctionResourceCrud) Create() error { } } + if successDestination, ok := s.D.GetOkExists("success_destination"); ok { + if tmpList := successDestination.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "success_destination", 0) + tmp, err := s.mapToSuccessDestinationDetails(fieldKeyFormat) + if err != nil { + return err + } + request.SuccessDestination = tmp + } + } + if timeoutInSeconds, ok := s.D.GetOkExists("timeout_in_seconds"); ok { tmp := timeoutInSeconds.(int) request.TimeoutInSeconds = &tmp @@ -468,6 +594,22 @@ func (s *FunctionsFunctionResourceCrud) Update() error { request.DefinedTags = convertedDefinedTags } + if detachedModeTimeoutInSeconds, ok := s.D.GetOkExists("detached_mode_timeout_in_seconds"); ok { + tmp := detachedModeTimeoutInSeconds.(int) + request.DetachedModeTimeoutInSeconds = &tmp + } + + if failureDestination, ok := s.D.GetOkExists("failure_destination"); ok { + if tmpList := failureDestination.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "failure_destination", 0) + tmp, err := s.mapToFailureDestinationDetails(fieldKeyFormat) + if err != nil { + return err + } + request.FailureDestination = tmp + } + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } @@ -508,6 +650,17 @@ func (s *FunctionsFunctionResourceCrud) Update() error { } } + if successDestination, ok := s.D.GetOkExists("success_destination"); ok { + if tmpList := successDestination.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "success_destination", 0) + tmp, err := s.mapToSuccessDestinationDetails(fieldKeyFormat) + if err != nil { + return err + } + request.SuccessDestination = tmp + } + } + if timeoutInSeconds, ok := s.D.GetOkExists("timeout_in_seconds"); ok { tmp := timeoutInSeconds.(int) request.TimeoutInSeconds = &tmp @@ -562,10 +715,24 @@ func (s *FunctionsFunctionResourceCrud) SetData() error { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } + if s.Res.DetachedModeTimeoutInSeconds != nil { + s.D.Set("detached_mode_timeout_in_seconds", *s.Res.DetachedModeTimeoutInSeconds) + } + if s.Res.DisplayName != nil { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.FailureDestination != nil { + failureDestinationArray := []interface{}{} + if failureDestinationMap := FailureDestinationDetailsToMap(&s.Res.FailureDestination); failureDestinationMap != nil { + failureDestinationArray = append(failureDestinationArray, failureDestinationMap) + } + s.D.Set("failure_destination", failureDestinationArray) + } else { + s.D.Set("failure_destination", nil) + } + s.D.Set("freeform_tags", s.Res.FreeformTags) if s.Res.Image != nil { @@ -611,6 +778,16 @@ func (s *FunctionsFunctionResourceCrud) SetData() error { s.D.Set("state", s.Res.LifecycleState) + if s.Res.SuccessDestination != nil { + successDestinationArray := []interface{}{} + if successDestinationMap := SuccessDestinationDetailsToMap(&s.Res.SuccessDestination); successDestinationMap != nil { + successDestinationArray = append(successDestinationArray, successDestinationMap) + } + s.D.Set("success_destination", successDestinationArray) + } else { + s.D.Set("success_destination", nil) + } + if s.Res.TimeCreated != nil { s.D.Set("time_created", s.Res.TimeCreated.String()) } @@ -632,6 +809,86 @@ func (s *FunctionsFunctionResourceCrud) SetData() error { return nil } +func (s *FunctionsFunctionResourceCrud) mapToFailureDestinationDetails(fieldKeyFormat string) (oci_functions.FailureDestinationDetails, error) { + var baseObject oci_functions.FailureDestinationDetails + //discriminator + kindRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "kind")) + var kind string + if ok { + kind = kindRaw.(string) + } else { + kind = "" // default value + } + switch strings.ToLower(kind) { + case strings.ToLower("NONE"): + details := oci_functions.NoneFailureDestinationDetails{} + baseObject = details + case strings.ToLower("NOTIFICATION"): + details := oci_functions.NotificationFailureDestinationDetails{} + if topicId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "topic_id")); ok { + tmp := topicId.(string) + details.TopicId = &tmp + } + baseObject = details + case strings.ToLower("QUEUE"): + details := oci_functions.QueueFailureDestinationDetails{} + if channelId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "channel_id")); ok { + tmp := channelId.(string) + details.ChannelId = &tmp + } + if queueId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "queue_id")); ok { + tmp := queueId.(string) + details.QueueId = &tmp + } + baseObject = details + case strings.ToLower("STREAM"): + details := oci_functions.StreamFailureDestinationDetails{} + if streamId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "stream_id")); ok { + tmp := streamId.(string) + details.StreamId = &tmp + } + baseObject = details + default: + return nil, fmt.Errorf("unknown kind '%v' was specified", kind) + } + return baseObject, nil +} + +func FailureDestinationDetailsToMap(obj *oci_functions.FailureDestinationDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_functions.NoneFailureDestinationDetails: + result["kind"] = "NONE" + case oci_functions.NotificationFailureDestinationDetails: + result["kind"] = "NOTIFICATION" + + if v.TopicId != nil { + result["topic_id"] = string(*v.TopicId) + } + case oci_functions.QueueFailureDestinationDetails: + result["kind"] = "QUEUE" + + if v.ChannelId != nil { + result["channel_id"] = string(*v.ChannelId) + } + + if v.QueueId != nil { + result["queue_id"] = string(*v.QueueId) + } + case oci_functions.StreamFailureDestinationDetails: + result["kind"] = "STREAM" + + if v.StreamId != nil { + result["stream_id"] = string(*v.StreamId) + } + default: + log.Printf("[WARN] Received 'kind' of unknown type %v", *obj) + return nil + } + + return result +} + func (s *FunctionsFunctionResourceCrud) mapToFunctionProvisionedConcurrencyConfig(fieldKeyFormat string) (oci_functions.FunctionProvisionedConcurrencyConfig, error) { var baseObject oci_functions.FunctionProvisionedConcurrencyConfig //discriminator @@ -739,3 +996,83 @@ func FunctionTraceConfigToMap(obj *oci_functions.FunctionTraceConfig) map[string return result } + +func (s *FunctionsFunctionResourceCrud) mapToSuccessDestinationDetails(fieldKeyFormat string) (oci_functions.SuccessDestinationDetails, error) { + var baseObject oci_functions.SuccessDestinationDetails + //discriminator + kindRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "kind")) + var kind string + if ok { + kind = kindRaw.(string) + } else { + kind = "" // default value + } + switch strings.ToLower(kind) { + case strings.ToLower("NONE"): + details := oci_functions.NoneSuccessDestinationDetails{} + baseObject = details + case strings.ToLower("NOTIFICATION"): + details := oci_functions.NotificationSuccessDestinationDetails{} + if topicId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "topic_id")); ok { + tmp := topicId.(string) + details.TopicId = &tmp + } + baseObject = details + case strings.ToLower("QUEUE"): + details := oci_functions.QueueSuccessDestinationDetails{} + if channelId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "channel_id")); ok { + tmp := channelId.(string) + details.ChannelId = &tmp + } + if queueId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "queue_id")); ok { + tmp := queueId.(string) + details.QueueId = &tmp + } + baseObject = details + case strings.ToLower("STREAM"): + details := oci_functions.StreamSuccessDestinationDetails{} + if streamId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "stream_id")); ok { + tmp := streamId.(string) + details.StreamId = &tmp + } + baseObject = details + default: + return nil, fmt.Errorf("unknown kind '%v' was specified", kind) + } + return baseObject, nil +} + +func SuccessDestinationDetailsToMap(obj *oci_functions.SuccessDestinationDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_functions.NoneSuccessDestinationDetails: + result["kind"] = "NONE" + case oci_functions.NotificationSuccessDestinationDetails: + result["kind"] = "NOTIFICATION" + + if v.TopicId != nil { + result["topic_id"] = string(*v.TopicId) + } + case oci_functions.QueueSuccessDestinationDetails: + result["kind"] = "QUEUE" + + if v.ChannelId != nil { + result["channel_id"] = string(*v.ChannelId) + } + + if v.QueueId != nil { + result["queue_id"] = string(*v.QueueId) + } + case oci_functions.StreamSuccessDestinationDetails: + result["kind"] = "STREAM" + + if v.StreamId != nil { + result["stream_id"] = string(*v.StreamId) + } + default: + log.Printf("[WARN] Received 'kind' of unknown type %v", *obj) + return nil + } + + return result +} diff --git a/internal/service/functions/functions_functions_data_source.go b/internal/service/functions/functions_functions_data_source.go index 373e4e537ef..13fa565381d 100644 --- a/internal/service/functions/functions_functions_data_source.go +++ b/internal/service/functions/functions_functions_data_source.go @@ -128,10 +128,24 @@ func (s *FunctionsFunctionsDataSourceCrud) SetData() error { function["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) } + if r.DetachedModeTimeoutInSeconds != nil { + function["detached_mode_timeout_in_seconds"] = *r.DetachedModeTimeoutInSeconds + } + if r.DisplayName != nil { function["display_name"] = *r.DisplayName } + if r.FailureDestination != nil { + failureDestinationArray := []interface{}{} + if failureDestinationMap := FailureDestinationDetailsToMap(&r.FailureDestination); failureDestinationMap != nil { + failureDestinationArray = append(failureDestinationArray, failureDestinationMap) + } + function["failure_destination"] = failureDestinationArray + } else { + function["failure_destination"] = nil + } + function["freeform_tags"] = r.FreeformTags if r.Id != nil { @@ -178,6 +192,16 @@ func (s *FunctionsFunctionsDataSourceCrud) SetData() error { function["state"] = r.LifecycleState + if r.SuccessDestination != nil { + successDestinationArray := []interface{}{} + if successDestinationMap := SuccessDestinationDetailsToMap(&r.SuccessDestination); successDestinationMap != nil { + successDestinationArray = append(successDestinationArray, successDestinationMap) + } + function["success_destination"] = successDestinationArray + } else { + function["success_destination"] = nil + } + if r.TimeCreated != nil { function["time_created"] = r.TimeCreated.String() } diff --git a/internal/service/generative_ai/generative_ai_endpoint_resource.go b/internal/service/generative_ai/generative_ai_endpoint_resource.go index 08f60502189..9367f7f2659 100644 --- a/internal/service/generative_ai/generative_ai_endpoint_resource.go +++ b/internal/service/generative_ai/generative_ai_endpoint_resource.go @@ -66,6 +66,16 @@ func GenerativeAiEndpointResource() *schema.Resource { }, // Optional + "mode": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "model_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, // Computed }, @@ -94,6 +104,11 @@ func GenerativeAiEndpointResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "generative_ai_private_endpoint_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, // Computed "lifecycle_details": { @@ -235,6 +250,11 @@ func (s *GenerativeAiEndpointResourceCrud) Create() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if generativeAiPrivateEndpointId, ok := s.D.GetOkExists("generative_ai_private_endpoint_id"); ok { + tmp := generativeAiPrivateEndpointId.(string) + request.GenerativeAiPrivateEndpointId = &tmp + } + if modelId, ok := s.D.GetOkExists("model_id"); ok { tmp := modelId.(string) request.ModelId = &tmp @@ -436,6 +456,11 @@ func (s *GenerativeAiEndpointResourceCrud) Update() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if generativeAiPrivateEndpointId, ok := s.D.GetOkExists("generative_ai_private_endpoint_id"); ok { + tmp := generativeAiPrivateEndpointId.(string) + request.GenerativeAiPrivateEndpointId = &tmp + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai") response, err := s.Client.UpdateEndpoint(context.Background(), request) @@ -496,6 +521,10 @@ func (s *GenerativeAiEndpointResourceCrud) SetData() error { s.D.Set("freeform_tags", s.Res.FreeformTags) + if s.Res.GenerativeAiPrivateEndpointId != nil { + s.D.Set("generative_ai_private_endpoint_id", *s.Res.GenerativeAiPrivateEndpointId) + } + if s.Res.LifecycleDetails != nil { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } @@ -529,6 +558,15 @@ func (s *GenerativeAiEndpointResourceCrud) mapToContentModerationConfig(fieldKey result.IsEnabled = &tmp } + if mode, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "mode")); ok { + result.Mode = oci_generative_ai.ContentModerationConfigModeEnum(mode.(string)) + } + + if modelId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_id")); ok { + tmp := modelId.(string) + result.ModelId = &tmp + } + return result, nil } @@ -539,6 +577,12 @@ func ContentModerationConfigToMap(obj *oci_generative_ai.ContentModerationConfig result["is_enabled"] = bool(*obj.IsEnabled) } + result["mode"] = string(obj.Mode) + + if obj.ModelId != nil { + result["model_id"] = string(*obj.ModelId) + } + return result } @@ -571,6 +615,10 @@ func EndpointSummaryToMap(obj oci_generative_ai.EndpointSummary) map[string]inte result["freeform_tags"] = obj.FreeformTags + if obj.GenerativeAiPrivateEndpointId != nil { + result["generative_ai_private_endpoint_id"] = string(*obj.GenerativeAiPrivateEndpointId) + } + if obj.Id != nil { result["id"] = string(*obj.Id) } diff --git a/internal/service/generative_ai/generative_ai_endpoints_data_source.go b/internal/service/generative_ai/generative_ai_endpoints_data_source.go index c93f324505a..b8ab97694e9 100644 --- a/internal/service/generative_ai/generative_ai_endpoints_data_source.go +++ b/internal/service/generative_ai/generative_ai_endpoints_data_source.go @@ -26,6 +26,10 @@ func GenerativeAiEndpointsDataSource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "generative_ai_private_endpoint_id": { + Type: schema.TypeString, + Optional: true, + }, "id": { Type: schema.TypeString, Optional: true, @@ -83,6 +87,11 @@ func (s *GenerativeAiEndpointsDataSourceCrud) Get() error { request.DisplayName = &tmp } + if generativeAiPrivateEndpointId, ok := s.D.GetOkExists("generative_ai_private_endpoint_id"); ok { + tmp := generativeAiPrivateEndpointId.(string) + request.GenerativeAiPrivateEndpointId = &tmp + } + if id, ok := s.D.GetOkExists("id"); ok { tmp := id.(string) request.Id = &tmp diff --git a/internal/service/generative_ai/generative_ai_export.go b/internal/service/generative_ai/generative_ai_export.go index 7db87476aa3..9f0dbdf90d6 100644 --- a/internal/service/generative_ai/generative_ai_export.go +++ b/internal/service/generative_ai/generative_ai_export.go @@ -63,10 +63,23 @@ var exportGenerativeAiModelHints = &tf_export.TerraformResourceHints{ }, } +var exportGenerativeAiGenerativeAiPrivateEndpointHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_generative_ai_generative_ai_private_endpoint", + DatasourceClass: "oci_generative_ai_generative_ai_private_endpoints", + DatasourceItemsAttr: "generative_ai_private_endpoint_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "generative_ai_private_endpoint", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateActive), + }, +} + var generativeAiResourceGraph = tf_export.TerraformResourceGraph{ "oci_identity_compartment": { {TerraformResourceHints: exportGenerativeAiDedicatedAiClusterHints}, {TerraformResourceHints: exportGenerativeAiEndpointHints}, {TerraformResourceHints: exportGenerativeAiModelHints}, + {TerraformResourceHints: exportGenerativeAiGenerativeAiPrivateEndpointHints}, }, } diff --git a/internal/service/generative_ai/generative_ai_generative_ai_private_endpoint_data_source.go b/internal/service/generative_ai/generative_ai_generative_ai_private_endpoint_data_source.go new file mode 100644 index 00000000000..9f176c4e23d --- /dev/null +++ b/internal/service/generative_ai/generative_ai_generative_ai_private_endpoint_data_source.go @@ -0,0 +1,92 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package generative_ai + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_generative_ai "github.com/oracle/oci-go-sdk/v65/generativeai" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func GenerativeAiGenerativeAiPrivateEndpointDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["generative_ai_private_endpoint_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(GenerativeAiGenerativeAiPrivateEndpointResource(), fieldMap, readSingularGenerativeAiGenerativeAiPrivateEndpoint) +} + +func readSingularGenerativeAiGenerativeAiPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &GenerativeAiGenerativeAiPrivateEndpointDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).GenerativeAiClient() + + return tfresource.ReadResource(sync) +} + +type GenerativeAiGenerativeAiPrivateEndpointDataSourceCrud struct { + D *schema.ResourceData + Client *oci_generative_ai.GenerativeAiClient + Res *oci_generative_ai.GetGenerativeAiPrivateEndpointResponse +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointDataSourceCrud) Get() error { + request := oci_generative_ai.GetGenerativeAiPrivateEndpointRequest{} + + if generativeAiPrivateEndpointId, ok := s.D.GetOkExists("generative_ai_private_endpoint_id"); ok { + tmp := generativeAiPrivateEndpointId.(string) + request.GenerativeAiPrivateEndpointId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "generative_ai") + + response, err := s.Client.GetGenerativeAiPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + if s.Res.Fqdn != nil { + s.D.Set("fqdn", *s.Res.Fqdn) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + s.D.Set("nsg_ids", s.Res.NsgIds) + + if s.Res.PrivateEndpointIp != nil { + s.D.Set("private_endpoint_ip", *s.Res.PrivateEndpointIp) + } + + s.D.Set("state", s.Res.LifecycleState) + + return nil +} diff --git a/internal/service/generative_ai/generative_ai_generative_ai_private_endpoint_resource.go b/internal/service/generative_ai/generative_ai_generative_ai_private_endpoint_resource.go new file mode 100644 index 00000000000..9b64d275137 --- /dev/null +++ b/internal/service/generative_ai/generative_ai_generative_ai_private_endpoint_resource.go @@ -0,0 +1,615 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package generative_ai + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_generative_ai "github.com/oracle/oci-go-sdk/v65/generativeai" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func GenerativeAiGenerativeAiPrivateEndpointResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createGenerativeAiGenerativeAiPrivateEndpoint, + Read: readGenerativeAiGenerativeAiPrivateEndpoint, + Update: updateGenerativeAiGenerativeAiPrivateEndpoint, + Delete: deleteGenerativeAiGenerativeAiPrivateEndpoint, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "dns_prefix": { + Type: schema.TypeString, + Required: true, + }, + "subnet_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + "nsg_ids": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Set: tfresource.LiteralTypeHashCodeForSets, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + // Computed + "fqdn": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "previous_state": { + Type: schema.TypeString, + Computed: true, + }, + "private_endpoint_ip": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createGenerativeAiGenerativeAiPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &GenerativeAiGenerativeAiPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).GenerativeAiClient() + + return tfresource.CreateResource(d, sync) +} + +func readGenerativeAiGenerativeAiPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &GenerativeAiGenerativeAiPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).GenerativeAiClient() + + return tfresource.ReadResource(sync) +} + +func updateGenerativeAiGenerativeAiPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &GenerativeAiGenerativeAiPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).GenerativeAiClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteGenerativeAiGenerativeAiPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &GenerativeAiGenerativeAiPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).GenerativeAiClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type GenerativeAiGenerativeAiPrivateEndpointResourceCrud struct { + tfresource.BaseCrud + Client *oci_generative_ai.GenerativeAiClient + Res *oci_generative_ai.GenerativeAiPrivateEndpoint + DisableNotFoundRetries bool +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) CreatedPending() []string { + return []string{ + string(oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateCreating), + } +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateActive), + } +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) DeletedPending() []string { + return []string{ + string(oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateDeleting), + } +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateDeleted), + } +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) Create() error { + request := oci_generative_ai.CreateGenerativeAiPrivateEndpointRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if dnsPrefix, ok := s.D.GetOkExists("dns_prefix"); ok { + tmp := dnsPrefix.(string) + request.DnsPrefix = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if nsgIds, ok := s.D.GetOkExists("nsg_ids"); ok { + set := nsgIds.(*schema.Set) + interfaces := set.List() + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("nsg_ids") { + request.NsgIds = tmp + } + } + + if subnetId, ok := s.D.GetOkExists("subnet_id"); ok { + tmp := subnetId.(string) + request.SubnetId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai") + + response, err := s.Client.CreateGenerativeAiPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + return s.getGenerativeAiPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai"), oci_generative_ai.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) getGenerativeAiPrivateEndpointFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_generative_ai.ActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + generativeAiPrivateEndpointId, err := generativeAiPrivateEndpointWaitForWorkRequest(workId, "generativeaiprivateendpoint", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) + + if err != nil { + return err + } + s.D.SetId(*generativeAiPrivateEndpointId) + + return s.Get() +} + +func generativeAiPrivateEndpointWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { + startTime := time.Now() + stopTime := startTime.Add(timeout) + return func(response oci_common.OCIOperationResponse) bool { + + // Stop after timeout has elapsed + if time.Now().After(stopTime) { + return false + } + + // Make sure we stop on default rules + if tfresource.ShouldRetry(response, false, "generative_ai", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_generative_ai.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func generativeAiPrivateEndpointWaitForWorkRequest(wId *string, entityType string, action oci_generative_ai.ActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_generative_ai.GenerativeAiClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "generative_ai") + retryPolicy.ShouldRetryOperation = generativeAiPrivateEndpointWorkRequestShouldRetryFunc(timeout) + + response := oci_generative_ai.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_generative_ai.OperationStatusInProgress), + string(oci_generative_ai.OperationStatusAccepted), + string(oci_generative_ai.OperationStatusCanceling), + }, + Target: []string{ + string(oci_generative_ai.OperationStatusSucceeded), + string(oci_generative_ai.OperationStatusFailed), + string(oci_generative_ai.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_generative_ai.GetWorkRequestRequest{ + WorkRequestId: wId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + wr := &response.WorkRequest + return wr, string(wr.Status), err + }, + Timeout: timeout, + } + if _, e := stateConf.WaitForState(); e != nil { + return nil, e + } + + var identifier *string + // The work request response contains an array of objects that finished the operation + for _, res := range response.Resources { + if strings.Contains(strings.ToLower(*res.EntityType), entityType) { + if res.ActionType == action { + identifier = res.Identifier + break + } + } + } + + // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled + if identifier == nil || response.Status == oci_generative_ai.OperationStatusFailed || response.Status == oci_generative_ai.OperationStatusCanceled { + return nil, getErrorFromGenerativeAiGenerativeAiPrivateEndpointWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromGenerativeAiGenerativeAiPrivateEndpointWorkRequest(client *oci_generative_ai.GenerativeAiClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_generative_ai.ActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_generative_ai.ListWorkRequestErrorsRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return err + } + + allErrs := make([]string, 0) + for _, wrkErr := range response.Items { + allErrs = append(allErrs, *wrkErr.Message) + } + errorMessage := strings.Join(allErrs, "\n") + + workRequestErr := fmt.Errorf("work request did not succeed, workId: %s, entity: %s, action: %s. Message: %s", *workId, entityType, action, errorMessage) + + return workRequestErr +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) Get() error { + request := oci_generative_ai.GetGenerativeAiPrivateEndpointRequest{} + + tmp := s.D.Id() + request.GenerativeAiPrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai") + + response, err := s.Client.GetGenerativeAiPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.GenerativeAiPrivateEndpoint + return nil +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) Update() error { + if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { + oldRaw, newRaw := s.D.GetChange("compartment_id") + if newRaw != "" && oldRaw != "" { + err := s.updateCompartment(compartment) + if err != nil { + return err + } + } + } + request := oci_generative_ai.UpdateGenerativeAiPrivateEndpointRequest{} + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if dnsPrefix, ok := s.D.GetOkExists("dns_prefix"); ok { + tmp := dnsPrefix.(string) + request.DnsPrefix = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + tmp := s.D.Id() + request.GenerativeAiPrivateEndpointId = &tmp + + if nsgIds, ok := s.D.GetOkExists("nsg_ids"); ok { + set := nsgIds.(*schema.Set) + interfaces := set.List() + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("nsg_ids") { + request.NsgIds = tmp + } + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai") + + response, err := s.Client.UpdateGenerativeAiPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getGenerativeAiPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai"), oci_generative_ai.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) Delete() error { + request := oci_generative_ai.DeleteGenerativeAiPrivateEndpointRequest{} + + tmp := s.D.Id() + request.GenerativeAiPrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai") + + response, err := s.Client.DeleteGenerativeAiPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := generativeAiPrivateEndpointWaitForWorkRequest(workId, "generativeaiprivateendpoint", + oci_generative_ai.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) + return delWorkRequestErr +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) SetData() error { + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + if s.Res.Fqdn != nil { + s.D.Set("fqdn", *s.Res.Fqdn) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + nsgIds := []interface{}{} + for _, item := range s.Res.NsgIds { + nsgIds = append(nsgIds, item) + } + s.D.Set("nsg_ids", schema.NewSet(tfresource.LiteralTypeHashCodeForSets, nsgIds)) + + if s.Res.PreviousState != nil { + s.D.Set("previous_state", *s.Res.PreviousState) + } + + if s.Res.PrivateEndpointIp != nil { + s.D.Set("private_endpoint_ip", *s.Res.PrivateEndpointIp) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SubnetId != nil { + s.D.Set("subnet_id", *s.Res.SubnetId) + } + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func GenerativeAiPrivateEndpointSummaryToMap(obj oci_generative_ai.GenerativeAiPrivateEndpointSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + if obj.Fqdn != nil { + result["fqdn"] = string(*obj.Fqdn) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + if obj.PrivateEndpointIp != nil { + result["private_endpoint_ip"] = string(*obj.PrivateEndpointIp) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SubnetId != nil { + result["subnet_id"] = string(*obj.SubnetId) + } + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + return result +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_generative_ai.ChangeGenerativeAiPrivateEndpointCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.GenerativeAiPrivateEndpointId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai") + + response, err := s.Client.ChangeGenerativeAiPrivateEndpointCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getGenerativeAiPrivateEndpointFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "generative_ai"), oci_generative_ai.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} diff --git a/internal/service/generative_ai/generative_ai_generative_ai_private_endpoints_data_source.go b/internal/service/generative_ai/generative_ai_generative_ai_private_endpoints_data_source.go new file mode 100644 index 00000000000..8f4fd1f00e8 --- /dev/null +++ b/internal/service/generative_ai/generative_ai_generative_ai_private_endpoints_data_source.go @@ -0,0 +1,144 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package generative_ai + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_generative_ai "github.com/oracle/oci-go-sdk/v65/generativeai" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func GenerativeAiGenerativeAiPrivateEndpointsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readGenerativeAiGenerativeAiPrivateEndpoints, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "generative_ai_private_endpoint_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(GenerativeAiGenerativeAiPrivateEndpointResource()), + }, + }, + }, + }, + }, + } +} + +func readGenerativeAiGenerativeAiPrivateEndpoints(d *schema.ResourceData, m interface{}) error { + sync := &GenerativeAiGenerativeAiPrivateEndpointsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).GenerativeAiClient() + + return tfresource.ReadResource(sync) +} + +type GenerativeAiGenerativeAiPrivateEndpointsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_generative_ai.GenerativeAiClient + Res *oci_generative_ai.ListGenerativeAiPrivateEndpointsResponse +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *GenerativeAiGenerativeAiPrivateEndpointsDataSourceCrud) Get() error { + request := oci_generative_ai.ListGenerativeAiPrivateEndpointsRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_generative_ai.GenerativeAiPrivateEndpointLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "generative_ai") + + response, err := s.Client.ListGenerativeAiPrivateEndpoints(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListGenerativeAiPrivateEndpoints(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 *GenerativeAiGenerativeAiPrivateEndpointsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("GenerativeAiGenerativeAiPrivateEndpointsDataSource-", GenerativeAiGenerativeAiPrivateEndpointsDataSource(), s.D)) + resources := []map[string]interface{}{} + generativeAiPrivateEndpoint := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, GenerativeAiPrivateEndpointSummaryToMap(item)) + } + generativeAiPrivateEndpoint["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, GenerativeAiGenerativeAiPrivateEndpointsDataSource().Schema["generative_ai_private_endpoint_collection"].Elem.(*schema.Resource).Schema) + generativeAiPrivateEndpoint["items"] = items + } + + resources = append(resources, generativeAiPrivateEndpoint) + if err := s.D.Set("generative_ai_private_endpoint_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/generative_ai/register_datasource.go b/internal/service/generative_ai/register_datasource.go index b5e9e8365c1..4c38e144feb 100644 --- a/internal/service/generative_ai/register_datasource.go +++ b/internal/service/generative_ai/register_datasource.go @@ -10,6 +10,8 @@ func RegisterDatasource() { tfresource.RegisterDatasource("oci_generative_ai_dedicated_ai_clusters", GenerativeAiDedicatedAiClustersDataSource()) tfresource.RegisterDatasource("oci_generative_ai_endpoint", GenerativeAiEndpointDataSource()) tfresource.RegisterDatasource("oci_generative_ai_endpoints", GenerativeAiEndpointsDataSource()) + tfresource.RegisterDatasource("oci_generative_ai_generative_ai_private_endpoint", GenerativeAiGenerativeAiPrivateEndpointDataSource()) + tfresource.RegisterDatasource("oci_generative_ai_generative_ai_private_endpoints", GenerativeAiGenerativeAiPrivateEndpointsDataSource()) tfresource.RegisterDatasource("oci_generative_ai_model", GenerativeAiModelDataSource()) tfresource.RegisterDatasource("oci_generative_ai_models", GenerativeAiModelsDataSource()) } diff --git a/internal/service/generative_ai/register_resource.go b/internal/service/generative_ai/register_resource.go index c2a645d9255..6c799ccb759 100644 --- a/internal/service/generative_ai/register_resource.go +++ b/internal/service/generative_ai/register_resource.go @@ -8,5 +8,6 @@ import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterResource() { tfresource.RegisterResource("oci_generative_ai_dedicated_ai_cluster", GenerativeAiDedicatedAiClusterResource()) tfresource.RegisterResource("oci_generative_ai_endpoint", GenerativeAiEndpointResource()) + tfresource.RegisterResource("oci_generative_ai_generative_ai_private_endpoint", GenerativeAiGenerativeAiPrivateEndpointResource()) tfresource.RegisterResource("oci_generative_ai_model", GenerativeAiModelResource()) } diff --git a/internal/service/golden_gate/golden_gate_connection_assignment_data_source.go b/internal/service/golden_gate/golden_gate_connection_assignment_data_source.go index 5061f7f4751..6f7ebc9cd22 100644 --- a/internal/service/golden_gate/golden_gate_connection_assignment_data_source.go +++ b/internal/service/golden_gate/golden_gate_connection_assignment_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -19,15 +20,15 @@ func GoldenGateConnectionAssignmentDataSource() *schema.Resource { Type: schema.TypeString, Required: true, } - return tfresource.GetSingularDataSourceItemSchema(GoldenGateConnectionAssignmentResource(), fieldMap, readSingularGoldenGateConnectionAssignment) + return tfresource.GetSingularDataSourceItemSchemaWithContext(GoldenGateConnectionAssignmentResource(), fieldMap, readSingularGoldenGateConnectionAssignmentWithContext) } -func readSingularGoldenGateConnectionAssignment(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateConnectionAssignmentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionAssignmentDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateConnectionAssignmentDataSourceCrud struct { @@ -40,7 +41,7 @@ func (s *GoldenGateConnectionAssignmentDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateConnectionAssignmentDataSourceCrud) Get() error { +func (s *GoldenGateConnectionAssignmentDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetConnectionAssignmentRequest{} if connectionAssignmentId, ok := s.D.GetOkExists("connection_assignment_id"); ok { @@ -50,7 +51,7 @@ func (s *GoldenGateConnectionAssignmentDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetConnectionAssignment(context.Background(), request) + response, err := s.Client.GetConnectionAssignment(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_connection_assignment_resource.go b/internal/service/golden_gate/golden_gate_connection_assignment_resource.go index 01220825f93..2cf998ce9d4 100644 --- a/internal/service/golden_gate/golden_gate_connection_assignment_resource.go +++ b/internal/service/golden_gate/golden_gate_connection_assignment_resource.go @@ -9,6 +9,8 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -24,10 +26,10 @@ func GoldenGateConnectionAssignmentResource() *schema.Resource { Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, - Timeouts: tfresource.DefaultTimeout, - Create: createGoldenGateConnectionAssignment, - Read: readGoldenGateConnectionAssignment, - Delete: deleteGoldenGateConnectionAssignment, + Timeouts: tfresource.DefaultTimeout, + CreateContext: createGoldenGateConnectionAssignmentWithContext, + ReadContext: readGoldenGateConnectionAssignmentWithContext, + DeleteContext: deleteGoldenGateConnectionAssignmentWithContext, Schema: map[string]*schema.Schema{ // Required "connection_id": { @@ -74,29 +76,29 @@ func GoldenGateConnectionAssignmentResource() *schema.Resource { } } -func createGoldenGateConnectionAssignment(d *schema.ResourceData, m interface{}) error { +func createGoldenGateConnectionAssignmentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionAssignmentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.CreateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.CreateResourceWithContext(ctx, d, sync)) } -func readGoldenGateConnectionAssignment(d *schema.ResourceData, m interface{}) error { +func readGoldenGateConnectionAssignmentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionAssignmentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } -func deleteGoldenGateConnectionAssignment(d *schema.ResourceData, m interface{}) error { +func deleteGoldenGateConnectionAssignmentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionAssignmentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() sync.DisableNotFoundRetries = true - return tfresource.DeleteResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.DeleteResourceWithContext(ctx, d, sync)) } type GoldenGateConnectionAssignmentResourceCrud struct { @@ -120,7 +122,7 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) DeletedTarget() []string { return []string{} } -func (s *GoldenGateConnectionAssignmentResourceCrud) Create() error { +func (s *GoldenGateConnectionAssignmentResourceCrud) CreateWithContext(ctx context.Context) error { request := oci_golden_gate.CreateConnectionAssignmentRequest{} if connectionId, ok := s.D.GetOkExists("connection_id"); ok { @@ -139,7 +141,7 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) Create() error { } request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.CreateConnectionAssignment(context.Background(), request) + response, err := s.Client.CreateConnectionAssignment(ctx, request) if err != nil { return err @@ -153,7 +155,7 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) Create() error { } // Wait until it finishes - _, err = connectionAssignmentWaitForWorkRequest(workId, "goldengateconnectionassignment", + _, err = connectionAssignmentWaitForWorkRequest(ctx, workId, "goldengateconnectionassignment", oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries, s.Client) if err != nil { @@ -161,7 +163,7 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) Create() error { } s.D.SetId(*response.ConnectionAssignment.Id) - return s.Get() + return s.GetWithContext(ctx) } func connectionAssignmentWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { @@ -187,7 +189,7 @@ func connectionAssignmentWorkRequestShouldRetryFunc(timeout time.Duration) func( } } -func connectionAssignmentWaitForWorkRequest(wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, +func connectionAssignmentWaitForWorkRequest(ctx context.Context, wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, timeout time.Duration, disableFoundRetries bool, client *oci_golden_gate.GoldenGateClient) (*string, error) { retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "golden_gate") retryPolicy.ShouldRetryOperation = connectionAssignmentWorkRequestShouldRetryFunc(timeout) @@ -206,7 +208,7 @@ func connectionAssignmentWaitForWorkRequest(wId *string, entityType string, acti }, Refresh: func() (interface{}, string, error) { var err error - response, err = client.GetWorkRequest(context.Background(), + response, err = client.GetWorkRequest(ctx, oci_golden_gate.GetWorkRequestRequest{ WorkRequestId: wId, RequestMetadata: oci_common.RequestMetadata{ @@ -253,7 +255,7 @@ func getErrorFromGoldenGateConnectionAssignmentWorkRequest(client *oci_golden_ga return workRequestErr } -func (s *GoldenGateConnectionAssignmentResourceCrud) Get() error { +func (s *GoldenGateConnectionAssignmentResourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetConnectionAssignmentRequest{} tmp := s.D.Id() @@ -261,7 +263,7 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.GetConnectionAssignment(context.Background(), request) + response, err := s.Client.GetConnectionAssignment(ctx, request) if err != nil { return err } @@ -270,7 +272,7 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) Get() error { return nil } -func (s *GoldenGateConnectionAssignmentResourceCrud) Delete() error { +func (s *GoldenGateConnectionAssignmentResourceCrud) DeleteWithContext(ctx context.Context) error { request := oci_golden_gate.DeleteConnectionAssignmentRequest{} tmp := s.D.Id() @@ -283,14 +285,14 @@ func (s *GoldenGateConnectionAssignmentResourceCrud) Delete() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.DeleteConnectionAssignment(context.Background(), request) + response, err := s.Client.DeleteConnectionAssignment(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, delWorkRequestErr := connectionAssignmentWaitForWorkRequest(workId, "goldengateconnectionassignment", + _, delWorkRequestErr := connectionAssignmentWaitForWorkRequest(ctx, workId, "goldengateconnectionassignment", oci_golden_gate.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) return delWorkRequestErr } diff --git a/internal/service/golden_gate/golden_gate_connection_assignments_data_source.go b/internal/service/golden_gate/golden_gate_connection_assignments_data_source.go index 0e194f07a8c..ef8943d72db 100644 --- a/internal/service/golden_gate/golden_gate_connection_assignments_data_source.go +++ b/internal/service/golden_gate/golden_gate_connection_assignments_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateConnectionAssignmentsDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateConnectionAssignments, + ReadContext: readGoldenGateConnectionAssignmentsWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -56,12 +57,12 @@ func GoldenGateConnectionAssignmentsDataSource() *schema.Resource { } } -func readGoldenGateConnectionAssignments(d *schema.ResourceData, m interface{}) error { +func readGoldenGateConnectionAssignmentsWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionAssignmentsDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateConnectionAssignmentsDataSourceCrud struct { @@ -74,7 +75,7 @@ func (s *GoldenGateConnectionAssignmentsDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateConnectionAssignmentsDataSourceCrud) Get() error { +func (s *GoldenGateConnectionAssignmentsDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListConnectionAssignmentsRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -103,7 +104,7 @@ func (s *GoldenGateConnectionAssignmentsDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListConnectionAssignments(context.Background(), request) + response, err := s.Client.ListConnectionAssignments(ctx, request) if err != nil { return err } @@ -112,7 +113,7 @@ func (s *GoldenGateConnectionAssignmentsDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListConnectionAssignments(context.Background(), request) + listResponse, err := s.Client.ListConnectionAssignments(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_connection_data_source.go b/internal/service/golden_gate/golden_gate_connection_data_source.go index b7ba997cda8..8028ce83ee8 100644 --- a/internal/service/golden_gate/golden_gate_connection_data_source.go +++ b/internal/service/golden_gate/golden_gate_connection_data_source.go @@ -7,6 +7,8 @@ import ( "context" "log" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -20,15 +22,15 @@ func GoldenGateConnectionDataSource() *schema.Resource { Type: schema.TypeString, Required: true, } - return tfresource.GetSingularDataSourceItemSchema(GoldenGateConnectionResource(), fieldMap, readSingularGoldenGateConnection) + return tfresource.GetSingularDataSourceItemSchemaWithContext(GoldenGateConnectionResource(), fieldMap, readSingularGoldenGateConnectionWithContext) } -func readSingularGoldenGateConnection(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateConnectionWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateConnectionDataSourceCrud struct { @@ -41,7 +43,7 @@ func (s *GoldenGateConnectionDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateConnectionDataSourceCrud) Get() error { +func (s *GoldenGateConnectionDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetConnectionRequest{} if connectionId, ok := s.D.GetOkExists("connection_id"); ok { @@ -51,7 +53,7 @@ func (s *GoldenGateConnectionDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetConnection(context.Background(), request) + response, err := s.Client.GetConnection(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_connection_resource.go b/internal/service/golden_gate/golden_gate_connection_resource.go index cbf44bd9e89..679529090ab 100644 --- a/internal/service/golden_gate/golden_gate_connection_resource.go +++ b/internal/service/golden_gate/golden_gate_connection_resource.go @@ -10,6 +10,8 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" @@ -26,11 +28,11 @@ func GoldenGateConnectionResource() *schema.Resource { Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, - Timeouts: tfresource.DefaultTimeout, - Create: createGoldenGateConnection, - Read: readGoldenGateConnection, - Update: updateGoldenGateConnection, - Delete: deleteGoldenGateConnection, + Timeouts: tfresource.DefaultTimeout, + CreateContext: createGoldenGateConnectionWithContext, + ReadContext: readGoldenGateConnectionWithContext, + UpdateContext: updateGoldenGateConnectionWithContext, + DeleteContext: deleteGoldenGateConnectionWithContext, Schema: map[string]*schema.Schema{ // Required "compartment_id": { @@ -850,26 +852,26 @@ func GoldenGateConnectionResource() *schema.Resource { } } -func createGoldenGateConnection(d *schema.ResourceData, m interface{}) error { +func createGoldenGateConnectionWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - err := tfresource.CreateResource(d, sync) + err := tfresource.HandleDiagError(m, tfresource.CreateResourceWithContext(ctx, d, sync)) // always rewrite to false sync.D.Set("trigger_refresh", false) return err } -func readGoldenGateConnection(d *schema.ResourceData, m interface{}) error { +func readGoldenGateConnectionWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } -func updateGoldenGateConnection(d *schema.ResourceData, m interface{}) error { +func updateGoldenGateConnectionWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() @@ -884,12 +886,12 @@ func updateGoldenGateConnection(d *schema.ResourceData, m interface{}) error { if refreshOnly { err = sync.refreshConnection() } else { - err = tfresource.UpdateResource(d, sync) + err = tfresource.UpdateResourceWithContext(ctx, d, sync) } // always rewrite to false sync.D.Set("trigger_refresh", false) - return err + return tfresource.HandleDiagError(m, err) } func (s *GoldenGateConnectionResourceCrud) refreshConnection() error { @@ -918,7 +920,7 @@ func (s *GoldenGateConnectionResourceCrud) refreshConnection() error { return refreshWorkRequestErr } - if e := s.Get(); e != nil { + if e := s.GetWithContext(context.Background()); e != nil { return e } @@ -929,13 +931,13 @@ func (s *GoldenGateConnectionResourceCrud) refreshConnection() error { return nil } -func deleteGoldenGateConnection(d *schema.ResourceData, m interface{}) error { +func deleteGoldenGateConnectionWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() sync.DisableNotFoundRetries = true - return tfresource.DeleteResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.DeleteResourceWithContext(ctx, d, sync)) } type GoldenGateConnectionResourceCrud struct { @@ -974,7 +976,7 @@ func (s *GoldenGateConnectionResourceCrud) DeletedTarget() []string { } } -func (s *GoldenGateConnectionResourceCrud) Create() error { +func (s *GoldenGateConnectionResourceCrud) CreateWithContext(ctx context.Context) error { request := oci_golden_gate.CreateConnectionRequest{} err := s.populateTopLevelPolymorphicCreateConnectionRequest(&request) if err != nil { @@ -1009,7 +1011,7 @@ func (s *GoldenGateConnectionResourceCrud) getConnectionFromWorkRequest(workId * } s.D.SetId(*connectionId) - return s.Get() + return s.GetWithContext(context.Background()) } func connectionWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { @@ -1027,7 +1029,7 @@ func connectionWorkRequestShouldRetryFunc(timeout time.Duration) func(response o return true } - // Only stop if the time Finished is set + // Only stop if the time Finished is set if workRequestResponse, ok := response.Response.(oci_golden_gate.GetWorkRequestResponse); ok { return workRequestResponse.TimeFinished == nil } @@ -1112,7 +1114,7 @@ func getErrorFromGoldenGateConnectionWorkRequest(client *oci_golden_gate.GoldenG return workRequestErr } -func (s *GoldenGateConnectionResourceCrud) Get() error { +func (s *GoldenGateConnectionResourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetConnectionRequest{} tmp := s.D.Id() @@ -1120,7 +1122,7 @@ func (s *GoldenGateConnectionResourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.GetConnection(context.Background(), request) + response, err := s.Client.GetConnection(ctx, request) if err != nil { return err } @@ -1129,7 +1131,7 @@ func (s *GoldenGateConnectionResourceCrud) Get() error { return nil } -func (s *GoldenGateConnectionResourceCrud) Update() error { +func (s *GoldenGateConnectionResourceCrud) UpdateWithContext(ctx context.Context) error { if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { oldRaw, newRaw := s.D.GetChange("compartment_id") if newRaw != "" && oldRaw != "" { @@ -1147,7 +1149,7 @@ func (s *GoldenGateConnectionResourceCrud) Update() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.UpdateConnection(context.Background(), request) + response, err := s.Client.UpdateConnection(ctx, request) if err != nil { return err } @@ -1156,7 +1158,7 @@ func (s *GoldenGateConnectionResourceCrud) Update() error { return s.getConnectionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } -func (s *GoldenGateConnectionResourceCrud) Delete() error { +func (s *GoldenGateConnectionResourceCrud) DeleteWithContext(ctx context.Context) error { request := oci_golden_gate.DeleteConnectionRequest{} tmp := s.D.Id() @@ -1169,7 +1171,7 @@ func (s *GoldenGateConnectionResourceCrud) Delete() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.DeleteConnection(context.Background(), request) + response, err := s.Client.DeleteConnection(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_connections_data_source.go b/internal/service/golden_gate/golden_gate_connections_data_source.go index d0f5336f2b4..aef5d1acb9a 100644 --- a/internal/service/golden_gate/golden_gate_connections_data_source.go +++ b/internal/service/golden_gate/golden_gate_connections_data_source.go @@ -6,6 +6,8 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +17,7 @@ import ( func GoldenGateConnectionsDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateConnections, + ReadContext: readGoldenGateConnectionsWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "assignable_deployment_id": { @@ -74,12 +76,12 @@ func GoldenGateConnectionsDataSource() *schema.Resource { } } -func readGoldenGateConnections(d *schema.ResourceData, m interface{}) error { +func readGoldenGateConnectionsWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateConnectionsDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResource(sync)) } type GoldenGateConnectionsDataSourceCrud struct { diff --git a/internal/service/golden_gate/golden_gate_database_registration_data_source.go b/internal/service/golden_gate/golden_gate_database_registration_data_source.go index a4a30693d72..244a55633da 100644 --- a/internal/service/golden_gate/golden_gate_database_registration_data_source.go +++ b/internal/service/golden_gate/golden_gate_database_registration_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" @@ -19,15 +20,15 @@ func GoldenGateDatabaseRegistrationDataSource() *schema.Resource { Type: schema.TypeString, Required: true, } - return tfresource.GetSingularDataSourceItemSchema(GoldenGateDatabaseRegistrationResource(), fieldMap, readSingularGoldenGateDatabaseRegistration) + return tfresource.GetSingularDataSourceItemSchemaWithContext(GoldenGateDatabaseRegistrationResource(), fieldMap, readSingularGoldenGateDatabaseRegistrationWithContext) } -func readSingularGoldenGateDatabaseRegistration(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateDatabaseRegistrationWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDatabaseRegistrationDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDatabaseRegistrationDataSourceCrud struct { @@ -40,7 +41,7 @@ func (s *GoldenGateDatabaseRegistrationDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDatabaseRegistrationDataSourceCrud) Get() error { +func (s *GoldenGateDatabaseRegistrationDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetDatabaseRegistrationRequest{} if databaseRegistrationId, ok := s.D.GetOkExists("database_registration_id"); ok { @@ -50,7 +51,7 @@ func (s *GoldenGateDatabaseRegistrationDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetDatabaseRegistration(context.Background(), request) + response, err := s.Client.GetDatabaseRegistration(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_database_registration_resource.go b/internal/service/golden_gate/golden_gate_database_registration_resource.go index ec4540bcb41..3dd1b9cba61 100644 --- a/internal/service/golden_gate/golden_gate_database_registration_resource.go +++ b/internal/service/golden_gate/golden_gate_database_registration_resource.go @@ -10,12 +10,12 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - oci_common "github.com/oracle/oci-go-sdk/v65/common" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" ) @@ -25,11 +25,11 @@ func GoldenGateDatabaseRegistrationResource() *schema.Resource { Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, - Timeouts: tfresource.DefaultTimeout, - Create: createGoldenGateDatabaseRegistration, - Read: readGoldenGateDatabaseRegistration, - Update: updateGoldenGateDatabaseRegistration, - Delete: deleteGoldenGateDatabaseRegistration, + Timeouts: tfresource.DefaultTimeout, + CreateContext: createGoldenGateDatabaseRegistrationWithContext, + ReadContext: readGoldenGateDatabaseRegistrationWithContext, + UpdateContext: updateGoldenGateDatabaseRegistrationWithContext, + DeleteContext: deleteGoldenGateDatabaseRegistrationWithContext, Schema: map[string]*schema.Schema{ // Required "alias_name": { @@ -163,37 +163,37 @@ func GoldenGateDatabaseRegistrationResource() *schema.Resource { } } -func createGoldenGateDatabaseRegistration(d *schema.ResourceData, m interface{}) error { +func createGoldenGateDatabaseRegistrationWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDatabaseRegistrationResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.CreateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.CreateResourceWithContext(ctx, d, sync)) } -func readGoldenGateDatabaseRegistration(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDatabaseRegistrationWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDatabaseRegistrationResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } -func updateGoldenGateDatabaseRegistration(d *schema.ResourceData, m interface{}) error { +func updateGoldenGateDatabaseRegistrationWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDatabaseRegistrationResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.UpdateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.UpdateResourceWithContext(ctx, d, sync)) } -func deleteGoldenGateDatabaseRegistration(d *schema.ResourceData, m interface{}) error { +func deleteGoldenGateDatabaseRegistrationWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDatabaseRegistrationResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() sync.DisableNotFoundRetries = true - return tfresource.DeleteResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.DeleteResourceWithContext(ctx, d, sync)) } type GoldenGateDatabaseRegistrationResourceCrud struct { @@ -234,7 +234,7 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) DeletedTarget() []string { } } -func (s *GoldenGateDatabaseRegistrationResourceCrud) Create() error { +func (s *GoldenGateDatabaseRegistrationResourceCrud) CreateWithContext(ctx context.Context) error { request := oci_golden_gate.CreateDatabaseRegistrationRequest{} if aliasName, ok := s.D.GetOkExists("alias_name"); ok { @@ -330,7 +330,7 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) Create() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.CreateDatabaseRegistration(context.Background(), request) + response, err := s.Client.CreateDatabaseRegistration(ctx, request) if err != nil { return err } @@ -341,14 +341,14 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) Create() error { if identifier != nil { s.D.SetId(*identifier) } - return s.getDatabaseRegistrationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) + return s.getDatabaseRegistrationFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } -func (s *GoldenGateDatabaseRegistrationResourceCrud) getDatabaseRegistrationFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, +func (s *GoldenGateDatabaseRegistrationResourceCrud) getDatabaseRegistrationFromWorkRequest(ctx context.Context, workId *string, retryPolicy *oci_common.RetryPolicy, actionTypeEnum oci_golden_gate.ActionTypeEnum, timeout time.Duration) error { // Wait until it finishes - databaseRegistrationId, err := databaseRegistrationWaitForWorkRequest(workId, "databaseregistration", + databaseRegistrationId, err := databaseRegistrationWaitForWorkRequest(ctx, workId, "databaseregistration", actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) if err != nil { @@ -358,7 +358,7 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) getDatabaseRegistrationFrom } s.D.SetId(*databaseRegistrationId) - return s.Get() + return s.GetWithContext(ctx) } func databaseRegistrationWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { @@ -384,7 +384,7 @@ func databaseRegistrationWorkRequestShouldRetryFunc(timeout time.Duration) func( } } -func databaseRegistrationWaitForWorkRequest(wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, +func databaseRegistrationWaitForWorkRequest(ctx context.Context, wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, timeout time.Duration, disableFoundRetries bool, client *oci_golden_gate.GoldenGateClient) (*string, error) { retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "golden_gate") retryPolicy.ShouldRetryOperation = databaseRegistrationWorkRequestShouldRetryFunc(timeout) @@ -460,7 +460,7 @@ func getErrorFromGoldenGateDatabaseRegistrationWorkRequest(client *oci_golden_ga return workRequestErr } -func (s *GoldenGateDatabaseRegistrationResourceCrud) Get() error { +func (s *GoldenGateDatabaseRegistrationResourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetDatabaseRegistrationRequest{} tmp := s.D.Id() @@ -468,7 +468,7 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.GetDatabaseRegistration(context.Background(), request) + response, err := s.Client.GetDatabaseRegistration(ctx, request) if err != nil { return err } @@ -477,11 +477,11 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) Get() error { return nil } -func (s *GoldenGateDatabaseRegistrationResourceCrud) Update() error { +func (s *GoldenGateDatabaseRegistrationResourceCrud) UpdateWithContext(ctx context.Context) error { if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { oldRaw, newRaw := s.D.GetChange("compartment_id") if newRaw != "" && oldRaw != "" { - err := s.updateCompartment(compartment) + err := s.updateCompartment(ctx, compartment) if err != nil { return err } @@ -550,16 +550,16 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) Update() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.UpdateDatabaseRegistration(context.Background(), request) + response, err := s.Client.UpdateDatabaseRegistration(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId - return s.getDatabaseRegistrationFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + return s.getDatabaseRegistrationFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } -func (s *GoldenGateDatabaseRegistrationResourceCrud) Delete() error { +func (s *GoldenGateDatabaseRegistrationResourceCrud) DeleteWithContext(ctx context.Context) error { request := oci_golden_gate.DeleteDatabaseRegistrationRequest{} tmp := s.D.Id() @@ -567,14 +567,14 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) Delete() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.DeleteDatabaseRegistration(context.Background(), request) + response, err := s.Client.DeleteDatabaseRegistration(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, delWorkRequestErr := databaseRegistrationWaitForWorkRequest(workId, "databaseregistration", + _, delWorkRequestErr := databaseRegistrationWaitForWorkRequest(ctx, workId, "databaseregistration", oci_golden_gate.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) return delWorkRequestErr } @@ -745,7 +745,7 @@ func DatabaseRegistrationSummaryToMap(obj oci_golden_gate.DatabaseRegistrationSu return result } -func (s *GoldenGateDatabaseRegistrationResourceCrud) updateCompartment(compartment interface{}) error { +func (s *GoldenGateDatabaseRegistrationResourceCrud) updateCompartment(ctx context.Context, compartment interface{}) error { changeCompartmentRequest := oci_golden_gate.ChangeDatabaseRegistrationCompartmentRequest{} compartmentTmp := compartment.(string) @@ -756,14 +756,14 @@ func (s *GoldenGateDatabaseRegistrationResourceCrud) updateCompartment(compartme changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.ChangeDatabaseRegistrationCompartment(context.Background(), changeCompartmentRequest) + response, err := s.Client.ChangeDatabaseRegistrationCompartment(ctx, changeCompartmentRequest) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, changeWorkRequestErr := databaseRegistrationWaitForWorkRequest(workId, "databaseregistration", + _, changeWorkRequestErr := databaseRegistrationWaitForWorkRequest(ctx, workId, "databaseregistration", oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries, s.Client) return changeWorkRequestErr } diff --git a/internal/service/golden_gate/golden_gate_database_registrations_data_source.go b/internal/service/golden_gate/golden_gate_database_registrations_data_source.go index ba756c07767..51dcf80701d 100644 --- a/internal/service/golden_gate/golden_gate_database_registrations_data_source.go +++ b/internal/service/golden_gate/golden_gate_database_registrations_data_source.go @@ -6,6 +6,8 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" @@ -15,7 +17,7 @@ import ( func GoldenGateDatabaseRegistrationsDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDatabaseRegistrations, + ReadContext: readGoldenGateDatabaseRegistrationsWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -48,12 +50,12 @@ func GoldenGateDatabaseRegistrationsDataSource() *schema.Resource { } } -func readGoldenGateDatabaseRegistrations(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDatabaseRegistrationsWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDatabaseRegistrationsDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDatabaseRegistrationsDataSourceCrud struct { @@ -66,7 +68,7 @@ func (s *GoldenGateDatabaseRegistrationsDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDatabaseRegistrationsDataSourceCrud) Get() error { +func (s *GoldenGateDatabaseRegistrationsDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDatabaseRegistrationsRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -85,7 +87,7 @@ func (s *GoldenGateDatabaseRegistrationsDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDatabaseRegistrations(context.Background(), request) + response, err := s.Client.ListDatabaseRegistrations(ctx, request) if err != nil { return err } @@ -94,7 +96,7 @@ func (s *GoldenGateDatabaseRegistrationsDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDatabaseRegistrations(context.Background(), request) + listResponse, err := s.Client.ListDatabaseRegistrations(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_backup_data_source.go b/internal/service/golden_gate/golden_gate_deployment_backup_data_source.go index a05e5091812..ef61601c47b 100644 --- a/internal/service/golden_gate/golden_gate_deployment_backup_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_backup_data_source.go @@ -6,6 +6,8 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" @@ -19,15 +21,15 @@ func GoldenGateDeploymentBackupDataSource() *schema.Resource { Type: schema.TypeString, Required: true, } - return tfresource.GetSingularDataSourceItemSchema(GoldenGateDeploymentBackupResource(), fieldMap, readSingularGoldenGateDeploymentBackup) + return tfresource.GetSingularDataSourceItemSchemaWithContext(GoldenGateDeploymentBackupResource(), fieldMap, readSingularGoldenGateDeploymentBackupWithContext) } -func readSingularGoldenGateDeploymentBackup(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateDeploymentBackupWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentBackupDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentBackupDataSourceCrud struct { @@ -40,7 +42,7 @@ func (s *GoldenGateDeploymentBackupDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentBackupDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentBackupDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetDeploymentBackupRequest{} if deploymentBackupId, ok := s.D.GetOkExists("deployment_backup_id"); ok { @@ -50,7 +52,7 @@ func (s *GoldenGateDeploymentBackupDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetDeploymentBackup(context.Background(), request) + response, err := s.Client.GetDeploymentBackup(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_backup_resource.go b/internal/service/golden_gate/golden_gate_deployment_backup_resource.go index 20df0e77b5d..2fc75fae0a0 100644 --- a/internal/service/golden_gate/golden_gate_deployment_backup_resource.go +++ b/internal/service/golden_gate/golden_gate_deployment_backup_resource.go @@ -10,12 +10,12 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - oci_common "github.com/oracle/oci-go-sdk/v65/common" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" ) @@ -25,11 +25,11 @@ func GoldenGateDeploymentBackupResource() *schema.Resource { Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, - Timeouts: tfresource.DefaultTimeout, - Create: createGoldenGateDeploymentBackup, - Read: readGoldenGateDeploymentBackup, - Update: updateGoldenGateDeploymentBackup, - Delete: deleteGoldenGateDeploymentBackup, + Timeouts: tfresource.DefaultTimeout, + CreateContext: createGoldenGateDeploymentBackupWithContext, + ReadContext: readGoldenGateDeploymentBackupWithContext, + UpdateContext: updateGoldenGateDeploymentBackupWithContext, + DeleteContext: deleteGoldenGateDeploymentBackupWithContext, Schema: map[string]*schema.Schema{ // Required "bucket": { @@ -179,37 +179,37 @@ func GoldenGateDeploymentBackupResource() *schema.Resource { } } -func createGoldenGateDeploymentBackup(d *schema.ResourceData, m interface{}) error { +func createGoldenGateDeploymentBackupWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentBackupResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.CreateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.CreateResourceWithContext(ctx, d, sync)) } -func readGoldenGateDeploymentBackup(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentBackupWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentBackupResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } -func updateGoldenGateDeploymentBackup(d *schema.ResourceData, m interface{}) error { +func updateGoldenGateDeploymentBackupWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentBackupResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.UpdateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.UpdateResourceWithContext(ctx, d, sync)) } -func deleteGoldenGateDeploymentBackup(d *schema.ResourceData, m interface{}) error { +func deleteGoldenGateDeploymentBackupWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentBackupResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() sync.DisableNotFoundRetries = true - return tfresource.DeleteResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.DeleteResourceWithContext(ctx, d, sync)) } type GoldenGateDeploymentBackupResourceCrud struct { @@ -250,7 +250,7 @@ func (s *GoldenGateDeploymentBackupResourceCrud) DeletedTarget() []string { } } -func (s *GoldenGateDeploymentBackupResourceCrud) Create() error { +func (s *GoldenGateDeploymentBackupResourceCrud) CreateWithContext(ctx context.Context) error { request := oci_golden_gate.CreateDeploymentBackupRequest{} if bucket, ok := s.D.GetOkExists("bucket"); ok { @@ -319,7 +319,7 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Create() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.CreateDeploymentBackup(context.Background(), request) + response, err := s.Client.CreateDeploymentBackup(ctx, request) if err != nil { return err } @@ -330,14 +330,14 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Create() error { if identifier != nil { s.D.SetId(*identifier) } - return s.getDeploymentBackupFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) + return s.getDeploymentBackupFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } -func (s *GoldenGateDeploymentBackupResourceCrud) getDeploymentBackupFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, +func (s *GoldenGateDeploymentBackupResourceCrud) getDeploymentBackupFromWorkRequest(ctx context.Context, workId *string, retryPolicy *oci_common.RetryPolicy, actionTypeEnum oci_golden_gate.ActionTypeEnum, timeout time.Duration) error { // Wait until it finishes - deploymentId, err := goldenGateDeploymentBackupWaitForWorkRequest(workId, "deploymentbackup", + deploymentId, err := goldenGateDeploymentBackupWaitForWorkRequest(ctx, workId, "deploymentbackup", actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) if err != nil { @@ -347,7 +347,7 @@ func (s *GoldenGateDeploymentBackupResourceCrud) getDeploymentBackupFromWorkRequ } s.D.SetId(*deploymentId) - return s.Get() + return s.GetWithContext(ctx) } func deploymentBackupWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { @@ -373,7 +373,7 @@ func deploymentBackupWorkRequestShouldRetryFunc(timeout time.Duration) func(resp } } -func goldenGateDeploymentBackupWaitForWorkRequest(wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, +func goldenGateDeploymentBackupWaitForWorkRequest(ctx context.Context, wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, timeout time.Duration, disableFoundRetries bool, client *oci_golden_gate.GoldenGateClient) (*string, error) { retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "golden_gate") retryPolicy.ShouldRetryOperation = deploymentBackupWorkRequestShouldRetryFunc(timeout) @@ -449,7 +449,7 @@ func getErrorFromGoldenGateDeploymentBackupWorkRequest(client *oci_golden_gate.G return workRequestErr } -func (s *GoldenGateDeploymentBackupResourceCrud) Get() error { +func (s *GoldenGateDeploymentBackupResourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetDeploymentBackupRequest{} tmp := s.D.Id() @@ -457,7 +457,7 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.GetDeploymentBackup(context.Background(), request) + response, err := s.Client.GetDeploymentBackup(ctx, request) if err != nil { return err } @@ -466,11 +466,11 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Get() error { return nil } -func (s *GoldenGateDeploymentBackupResourceCrud) Update() error { +func (s *GoldenGateDeploymentBackupResourceCrud) UpdateWithContext(ctx context.Context) error { if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { oldRaw, newRaw := s.D.GetChange("compartment_id") if newRaw != "" && oldRaw != "" { - err := s.updateCompartment(compartment) + err := s.updateCompartment(ctx, compartment) if err != nil { return err } @@ -500,7 +500,7 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Update() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.UpdateDeploymentBackup(context.Background(), request) + response, err := s.Client.UpdateDeploymentBackup(ctx, request) if err != nil { return err } @@ -509,7 +509,7 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Update() error { return nil } -func (s *GoldenGateDeploymentBackupResourceCrud) Delete() error { +func (s *GoldenGateDeploymentBackupResourceCrud) DeleteWithContext(ctx context.Context) error { request := oci_golden_gate.DeleteDeploymentBackupRequest{} tmp := s.D.Id() @@ -522,14 +522,14 @@ func (s *GoldenGateDeploymentBackupResourceCrud) Delete() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.DeleteDeploymentBackup(context.Background(), request) + response, err := s.Client.DeleteDeploymentBackup(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, delWorkRequestErr := goldenGateDeploymentBackupWaitForWorkRequest(workId, "deploymentbackup", + _, delWorkRequestErr := goldenGateDeploymentBackupWaitForWorkRequest(ctx, workId, "deploymentbackup", oci_golden_gate.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) return delWorkRequestErr } @@ -731,7 +731,7 @@ func DeploymentBackupSummaryToMap(obj oci_golden_gate.DeploymentBackupSummary) m return result } -func (s *GoldenGateDeploymentBackupResourceCrud) updateCompartment(compartment interface{}) error { +func (s *GoldenGateDeploymentBackupResourceCrud) updateCompartment(ctx context.Context, compartment interface{}) error { changeCompartmentRequest := oci_golden_gate.ChangeDeploymentBackupCompartmentRequest{} compartmentTmp := compartment.(string) @@ -747,12 +747,12 @@ func (s *GoldenGateDeploymentBackupResourceCrud) updateCompartment(compartment i changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - _, err := s.Client.ChangeDeploymentBackupCompartment(context.Background(), changeCompartmentRequest) + _, err := s.Client.ChangeDeploymentBackupCompartment(ctx, changeCompartmentRequest) if err != nil { return err } - if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + if waitErr := tfresource.WaitForUpdatedStateWithContext(s.D, s); waitErr != nil { return waitErr } diff --git a/internal/service/golden_gate/golden_gate_deployment_backups_data_source.go b/internal/service/golden_gate/golden_gate_deployment_backups_data_source.go index dcca98a1886..572c6ccc91c 100644 --- a/internal/service/golden_gate/golden_gate_deployment_backups_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_backups_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentBackupsDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeploymentBackups, + ReadContext: readGoldenGateDeploymentBackupsWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -52,12 +53,12 @@ func GoldenGateDeploymentBackupsDataSource() *schema.Resource { } } -func readGoldenGateDeploymentBackups(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentBackupsWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentBackupsDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentBackupsDataSourceCrud struct { @@ -70,7 +71,7 @@ func (s *GoldenGateDeploymentBackupsDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentBackupsDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentBackupsDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentBackupsRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -94,7 +95,7 @@ func (s *GoldenGateDeploymentBackupsDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeploymentBackups(context.Background(), request) + response, err := s.Client.ListDeploymentBackups(ctx, request) if err != nil { return err } @@ -103,7 +104,7 @@ func (s *GoldenGateDeploymentBackupsDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDeploymentBackups(context.Background(), request) + listResponse, err := s.Client.ListDeploymentBackups(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_certificate_data_source.go b/internal/service/golden_gate/golden_gate_deployment_certificate_data_source.go index 10d6125bc87..c801e32fa78 100644 --- a/internal/service/golden_gate/golden_gate_deployment_certificate_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_certificate_data_source.go @@ -7,6 +7,7 @@ import ( "context" "strconv" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -24,15 +25,15 @@ func GoldenGateDeploymentCertificateDataSource() *schema.Resource { Type: schema.TypeString, Required: true, } - return tfresource.GetSingularDataSourceItemSchema(GoldenGateDeploymentCertificateResource(), fieldMap, readSingularGoldenGateDeploymentCertificate) + return tfresource.GetSingularDataSourceItemSchemaWithContext(GoldenGateDeploymentCertificateResource(), fieldMap, readSingularGoldenGateDeploymentCertificateWithContext) } -func readSingularGoldenGateDeploymentCertificate(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateDeploymentCertificateWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentCertificateDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentCertificateDataSourceCrud struct { @@ -45,7 +46,7 @@ func (s *GoldenGateDeploymentCertificateDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentCertificateDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentCertificateDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetCertificateRequest{} if certificateKey, ok := s.D.GetOkExists("certificate_key"); ok { @@ -60,7 +61,7 @@ func (s *GoldenGateDeploymentCertificateDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetCertificate(context.Background(), request) + response, err := s.Client.GetCertificate(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_certificate_resource.go b/internal/service/golden_gate/golden_gate_deployment_certificate_resource.go index 270d8e7eca8..316325e7dfc 100644 --- a/internal/service/golden_gate/golden_gate_deployment_certificate_resource.go +++ b/internal/service/golden_gate/golden_gate_deployment_certificate_resource.go @@ -13,9 +13,9 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - oci_common "github.com/oracle/oci-go-sdk/v65/common" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -28,10 +28,10 @@ func GoldenGateDeploymentCertificateResource() *schema.Resource { Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, - Timeouts: tfresource.DefaultTimeout, - Create: createGoldenGateDeploymentCertificate, - Read: readGoldenGateDeploymentCertificate, - Delete: deleteGoldenGateDeploymentCertificate, + Timeouts: tfresource.DefaultTimeout, + CreateContext: createGoldenGateDeploymentCertificateWithContext, + ReadContext: readGoldenGateDeploymentCertificateWithContext, + DeleteContext: deleteGoldenGateDeploymentCertificateWithContext, Schema: map[string]*schema.Schema{ // Required "certificate_content": { @@ -131,29 +131,29 @@ func GoldenGateDeploymentCertificateResource() *schema.Resource { } } -func createGoldenGateDeploymentCertificate(d *schema.ResourceData, m interface{}) error { +func createGoldenGateDeploymentCertificateWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentCertificateResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.CreateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.CreateResourceWithContext(ctx, d, sync)) } -func readGoldenGateDeploymentCertificate(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentCertificateWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentCertificateResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } -func deleteGoldenGateDeploymentCertificate(d *schema.ResourceData, m interface{}) error { +func deleteGoldenGateDeploymentCertificateWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentCertificateResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() sync.DisableNotFoundRetries = true - return tfresource.DeleteResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.DeleteResourceWithContext(ctx, d, sync)) } type GoldenGateDeploymentCertificateResourceCrud struct { @@ -212,7 +212,7 @@ func (s *GoldenGateDeploymentCertificateResourceCrud) DeletedTarget() []string { } } -func (s *GoldenGateDeploymentCertificateResourceCrud) Create() error { +func (s *GoldenGateDeploymentCertificateResourceCrud) CreateWithContext(ctx context.Context) error { request := oci_golden_gate.CreateCertificateRequest{} if certificateContent, ok := s.D.GetOkExists("certificate_content"); ok { @@ -237,20 +237,20 @@ func (s *GoldenGateDeploymentCertificateResourceCrud) Create() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.CreateCertificate(context.Background(), request) + response, err := s.Client.CreateCertificate(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId - return s.getDeploymentCertificateFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) + return s.getDeploymentCertificateFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } -func (s *GoldenGateDeploymentCertificateResourceCrud) getDeploymentCertificateFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, +func (s *GoldenGateDeploymentCertificateResourceCrud) getDeploymentCertificateFromWorkRequest(ctx context.Context, workId *string, retryPolicy *oci_common.RetryPolicy, actionTypeEnum oci_golden_gate.ActionTypeEnum, timeout time.Duration) error { // Wait until it finishes - certificateKey, deploymentId, err := deploymentCertificateWaitForWorkRequest(workId, + certificateKey, deploymentId, err := deploymentCertificateWaitForWorkRequest(ctx, workId, actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) if err != nil { @@ -258,7 +258,7 @@ func (s *GoldenGateDeploymentCertificateResourceCrud) getDeploymentCertificateFr } s.D.SetId(GetDeploymentCertificateCompositeId(*certificateKey, *deploymentId)) - return s.Get() + return s.GetWithContext(ctx) } func deploymentCertificateWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { @@ -284,7 +284,7 @@ func deploymentCertificateWorkRequestShouldRetryFunc(timeout time.Duration) func } } -func deploymentCertificateWaitForWorkRequest(wId *string, action oci_golden_gate.ActionTypeEnum, +func deploymentCertificateWaitForWorkRequest(ctx context.Context, wId *string, action oci_golden_gate.ActionTypeEnum, timeout time.Duration, disableFoundRetries bool, client *oci_golden_gate.GoldenGateClient) (*string, *string, error) { retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "golden_gate") retryPolicy.ShouldRetryOperation = deploymentCertificateWorkRequestShouldRetryFunc(timeout) @@ -365,7 +365,7 @@ func getErrorFromGoldenGateDeploymentCertificateWorkRequest(client *oci_golden_g return workRequestErr } -func (s *GoldenGateDeploymentCertificateResourceCrud) Get() error { +func (s *GoldenGateDeploymentCertificateResourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetCertificateRequest{} certificateKey, deploymentId, err := parseDeploymentCertificateCompositeId(s.D.Id()) @@ -378,7 +378,7 @@ func (s *GoldenGateDeploymentCertificateResourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.GetCertificate(context.Background(), request) + response, err := s.Client.GetCertificate(ctx, request) if err != nil { return err } @@ -387,7 +387,7 @@ func (s *GoldenGateDeploymentCertificateResourceCrud) Get() error { return nil } -func (s *GoldenGateDeploymentCertificateResourceCrud) Delete() error { +func (s *GoldenGateDeploymentCertificateResourceCrud) DeleteWithContext(ctx context.Context) error { request := oci_golden_gate.DeleteCertificateRequest{} if key, ok := s.D.GetOkExists("key"); ok { @@ -407,14 +407,14 @@ func (s *GoldenGateDeploymentCertificateResourceCrud) Delete() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.DeleteCertificate(context.Background(), request) + response, err := s.Client.DeleteCertificate(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, _, delWorkRequestErr := deploymentCertificateWaitForWorkRequest(workId, + _, _, delWorkRequestErr := deploymentCertificateWaitForWorkRequest(ctx, workId, oci_golden_gate.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) return delWorkRequestErr } diff --git a/internal/service/golden_gate/golden_gate_deployment_certificates_data_source.go b/internal/service/golden_gate/golden_gate_deployment_certificates_data_source.go index 60d3afd485c..239993c29c1 100644 --- a/internal/service/golden_gate/golden_gate_deployment_certificates_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_certificates_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentCertificatesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeploymentCertificates, + ReadContext: readGoldenGateDeploymentCertificatesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "deployment_id": { @@ -44,12 +45,12 @@ func GoldenGateDeploymentCertificatesDataSource() *schema.Resource { } } -func readGoldenGateDeploymentCertificates(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentCertificatesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentCertificatesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentCertificatesDataSourceCrud struct { @@ -62,7 +63,7 @@ func (s *GoldenGateDeploymentCertificatesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentCertificatesDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentCertificatesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListCertificatesRequest{} if deploymentId, ok := s.D.GetOkExists("deployment_id"); ok { @@ -76,7 +77,7 @@ func (s *GoldenGateDeploymentCertificatesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListCertificates(context.Background(), request) + response, err := s.Client.ListCertificates(ctx, request) if err != nil { return err } @@ -85,7 +86,7 @@ func (s *GoldenGateDeploymentCertificatesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListCertificates(context.Background(), request) + listResponse, err := s.Client.ListCertificates(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_data_source.go b/internal/service/golden_gate/golden_gate_deployment_data_source.go index 3c8f04a1779..edb8e33947b 100644 --- a/internal/service/golden_gate/golden_gate_deployment_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_data_source.go @@ -7,11 +7,12 @@ import ( "context" "strconv" - "github.com/oracle/terraform-provider-oci/internal/client" - "github.com/oracle/terraform-provider-oci/internal/tfresource" - + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" ) func GoldenGateDeploymentDataSource() *schema.Resource { @@ -20,15 +21,15 @@ func GoldenGateDeploymentDataSource() *schema.Resource { Type: schema.TypeString, Required: true, } - return tfresource.GetSingularDataSourceItemSchema(GoldenGateDeploymentResource(), fieldMap, readSingularGoldenGateDeployment) + return tfresource.GetSingularDataSourceItemSchemaWithContext(GoldenGateDeploymentResource(), fieldMap, readSingularGoldenGateDeploymentWithContext) } -func readSingularGoldenGateDeployment(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateDeploymentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentDataSourceCrud struct { @@ -41,7 +42,7 @@ func (s *GoldenGateDeploymentDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetDeploymentRequest{} if deploymentId, ok := s.D.GetOkExists("deployment_id"); ok { @@ -51,7 +52,7 @@ func (s *GoldenGateDeploymentDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetDeployment(context.Background(), request) + response, err := s.Client.GetDeployment(ctx, request) if err != nil { return err } @@ -67,14 +68,15 @@ func (s *GoldenGateDeploymentDataSourceCrud) SetData() error { s.D.SetId(*s.Res.Id) + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + if s.Res.BackupSchedule != nil { s.D.Set("backup_schedule", []interface{}{BackupScheduleToMap(s.Res.BackupSchedule)}) } else { s.D.Set("backup_schedule", nil) } - if s.Res.AvailabilityDomain != nil { - s.D.Set("availability_domain", *s.Res.AvailabilityDomain) - } if s.Res.ByolCpuCoreCountLimit != nil { s.D.Set("byol_cpu_core_count_limit", *s.Res.ByolCpuCoreCountLimit) diff --git a/internal/service/golden_gate/golden_gate_deployment_environments_data_source.go b/internal/service/golden_gate/golden_gate_deployment_environments_data_source.go index 83fe642bb7f..89da7382733 100644 --- a/internal/service/golden_gate/golden_gate_deployment_environments_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_environments_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentEnvironmentsDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeploymentEnvironments, + ReadContext: readGoldenGateDeploymentEnvironmentsWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -92,12 +93,12 @@ func GoldenGateDeploymentEnvironmentsDataSource() *schema.Resource { } } -func readGoldenGateDeploymentEnvironments(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentEnvironmentsWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentEnvironmentsDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentEnvironmentsDataSourceCrud struct { @@ -110,7 +111,7 @@ func (s *GoldenGateDeploymentEnvironmentsDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentEnvironmentsDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentEnvironmentsDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentEnvironmentsRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -120,7 +121,7 @@ func (s *GoldenGateDeploymentEnvironmentsDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeploymentEnvironments(context.Background(), request) + response, err := s.Client.ListDeploymentEnvironments(ctx, request) if err != nil { return err } @@ -129,7 +130,7 @@ func (s *GoldenGateDeploymentEnvironmentsDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDeploymentEnvironments(context.Background(), request) + listResponse, err := s.Client.ListDeploymentEnvironments(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_peers_data_source.go b/internal/service/golden_gate/golden_gate_deployment_peers_data_source.go index 23e817b30e4..24181ae8e80 100644 --- a/internal/service/golden_gate/golden_gate_deployment_peers_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_peers_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentPeersDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeploymentPeers, + ReadContext: readGoldenGateDeploymentPeersWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "deployment_id": { @@ -108,12 +109,12 @@ func GoldenGateDeploymentPeersDataSource() *schema.Resource { } } -func readGoldenGateDeploymentPeers(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentPeersWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentPeersDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentPeersDataSourceCrud struct { @@ -126,7 +127,7 @@ func (s *GoldenGateDeploymentPeersDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentPeersDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentPeersDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentPeersRequest{} if deploymentId, ok := s.D.GetOkExists("deployment_id"); ok { @@ -145,7 +146,7 @@ func (s *GoldenGateDeploymentPeersDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeploymentPeers(context.Background(), request) + response, err := s.Client.ListDeploymentPeers(ctx, request) if err != nil { return err } @@ -154,7 +155,7 @@ func (s *GoldenGateDeploymentPeersDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDeploymentPeers(context.Background(), request) + listResponse, err := s.Client.ListDeploymentPeers(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_resource.go b/internal/service/golden_gate/golden_gate_deployment_resource.go index 777cf74723d..3785032427a 100644 --- a/internal/service/golden_gate/golden_gate_deployment_resource.go +++ b/internal/service/golden_gate/golden_gate_deployment_resource.go @@ -10,6 +10,9 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/oracle/terraform-provider-oci/internal/client" @@ -17,9 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - oci_common "github.com/oracle/oci-go-sdk/v65/common" - oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" ) func GoldenGateDeploymentResource() *schema.Resource { @@ -32,10 +33,10 @@ func GoldenGateDeploymentResource() *schema.Resource { Update: tfresource.GetTimeoutDuration("60m"), Delete: tfresource.GetTimeoutDuration("30m"), }, - Create: createGoldenGateDeployment, - Read: readGoldenGateDeployment, - Update: updateGoldenGateDeployment, - Delete: deleteGoldenGateDeployment, + CreateContext: createGoldenGateDeploymentWithContext, + ReadContext: readGoldenGateDeploymentWithContext, + UpdateContext: updateGoldenGateDeploymentWithContext, + DeleteContext: deleteGoldenGateDeploymentWithContext, Schema: map[string]*schema.Schema{ // Required "compartment_id": { @@ -585,7 +586,7 @@ func GoldenGateDeploymentResource() *schema.Resource { } } -func createGoldenGateDeployment(d *schema.ResourceData, m interface{}) error { +func createGoldenGateDeploymentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() @@ -597,26 +598,26 @@ func createGoldenGateDeployment(d *schema.ResourceData, m interface{}) error { } } - if e := tfresource.CreateResource(d, sync); e != nil { + if e := tfresource.HandleDiagError(m, tfresource.CreateResourceWithContext(ctx, d, sync)); e != nil { return e } if stopDeployment { - return sync.stopDeployment() + return tfresource.HandleDiagError(m, sync.stopDeployment(ctx)) } return nil } -func readGoldenGateDeployment(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } -func updateGoldenGateDeployment(d *schema.ResourceData, m interface{}) error { +func updateGoldenGateDeploymentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() @@ -662,41 +663,41 @@ func updateGoldenGateDeployment(d *schema.ResourceData, m interface{}) error { */ if startDeployment { - if err := upgradeGoldenGateDeploymentIfNeeded(d, m); err != nil { - return err + if err := upgradeGoldenGateDeploymentIfNeeded(ctx, d, m); err != nil { + return tfresource.HandleDiagError(m, err) } - if err := sync.startDeployment(); err != nil { - return err + if err := sync.startDeployment(ctx); err != nil { + return tfresource.HandleDiagError(m, err) } - if err := switchoverDeploymentPeerIfNeeded(d, m); err != nil { - return err + if err := switchoverDeploymentPeerIfNeeded(ctx, d, m); err != nil { + return tfresource.HandleDiagError(m, err) } - return tfresource.UpdateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.UpdateResourceWithContext(ctx, d, sync)) } else if stopDeployment { - if err := switchoverDeploymentPeerIfNeeded(d, m); err != nil { - return err + if err := switchoverDeploymentPeerIfNeeded(ctx, d, m); err != nil { + return tfresource.HandleDiagError(m, err) } - if err := tfresource.UpdateResource(d, sync); err != nil { - return err + if err := tfresource.UpdateResourceWithContext(ctx, d, sync); err != nil { + return tfresource.HandleDiagError(m, err) } - if err := sync.stopDeployment(); err != nil { - return err + if err := sync.stopDeployment(ctx); err != nil { + return tfresource.HandleDiagError(m, err) } - return upgradeGoldenGateDeploymentIfNeeded(d, m) + return tfresource.HandleDiagError(m, upgradeGoldenGateDeploymentIfNeeded(ctx, d, m)) } else { - if err := switchoverDeploymentPeerIfNeeded(d, m); err != nil { - return err + if err := switchoverDeploymentPeerIfNeeded(ctx, d, m); err != nil { + return tfresource.HandleDiagError(m, err) } - if err := upgradeGoldenGateDeploymentIfNeeded(d, m); err != nil { - return err + if err := upgradeGoldenGateDeploymentIfNeeded(ctx, d, m); err != nil { + return tfresource.HandleDiagError(m, err) } - return tfresource.UpdateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.UpdateResourceWithContext(ctx, d, sync)) } } -func upgradeGoldenGateDeploymentIfNeeded(d *schema.ResourceData, m interface{}) error { +func upgradeGoldenGateDeploymentIfNeeded(ctx context.Context, d *schema.ResourceData, m interface{}) error { sync := &GoldenGateDeploymentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() @@ -706,7 +707,7 @@ func upgradeGoldenGateDeploymentIfNeeded(d *schema.ResourceData, m interface{}) if _, ok := sync.D.GetOkExists(oggVersionKeyFormat); ok && sync.D.HasChange(oggVersionKeyFormat) { oldVersion, newVersion := sync.D.GetChange(oggVersionKeyFormat) if newVersion != "" && oldVersion != newVersion { - if err := sync.upgradeToSpecificVersion(newVersion); err != nil { + if err := sync.upgradeToSpecificVersion(ctx, newVersion); err != nil { return err } } @@ -714,13 +715,13 @@ func upgradeGoldenGateDeploymentIfNeeded(d *schema.ResourceData, m interface{}) return nil } -func deleteGoldenGateDeployment(d *schema.ResourceData, m interface{}) error { +func deleteGoldenGateDeploymentWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() sync.DisableNotFoundRetries = true - return tfresource.DeleteResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.DeleteResourceWithContext(ctx, d, sync)) } type GoldenGateDeploymentResourceCrud struct { @@ -761,7 +762,7 @@ func (s *GoldenGateDeploymentResourceCrud) DeletedTarget() []string { } } -func (s *GoldenGateDeploymentResourceCrud) Create() error { +func (s *GoldenGateDeploymentResourceCrud) CreateWithContext(ctx context.Context) error { request := oci_golden_gate.CreateDeploymentRequest{} if backupSchedule, ok := s.D.GetOkExists("backup_schedule"); ok { @@ -956,7 +957,7 @@ func (s *GoldenGateDeploymentResourceCrud) Create() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.CreateDeployment(context.Background(), request) + response, err := s.Client.CreateDeployment(ctx, request) if err != nil { return err } @@ -967,14 +968,14 @@ func (s *GoldenGateDeploymentResourceCrud) Create() error { if identifier != nil { s.D.SetId(*identifier) } - return s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) + return s.getDeploymentFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } -func (s *GoldenGateDeploymentResourceCrud) getDeploymentFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, +func (s *GoldenGateDeploymentResourceCrud) getDeploymentFromWorkRequest(ctx context.Context, workId *string, retryPolicy *oci_common.RetryPolicy, actionTypeEnum oci_golden_gate.ActionTypeEnum, timeout time.Duration) error { // Wait until it finishes - deploymentId, err := deploymentWaitForWorkRequest(workId, "deployment", + deploymentId, err := deploymentWaitForWorkRequest(ctx, workId, "deployment", actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) if err != nil { @@ -982,7 +983,7 @@ func (s *GoldenGateDeploymentResourceCrud) getDeploymentFromWorkRequest(workId * } s.D.SetId(*deploymentId) - return s.Get() + return s.GetWithContext(ctx) } func deploymentWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { @@ -1008,7 +1009,7 @@ func deploymentWorkRequestShouldRetryFunc(timeout time.Duration) func(response o } } -func deploymentWaitForWorkRequest(wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, +func deploymentWaitForWorkRequest(ctx context.Context, wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, timeout time.Duration, disableFoundRetries bool, client *oci_golden_gate.GoldenGateClient) (*string, error) { retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "golden_gate") retryPolicy.ShouldRetryOperation = deploymentWorkRequestShouldRetryFunc(timeout) @@ -1027,7 +1028,7 @@ func deploymentWaitForWorkRequest(wId *string, entityType string, action oci_gol }, Refresh: func() (interface{}, string, error) { var err error - response, err = client.GetWorkRequest(context.Background(), + response, err = client.GetWorkRequest(ctx, oci_golden_gate.GetWorkRequestRequest{ WorkRequestId: wId, RequestMetadata: oci_common.RequestMetadata{ @@ -1056,14 +1057,14 @@ func deploymentWaitForWorkRequest(wId *string, entityType string, action oci_gol // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled if identifier == nil || response.Status == oci_golden_gate.OperationStatusFailed || response.Status == oci_golden_gate.OperationStatusCanceled { - return nil, getErrorFromGoldenGateDeploymentWorkRequest(client, wId, retryPolicy, entityType, action) + return nil, getErrorFromGoldenGateDeploymentWorkRequest(ctx, client, wId, retryPolicy, entityType, action) } return identifier, nil } -func getErrorFromGoldenGateDeploymentWorkRequest(client *oci_golden_gate.GoldenGateClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_golden_gate.ActionTypeEnum) error { - response, err := client.ListWorkRequestErrors(context.Background(), +func getErrorFromGoldenGateDeploymentWorkRequest(ctx context.Context, client *oci_golden_gate.GoldenGateClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_golden_gate.ActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(ctx, oci_golden_gate.ListWorkRequestErrorsRequest{ WorkRequestId: workId, RequestMetadata: oci_common.RequestMetadata{ @@ -1085,7 +1086,7 @@ func getErrorFromGoldenGateDeploymentWorkRequest(client *oci_golden_gate.GoldenG return workRequestErr } -func (s *GoldenGateDeploymentResourceCrud) Get() error { +func (s *GoldenGateDeploymentResourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetDeploymentRequest{} tmp := s.D.Id() @@ -1093,7 +1094,7 @@ func (s *GoldenGateDeploymentResourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.GetDeployment(context.Background(), request) + response, err := s.Client.GetDeployment(ctx, request) if err != nil { return err } @@ -1102,11 +1103,11 @@ func (s *GoldenGateDeploymentResourceCrud) Get() error { return nil } -func (s *GoldenGateDeploymentResourceCrud) Update() error { +func (s *GoldenGateDeploymentResourceCrud) UpdateWithContext(ctx context.Context) error { if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { oldRaw, newRaw := s.D.GetChange("compartment_id") if newRaw != "" && oldRaw != "" { - err := s.updateCompartment(compartment) + err := s.updateCompartment(ctx, compartment) if err != nil { return err } @@ -1269,16 +1270,16 @@ func (s *GoldenGateDeploymentResourceCrud) Update() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.UpdateDeployment(context.Background(), request) + response, err := s.Client.UpdateDeployment(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId - return s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + return s.getDeploymentFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } -func (s *GoldenGateDeploymentResourceCrud) Delete() error { +func (s *GoldenGateDeploymentResourceCrud) DeleteWithContext(ctx context.Context) error { request := oci_golden_gate.DeleteDeploymentRequest{} tmp := s.D.Id() @@ -1291,14 +1292,14 @@ func (s *GoldenGateDeploymentResourceCrud) Delete() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.DeleteDeployment(context.Background(), request) + response, err := s.Client.DeleteDeployment(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, delWorkRequestErr := deploymentWaitForWorkRequest(workId, "deployment", + _, delWorkRequestErr := deploymentWaitForWorkRequest(ctx, workId, "deployment", oci_golden_gate.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) return delWorkRequestErr } @@ -2210,7 +2211,7 @@ func GroupToRolesMappingDetailsToMap(obj *oci_golden_gate.GroupToRolesMappingDet return result } -func (s *GoldenGateDeploymentResourceCrud) updateCompartment(compartment interface{}) error { +func (s *GoldenGateDeploymentResourceCrud) updateCompartment(ctx context.Context, compartment interface{}) error { changeCompartmentRequest := oci_golden_gate.ChangeDeploymentCompartmentRequest{} compartmentTmp := compartment.(string) @@ -2226,18 +2227,18 @@ func (s *GoldenGateDeploymentResourceCrud) updateCompartment(compartment interfa changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.ChangeDeploymentCompartment(context.Background(), changeCompartmentRequest) + response, err := s.Client.ChangeDeploymentCompartment(ctx, changeCompartmentRequest) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - return s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), + return s.getDeploymentFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } -func (s *GoldenGateDeploymentResourceCrud) upgradeToSpecificVersion(oggVersion interface{}) error { +func (s *GoldenGateDeploymentResourceCrud) upgradeToSpecificVersion(ctx context.Context, oggVersion interface{}) error { upgradeDeploymentRequest := oci_golden_gate.UpgradeDeploymentRequest{} upgradeDetails := oci_golden_gate.UpgradeDeploymentSpecificReleaseDetails{} @@ -2255,21 +2256,21 @@ func (s *GoldenGateDeploymentResourceCrud) upgradeToSpecificVersion(oggVersion i upgradeDeploymentRequest.IsLockOverride = &tmp } - response, err := s.Client.UpgradeDeployment(context.Background(), upgradeDeploymentRequest) + response, err := s.Client.UpgradeDeployment(ctx, upgradeDeploymentRequest) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, upgradeWorkRequestErr := deploymentWaitForWorkRequest(workId, "deployment", + _, upgradeWorkRequestErr := deploymentWaitForWorkRequest(ctx, workId, "deployment", oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries, s.Client) if upgradeWorkRequestErr != nil { return upgradeWorkRequestErr } // set changed parameters - if err := s.getAndSaveStateChanges(); err != nil { + if err := s.getAndSaveStateChanges(ctx); err != nil { return err } @@ -2288,7 +2289,7 @@ func (s *GoldenGateDeploymentResourceCrud) upgradeToSpecificVersion(oggVersion i return nil } -func (s *GoldenGateDeploymentResourceCrud) startDeployment() error { +func (s *GoldenGateDeploymentResourceCrud) startDeployment(ctx context.Context) error { startDeploymentRequest := oci_golden_gate.StartDeploymentRequest{} idTmp := s.D.Id() @@ -2301,23 +2302,23 @@ func (s *GoldenGateDeploymentResourceCrud) startDeployment() error { startDeploymentRequest.IsLockOverride = &tmp } - response, err := s.Client.StartDeployment(context.Background(), startDeploymentRequest) + response, err := s.Client.StartDeployment(ctx, startDeploymentRequest) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - startWorkRequestErr := s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), + startWorkRequestErr := s.getDeploymentFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) if startWorkRequestErr != nil { return startWorkRequestErr } // set changed parameters - return s.getAndSaveStateChanges() + return s.getAndSaveStateChanges(ctx) } -func (s *GoldenGateDeploymentResourceCrud) stopDeployment() error { +func (s *GoldenGateDeploymentResourceCrud) stopDeployment(ctx context.Context) error { stopDeploymentRequest := oci_golden_gate.StopDeploymentRequest{} idTmp := s.D.Id() @@ -2330,24 +2331,24 @@ func (s *GoldenGateDeploymentResourceCrud) stopDeployment() error { stopDeploymentRequest.IsLockOverride = &tmp } - response, err := s.Client.StopDeployment(context.Background(), stopDeploymentRequest) + response, err := s.Client.StopDeployment(ctx, stopDeploymentRequest) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - stopWorkRequestErr := s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), + stopWorkRequestErr := s.getDeploymentFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) if stopWorkRequestErr != nil { return stopWorkRequestErr } // set changed parameters - return s.getAndSaveStateChanges() + return s.getAndSaveStateChanges(ctx) } -func switchoverDeploymentPeerIfNeeded(d *schema.ResourceData, m interface{}) error { +func switchoverDeploymentPeerIfNeeded(ctx context.Context, d *schema.ResourceData, m interface{}) error { sync := &GoldenGateDeploymentResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() @@ -2361,7 +2362,7 @@ func switchoverDeploymentPeerIfNeeded(d *schema.ResourceData, m interface{}) err if newAD != "" && newFD != "" && oldAD != newAD && oldFD != newFD { availabilityDomain = newAD.(string) faultDomain = newFD.(string) - if err := sync.switchoverDeploymentPeer(availabilityDomain, faultDomain); err != nil { + if err := sync.switchoverDeploymentPeer(ctx, availabilityDomain, faultDomain); err != nil { return err } } @@ -2369,7 +2370,7 @@ func switchoverDeploymentPeerIfNeeded(d *schema.ResourceData, m interface{}) err return nil } -func (s *GoldenGateDeploymentResourceCrud) switchoverDeploymentPeer(availabilityDomain string, faultDomain string) error { +func (s *GoldenGateDeploymentResourceCrud) switchoverDeploymentPeer(ctx context.Context, availabilityDomain string, faultDomain string) error { switchoverDeploymentPeerRequest := oci_golden_gate.SwitchoverDeploymentPeerRequest{} switchoverPeerDetails := oci_golden_gate.SwitchoverDeploymentPeerDetails{} @@ -2382,24 +2383,24 @@ func (s *GoldenGateDeploymentResourceCrud) switchoverDeploymentPeer(availability switchoverDeploymentPeerRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.SwitchoverDeploymentPeer(context.Background(), switchoverDeploymentPeerRequest) + response, err := s.Client.SwitchoverDeploymentPeer(ctx, switchoverDeploymentPeerRequest) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - switchoverWorkRequestErr := s.getDeploymentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), + switchoverWorkRequestErr := s.getDeploymentFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) if switchoverWorkRequestErr != nil { return switchoverWorkRequestErr } // set changed parameters - return s.getAndSaveStateChanges() + return s.getAndSaveStateChanges(ctx) } -func (s *GoldenGateDeploymentResourceCrud) getAndSaveStateChanges() error { - if e := s.Get(); e != nil { +func (s *GoldenGateDeploymentResourceCrud) getAndSaveStateChanges(ctx context.Context) error { + if e := s.GetWithContext(ctx); e != nil { return e } s.D.Set("state", s.Res.LifecycleState) diff --git a/internal/service/golden_gate/golden_gate_deployment_type_data_source.go b/internal/service/golden_gate/golden_gate_deployment_type_data_source.go index 92f7d3c6915..8b9e479dcdc 100644 --- a/internal/service/golden_gate/golden_gate_deployment_type_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_type_data_source.go @@ -6,6 +6,8 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +17,7 @@ import ( func GoldenGateDeploymentTypeDataSource() *schema.Resource { return &schema.Resource{ - Read: readSingularGoldenGateDeploymentType, + ReadContext: readSingularGoldenGateDeploymentTypeWithContext, Schema: map[string]*schema.Schema{ "compartment_id": { Type: schema.TypeString, @@ -76,12 +78,13 @@ func GoldenGateDeploymentTypeDataSource() *schema.Resource { } } -func readSingularGoldenGateDeploymentType(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateDeploymentTypeWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { + sync := &GoldenGateDeploymentTypeDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentTypeDataSourceCrud struct { @@ -94,7 +97,7 @@ func (s *GoldenGateDeploymentTypeDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentTypeDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentTypeDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentTypesRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -109,7 +112,7 @@ func (s *GoldenGateDeploymentTypeDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeploymentTypes(context.Background(), request) + response, err := s.Client.ListDeploymentTypes(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_types_data_source.go b/internal/service/golden_gate/golden_gate_deployment_types_data_source.go index 14eb61e9f9f..631bb2e5cb5 100644 --- a/internal/service/golden_gate/golden_gate_deployment_types_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_types_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentTypesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeploymentTypes, + ReadContext: readGoldenGateDeploymentTypesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -111,12 +112,12 @@ func GoldenGateDeploymentTypesDataSource() *schema.Resource { } } -func readGoldenGateDeploymentTypes(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentTypesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentTypesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentTypesDataSourceCrud struct { @@ -129,7 +130,7 @@ func (s *GoldenGateDeploymentTypesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentTypesDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentTypesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentTypesRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -153,7 +154,7 @@ func (s *GoldenGateDeploymentTypesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeploymentTypes(context.Background(), request) + response, err := s.Client.ListDeploymentTypes(ctx, request) if err != nil { return err } @@ -162,7 +163,7 @@ func (s *GoldenGateDeploymentTypesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDeploymentTypes(context.Background(), request) + listResponse, err := s.Client.ListDeploymentTypes(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_upgrade_data_source.go b/internal/service/golden_gate/golden_gate_deployment_upgrade_data_source.go index e9af494eef7..6e9dcd23a48 100644 --- a/internal/service/golden_gate/golden_gate_deployment_upgrade_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_upgrade_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentUpgradeDataSource() *schema.Resource { return &schema.Resource{ - Read: readSingularGoldenGateDeploymentUpgrade, + ReadContext: readSingularGoldenGateDeploymentUpgradeWithContext, Schema: map[string]*schema.Schema{ "deployment_upgrade_id": { Type: schema.TypeString, @@ -141,12 +142,12 @@ func GoldenGateDeploymentUpgradeDataSource() *schema.Resource { } } -func readSingularGoldenGateDeploymentUpgrade(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateDeploymentUpgradeWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentUpgradeDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentUpgradeDataSourceCrud struct { @@ -159,7 +160,7 @@ func (s *GoldenGateDeploymentUpgradeDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentUpgradeDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentUpgradeDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetDeploymentUpgradeRequest{} if deploymentUpgradeId, ok := s.D.GetOkExists("deployment_upgrade_id"); ok { @@ -169,7 +170,7 @@ func (s *GoldenGateDeploymentUpgradeDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetDeploymentUpgrade(context.Background(), request) + response, err := s.Client.GetDeploymentUpgrade(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_upgrades_data_source.go b/internal/service/golden_gate/golden_gate_deployment_upgrades_data_source.go index 4a857d4c882..2c7800ce628 100644 --- a/internal/service/golden_gate/golden_gate_deployment_upgrades_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_upgrades_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/tfresource" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentUpgradesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeploymentUpgrades, + ReadContext: readGoldenGateDeploymentUpgradesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -178,12 +179,12 @@ func GoldenGateDeploymentUpgradesDataSource() *schema.Resource { } } -func readGoldenGateDeploymentUpgrades(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentUpgradesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentUpgradesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentUpgradesDataSourceCrud struct { @@ -196,7 +197,7 @@ func (s *GoldenGateDeploymentUpgradesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentUpgradesDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentUpgradesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentUpgradesRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -220,7 +221,7 @@ func (s *GoldenGateDeploymentUpgradesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeploymentUpgrades(context.Background(), request) + response, err := s.Client.ListDeploymentUpgrades(ctx, request) if err != nil { return err } @@ -229,7 +230,7 @@ func (s *GoldenGateDeploymentUpgradesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDeploymentUpgrades(context.Background(), request) + listResponse, err := s.Client.ListDeploymentUpgrades(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployment_versions_data_source.go b/internal/service/golden_gate/golden_gate_deployment_versions_data_source.go index 95276b9929b..ce5118a7dcd 100644 --- a/internal/service/golden_gate/golden_gate_deployment_versions_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployment_versions_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateDeploymentVersionsDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeploymentVersions, + ReadContext: readGoldenGateDeploymentVersionsWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -84,12 +85,12 @@ func GoldenGateDeploymentVersionsDataSource() *schema.Resource { } } -func readGoldenGateDeploymentVersions(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentVersionsWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentVersionsDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentVersionsDataSourceCrud struct { @@ -102,7 +103,7 @@ func (s *GoldenGateDeploymentVersionsDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentVersionsDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentVersionsDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentVersionsRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -121,7 +122,7 @@ func (s *GoldenGateDeploymentVersionsDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeploymentVersions(context.Background(), request) + response, err := s.Client.ListDeploymentVersions(ctx, request) if err != nil { return err } @@ -130,7 +131,7 @@ func (s *GoldenGateDeploymentVersionsDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDeploymentVersions(context.Background(), request) + listResponse, err := s.Client.ListDeploymentVersions(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_deployments_data_source.go b/internal/service/golden_gate/golden_gate_deployments_data_source.go index 0f00e551e6c..6f5b726d76f 100644 --- a/internal/service/golden_gate/golden_gate_deployments_data_source.go +++ b/internal/service/golden_gate/golden_gate_deployments_data_source.go @@ -6,16 +6,17 @@ package golden_gate import ( "context" - "github.com/oracle/terraform-provider-oci/internal/client" - "github.com/oracle/terraform-provider-oci/internal/tfresource" - + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" ) func GoldenGateDeploymentsDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateDeployments, + ReadContext: readGoldenGateDeploymentsWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "assignable_connection_id": { @@ -72,12 +73,12 @@ func GoldenGateDeploymentsDataSource() *schema.Resource { } } -func readGoldenGateDeployments(d *schema.ResourceData, m interface{}) error { +func readGoldenGateDeploymentsWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateDeploymentsDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateDeploymentsDataSourceCrud struct { @@ -90,7 +91,7 @@ func (s *GoldenGateDeploymentsDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateDeploymentsDataSourceCrud) Get() error { +func (s *GoldenGateDeploymentsDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListDeploymentsRequest{} if assignableConnectionId, ok := s.D.GetOkExists("assignable_connection_id"); ok { @@ -136,7 +137,7 @@ func (s *GoldenGateDeploymentsDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListDeployments(context.Background(), request) + response, err := s.Client.ListDeployments(ctx, request) if err != nil { return err } @@ -145,7 +146,7 @@ func (s *GoldenGateDeploymentsDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListDeployments(context.Background(), request) + listResponse, err := s.Client.ListDeployments(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_message_data_source.go b/internal/service/golden_gate/golden_gate_message_data_source.go index 346eeae41a1..565b173818f 100644 --- a/internal/service/golden_gate/golden_gate_message_data_source.go +++ b/internal/service/golden_gate/golden_gate_message_data_source.go @@ -6,6 +6,8 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +17,7 @@ import ( func GoldenGateMessageDataSource() *schema.Resource { return &schema.Resource{ - Read: readSingularGoldenGateMessage, + ReadContext: readSingularGoldenGateMessageWithContext, Schema: map[string]*schema.Schema{ "deployment_id": { Type: schema.TypeString, @@ -52,12 +54,12 @@ func GoldenGateMessageDataSource() *schema.Resource { } } -func readSingularGoldenGateMessage(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGateMessageWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateMessageDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateMessageDataSourceCrud struct { @@ -70,7 +72,7 @@ func (s *GoldenGateMessageDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateMessageDataSourceCrud) Get() error { +func (s *GoldenGateMessageDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListMessagesRequest{} if deploymentId, ok := s.D.GetOkExists("deployment_id"); ok { @@ -80,7 +82,7 @@ func (s *GoldenGateMessageDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListMessages(context.Background(), request) + response, err := s.Client.ListMessages(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_messages_data_source.go b/internal/service/golden_gate/golden_gate_messages_data_source.go index 7198f8144e6..38b955b9001 100644 --- a/internal/service/golden_gate/golden_gate_messages_data_source.go +++ b/internal/service/golden_gate/golden_gate_messages_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateMessagesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateMessages, + ReadContext: readGoldenGateMessagesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "deployment_id": { @@ -59,12 +60,12 @@ func GoldenGateMessagesDataSource() *schema.Resource { } } -func readGoldenGateMessages(d *schema.ResourceData, m interface{}) error { +func readGoldenGateMessagesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateMessagesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateMessagesDataSourceCrud struct { @@ -77,7 +78,7 @@ func (s *GoldenGateMessagesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateMessagesDataSourceCrud) Get() error { +func (s *GoldenGateMessagesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListMessagesRequest{} if deploymentId, ok := s.D.GetOkExists("deployment_id"); ok { @@ -87,7 +88,7 @@ func (s *GoldenGateMessagesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListMessages(context.Background(), request) + response, err := s.Client.ListMessages(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_pipeline_data_source.go b/internal/service/golden_gate/golden_gate_pipeline_data_source.go index 42a5de42f81..b906a870def 100644 --- a/internal/service/golden_gate/golden_gate_pipeline_data_source.go +++ b/internal/service/golden_gate/golden_gate_pipeline_data_source.go @@ -8,6 +8,7 @@ import ( "log" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -21,15 +22,15 @@ func GoldenGatePipelineDataSource() *schema.Resource { Type: schema.TypeString, Required: true, } - return tfresource.GetSingularDataSourceItemSchema(GoldenGatePipelineResource(), fieldMap, readSingularGoldenGatePipeline) + return tfresource.GetSingularDataSourceItemSchemaWithContext(GoldenGatePipelineResource(), fieldMap, readSingularGoldenGatePipelineWithContext) } -func readSingularGoldenGatePipeline(d *schema.ResourceData, m interface{}) error { +func readSingularGoldenGatePipelineWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGatePipelineDataSourceCrud struct { @@ -42,7 +43,7 @@ func (s *GoldenGatePipelineDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGatePipelineDataSourceCrud) Get() error { +func (s *GoldenGatePipelineDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetPipelineRequest{} if pipelineId, ok := s.D.GetOkExists("pipeline_id"); ok { @@ -52,7 +53,7 @@ func (s *GoldenGatePipelineDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.GetPipeline(context.Background(), request) + response, err := s.Client.GetPipeline(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_pipeline_resource.go b/internal/service/golden_gate/golden_gate_pipeline_resource.go index c05687ded27..efd7f98dc06 100644 --- a/internal/service/golden_gate/golden_gate_pipeline_resource.go +++ b/internal/service/golden_gate/golden_gate_pipeline_resource.go @@ -10,10 +10,10 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" - oci_common "github.com/oracle/oci-go-sdk/v65/common" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -26,11 +26,11 @@ func GoldenGatePipelineResource() *schema.Resource { Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, - Timeouts: tfresource.DefaultTimeout, - Create: createGoldenGatePipeline, - Read: readGoldenGatePipeline, - Update: updateGoldenGatePipeline, - Delete: deleteGoldenGatePipeline, + Timeouts: tfresource.DefaultTimeout, + CreateContext: createGoldenGatePipelineWithContext, + ReadContext: readGoldenGatePipelineWithContext, + UpdateContext: updateGoldenGatePipelineWithContext, + DeleteContext: deleteGoldenGatePipelineWithContext, Schema: map[string]*schema.Schema{ // Required "compartment_id": { @@ -320,37 +320,37 @@ func GoldenGatePipelineResource() *schema.Resource { } } -func createGoldenGatePipeline(d *schema.ResourceData, m interface{}) error { +func createGoldenGatePipelineWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.CreateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.CreateResourceWithContext(ctx, d, sync)) } -func readGoldenGatePipeline(d *schema.ResourceData, m interface{}) error { +func readGoldenGatePipelineWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } -func updateGoldenGatePipeline(d *schema.ResourceData, m interface{}) error { +func updateGoldenGatePipelineWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.UpdateResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.UpdateResourceWithContext(ctx, d, sync)) } -func deleteGoldenGatePipeline(d *schema.ResourceData, m interface{}) error { +func deleteGoldenGatePipelineWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineResourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() sync.DisableNotFoundRetries = true - return tfresource.DeleteResource(d, sync) + return tfresource.HandleDiagError(m, tfresource.DeleteResourceWithContext(ctx, d, sync)) } type GoldenGatePipelineResourceCrud struct { @@ -390,7 +390,7 @@ func (s *GoldenGatePipelineResourceCrud) DeletedTarget() []string { } } -func (s *GoldenGatePipelineResourceCrud) Create() error { +func (s *GoldenGatePipelineResourceCrud) CreateWithContext(ctx context.Context) error { request := oci_golden_gate.CreatePipelineRequest{} err := s.populateTopLevelPolymorphicCreatePipelineRequest(&request) if err != nil { @@ -399,7 +399,7 @@ func (s *GoldenGatePipelineResourceCrud) Create() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.CreatePipeline(context.Background(), request) + response, err := s.Client.CreatePipeline(ctx, request) if err != nil { return err } @@ -410,14 +410,14 @@ func (s *GoldenGatePipelineResourceCrud) Create() error { if identifier != nil { s.D.SetId(*identifier) } - return s.getPipelineFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) + return s.getPipelineFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } -func (s *GoldenGatePipelineResourceCrud) getPipelineFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, +func (s *GoldenGatePipelineResourceCrud) getPipelineFromWorkRequest(ctx context.Context, workId *string, retryPolicy *oci_common.RetryPolicy, actionTypeEnum oci_golden_gate.ActionTypeEnum, timeout time.Duration) error { // Wait until it finishes - pipelineId, err := pipelineWaitForWorkRequest(workId, "pipeline", + pipelineId, err := pipelineWaitForWorkRequest(ctx, workId, "pipeline", actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) if err != nil { @@ -425,7 +425,7 @@ func (s *GoldenGatePipelineResourceCrud) getPipelineFromWorkRequest(workId *stri } s.D.SetId(*pipelineId) - return s.Get() + return s.GetWithContext(ctx) } func pipelineWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { @@ -451,7 +451,7 @@ func pipelineWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci } } -func pipelineWaitForWorkRequest(wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, +func pipelineWaitForWorkRequest(ctx context.Context, wId *string, entityType string, action oci_golden_gate.ActionTypeEnum, timeout time.Duration, disableFoundRetries bool, client *oci_golden_gate.GoldenGateClient) (*string, error) { retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "golden_gate") retryPolicy.ShouldRetryOperation = pipelineWorkRequestShouldRetryFunc(timeout) @@ -527,7 +527,7 @@ func getErrorFromGoldenGatePipelineWorkRequest(client *oci_golden_gate.GoldenGat return workRequestErr } -func (s *GoldenGatePipelineResourceCrud) Get() error { +func (s *GoldenGatePipelineResourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.GetPipelineRequest{} tmp := s.D.Id() @@ -535,7 +535,7 @@ func (s *GoldenGatePipelineResourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.GetPipeline(context.Background(), request) + response, err := s.Client.GetPipeline(ctx, request) if err != nil { return err } @@ -544,11 +544,11 @@ func (s *GoldenGatePipelineResourceCrud) Get() error { return nil } -func (s *GoldenGatePipelineResourceCrud) Update() error { +func (s *GoldenGatePipelineResourceCrud) UpdateWithContext(ctx context.Context) error { if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { oldRaw, newRaw := s.D.GetChange("compartment_id") if newRaw != "" && oldRaw != "" { - err := s.updateCompartment(compartment) + err := s.updateCompartment(ctx, compartment) if err != nil { return err } @@ -562,16 +562,16 @@ func (s *GoldenGatePipelineResourceCrud) Update() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.UpdatePipeline(context.Background(), request) + response, err := s.Client.UpdatePipeline(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId - return s.getPipelineFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + return s.getPipelineFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } -func (s *GoldenGatePipelineResourceCrud) Delete() error { +func (s *GoldenGatePipelineResourceCrud) DeleteWithContext(ctx context.Context) error { request := oci_golden_gate.DeletePipelineRequest{} if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { @@ -584,14 +584,14 @@ func (s *GoldenGatePipelineResourceCrud) Delete() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.DeletePipeline(context.Background(), request) + response, err := s.Client.DeletePipeline(ctx, request) if err != nil { return err } workId := response.OpcWorkRequestId // Wait until it finishes - _, delWorkRequestErr := pipelineWaitForWorkRequest(workId, "pipeline", + _, delWorkRequestErr := pipelineWaitForWorkRequest(ctx, workId, "pipeline", oci_golden_gate.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) return delWorkRequestErr } @@ -1116,7 +1116,7 @@ func (s *GoldenGatePipelineResourceCrud) populateTopLevelPolymorphicUpdatePipeli return nil } -func (s *GoldenGatePipelineResourceCrud) updateCompartment(compartment interface{}) error { +func (s *GoldenGatePipelineResourceCrud) updateCompartment(ctx context.Context, compartment interface{}) error { changeCompartmentRequest := oci_golden_gate.ChangePipelineCompartmentRequest{} compartmentTmp := compartment.(string) @@ -1132,11 +1132,11 @@ func (s *GoldenGatePipelineResourceCrud) updateCompartment(compartment interface changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate") - response, err := s.Client.ChangePipelineCompartment(context.Background(), changeCompartmentRequest) + response, err := s.Client.ChangePipelineCompartment(ctx, changeCompartmentRequest) if err != nil { return err } workId := response.OpcWorkRequestId - return s.getPipelineFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + return s.getPipelineFromWorkRequest(ctx, workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "golden_gate"), oci_golden_gate.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } diff --git a/internal/service/golden_gate/golden_gate_pipeline_running_processes_data_source.go b/internal/service/golden_gate/golden_gate_pipeline_running_processes_data_source.go index fd53620ed1b..63e249dbe8a 100644 --- a/internal/service/golden_gate/golden_gate_pipeline_running_processes_data_source.go +++ b/internal/service/golden_gate/golden_gate_pipeline_running_processes_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGatePipelineRunningProcessesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGatePipelineRunningProcesses, + ReadContext: readGoldenGatePipelineRunningProcessesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "pipeline_id": { @@ -72,12 +73,12 @@ func GoldenGatePipelineRunningProcessesDataSource() *schema.Resource { } } -func readGoldenGatePipelineRunningProcesses(d *schema.ResourceData, m interface{}) error { +func readGoldenGatePipelineRunningProcessesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineRunningProcessesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGatePipelineRunningProcessesDataSourceCrud struct { @@ -90,7 +91,7 @@ func (s *GoldenGatePipelineRunningProcessesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGatePipelineRunningProcessesDataSourceCrud) Get() error { +func (s *GoldenGatePipelineRunningProcessesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListPipelineRunningProcessesRequest{} if pipelineId, ok := s.D.GetOkExists("pipeline_id"); ok { @@ -100,7 +101,7 @@ func (s *GoldenGatePipelineRunningProcessesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListPipelineRunningProcesses(context.Background(), request) + response, err := s.Client.ListPipelineRunningProcesses(ctx, request) if err != nil { return err } @@ -109,7 +110,7 @@ func (s *GoldenGatePipelineRunningProcessesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListPipelineRunningProcesses(context.Background(), request) + listResponse, err := s.Client.ListPipelineRunningProcesses(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_pipeline_schema_tables_data_source.go b/internal/service/golden_gate/golden_gate_pipeline_schema_tables_data_source.go index 3b94cd497f6..8943cbc2269 100644 --- a/internal/service/golden_gate/golden_gate_pipeline_schema_tables_data_source.go +++ b/internal/service/golden_gate/golden_gate_pipeline_schema_tables_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGatePipelineSchemaTablesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGatePipelineSchemaTables, + ReadContext: readGoldenGatePipelineSchemaTablesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "display_name": { @@ -80,12 +81,12 @@ func GoldenGatePipelineSchemaTablesDataSource() *schema.Resource { } } -func readGoldenGatePipelineSchemaTables(d *schema.ResourceData, m interface{}) error { +func readGoldenGatePipelineSchemaTablesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineSchemaTablesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGatePipelineSchemaTablesDataSourceCrud struct { @@ -98,7 +99,7 @@ func (s *GoldenGatePipelineSchemaTablesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGatePipelineSchemaTablesDataSourceCrud) Get() error { +func (s *GoldenGatePipelineSchemaTablesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListPipelineSchemaTablesRequest{} if displayName, ok := s.D.GetOkExists("display_name"); ok { @@ -123,7 +124,7 @@ func (s *GoldenGatePipelineSchemaTablesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListPipelineSchemaTables(context.Background(), request) + response, err := s.Client.ListPipelineSchemaTables(ctx, request) if err != nil { return err } @@ -132,7 +133,7 @@ func (s *GoldenGatePipelineSchemaTablesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListPipelineSchemaTables(context.Background(), request) + listResponse, err := s.Client.ListPipelineSchemaTables(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_pipeline_schemas_data_source.go b/internal/service/golden_gate/golden_gate_pipeline_schemas_data_source.go index 435c9c30884..7e9ca3796cd 100644 --- a/internal/service/golden_gate/golden_gate_pipeline_schemas_data_source.go +++ b/internal/service/golden_gate/golden_gate_pipeline_schemas_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGatePipelineSchemasDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGatePipelineSchemas, + ReadContext: readGoldenGatePipelineSchemasWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "display_name": { @@ -64,12 +65,12 @@ func GoldenGatePipelineSchemasDataSource() *schema.Resource { } } -func readGoldenGatePipelineSchemas(d *schema.ResourceData, m interface{}) error { +func readGoldenGatePipelineSchemasWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelineSchemasDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGatePipelineSchemasDataSourceCrud struct { @@ -82,7 +83,7 @@ func (s *GoldenGatePipelineSchemasDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGatePipelineSchemasDataSourceCrud) Get() error { +func (s *GoldenGatePipelineSchemasDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListPipelineSchemasRequest{} if displayName, ok := s.D.GetOkExists("display_name"); ok { @@ -97,7 +98,7 @@ func (s *GoldenGatePipelineSchemasDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListPipelineSchemas(context.Background(), request) + response, err := s.Client.ListPipelineSchemas(ctx, request) if err != nil { return err } @@ -106,7 +107,7 @@ func (s *GoldenGatePipelineSchemasDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListPipelineSchemas(context.Background(), request) + listResponse, err := s.Client.ListPipelineSchemas(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_pipelines_data_source.go b/internal/service/golden_gate/golden_gate_pipelines_data_source.go index 7ab760a53b8..c72a604cf97 100644 --- a/internal/service/golden_gate/golden_gate_pipelines_data_source.go +++ b/internal/service/golden_gate/golden_gate_pipelines_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGatePipelinesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGatePipelines, + ReadContext: readGoldenGatePipelinesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -52,12 +53,12 @@ func GoldenGatePipelinesDataSource() *schema.Resource { } } -func readGoldenGatePipelines(d *schema.ResourceData, m interface{}) error { +func readGoldenGatePipelinesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGatePipelinesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGatePipelinesDataSourceCrud struct { @@ -70,7 +71,7 @@ func (s *GoldenGatePipelinesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGatePipelinesDataSourceCrud) Get() error { +func (s *GoldenGatePipelinesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListPipelinesRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -93,7 +94,7 @@ func (s *GoldenGatePipelinesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListPipelines(context.Background(), request) + response, err := s.Client.ListPipelines(ctx, request) if err != nil { return err } @@ -102,7 +103,7 @@ func (s *GoldenGatePipelinesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListPipelines(context.Background(), request) + listResponse, err := s.Client.ListPipelines(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_recipes_data_source.go b/internal/service/golden_gate/golden_gate_recipes_data_source.go index 21f2dfd4e0f..b5cca0014ac 100644 --- a/internal/service/golden_gate/golden_gate_recipes_data_source.go +++ b/internal/service/golden_gate/golden_gate_recipes_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateRecipesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateRecipes, + ReadContext: readGoldenGateRecipesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "compartment_id": { @@ -90,12 +91,12 @@ func GoldenGateRecipesDataSource() *schema.Resource { } } -func readGoldenGateRecipes(d *schema.ResourceData, m interface{}) error { +func readGoldenGateRecipesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateRecipesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateRecipesDataSourceCrud struct { @@ -108,7 +109,7 @@ func (s *GoldenGateRecipesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateRecipesDataSourceCrud) Get() error { +func (s *GoldenGateRecipesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListRecipesRequest{} if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { @@ -127,7 +128,7 @@ func (s *GoldenGateRecipesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListRecipes(context.Background(), request) + response, err := s.Client.ListRecipes(ctx, request) if err != nil { return err } @@ -136,7 +137,7 @@ func (s *GoldenGateRecipesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListRecipes(context.Background(), request) + listResponse, err := s.Client.ListRecipes(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_trail_files_data_source.go b/internal/service/golden_gate/golden_gate_trail_files_data_source.go index aaf9417c51e..38a0c8c0063 100644 --- a/internal/service/golden_gate/golden_gate_trail_files_data_source.go +++ b/internal/service/golden_gate/golden_gate_trail_files_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateTrailFilesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateTrailFiles, + ReadContext: readGoldenGateTrailFilesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "deployment_id": { @@ -98,12 +99,12 @@ func GoldenGateTrailFilesDataSource() *schema.Resource { } } -func readGoldenGateTrailFiles(d *schema.ResourceData, m interface{}) error { +func readGoldenGateTrailFilesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateTrailFilesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateTrailFilesDataSourceCrud struct { @@ -116,7 +117,7 @@ func (s *GoldenGateTrailFilesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateTrailFilesDataSourceCrud) Get() error { +func (s *GoldenGateTrailFilesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListTrailFilesRequest{} if deploymentId, ok := s.D.GetOkExists("deployment_id"); ok { @@ -136,7 +137,7 @@ func (s *GoldenGateTrailFilesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListTrailFiles(context.Background(), request) + response, err := s.Client.ListTrailFiles(ctx, request) if err != nil { return err } @@ -145,7 +146,7 @@ func (s *GoldenGateTrailFilesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListTrailFiles(context.Background(), request) + listResponse, err := s.Client.ListTrailFiles(ctx, request) if err != nil { return err } diff --git a/internal/service/golden_gate/golden_gate_trail_sequences_data_source.go b/internal/service/golden_gate/golden_gate_trail_sequences_data_source.go index 0e9173d0592..ff65a3825d5 100644 --- a/internal/service/golden_gate/golden_gate_trail_sequences_data_source.go +++ b/internal/service/golden_gate/golden_gate_trail_sequences_data_source.go @@ -6,6 +6,7 @@ package golden_gate import ( "context" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_golden_gate "github.com/oracle/oci-go-sdk/v65/goldengate" @@ -15,7 +16,7 @@ import ( func GoldenGateTrailSequencesDataSource() *schema.Resource { return &schema.Resource{ - Read: readGoldenGateTrailSequences, + ReadContext: readGoldenGateTrailSequencesWithContext, Schema: map[string]*schema.Schema{ "filter": tfresource.DataSourceFiltersSchema(), "deployment_id": { @@ -79,12 +80,12 @@ func GoldenGateTrailSequencesDataSource() *schema.Resource { } } -func readGoldenGateTrailSequences(d *schema.ResourceData, m interface{}) error { +func readGoldenGateTrailSequencesWithContext(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics { sync := &GoldenGateTrailSequencesDataSourceCrud{} sync.D = d sync.Client = m.(*client.OracleClients).GoldenGateClient() - return tfresource.ReadResource(sync) + return tfresource.HandleDiagError(m, tfresource.ReadResourceWithContext(ctx, sync)) } type GoldenGateTrailSequencesDataSourceCrud struct { @@ -97,7 +98,7 @@ func (s *GoldenGateTrailSequencesDataSourceCrud) VoidState() { s.D.SetId("") } -func (s *GoldenGateTrailSequencesDataSourceCrud) Get() error { +func (s *GoldenGateTrailSequencesDataSourceCrud) GetWithContext(ctx context.Context) error { request := oci_golden_gate.ListTrailSequencesRequest{} if deploymentId, ok := s.D.GetOkExists("deployment_id"); ok { @@ -122,7 +123,7 @@ func (s *GoldenGateTrailSequencesDataSourceCrud) Get() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "golden_gate") - response, err := s.Client.ListTrailSequences(context.Background(), request) + response, err := s.Client.ListTrailSequences(ctx, request) if err != nil { return err } @@ -131,7 +132,7 @@ func (s *GoldenGateTrailSequencesDataSourceCrud) Get() error { request.Page = s.Res.OpcNextPage for request.Page != nil { - listResponse, err := s.Client.ListTrailSequences(context.Background(), request) + listResponse, err := s.Client.ListTrailSequences(ctx, request) if err != nil { return err } diff --git a/internal/service/managed_kafka/managed_kafka_kafka_cluster_resource.go b/internal/service/managed_kafka/managed_kafka_kafka_cluster_resource.go index 7377061ac21..f97c9b9b497 100644 --- a/internal/service/managed_kafka/managed_kafka_kafka_cluster_resource.go +++ b/internal/service/managed_kafka/managed_kafka_kafka_cluster_resource.go @@ -6,11 +6,12 @@ package managed_kafka import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-testing/helper/resource" "log" "strings" "time" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_common "github.com/oracle/oci-go-sdk/v65/common" diff --git a/internal/service/managed_kafka/managed_kafka_kafka_cluster_superusers_management_resource.go b/internal/service/managed_kafka/managed_kafka_kafka_cluster_superusers_management_resource.go index a8f7337ce25..970eb5d81a5 100644 --- a/internal/service/managed_kafka/managed_kafka_kafka_cluster_superusers_management_resource.go +++ b/internal/service/managed_kafka/managed_kafka_kafka_cluster_superusers_management_resource.go @@ -6,11 +6,12 @@ package managed_kafka import ( "context" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "log" "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_common "github.com/oracle/oci-go-sdk/v65/common" oci_managed_kafka "github.com/oracle/oci-go-sdk/v65/managedkafka" diff --git a/internal/service/multicloud/multicloud_external_location_mapping_metadata_data_source.go b/internal/service/multicloud/multicloud_external_location_mapping_metadata_data_source.go new file mode 100644 index 00000000000..3430814543a --- /dev/null +++ b/internal/service/multicloud/multicloud_external_location_mapping_metadata_data_source.go @@ -0,0 +1,286 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudExternalLocationMappingMetadataDataSource() *schema.Resource { + return &schema.Resource{ + Read: readMulticloudExternalLocationMappingMetadata, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "subscription_id": { + Type: schema.TypeString, + Optional: true, + }, + "subscription_service_name": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + }, + "external_location_mapping_metadatum_summary_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "items": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "external_location": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "csp_physical_az": { + Type: schema.TypeString, + Computed: true, + }, + "csp_physical_az_display_name": { + Type: schema.TypeString, + Computed: true, + }, + "csp_region": { + Type: schema.TypeString, + Computed: true, + }, + "csp_region_display_name": { + Type: schema.TypeString, + Computed: true, + }, + "service_name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "oci_logical_ad": { + Type: schema.TypeString, + Computed: true, + }, + "oci_physical_ad": { + Type: schema.TypeString, + Computed: true, + }, + "oci_region": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func readMulticloudExternalLocationMappingMetadata(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudExternalLocationMappingMetadataDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MetadataClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudExternalLocationMappingMetadataDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.MetadataClient + Res *oci_multicloud.ListExternalLocationMappingMetadataResponse +} + +func (s *MulticloudExternalLocationMappingMetadataDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudExternalLocationMappingMetadataDataSourceCrud) Get() error { + request := oci_multicloud.ListExternalLocationMappingMetadataRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + if subscriptionServiceName, ok := s.D.GetOkExists("subscription_service_name"); ok { + interfaces := subscriptionServiceName.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("subscription_service_name") { + for _, tmpStr := range tmp { + request.SubscriptionServiceName = append(request.SubscriptionServiceName, oci_multicloud.SubscriptionTypeEnum(tmpStr)) + } + } + } + + if limit, ok := s.D.GetOkExists("limit"); ok { + tmp := limit.(int) + request.Limit = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.ListExternalLocationMappingMetadata(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListExternalLocationMappingMetadata(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 *MulticloudExternalLocationMappingMetadataDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("MulticloudExternalLocationMappingMetadataDataSource-", MulticloudExternalLocationMappingMetadataDataSource(), s.D)) + resources := []map[string]interface{}{} + externalLocationMappingMetadata := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, ExternalLocationMappingMetadatumSummaryToMap(item)) + } + externalLocationMappingMetadata["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, MulticloudExternalLocationMappingMetadataDataSource().Schema["external_location_mapping_metadatum_summary_collection"].Elem.(*schema.Resource).Schema) + externalLocationMappingMetadata["items"] = items + } + + resources = append(resources, externalLocationMappingMetadata) + if err := s.D.Set("external_location_mapping_metadatum_summary_collection", resources); err != nil { + return err + } + + return nil +} + +func ExternalLocationToMap(obj *oci_multicloud.ExternalLocation) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CspPhysicalAz != nil { + result["csp_physical_az"] = string(*obj.CspPhysicalAz) + } + + if obj.CspPhysicalAzDisplayName != nil { + result["csp_physical_az_display_name"] = string(*obj.CspPhysicalAzDisplayName) + } + + if obj.CspRegion != nil { + result["csp_region"] = string(*obj.CspRegion) + } + + if obj.CspRegionDisplayName != nil { + result["csp_region_display_name"] = string(*obj.CspRegionDisplayName) + } + + result["service_name"] = string(obj.ServiceName) + + return result +} + +func ExternalLocationMappingMetadatumSummaryToMap(obj oci_multicloud.ExternalLocationMappingMetadatumSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.ExternalLocation != nil { + result["external_location"] = []interface{}{ExternalLocationToMap(obj.ExternalLocation)} + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.OciLogicalAd != nil { + result["oci_logical_ad"] = string(*obj.OciLogicalAd) + } + + if obj.OciPhysicalAd != nil { + result["oci_physical_ad"] = string(*obj.OciPhysicalAd) + } + + if obj.OciRegion != nil { + result["oci_region"] = string(*obj.OciRegion) + } + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + return result +} diff --git a/internal/service/multicloud/multicloud_external_location_summaries_metadata_data_source.go b/internal/service/multicloud/multicloud_external_location_summaries_metadata_data_source.go new file mode 100644 index 00000000000..2f3a050789a --- /dev/null +++ b/internal/service/multicloud/multicloud_external_location_summaries_metadata_data_source.go @@ -0,0 +1,242 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudExternalLocationSummariesMetadataDataSource() *schema.Resource { + return &schema.Resource{ + Read: readMulticloudExternalLocationSummariesMetadata, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "entity_type": { + Type: schema.TypeString, + Optional: true, + }, + "subscription_id": { + Type: schema.TypeString, + Optional: true, + }, + "subscription_service_name": { + Type: schema.TypeString, + Required: true, + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + }, + "external_location_summaries_metadatum_summary_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "items": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "external_location": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "csp_region": { + Type: schema.TypeString, + Computed: true, + }, + "csp_region_display_name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "oci_region": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func readMulticloudExternalLocationSummariesMetadata(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudExternalLocationSummariesMetadataDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MetadataClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudExternalLocationSummariesMetadataDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.MetadataClient + Res *oci_multicloud.ListExternalLocationSummariesMetadataResponse +} + +func (s *MulticloudExternalLocationSummariesMetadataDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudExternalLocationSummariesMetadataDataSourceCrud) Get() error { + request := oci_multicloud.ListExternalLocationSummariesMetadataRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if entityType, ok := s.D.GetOkExists("entity_type"); ok { + request.EntityType = oci_multicloud.ListExternalLocationSummariesMetadataEntityTypeEnum(entityType.(string)) + } + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + if subscriptionServiceName, ok := s.D.GetOkExists("subscription_service_name"); ok { + request.SubscriptionServiceName = oci_multicloud.ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum(subscriptionServiceName.(string)) + } + + if limit, ok := s.D.GetOkExists("limit"); ok { + tmp := limit.(int) + request.Limit = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.ListExternalLocationSummariesMetadata(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListExternalLocationSummariesMetadata(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 *MulticloudExternalLocationSummariesMetadataDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("MulticloudExternalLocationSummariesMetadataDataSource-", MulticloudExternalLocationSummariesMetadataDataSource(), s.D)) + resources := []map[string]interface{}{} + externalLocationSummariesMetadata := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, ExternalLocationSummariesMetadatumSummaryToMap(item)) + } + externalLocationSummariesMetadata["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, MulticloudExternalLocationSummariesMetadataDataSource().Schema["external_location_summaries_metadatum_summary_collection"].Elem.(*schema.Resource).Schema) + externalLocationSummariesMetadata["items"] = items + } + + resources = append(resources, externalLocationSummariesMetadata) + if err := s.D.Set("external_location_summaries_metadatum_summary_collection", resources); err != nil { + return err + } + + return nil +} + +func ExternalLocationSummariesMetadatumSummaryToMap(obj oci_multicloud.ExternalLocationSummariesMetadatumSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.ExternalLocation != nil { + result["external_location"] = []interface{}{ExternalLocationSummaryToMap(obj.ExternalLocation)} + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.OciRegion != nil { + result["oci_region"] = string(*obj.OciRegion) + } + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + return result +} + +func ExternalLocationSummaryToMap(obj *oci_multicloud.ExternalLocationSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CspRegion != nil { + result["csp_region"] = string(*obj.CspRegion) + } + + if obj.CspRegionDisplayName != nil { + result["csp_region_display_name"] = string(*obj.CspRegionDisplayName) + } + + return result +} diff --git a/internal/service/multicloud/multicloud_external_locations_metadata_data_source.go b/internal/service/multicloud/multicloud_external_locations_metadata_data_source.go new file mode 100644 index 00000000000..de9ce6f0a58 --- /dev/null +++ b/internal/service/multicloud/multicloud_external_locations_metadata_data_source.go @@ -0,0 +1,344 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudExternalLocationsMetadataDataSource() *schema.Resource { + return &schema.Resource{ + Read: readMulticloudExternalLocationsMetadata, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "entity_type": { + Type: schema.TypeString, + Optional: true, + }, + "linked_compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "subscription_id": { + Type: schema.TypeString, + Required: true, + }, + "subscription_service_name": { + Type: schema.TypeString, + Required: true, + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + }, + "external_locations_metadatum_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "items": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "cpg_id": { + Type: schema.TypeString, + Computed: true, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "external_location": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "csp_logical_az": { + Type: schema.TypeString, + Computed: true, + }, + "csp_physical_az": { + Type: schema.TypeString, + Computed: true, + }, + "csp_physical_az_display_name": { + Type: schema.TypeString, + Computed: true, + }, + "csp_region": { + Type: schema.TypeString, + Computed: true, + }, + "csp_region_display_name": { + Type: schema.TypeString, + Computed: true, + }, + "csp_zone_key_reference_id": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "key_name": { + Type: schema.TypeString, + Computed: true, + }, + "key_value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "service_name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "oci_logical_ad": { + Type: schema.TypeString, + Computed: true, + }, + "oci_physical_ad": { + Type: schema.TypeString, + Computed: true, + }, + "oci_region": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func readMulticloudExternalLocationsMetadata(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudExternalLocationsMetadataDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MetadataClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudExternalLocationsMetadataDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.MetadataClient + Res *oci_multicloud.ListExternalLocationDetailsMetadataResponse +} + +func (s *MulticloudExternalLocationsMetadataDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudExternalLocationsMetadataDataSourceCrud) Get() error { + request := oci_multicloud.ListExternalLocationDetailsMetadataRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if entityType, ok := s.D.GetOkExists("entity_type"); ok { + request.EntityType = oci_multicloud.ListExternalLocationDetailsMetadataEntityTypeEnum(entityType.(string)) + } + + if linkedCompartmentId, ok := s.D.GetOkExists("linked_compartment_id"); ok { + tmp := linkedCompartmentId.(string) + request.LinkedCompartmentId = &tmp + } + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + if subscriptionServiceName, ok := s.D.GetOkExists("subscription_service_name"); ok { + request.SubscriptionServiceName = oci_multicloud.ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum(subscriptionServiceName.(string)) + } + + if limit, ok := s.D.GetOkExists("limit"); ok { + tmp := limit.(int) + request.Limit = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.ListExternalLocationDetailsMetadata(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListExternalLocationDetailsMetadata(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 *MulticloudExternalLocationsMetadataDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("MulticloudExternalLocationsMetadataDataSource-", MulticloudExternalLocationsMetadataDataSource(), s.D)) + resources := []map[string]interface{}{} + externalLocationsMetadata := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, ExternalLocationsMetadatumSummaryToMap(item)) + } + externalLocationsMetadata["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, MulticloudExternalLocationsMetadataDataSource().Schema["external_locations_metadatum_collection"].Elem.(*schema.Resource).Schema) + externalLocationsMetadata["items"] = items + } + + resources = append(resources, externalLocationsMetadata) + if err := s.D.Set("external_locations_metadatum_collection", resources); err != nil { + return err + } + + return nil +} + +func CspZoneKeyReferenceIdToMap(obj *oci_multicloud.CspZoneKeyReferenceId) map[string]interface{} { + result := map[string]interface{}{} + + if obj.KeyName != nil { + result["key_name"] = string(*obj.KeyName) + } + + if obj.KeyValue != nil { + result["key_value"] = string(*obj.KeyValue) + } + + return result +} + +func ExternalLocationDetailToMap(obj *oci_multicloud.ExternalLocationDetail) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CspLogicalAz != nil { + result["csp_logical_az"] = string(*obj.CspLogicalAz) + } + + if obj.CspPhysicalAz != nil { + result["csp_physical_az"] = string(*obj.CspPhysicalAz) + } + + if obj.CspPhysicalAzDisplayName != nil { + result["csp_physical_az_display_name"] = string(*obj.CspPhysicalAzDisplayName) + } + + if obj.CspRegion != nil { + result["csp_region"] = string(*obj.CspRegion) + } + + if obj.CspRegionDisplayName != nil { + result["csp_region_display_name"] = string(*obj.CspRegionDisplayName) + } + + if obj.CspZoneKeyReferenceId != nil { + result["csp_zone_key_reference_id"] = []interface{}{CspZoneKeyReferenceIdToMap(obj.CspZoneKeyReferenceId)} + } + + result["service_name"] = string(obj.ServiceName) + + return result +} + +func ExternalLocationsMetadatumSummaryToMap(obj oci_multicloud.ExternalLocationsMetadatumSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CpgId != nil { + result["cpg_id"] = string(*obj.CpgId) + } + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.ExternalLocation != nil { + result["external_location"] = []interface{}{ExternalLocationDetailToMap(obj.ExternalLocation)} + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.OciLogicalAd != nil { + result["oci_logical_ad"] = string(*obj.OciLogicalAd) + } + + if obj.OciPhysicalAd != nil { + result["oci_physical_ad"] = string(*obj.OciPhysicalAd) + } + + if obj.OciRegion != nil { + result["oci_region"] = string(*obj.OciRegion) + } + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + return result +} diff --git a/internal/service/multicloud/multicloud_network_anchor_data_source.go b/internal/service/multicloud/multicloud_network_anchor_data_source.go new file mode 100644 index 00000000000..a3a21fd715f --- /dev/null +++ b/internal/service/multicloud/multicloud_network_anchor_data_source.go @@ -0,0 +1,469 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudNetworkAnchorDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularMulticloudNetworkAnchor, + Schema: map[string]*schema.Schema{ + // Required + "network_anchor_id": { + Type: schema.TypeString, + Required: true, + }, + "subscription_service_name": { + Type: schema.TypeString, + Required: true, + }, + "subscription_id": { + Type: schema.TypeString, + Required: true, + }, + // Optional + "external_location": { + Type: schema.TypeString, + Optional: true, + }, + // Computed + "id": { + Type: schema.TypeString, + Computed: true, + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "resource_anchor_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + "network_anchor_lifecycle_state": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "setup_mode": { + Type: schema.TypeString, + Computed: true, + }, + "cluster_placement_group_id": { + Type: schema.TypeString, + Computed: true, + }, + "oci_metadata_item": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "network_anchor_connection_status": { + Type: schema.TypeString, + Computed: true, + }, + "vcn": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "vcn_id": { + Type: schema.TypeString, + Computed: true, + }, + "cidr_blocks": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "backup_cidr_blocks": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "dns_label": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "dns": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "custom_domain_name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "subnets": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "type": { + Type: schema.TypeString, + Computed: true, + }, + "subnet_id": { + Type: schema.TypeString, + Computed: true, + }, + "label": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "dns_listening_endpoint_ip_address": { + Type: schema.TypeString, + Computed: true, + }, + "dns_forwarding_endpoint_ip_address": { + Type: schema.TypeString, + Computed: true, + }, + "dns_forwarding_config": { + Type: schema.TypeList, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + "cloud_service_provider_metadata_item": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "region": { + Type: schema.TypeString, + Computed: true, + }, + "odb_network_id": { + Type: schema.TypeString, + Computed: true, + }, + "cidr_blocks": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "network_anchor_uri": { + Type: schema.TypeString, + Computed: true, + }, + "dns_forwarding_config": { + Type: schema.TypeList, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + }, + } +} + +func readSingularMulticloudNetworkAnchor(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudNetworkAnchorDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OmhubNetworkAnchorClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudNetworkAnchorDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.OmhubNetworkAnchorClient + Res *oci_multicloud.GetNetworkAnchorResponse +} + +func (s *MulticloudNetworkAnchorDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudNetworkAnchorDataSourceCrud) Get() error { + request := oci_multicloud.GetNetworkAnchorRequest{} + + // Required + + if networkAnchorId, ok := s.D.GetOkExists("network_anchor_id"); ok { + tmp := networkAnchorId.(string) + request.NetworkAnchorId = &tmp + } + + if subscriptionServiceName, ok := s.D.GetOkExists("subscription_service_name"); ok { + request.SubscriptionServiceName = oci_multicloud.GetNetworkAnchorSubscriptionServiceNameEnum(subscriptionServiceName.(string)) + } + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + // Optional + + if externalLocation, ok := s.D.GetOkExists("external_location"); ok { + tmp := externalLocation.(string) + request.ExternalLocation = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.GetNetworkAnchor(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *MulticloudNetworkAnchorDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.Id != nil { + s.D.Set("id", *s.Res.Id) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.ResourceAnchorId != nil { + s.D.Set("resource_anchor_id", *s.Res.ResourceAnchorId) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + s.D.Set("network_anchor_lifecycle_state", string(s.Res.LifecycleState)) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + s.D.Set("setup_mode", string(s.Res.SetupMode)) + + if s.Res.ClusterPlacementGroupId != nil { + s.D.Set("cluster_placement_group_id", *s.Res.ClusterPlacementGroupId) + } + + if s.Res.OciMetadataItem != nil { + s.D.Set("oci_metadata_item", []interface{}{OciNetworkMetadataToMap(s.Res.OciMetadataItem)}) + } else { + s.D.Set("oci_metadata_item", nil) + } + + if s.Res.CloudServiceProviderMetadataItem != nil { + s.D.Set("cloud_service_provider_metadata_item", []interface{}{CloudServiceProviderNetworkMetadataItemToMap(s.Res.CloudServiceProviderMetadataItem)}) + } else { + s.D.Set("cloud_service_provider_metadata_item", nil) + } + + return nil +} + +func CloudServiceProviderNetworkMetadataItemToMap(obj *oci_multicloud.CloudServiceProviderNetworkMetadataItem) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Region != nil { + result["region"] = string(*obj.Region) + } + + if obj.OdbNetworkId != nil { + result["odb_network_id"] = string(*obj.OdbNetworkId) + } + + result["cidr_blocks"] = obj.CidrBlocks + + if obj.NetworkAnchorUri != nil { + result["network_anchor_uri"] = string(*obj.NetworkAnchorUri) + } + + dnsForwardingConfig := []interface{}{} + for _, item := range obj.DnsForwardingConfig { + dnsForwardingConfig = append(dnsForwardingConfig, item) + } + result["dns_forwarding_config"] = dnsForwardingConfig + + return result +} + +func OciDnsToMap(obj *oci_multicloud.OciDns) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CustomDomainName != nil { + result["custom_domain_name"] = string(*obj.CustomDomainName) + } + + return result +} + +func OciNetworkMetadataToMap(obj *oci_multicloud.OciNetworkMetadata) map[string]interface{} { + result := map[string]interface{}{} + + result["network_anchor_connection_status"] = string(obj.NetworkAnchorConnectionStatus) + + if obj.Vcn != nil { + result["vcn"] = []interface{}{OciVcnToMap(obj.Vcn)} + } + + if obj.Dns != nil { + result["dns"] = []interface{}{OciDnsToMap(obj.Dns)} + } + + subnets := []interface{}{} + for _, item := range obj.Subnets { + subnets = append(subnets, OciNetworkSubnetToMap(item)) + } + result["subnets"] = subnets + + if obj.DnsListeningEndpointIpAddress != nil { + result["dns_listening_endpoint_ip_address"] = string(*obj.DnsListeningEndpointIpAddress) + } + + if obj.DnsForwardingEndpointIpAddress != nil { + result["dns_forwarding_endpoint_ip_address"] = string(*obj.DnsForwardingEndpointIpAddress) + } + + dnsForwardingConfig := []interface{}{} + for _, item := range obj.DnsForwardingConfig { + dnsForwardingConfig = append(dnsForwardingConfig, item) + } + result["dns_forwarding_config"] = dnsForwardingConfig + + return result +} + +func OciNetworkSubnetToMap(obj oci_multicloud.OciNetworkSubnet) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Label != nil { + result["label"] = string(*obj.Label) + } + + if obj.SubnetId != nil { + result["subnet_id"] = string(*obj.SubnetId) + } + + result["type"] = string(obj.Type) + + return result +} + +func OciVcnToMap(obj *oci_multicloud.OciVcn) map[string]interface{} { + result := map[string]interface{}{} + + if obj.VcnId != nil { + result["vcn_id"] = string(*obj.VcnId) + } + + result["cidr_blocks"] = obj.CidrBlocks + + result["backup_cidr_blocks"] = obj.BackupCidrBlocks + + if obj.DnsLabel != nil { + result["dns_label"] = string(*obj.DnsLabel) + } + + return result +} diff --git a/internal/service/multicloud/multicloud_network_anchors_data_source.go b/internal/service/multicloud/multicloud_network_anchors_data_source.go new file mode 100644 index 00000000000..cac7a93491d --- /dev/null +++ b/internal/service/multicloud/multicloud_network_anchors_data_source.go @@ -0,0 +1,314 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudNetworkAnchorsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readMulticloudNetworkAnchors, + Schema: map[string]*schema.Schema{ + // Required + "subscription_id": { + Type: schema.TypeString, + Required: true, + }, + "subscription_service_name": { + Type: schema.TypeString, + Required: true, + }, + "external_location": { + Type: schema.TypeString, + Required: true, + }, + // Optional + "compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "network_anchor_lifecycle_state": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "network_anchor_oci_subnet_id": { + Type: schema.TypeString, + Optional: true, + }, + "network_anchor_oci_vcn_id": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + }, + // Computed + "network_anchor_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "items": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "id": { + Type: schema.TypeString, + Computed: true, + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "resource_anchor_id": { + Type: schema.TypeString, + Computed: true, + }, + "vcn_id": { + Type: schema.TypeString, + Computed: true, + }, + "cluster_placement_group_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + "network_anchor_lifecycle_state": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func readMulticloudNetworkAnchors(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudNetworkAnchorsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OmhubNetworkAnchorClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudNetworkAnchorsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.OmhubNetworkAnchorClient + Res *oci_multicloud.ListNetworkAnchorsResponse +} + +func (s *MulticloudNetworkAnchorsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudNetworkAnchorsDataSourceCrud) Get() error { + request := oci_multicloud.ListNetworkAnchorsRequest{} + + // Required + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + if subscriptionServiceName, ok := s.D.GetOkExists("subscription_service_name"); ok { + request.SubscriptionServiceName = oci_multicloud.ListNetworkAnchorsSubscriptionServiceNameEnum(subscriptionServiceName.(string)) + } + + if externalLocation, ok := s.D.GetOkExists("external_location"); ok { + tmp := externalLocation.(string) + request.ExternalLocation = &tmp + } + + // Optional + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if lifecycleState, ok := s.D.GetOkExists("network_anchor_lifecycle_state"); ok { + request.LifecycleState = oci_multicloud.NetworkAnchorLifecycleStateEnum(lifecycleState.(string)) + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if networkAnchorOciSubnetId, ok := s.D.GetOkExists("network_anchor_oci_subnet_id"); ok { + tmp := networkAnchorOciSubnetId.(string) + request.NetworkAnchorOciSubnetId = &tmp + } + + if networkAnchorOciVcnId, ok := s.D.GetOkExists("network_anchor_oci_vcn_id"); ok { + tmp := networkAnchorOciVcnId.(string) + request.NetworkAnchorOciVcnId = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if limit, ok := s.D.GetOkExists("limit"); ok { + tmp := limit.(int) + request.Limit = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.ListNetworkAnchors(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListNetworkAnchors(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 *MulticloudNetworkAnchorsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("MulticloudNetworkAnchorsDataSource-", MulticloudNetworkAnchorsDataSource(), s.D)) + resources := []map[string]interface{}{} + networkAnchor := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, NetworkAnchorSummaryToMap(item)) + } + networkAnchor["items"] = items + resources = append(resources, networkAnchor) + + if err := s.D.Set("network_anchor_collection", resources); err != nil { + return err + } + + return nil +} + +func NetworkAnchorSummaryToMap(obj oci_multicloud.NetworkAnchorSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.ResourceAnchorId != nil { + result["resource_anchor_id"] = string(*obj.ResourceAnchorId) + } + + if obj.VcnId != nil { + result["vcn_id"] = string(*obj.VcnId) + } + + if obj.ClusterPlacementGroupId != nil { + result["cluster_placement_group_id"] = string(*obj.ClusterPlacementGroupId) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + result["network_anchor_lifecycle_state"] = string(obj.LifecycleState) + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + return result +} diff --git a/internal/service/multicloud/multicloud_om_hub_multi_cloud_metadata_data_source.go b/internal/service/multicloud/multicloud_om_hub_multi_cloud_metadata_data_source.go new file mode 100644 index 00000000000..fe8fbd18cf2 --- /dev/null +++ b/internal/service/multicloud/multicloud_om_hub_multi_cloud_metadata_data_source.go @@ -0,0 +1,132 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudOmHubMultiCloudMetadataDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularMulticloudOmHubMultiCloudMetadata, + Schema: map[string]*schema.Schema{ + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "subscription_id": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "base_compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "base_subscription_id": { + Type: schema.TypeString, + Computed: true, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func readSingularMulticloudOmHubMultiCloudMetadata(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudOmHubMultiCloudMetadataDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MultiCloudsMetadataClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudOmHubMultiCloudMetadataDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.MultiCloudsMetadataClient + Res *oci_multicloud.GetMultiCloudMetadataResponse +} + +func (s *MulticloudOmHubMultiCloudMetadataDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudOmHubMultiCloudMetadataDataSourceCrud) Get() error { + request := oci_multicloud.GetMultiCloudMetadataRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.GetMultiCloudMetadata(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *MulticloudOmHubMultiCloudMetadataDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("MulticloudOmHubMultiCloudMetadataDataSource-", MulticloudOmHubMultiCloudMetadataDataSource(), s.D)) + + if s.Res.CompartmentId != nil { + s.D.Set("base_compartment_id", *s.Res.CompartmentId) + } + + if s.Res.SubscriptionId != nil { + s.D.Set("base_subscription_id", *s.Res.SubscriptionId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + return nil +} diff --git a/internal/service/multicloud/multicloud_om_hub_multi_clouds_metadata_data_source.go b/internal/service/multicloud/multicloud_om_hub_multi_clouds_metadata_data_source.go new file mode 100644 index 00000000000..ca404994aaa --- /dev/null +++ b/internal/service/multicloud/multicloud_om_hub_multi_clouds_metadata_data_source.go @@ -0,0 +1,172 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudOmHubMultiCloudsMetadataDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularMulticloudOmHubMultiCloudsMetadata, + Schema: map[string]*schema.Schema{ + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + }, + // Computed + "multi_cloud_metadata_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "items": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "subscription_id": { + Type: schema.TypeString, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func readSingularMulticloudOmHubMultiCloudsMetadata(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudOmHubMultiCloudsMetadataDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MultiCloudsMetadataClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudOmHubMultiCloudsMetadataDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.MultiCloudsMetadataClient + Res *oci_multicloud.ListMultiCloudMetadataResponse +} + +func (s *MulticloudOmHubMultiCloudsMetadataDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudOmHubMultiCloudsMetadataDataSourceCrud) Get() error { + request := oci_multicloud.ListMultiCloudMetadataRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if limit, ok := s.D.GetOkExists("limit"); ok { + tmp := limit.(int) + request.Limit = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.ListMultiCloudMetadata(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *MulticloudOmHubMultiCloudsMetadataDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("MulticloudOmHubMultiCloudsMetadataDataSource-", MulticloudOmHubMultiCloudsMetadataDataSource(), s.D)) + collection := []map[string]interface{}{} + MetadataCollection := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, MultiCloudMetadataSummaryToMap(item)) + } + MetadataCollection["items"] = items + + collection = append(collection, MetadataCollection) + if err := s.D.Set("multi_cloud_metadata_collection", collection); err != nil { + return err + } + + return nil +} + +func MultiCloudMetadataSummaryToMap(obj oci_multicloud.MultiCloudMetadataSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.SubscriptionId != nil { + result["subscription_id"] = string(*obj.SubscriptionId) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + return result +} diff --git a/internal/service/multicloud/multicloud_resource_anchor_data_source.go b/internal/service/multicloud/multicloud_resource_anchor_data_source.go new file mode 100644 index 00000000000..84c4f5b855e --- /dev/null +++ b/internal/service/multicloud/multicloud_resource_anchor_data_source.go @@ -0,0 +1,331 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudResourceAnchorDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularMulticloudResourceAnchor, + Schema: map[string]*schema.Schema{ + "resource_anchor_id": { + Type: schema.TypeString, + Required: true, + }, + "subscription_id": { + Type: schema.TypeString, + Required: true, + }, + "subscription_service_name": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "cloud_service_provider_metadata_item": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "account_id": { + Type: schema.TypeString, + Computed: true, + }, + "project_number": { + Type: schema.TypeString, + Computed: true, + }, + "region": { + Type: schema.TypeString, + Computed: true, + }, + "resource_anchor_name": { + Type: schema.TypeString, + Computed: true, + }, + "resource_anchor_uri": { + Type: schema.TypeString, + Computed: true, + }, + "resource_group": { + Type: schema.TypeString, + Computed: true, + }, + "subscription": { + Type: schema.TypeString, + Computed: true, + }, + "subscription_type": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "linked_compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "region": { + Type: schema.TypeString, + Computed: true, + }, + "setup_mode": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_state": { + Type: schema.TypeString, + Computed: true, + }, + "resource_anchor_subscription_id": { + Type: schema.TypeString, + Computed: true, + }, + "subscription_type": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func readSingularMulticloudResourceAnchor(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudResourceAnchorDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OmhubResourceAnchorClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudResourceAnchorDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.OmhubResourceAnchorClient + Res *oci_multicloud.GetResourceAnchorResponse +} + +func (s *MulticloudResourceAnchorDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudResourceAnchorDataSourceCrud) Get() error { + request := oci_multicloud.GetResourceAnchorRequest{} + + if resourceAnchorId, ok := s.D.GetOkExists("resource_anchor_id"); ok { + tmp := resourceAnchorId.(string) + request.ResourceAnchorId = &tmp + } + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + if subscriptionServiceName, ok := s.D.GetOkExists("subscription_service_name"); ok { + request.SubscriptionServiceName = oci_multicloud.GetResourceAnchorSubscriptionServiceNameEnum(subscriptionServiceName.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.GetResourceAnchor(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *MulticloudResourceAnchorDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.CloudServiceProviderMetadataItem != nil { + cloudServiceProviderMetadataItemArray := []interface{}{} + if cloudServiceProviderMetadataItemMap := CloudServiceProviderMetadataItemToMap(&s.Res.CloudServiceProviderMetadataItem); cloudServiceProviderMetadataItemMap != nil { + cloudServiceProviderMetadataItemArray = append(cloudServiceProviderMetadataItemArray, cloudServiceProviderMetadataItemMap) + } + s.D.Set("cloud_service_provider_metadata_item", cloudServiceProviderMetadataItemArray) + } else { + s.D.Set("cloud_service_provider_metadata_item", nil) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + if s.Res.Id != nil { + s.D.Set("id", *s.Res.Id) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.LinkedCompartmentId != nil { + s.D.Set("linked_compartment_id", *s.Res.LinkedCompartmentId) + } + + if s.Res.Region != nil { + s.D.Set("region", *s.Res.Region) + } + + s.D.Set("setup_mode", s.Res.SetupMode) + + s.D.Set("lifecycle_state", s.Res.LifecycleState) + + if s.Res.SubscriptionId != nil { + s.D.Set("resource_anchor_subscription_id", *s.Res.SubscriptionId) + } + + s.D.Set("subscription_type", s.Res.SubscriptionType) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func CloudServiceProviderMetadataItemToMap(obj *oci_multicloud.CloudServiceProviderMetadataItem) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_multicloud.AwsCloudServiceProviderMetadataItem: + result["subscription_type"] = "ORACLEDBATAWS" + + if v.AccountId != nil { + result["account_id"] = string(*v.AccountId) + } + + if v.Region != nil { + result["region"] = string(*v.Region) + } + + if v.ResourceAnchorName != nil { + result["resource_anchor_name"] = string(*v.ResourceAnchorName) + } + + if v.ResourceAnchorUri != nil { + result["resource_anchor_uri"] = string(*v.ResourceAnchorUri) + } + case oci_multicloud.AzureCloudServiceProviderMetadataItem: + result["subscription_type"] = "ORACLEDBATAZURE" + + if v.ResourceGroup != nil { + result["resource_group"] = string(*v.ResourceGroup) + } + + if v.Subscription != nil { + result["subscription"] = string(*v.Subscription) + } + + if v.Region != nil { + result["region"] = string(*v.Region) + } + + if v.ResourceAnchorName != nil { + result["resource_anchor_name"] = string(*v.ResourceAnchorName) + } + + if v.ResourceAnchorUri != nil { + result["resource_anchor_uri"] = string(*v.ResourceAnchorUri) + } + case oci_multicloud.GcpCloudServiceProviderMetadataItem: + result["subscription_type"] = "ORACLEDBATGOOGLE" + + if v.ProjectNumber != nil { + result["project_number"] = string(*v.ProjectNumber) + } + + if v.Region != nil { + result["region"] = string(*v.Region) + } + + if v.ResourceAnchorName != nil { + result["resource_anchor_name"] = string(*v.ResourceAnchorName) + } + + if v.ResourceAnchorUri != nil { + result["resource_anchor_uri"] = string(*v.ResourceAnchorUri) + } + default: + log.Printf("[WARN] Received 'subscription_type' of unknown type %v", *obj) + return nil + } + + return result +} diff --git a/internal/service/multicloud/multicloud_resource_anchors_data_source.go b/internal/service/multicloud/multicloud_resource_anchors_data_source.go new file mode 100644 index 00000000000..bbcf0cfaa2f --- /dev/null +++ b/internal/service/multicloud/multicloud_resource_anchors_data_source.go @@ -0,0 +1,288 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_multicloud "github.com/oracle/oci-go-sdk/v65/multicloud" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func MulticloudResourceAnchorsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readMulticloudResourceAnchors, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "subscription_service_name": { + Type: schema.TypeString, + Required: true, + }, + "subscription_id": { + Type: schema.TypeString, + Required: true, + }, + "compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "is_compartment_id_in_subtree": { + Type: schema.TypeBool, + Optional: true, + }, + "linked_compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "lifecycle_state": { + Type: schema.TypeString, + Optional: true, + }, + "limit": { + Type: schema.TypeInt, + Optional: true, + }, + "resource_anchor_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "items": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_state": { + Type: schema.TypeString, + Computed: true, + }, + "subscription_id": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func readMulticloudResourceAnchors(d *schema.ResourceData, m interface{}) error { + sync := &MulticloudResourceAnchorsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OmhubResourceAnchorClient() + + return tfresource.ReadResource(sync) +} + +type MulticloudResourceAnchorsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_multicloud.OmhubResourceAnchorClient + Res *oci_multicloud.ListResourceAnchorsResponse +} + +func (s *MulticloudResourceAnchorsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *MulticloudResourceAnchorsDataSourceCrud) Get() error { + request := oci_multicloud.ListResourceAnchorsRequest{} + + if subscriptionServiceName, ok := s.D.GetOkExists("subscription_service_name"); ok { + request.SubscriptionServiceName = oci_multicloud.ListResourceAnchorsSubscriptionServiceNameEnum(subscriptionServiceName.(string)) + } + + if subscriptionId, ok := s.D.GetOkExists("subscription_id"); ok { + tmp := subscriptionId.(string) + request.SubscriptionId = &tmp + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if isCompartmentIdInSubtree, ok := s.D.GetOkExists("is_compartment_id_in_subtree"); ok { + tmp := isCompartmentIdInSubtree.(bool) + request.IsCompartmentIdInSubtree = &tmp + } + + if linkedCompartmentId, ok := s.D.GetOkExists("linked_compartment_id"); ok { + tmp := linkedCompartmentId.(string) + request.LinkedCompartmentId = &tmp + } + + if state, ok := s.D.GetOkExists("lifecycle_state"); ok { + request.LifecycleState = oci_multicloud.ResourceAnchorLifecycleStateEnum(state.(string)) + } + + if limit, ok := s.D.GetOkExists("limit"); ok { + tmp := limit.(int) + request.Limit = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "multicloud") + + response, err := s.Client.ListResourceAnchors(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListResourceAnchors(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 *MulticloudResourceAnchorsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("MulticloudResourceAnchorsDataSource-", MulticloudResourceAnchorsDataSource(), s.D)) + resources := []map[string]interface{}{} + resourceAnchor := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, ResourceAnchorSummaryToMap(item)) + } + resourceAnchor["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, MulticloudResourceAnchorsDataSource().Schema["resource_anchor_collection"].Elem.(*schema.Resource).Schema) + resourceAnchor["items"] = items + } + + resources = append(resources, resourceAnchor) + if err := s.D.Set("resource_anchor_collection", resources); err != nil { + return err + } + + return nil +} + +func ResourceAnchorSummaryToMap(obj oci_multicloud.ResourceAnchorSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + result["lifecycle_state"] = string(obj.LifecycleState) + + if obj.SubscriptionId != nil { + result["subscription_id"] = string(*obj.SubscriptionId) + } + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + return result +} diff --git a/internal/service/multicloud/register_datasource.go b/internal/service/multicloud/register_datasource.go new file mode 100644 index 00000000000..0ef5600657a --- /dev/null +++ b/internal/service/multicloud/register_datasource.go @@ -0,0 +1,18 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterDatasource() { + tfresource.RegisterDatasource("oci_multicloud_external_location_mapping_metadata", MulticloudExternalLocationMappingMetadataDataSource()) + tfresource.RegisterDatasource("oci_multicloud_external_location_summaries_metadata", MulticloudExternalLocationSummariesMetadataDataSource()) + tfresource.RegisterDatasource("oci_multicloud_external_locations_metadata", MulticloudExternalLocationsMetadataDataSource()) + tfresource.RegisterDatasource("oci_multicloud_network_anchor", MulticloudNetworkAnchorDataSource()) + tfresource.RegisterDatasource("oci_multicloud_network_anchors", MulticloudNetworkAnchorsDataSource()) + tfresource.RegisterDatasource("oci_multicloud_om_hub_multi_cloud_metadata", MulticloudOmHubMultiCloudMetadataDataSource()) + tfresource.RegisterDatasource("oci_multicloud_om_hub_multi_clouds_metadata", MulticloudOmHubMultiCloudsMetadataDataSource()) + tfresource.RegisterDatasource("oci_multicloud_resource_anchor", MulticloudResourceAnchorDataSource()) + tfresource.RegisterDatasource("oci_multicloud_resource_anchors", MulticloudResourceAnchorsDataSource()) +} diff --git a/internal/service/multicloud/register_resource.go b/internal/service/multicloud/register_resource.go new file mode 100644 index 00000000000..b5715eb7b00 --- /dev/null +++ b/internal/service/multicloud/register_resource.go @@ -0,0 +1,7 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package multicloud + +func RegisterResource() { +} diff --git a/internal/service/ocvp/ocvp_cluster_data_source.go b/internal/service/ocvp/ocvp_cluster_data_source.go index 3f3b0ec9745..9685e7f7b5c 100644 --- a/internal/service/ocvp/ocvp_cluster_data_source.go +++ b/internal/service/ocvp/ocvp_cluster_data_source.go @@ -78,6 +78,8 @@ func (s *OcvpClusterDataSourceCrud) SetData() error { s.D.Set("compute_availability_domain", *s.Res.ComputeAvailabilityDomain) } + s.D.Set("datastore_cluster_ids", s.Res.DatastoreClusterIds) + datastores := []interface{}{} for _, item := range s.Res.Datastores { datastores = append(datastores, DatastoreDetailsToMap(item)) diff --git a/internal/service/ocvp/ocvp_cluster_resource.go b/internal/service/ocvp/ocvp_cluster_resource.go index 1dc36657487..bb934c2f70d 100644 --- a/internal/service/ocvp/ocvp_cluster_resource.go +++ b/internal/service/ocvp/ocvp_cluster_resource.go @@ -216,6 +216,22 @@ func OcvpClusterResource() *schema.Resource { Computed: true, ForceNew: true, }, + "attach_datastore_cluster_ids": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + ConflictsWith: []string{"datastores"}, + }, + "detach_datastore_cluster_ids": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + ConflictsWith: []string{"datastores"}, + }, // Computed "actual_esxi_hosts_count": { @@ -284,6 +300,13 @@ func OcvpClusterResource() *schema.Resource { }, }, }, + "datastore_cluster_ids": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, }, } } @@ -310,6 +333,7 @@ func updateOcvpCluster(d *schema.ResourceData, m interface{}) error { sync.D = d sync.Client = m.(*client.OracleClients).ClusterClient() sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + sync.DatastoreClusterClient = m.(*client.OracleClients).DatastoreClusterClient() return tfresource.UpdateResource(d, sync) } @@ -330,6 +354,7 @@ type OcvpClusterResourceCrud struct { Res *oci_ocvp.Cluster DisableNotFoundRetries bool WorkRequestClient *oci_ocvp.WorkRequestClient + DatastoreClusterClient *oci_ocvp.DatastoreClusterClient } func (s *OcvpClusterResourceCrud) ID() string { @@ -373,6 +398,19 @@ func (s *OcvpClusterResourceCrud) Create() error { request.ComputeAvailabilityDomain = &tmp } + if datastoreClusterIds, ok := s.D.GetOkExists("attach_datastore_cluster_ids"); ok { + interfaces := datastoreClusterIds.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("attach_datastore_cluster_ids") { + request.DatastoreClusterIds = tmp + } + } + if datastores, ok := s.D.GetOkExists("datastores"); ok { interfaces := datastores.([]interface{}) tmp := make([]oci_ocvp.DatastoreInfo, len(interfaces)) @@ -673,13 +711,15 @@ func (s *OcvpClusterResourceCrud) Update() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") - response, err := s.Client.UpdateCluster(context.Background(), request) + _, err := s.Client.UpdateCluster(context.Background(), request) if err != nil { return err } - s.Res = &response.Cluster - return nil + if err = s.executeAttachDetachDatastoreClustersToCluster(); err != nil { + return err + } + return s.Get() } func (s *OcvpClusterResourceCrud) Delete() error { @@ -715,11 +755,7 @@ func (s *OcvpClusterResourceCrud) SetData() error { s.D.Set("compute_availability_domain", *s.Res.ComputeAvailabilityDomain) } - datastores := []interface{}{} - for _, item := range s.Res.Datastores { - datastores = append(datastores, DatastoreDetailsToMap(item)) - } - s.D.Set("datastores", datastores) + s.D.Set("datastore_cluster_ids", s.Res.DatastoreClusterIds) if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) @@ -1057,3 +1093,61 @@ func VsphereUpgradeObjectToMap(obj oci_ocvp.VsphereUpgradeObject) map[string]int return result } + +func (s *OcvpClusterResourceCrud) executeAttachDetachDatastoreClustersToCluster() error { + var datastoreClusterIdsToDetach []string + var datastoreClusterIdsToAttach []string + if tmp, ok := s.D.GetOk("detach_datastore_cluster_ids"); ok && s.D.HasChange("detach_datastore_cluster_ids") { + datastoreClusterIdsToDetach = castToSliceOfStrings(tmp) + log.Printf("[DEBUG] datastore_cluster_ids requested to be detached: %v", datastoreClusterIdsToDetach) + } + if tmp, ok := s.D.GetOk("attach_datastore_cluster_ids"); ok && s.D.HasChange("attach_datastore_cluster_ids") { + datastoreClusterIdsToAttach = castToSliceOfStrings(tmp) + log.Printf("[DEBUG] datastore_cluster_ids requested to be attached: %v", datastoreClusterIdsToAttach) + } + for _, datastoreClusterId := range datastoreClusterIdsToDetach { + log.Printf("[DEBUG] detaching datastore cluster %v", datastoreClusterId) + if err := s.detachDatastoreClusterFromCluster(datastoreClusterId); err != nil { + return err + } + } + for _, datastoreClusterId := range datastoreClusterIdsToAttach { + log.Printf("[DEBUG] attaching datastore cluster %v", datastoreClusterId) + if err := s.attachDatastoreClusterToCluster(datastoreClusterId); err != nil { + return err + } + } + return nil +} + +func (s *OcvpClusterResourceCrud) attachDatastoreClusterToCluster(datastoreClusterId string) error { + clusterId := s.D.Id() + request := oci_ocvp.AttachDatastoreClusterToClusterRequest{ + DatastoreClusterId: &datastoreClusterId, + AttachDatastoreClusterToClusterDetails: oci_ocvp.AttachDatastoreClusterToClusterDetails{ + ClusterId: &clusterId, + }, + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + response, err := s.DatastoreClusterClient.AttachDatastoreClusterToCluster(context.Background(), request) + if err != nil { + return err + } + _, err = datastoreClusterWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore-cluster", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), + s.DisableNotFoundRetries, s.WorkRequestClient) + return err +} + +func (s *OcvpClusterResourceCrud) detachDatastoreClusterFromCluster(datastoreClusterId string) error { + request := oci_ocvp.DetachDatastoreClusterFromClusterRequest{ + DatastoreClusterId: &datastoreClusterId, + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + response, err := s.DatastoreClusterClient.DetachDatastoreClusterFromCluster(context.Background(), request) + if err != nil { + return err + } + _, err = datastoreClusterWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore-cluster", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), + s.DisableNotFoundRetries, s.WorkRequestClient) + return err +} diff --git a/internal/service/ocvp/ocvp_datastore_cluster_data_source.go b/internal/service/ocvp/ocvp_datastore_cluster_data_source.go new file mode 100644 index 00000000000..4cb1ec57408 --- /dev/null +++ b/internal/service/ocvp/ocvp_datastore_cluster_data_source.go @@ -0,0 +1,120 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package ocvp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func OcvpDatastoreClusterDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["datastore_cluster_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(OcvpDatastoreClusterResource(), fieldMap, readSingularOcvpDatastoreCluster) +} + +func readSingularOcvpDatastoreCluster(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreClusterDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClusterClient() + + return tfresource.ReadResource(sync) +} + +type OcvpDatastoreClusterDataSourceCrud struct { + D *schema.ResourceData + Client *oci_ocvp.DatastoreClusterClient + Res *oci_ocvp.GetDatastoreClusterResponse +} + +func (s *OcvpDatastoreClusterDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *OcvpDatastoreClusterDataSourceCrud) Get() error { + request := oci_ocvp.GetDatastoreClusterRequest{} + + if datastoreClusterId, ok := s.D.GetOkExists("datastore_cluster_id"); ok { + tmp := datastoreClusterId.(string) + request.DatastoreClusterId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "ocvp") + + response, err := s.Client.GetDatastoreCluster(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *OcvpDatastoreClusterDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + + if s.Res.CapacityInGBs != nil { + s.D.Set("capacity_in_gbs", *s.Res.CapacityInGBs) + } + + if s.Res.ClusterId != nil { + s.D.Set("cluster_id", *s.Res.ClusterId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + s.D.Set("datastore_cluster_type", s.Res.DatastoreClusterType) + + s.D.Set("datastore_ids", s.Res.DatastoreIds) + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("esxi_host_ids", s.Res.EsxiHostIds) + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.SddcId != nil { + s.D.Set("sddc_id", *s.Res.SddcId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} diff --git a/internal/service/ocvp/ocvp_datastore_cluster_resource.go b/internal/service/ocvp/ocvp_datastore_cluster_resource.go new file mode 100644 index 00000000000..2675c8761ce --- /dev/null +++ b/internal/service/ocvp/ocvp_datastore_cluster_resource.go @@ -0,0 +1,674 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package ocvp + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func OcvpDatastoreClusterResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createOcvpDatastoreCluster, + Read: readOcvpDatastoreCluster, + Update: updateOcvpDatastoreCluster, + Delete: deleteOcvpDatastoreCluster, + Schema: map[string]*schema.Schema{ + // Required + "availability_domain": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + }, + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "datastore_cluster_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "display_name": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "datastore_ids": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + + // Computed + "capacity_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, + "cluster_id": { + Type: schema.TypeString, + Computed: true, + }, + "esxi_host_ids": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "sddc_id": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createOcvpDatastoreCluster(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreClusterResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClusterClient() + sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + + return tfresource.CreateResource(d, sync) +} + +func readOcvpDatastoreCluster(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreClusterResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClusterClient() + + return tfresource.ReadResource(sync) +} + +func updateOcvpDatastoreCluster(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreClusterResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClusterClient() + sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteOcvpDatastoreCluster(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreClusterResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClusterClient() + sync.DisableNotFoundRetries = true + sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + + return tfresource.DeleteResource(d, sync) +} + +type OcvpDatastoreClusterResourceCrud struct { + tfresource.BaseCrud + Client *oci_ocvp.DatastoreClusterClient + Res *oci_ocvp.DatastoreCluster + DisableNotFoundRetries bool + WorkRequestClient *oci_ocvp.WorkRequestClient +} + +func (s *OcvpDatastoreClusterResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *OcvpDatastoreClusterResourceCrud) CreatedPending() []string { + return []string{ + string(oci_ocvp.LifecycleStatesCreating), + } +} + +func (s *OcvpDatastoreClusterResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_ocvp.LifecycleStatesActive), + } +} + +func (s *OcvpDatastoreClusterResourceCrud) DeletedPending() []string { + return []string{ + string(oci_ocvp.LifecycleStatesDeleting), + } +} + +func (s *OcvpDatastoreClusterResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_ocvp.LifecycleStatesDeleted), + } +} + +func (s *OcvpDatastoreClusterResourceCrud) Create() error { + request := oci_ocvp.CreateDatastoreClusterRequest{} + + if availabilityDomain, ok := s.D.GetOkExists("availability_domain"); ok { + tmp := availabilityDomain.(string) + request.AvailabilityDomain = &tmp + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if datastoreClusterType, ok := s.D.GetOkExists("datastore_cluster_type"); ok { + request.DatastoreClusterType = oci_ocvp.DatastoreClusterTypesEnum(datastoreClusterType.(string)) + } + + if datastoreIds, ok := s.D.GetOkExists("datastore_ids"); ok { + interfaces := datastoreIds.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("datastore_ids") { + request.DatastoreIds = tmp + } + } + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.CreateDatastoreCluster(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + workRequestResponse := oci_ocvp.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkRequestClient.GetWorkRequest(context.Background(), + oci_ocvp.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "sddc-datastore-cluster") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } + return s.getDatastoreClusterFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), oci_ocvp.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *OcvpDatastoreClusterResourceCrud) getDatastoreClusterFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_ocvp.ActionTypesEnum, timeout time.Duration) error { + + // Wait until it finishes + datastoreClusterId, err := datastoreClusterWaitForWorkRequest(workId, "sddc-datastore-cluster", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.WorkRequestClient) + + if err != nil { + return err + } + s.D.SetId(*datastoreClusterId) + + return s.Get() +} + +func datastoreClusterWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { + startTime := time.Now() + stopTime := startTime.Add(timeout) + return func(response oci_common.OCIOperationResponse) bool { + + // Stop after timeout has elapsed + if time.Now().After(stopTime) { + return false + } + + // Make sure we stop on default rules + if tfresource.ShouldRetry(response, false, "ocvp", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_ocvp.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func datastoreClusterWaitForWorkRequest(wId *string, entityType string, action oci_ocvp.ActionTypesEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_ocvp.WorkRequestClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "ocvp") + retryPolicy.ShouldRetryOperation = datastoreClusterWorkRequestShouldRetryFunc(timeout) + + response := oci_ocvp.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_ocvp.OperationStatusInProgress), + string(oci_ocvp.OperationStatusAccepted), + string(oci_ocvp.OperationStatusCanceling), + }, + Target: []string{ + string(oci_ocvp.OperationStatusSucceeded), + string(oci_ocvp.OperationStatusFailed), + string(oci_ocvp.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_ocvp.GetWorkRequestRequest{ + WorkRequestId: wId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + wr := &response.WorkRequest + return wr, string(wr.Status), err + }, + Timeout: timeout, + } + if _, e := stateConf.WaitForState(); e != nil { + return nil, e + } + + var identifier *string + // The work request response contains an array of objects that finished the operation + for _, res := range response.Resources { + if strings.Contains(strings.ToLower(*res.EntityType), entityType) { + if res.ActionType == action { + identifier = res.Identifier + break + } + } + } + + // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled + if identifier == nil || response.Status == oci_ocvp.OperationStatusFailed || response.Status == oci_ocvp.OperationStatusCanceled { + return nil, getErrorFromOcvpDatastoreClusterWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromOcvpDatastoreClusterWorkRequest(client *oci_ocvp.WorkRequestClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_ocvp.ActionTypesEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_ocvp.ListWorkRequestErrorsRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return err + } + + allErrs := make([]string, 0) + for _, wrkErr := range response.Items { + allErrs = append(allErrs, *wrkErr.Message) + } + errorMessage := strings.Join(allErrs, "\n") + + workRequestErr := fmt.Errorf("work request did not succeed, workId: %s, entity: %s, action: %s. Message: %s", *workId, entityType, action, errorMessage) + + return workRequestErr +} + +func (s *OcvpDatastoreClusterResourceCrud) Get() error { + request := oci_ocvp.GetDatastoreClusterRequest{} + + tmp := s.D.Id() + request.DatastoreClusterId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.GetDatastoreCluster(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.DatastoreCluster + return nil +} + +func (s *OcvpDatastoreClusterResourceCrud) Update() error { + if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { + oldRaw, newRaw := s.D.GetChange("compartment_id") + if newRaw != "" && oldRaw != "" { + err := s.updateCompartment(compartment) + if err != nil { + return err + } + } + } + request := oci_ocvp.UpdateDatastoreClusterRequest{} + + tmp := s.D.Id() + request.DatastoreClusterId = &tmp + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.UpdateDatastoreCluster(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + err = s.getDatastoreClusterFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + + var datastoreIdsToRemove []string + var datastoreIdsToAdd []string + if s.D.HasChange("datastore_ids") { + oldDatastoreIds, newDatastoreIds := s.D.GetChange("datastore_ids") + log.Printf("[DEBUG] datastore_ids have been updated in config from %v to %v", oldDatastoreIds, newDatastoreIds) + datastoreIdsToRemove, datastoreIdsToAdd = compareSlices(castToSliceOfStrings(oldDatastoreIds), castToSliceOfStrings(newDatastoreIds)) + log.Printf("[DEBUG] datastore_ids to remove: %v; datastore_ids to add: %v", datastoreIdsToRemove, datastoreIdsToAdd) + } + + if len(datastoreIdsToRemove) > 0 { + log.Printf("[DEBUG] removing datastores %v", datastoreIdsToRemove) + if err = s.removeDatastore(datastoreIdsToRemove); err != nil { + return err + } + } + + if len(datastoreIdsToAdd) > 0 { + log.Printf("[DEBUG] adding datastores %v", datastoreIdsToAdd) + if err = s.addDatastore(datastoreIdsToAdd); err != nil { + return err + } + } + return s.Get() +} + +func castToSliceOfStrings(untypedInput interface{}) []string { + if untypedInput == nil { + return []string{} + } + sliceOfUntyped := untypedInput.([]interface{}) + sliceOfStrings := make([]string, 0, len(sliceOfUntyped)) + for _, untypedElement := range sliceOfUntyped { + sliceOfStrings = append(sliceOfStrings, untypedElement.(string)) + } + return sliceOfStrings +} + +func (s *OcvpDatastoreClusterResourceCrud) Delete() error { + // Cannot delete datastore cluster with datastores. So remove them first. + if datastoreIds, hasDatastores := s.D.GetOk("datastore_ids"); hasDatastores { + if err := s.removeDatastore(castToSliceOfStrings(datastoreIds)); err != nil { + return err + } + + } + + tmp := s.D.Id() + request := oci_ocvp.DeleteDatastoreClusterRequest{} + + request.DatastoreClusterId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.DeleteDatastoreCluster(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := datastoreClusterWaitForWorkRequest(workId, "sddc-datastore-cluster", + oci_ocvp.ActionTypesDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.WorkRequestClient) + return delWorkRequestErr +} + +func (s *OcvpDatastoreClusterResourceCrud) SetData() error { + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + + if s.Res.CapacityInGBs != nil { + s.D.Set("capacity_in_gbs", *s.Res.CapacityInGBs) + } + + if s.Res.ClusterId != nil { + s.D.Set("cluster_id", *s.Res.ClusterId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + s.D.Set("datastore_cluster_type", s.Res.DatastoreClusterType) + + s.D.Set("datastore_ids", s.Res.DatastoreIds) + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("esxi_host_ids", s.Res.EsxiHostIds) + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.SddcId != nil { + s.D.Set("sddc_id", *s.Res.SddcId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func DatastoreClusterSummaryToMap(obj oci_ocvp.DatastoreClusterSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.AvailabilityDomain != nil { + result["availability_domain"] = string(*obj.AvailabilityDomain) + } + + if obj.CapacityInGBs != nil { + result["capacity_in_gbs"] = float64(*obj.CapacityInGBs) + } + + if obj.ClusterId != nil { + result["cluster_id"] = string(*obj.ClusterId) + } + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + result["datastore_cluster_type"] = string(obj.DatastoreClusterType) + + result["datastore_ids"] = obj.DatastoreIds + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + result["esxi_host_ids"] = obj.EsxiHostIds + + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.SddcId != nil { + result["sddc_id"] = string(*obj.SddcId) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + return result +} + +func (s *OcvpDatastoreClusterResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_ocvp.ChangeDatastoreClusterCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.DatastoreClusterId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + _, err := s.Client.ChangeDatastoreClusterCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + return waitErr + } + + return nil +} + +func (s *OcvpDatastoreClusterResourceCrud) addDatastore(datastoreId []string) error { + datastoreClusterId := s.D.Id() + request := oci_ocvp.AddDatastoreToDatastoreClusterRequest{ + DatastoreClusterId: &datastoreClusterId, + AddDatastoreToDatastoreClusterDetails: oci_ocvp.AddDatastoreToDatastoreClusterDetails{ + DatastoreIds: datastoreId, + }, + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + response, err := s.Client.AddDatastoreToDatastoreCluster(context.Background(), request) + if err != nil { + return err + } + _, err = datastoreClusterWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore-cluster", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), + s.DisableNotFoundRetries, s.WorkRequestClient) + return err +} + +func (s *OcvpDatastoreClusterResourceCrud) removeDatastore(datastoreId []string) error { + datastoreClusterId := s.D.Id() + request := oci_ocvp.RemoveDatastoreFromDatastoreClusterRequest{ + DatastoreClusterId: &datastoreClusterId, + RemoveDatastoreFromDatastoreClusterDetails: oci_ocvp.RemoveDatastoreFromDatastoreClusterDetails{ + DatastoreIds: datastoreId, + }, + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + response, err := s.Client.RemoveDatastoreFromDatastoreCluster(context.Background(), request) + if err != nil { + return err + } + _, err = datastoreClusterWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore-cluster", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), + s.DisableNotFoundRetries, s.WorkRequestClient) + return err +} diff --git a/internal/service/ocvp/ocvp_datastore_clusters_data_source.go b/internal/service/ocvp/ocvp_datastore_clusters_data_source.go new file mode 100644 index 00000000000..59bb8fe66c5 --- /dev/null +++ b/internal/service/ocvp/ocvp_datastore_clusters_data_source.go @@ -0,0 +1,153 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package ocvp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func OcvpDatastoreClustersDataSource() *schema.Resource { + return &schema.Resource{ + Read: readOcvpDatastoreClusters, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "cluster_id": { + Type: schema.TypeString, + Optional: true, + }, + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "datastore_cluster_id": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "datastore_cluster_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(OcvpDatastoreClusterResource()), + }, + }, + }, + }, + }, + } +} + +func readOcvpDatastoreClusters(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreClustersDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClusterClient() + + return tfresource.ReadResource(sync) +} + +type OcvpDatastoreClustersDataSourceCrud struct { + D *schema.ResourceData + Client *oci_ocvp.DatastoreClusterClient + Res *oci_ocvp.ListDatastoreClustersResponse +} + +func (s *OcvpDatastoreClustersDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *OcvpDatastoreClustersDataSourceCrud) Get() error { + request := oci_ocvp.ListDatastoreClustersRequest{} + + if clusterId, ok := s.D.GetOkExists("cluster_id"); ok { + tmp := clusterId.(string) + request.ClusterId = &tmp + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if datastoreClusterId, ok := s.D.GetOkExists("id"); ok { + tmp := datastoreClusterId.(string) + request.DatastoreClusterId = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_ocvp.ListDatastoreClustersLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "ocvp") + + response, err := s.Client.ListDatastoreClusters(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListDatastoreClusters(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 *OcvpDatastoreClustersDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("OcvpDatastoreClustersDataSource-", OcvpDatastoreClustersDataSource(), s.D)) + resources := []map[string]interface{}{} + datastoreCluster := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, DatastoreClusterSummaryToMap(item)) + } + datastoreCluster["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, OcvpDatastoreClustersDataSource().Schema["datastore_cluster_collection"].Elem.(*schema.Resource).Schema) + datastoreCluster["items"] = items + } + + resources = append(resources, datastoreCluster) + if err := s.D.Set("datastore_cluster_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/ocvp/ocvp_datastore_data_source.go b/internal/service/ocvp/ocvp_datastore_data_source.go new file mode 100644 index 00000000000..78f39684a3c --- /dev/null +++ b/internal/service/ocvp/ocvp_datastore_data_source.go @@ -0,0 +1,122 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package ocvp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func OcvpDatastoreDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["datastore_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(OcvpDatastoreResource(), fieldMap, readSingularOcvpDatastore) +} + +func readSingularOcvpDatastore(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClient() + + return tfresource.ReadResource(sync) +} + +type OcvpDatastoreDataSourceCrud struct { + D *schema.ResourceData + Client *oci_ocvp.DatastoreClient + Res *oci_ocvp.GetDatastoreResponse +} + +func (s *OcvpDatastoreDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *OcvpDatastoreDataSourceCrud) Get() error { + request := oci_ocvp.GetDatastoreRequest{} + + if datastoreId, ok := s.D.GetOkExists("datastore_id"); ok { + tmp := datastoreId.(string) + request.DatastoreId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "ocvp") + + response, err := s.Client.GetDatastore(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *OcvpDatastoreDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + + blockVolumeDetails := []interface{}{} + for _, item := range s.Res.BlockVolumeDetails { + blockVolumeDetails = append(blockVolumeDetails, BlockVolumeDetailsToMap(item)) + } + s.D.Set("block_volume_details", blockVolumeDetails) + + s.D.Set("block_volume_ids", s.Res.BlockVolumeIds) + + if s.Res.CapacityInGBs != nil { + s.D.Set("capacity_in_gbs", *s.Res.CapacityInGBs) + } + + if s.Res.ClusterId != nil { + s.D.Set("cluster_id", *s.Res.ClusterId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.SddcId != nil { + s.D.Set("sddc_id", *s.Res.SddcId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} diff --git a/internal/service/ocvp/ocvp_datastore_resource.go b/internal/service/ocvp/ocvp_datastore_resource.go new file mode 100644 index 00000000000..fe2d06b6af2 --- /dev/null +++ b/internal/service/ocvp/ocvp_datastore_resource.go @@ -0,0 +1,726 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package ocvp + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func OcvpDatastoreResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createOcvpDatastore, + Read: readOcvpDatastore, + Update: updateOcvpDatastore, + Delete: deleteOcvpDatastore, + Schema: map[string]*schema.Schema{ + // Required + "availability_domain": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + }, + "block_volume_ids": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "display_name": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + + // Computed + "block_volume_details": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "attachments": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "esxi_host_id": { + Type: schema.TypeString, + Computed: true, + }, + "ip_address": { + Type: schema.TypeString, + Computed: true, + }, + "port": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + "iqn": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "capacity_in_gbs": { + Type: schema.TypeFloat, + Computed: true, + }, + "cluster_id": { + Type: schema.TypeString, + Computed: true, + }, + "sddc_id": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createOcvpDatastore(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClient() + sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + + return tfresource.CreateResource(d, sync) +} + +func readOcvpDatastore(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClient() + + return tfresource.ReadResource(sync) +} + +func updateOcvpDatastore(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClient() + sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteOcvpDatastore(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoreResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClient() + sync.DisableNotFoundRetries = true + sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + + return tfresource.DeleteResource(d, sync) +} + +type OcvpDatastoreResourceCrud struct { + tfresource.BaseCrud + Client *oci_ocvp.DatastoreClient + Res *oci_ocvp.Datastore + DisableNotFoundRetries bool + WorkRequestClient *oci_ocvp.WorkRequestClient +} + +func (s *OcvpDatastoreResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *OcvpDatastoreResourceCrud) CreatedPending() []string { + return []string{ + string(oci_ocvp.LifecycleStatesCreating), + } +} + +func (s *OcvpDatastoreResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_ocvp.LifecycleStatesActive), + } +} + +func (s *OcvpDatastoreResourceCrud) DeletedPending() []string { + return []string{ + string(oci_ocvp.LifecycleStatesDeleting), + } +} + +func (s *OcvpDatastoreResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_ocvp.LifecycleStatesDeleted), + } +} + +func (s *OcvpDatastoreResourceCrud) Create() error { + request := oci_ocvp.CreateDatastoreRequest{} + + if availabilityDomain, ok := s.D.GetOkExists("availability_domain"); ok { + tmp := availabilityDomain.(string) + request.AvailabilityDomain = &tmp + } + + if blockVolumeIds, ok := s.D.GetOkExists("block_volume_ids"); ok { + interfaces := blockVolumeIds.([]interface{}) + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("block_volume_ids") { + request.BlockVolumeIds = tmp + } + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.CreateDatastore(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + workRequestResponse := oci_ocvp.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkRequestClient.GetWorkRequest(context.Background(), + oci_ocvp.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "sddc-datastore") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } + return s.getDatastoreFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), oci_ocvp.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *OcvpDatastoreResourceCrud) getDatastoreFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_ocvp.ActionTypesEnum, timeout time.Duration) error { + + // Wait until it finishes + datastoreId, err := datastoreWaitForWorkRequest(workId, "sddc-datastore", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.WorkRequestClient) + + if err != nil { + return err + } + s.D.SetId(*datastoreId) + + return s.Get() +} + +func datastoreWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { + startTime := time.Now() + stopTime := startTime.Add(timeout) + return func(response oci_common.OCIOperationResponse) bool { + + // Stop after timeout has elapsed + if time.Now().After(stopTime) { + return false + } + + // Make sure we stop on default rules + if tfresource.ShouldRetry(response, false, "ocvp", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_ocvp.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func datastoreWaitForWorkRequest(wId *string, entityType string, action oci_ocvp.ActionTypesEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_ocvp.WorkRequestClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "ocvp") + retryPolicy.ShouldRetryOperation = datastoreWorkRequestShouldRetryFunc(timeout) + + response := oci_ocvp.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_ocvp.OperationStatusInProgress), + string(oci_ocvp.OperationStatusAccepted), + string(oci_ocvp.OperationStatusCanceling), + }, + Target: []string{ + string(oci_ocvp.OperationStatusSucceeded), + string(oci_ocvp.OperationStatusFailed), + string(oci_ocvp.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_ocvp.GetWorkRequestRequest{ + WorkRequestId: wId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + wr := &response.WorkRequest + return wr, string(wr.Status), err + }, + Timeout: timeout, + } + if _, e := stateConf.WaitForState(); e != nil { + return nil, e + } + + var identifier *string + // The work request response contains an array of objects that finished the operation + for _, res := range response.Resources { + if strings.Contains(strings.ToLower(*res.EntityType), entityType) { + if res.ActionType == action { + identifier = res.Identifier + break + } + } + } + + // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled + if identifier == nil || response.Status == oci_ocvp.OperationStatusFailed || response.Status == oci_ocvp.OperationStatusCanceled { + return nil, getErrorFromOcvpDatastoreWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromOcvpDatastoreWorkRequest(client *oci_ocvp.WorkRequestClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_ocvp.ActionTypesEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_ocvp.ListWorkRequestErrorsRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return err + } + + allErrs := make([]string, 0) + for _, wrkErr := range response.Items { + allErrs = append(allErrs, *wrkErr.Message) + } + errorMessage := strings.Join(allErrs, "\n") + + workRequestErr := fmt.Errorf("work request did not succeed, workId: %s, entity: %s, action: %s. Message: %s", *workId, entityType, action, errorMessage) + + return workRequestErr +} + +func (s *OcvpDatastoreResourceCrud) Get() error { + request := oci_ocvp.GetDatastoreRequest{} + + tmp := s.D.Id() + request.DatastoreId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.GetDatastore(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.Datastore + return nil +} + +func (s *OcvpDatastoreResourceCrud) Update() error { + var blockVolumeIdsToRemove []string + var blockVolumeIdsToAdd []string + if s.D.HasChange("block_volume_ids") { + oldBvIds, newBvIds := s.D.GetChange("block_volume_ids") + log.Printf("[DEBUG] block_volume_ids has been updated in config from %v to %v", oldBvIds, newBvIds) + blockVolumeIdsToRemove, blockVolumeIdsToAdd = compareSlices(castToSliceOfStrings(oldBvIds), castToSliceOfStrings(newBvIds)) + log.Printf("[DEBUG] block volumes to remove: %v; block volumes to add: %v", blockVolumeIdsToRemove, blockVolumeIdsToAdd) + } + + if len(blockVolumeIdsToRemove) > 0 { + return fmt.Errorf("Block volumes cannot be removed from datastore. Please consider tainting/replacing the datastore if needed") + } + + if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { + oldRaw, newRaw := s.D.GetChange("compartment_id") + if newRaw != "" && oldRaw != "" { + err := s.updateCompartment(compartment) + if err != nil { + return err + } + } + } + request := oci_ocvp.UpdateDatastoreRequest{} + + datastoreId := s.D.Id() + request.DatastoreId = &datastoreId + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.UpdateDatastore(context.Background(), request) + if err != nil { + return err + } + + _, err = datastoreWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries, s.WorkRequestClient) + if err != nil { + return err + } + + for _, blockVolumeId := range blockVolumeIdsToAdd { + log.Printf("[DEBUG] adding block volume %v", blockVolumeId) + err = s.addBlockVolume(blockVolumeId) + if err != nil { + return err + } + } + return s.Get() +} + +func compareSlices(old []string, new []string) (toRemove []string, toAdd []string) { + oldSet := make(map[string]struct{}) + newSet := make(map[string]struct{}) + for _, item := range old { + oldSet[item] = struct{}{} + } + for _, item := range new { + newSet[item] = struct{}{} + } + for _, item := range old { + if _, ok := newSet[item]; !ok { + toRemove = append(toRemove, item) + } + } + for _, item := range new { + if _, ok := oldSet[item]; !ok { + toAdd = append(toAdd, item) + } + } + return +} + +func (s *OcvpDatastoreResourceCrud) Delete() error { + request := oci_ocvp.DeleteDatastoreRequest{} + + tmp := s.D.Id() + request.DatastoreId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + response, err := s.Client.DeleteDatastore(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := datastoreWaitForWorkRequest(workId, "sddc-datastore", + oci_ocvp.ActionTypesDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.WorkRequestClient) + return delWorkRequestErr +} + +func (s *OcvpDatastoreResourceCrud) SetData() error { + if s.Res.AvailabilityDomain != nil { + s.D.Set("availability_domain", *s.Res.AvailabilityDomain) + } + + blockVolumeDetails := []interface{}{} + for _, item := range s.Res.BlockVolumeDetails { + blockVolumeDetails = append(blockVolumeDetails, BlockVolumeDetailsToMap(item)) + } + s.D.Set("block_volume_details", blockVolumeDetails) + + s.D.Set("block_volume_ids", s.Res.BlockVolumeIds) + + if s.Res.CapacityInGBs != nil { + s.D.Set("capacity_in_gbs", *s.Res.CapacityInGBs) + } + + if s.Res.ClusterId != nil { + s.D.Set("cluster_id", *s.Res.ClusterId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.SddcId != nil { + s.D.Set("sddc_id", *s.Res.SddcId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func BlockVolumeAttachmentToMap(obj oci_ocvp.BlockVolumeAttachment) map[string]interface{} { + result := map[string]interface{}{} + + if obj.EsxiHostId != nil { + result["esxi_host_id"] = string(*obj.EsxiHostId) + } + + if obj.IpAddress != nil { + result["ip_address"] = string(*obj.IpAddress) + } + + if obj.Port != nil { + result["port"] = int(*obj.Port) + } + + return result +} + +func BlockVolumeDetailsToMap(obj oci_ocvp.BlockVolumeDetails) map[string]interface{} { + result := map[string]interface{}{} + + attachments := []interface{}{} + for _, item := range obj.Attachments { + attachments = append(attachments, BlockVolumeAttachmentToMap(item)) + } + result["attachments"] = attachments + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.Iqn != nil { + result["iqn"] = string(*obj.Iqn) + } + + return result +} + +func DatastoreSummaryToMap(obj oci_ocvp.DatastoreSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.AvailabilityDomain != nil { + result["availability_domain"] = string(*obj.AvailabilityDomain) + } + + blockVolumeDetails := []interface{}{} + for _, item := range obj.BlockVolumeDetails { + blockVolumeDetails = append(blockVolumeDetails, BlockVolumeDetailsToMap(item)) + } + result["block_volume_details"] = blockVolumeDetails + + result["block_volume_ids"] = obj.BlockVolumeIds + + if obj.CapacityInGBs != nil { + result["capacity_in_gbs"] = float64(*obj.CapacityInGBs) + } + + if obj.ClusterId != nil { + result["cluster_id"] = string(*obj.ClusterId) + } + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.SddcId != nil { + result["sddc_id"] = string(*obj.SddcId) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + return result +} + +func (s *OcvpDatastoreResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_ocvp.ChangeDatastoreCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.DatastoreId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + + _, err := s.Client.ChangeDatastoreCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + return waitErr + } + + return nil +} + +func (s *OcvpDatastoreResourceCrud) addBlockVolume(blockVolumeId string) error { + datastoreId := s.D.Id() + request := oci_ocvp.AddBlockVolumeToDatastoreRequest{ + DatastoreId: &datastoreId, + AddBlockVolumeToDatastoreDetails: oci_ocvp.AddBlockVolumeToDatastoreDetails{ + BlockVolumeId: &blockVolumeId, + }, + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + response, err := s.Client.AddBlockVolumeToDatastore(context.Background(), request) + if err != nil { + return err + } + _, err = datastoreWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries, s.WorkRequestClient) + return err +} diff --git a/internal/service/ocvp/ocvp_datastores_data_source.go b/internal/service/ocvp/ocvp_datastores_data_source.go new file mode 100644 index 00000000000..10ff3b87637 --- /dev/null +++ b/internal/service/ocvp/ocvp_datastores_data_source.go @@ -0,0 +1,153 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package ocvp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_ocvp "github.com/oracle/oci-go-sdk/v65/ocvp" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func OcvpDatastoresDataSource() *schema.Resource { + return &schema.Resource{ + Read: readOcvpDatastores, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "cluster_id": { + Type: schema.TypeString, + Optional: true, + }, + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "datastore_id": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "datastore_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(OcvpDatastoreResource()), + }, + }, + }, + }, + }, + } +} + +func readOcvpDatastores(d *schema.ResourceData, m interface{}) error { + sync := &OcvpDatastoresDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatastoreClient() + + return tfresource.ReadResource(sync) +} + +type OcvpDatastoresDataSourceCrud struct { + D *schema.ResourceData + Client *oci_ocvp.DatastoreClient + Res *oci_ocvp.ListDatastoresResponse +} + +func (s *OcvpDatastoresDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *OcvpDatastoresDataSourceCrud) Get() error { + request := oci_ocvp.ListDatastoresRequest{} + + if clusterId, ok := s.D.GetOkExists("cluster_id"); ok { + tmp := clusterId.(string) + request.ClusterId = &tmp + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if datastoreId, ok := s.D.GetOkExists("id"); ok { + tmp := datastoreId.(string) + request.DatastoreId = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_ocvp.ListDatastoresLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "ocvp") + + response, err := s.Client.ListDatastores(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListDatastores(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 *OcvpDatastoresDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("OcvpDatastoresDataSource-", OcvpDatastoresDataSource(), s.D)) + resources := []map[string]interface{}{} + datastore := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, DatastoreSummaryToMap(item)) + } + datastore["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, OcvpDatastoresDataSource().Schema["datastore_collection"].Elem.(*schema.Resource).Schema) + datastore["items"] = items + } + + resources = append(resources, datastore) + if err := s.D.Set("datastore_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/ocvp/ocvp_esxi_host_data_source.go b/internal/service/ocvp/ocvp_esxi_host_data_source.go index 6c7412ebc8e..cd0386d07f7 100644 --- a/internal/service/ocvp/ocvp_esxi_host_data_source.go +++ b/internal/service/ocvp/ocvp_esxi_host_data_source.go @@ -100,6 +100,14 @@ func (s *OcvpEsxiHostDataSourceCrud) SetData() error { s.D.Set("current_commitment", s.Res.CurrentCommitment) s.D.Set("current_sku", s.Res.CurrentCommitment) + datastoreAttachments := []interface{}{} + for _, item := range s.Res.DatastoreAttachments { + datastoreAttachments = append(datastoreAttachments, DatastoreAttachmentToMap(item)) + } + s.D.Set("datastore_attachments", datastoreAttachments) + + s.D.Set("datastore_cluster_ids", s.Res.DatastoreClusterIds) + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } diff --git a/internal/service/ocvp/ocvp_esxi_host_resource.go b/internal/service/ocvp/ocvp_esxi_host_resource.go index 5cec4144db9..79f01258b95 100644 --- a/internal/service/ocvp/ocvp_esxi_host_resource.go +++ b/internal/service/ocvp/ocvp_esxi_host_resource.go @@ -6,6 +6,7 @@ package ocvp import ( "context" "fmt" + "log" "strings" "time" @@ -146,6 +147,20 @@ func OcvpEsxiHostResource() *schema.Resource { DiffSuppressFunc: suppressEsxiHostDeprecatedFieldRemoval, Deprecated: "This 'non_upgraded_esxi_host_id' argument has been deprecated and will be computed only.", }, + "attach_datastore_cluster_ids": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "detach_datastore_cluster_ids": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, // Computed "billing_contract_end_date": { @@ -160,6 +175,46 @@ func OcvpEsxiHostResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "datastore_attachments": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "block_volume_id": { + Type: schema.TypeString, + Computed: true, + }, + "datastore_id": { + Type: schema.TypeString, + Computed: true, + }, + "ip_address": { + Type: schema.TypeString, + Computed: true, + }, + "port": { + Type: schema.TypeInt, + Computed: true, + }, + "volume_iqn": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "datastore_cluster_ids": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "current_commitment": { Type: schema.TypeString, Computed: true, @@ -227,6 +282,7 @@ func createOcvpEsxiHost(d *schema.ResourceData, m interface{}) error { sync.ClusterClient = m.(*client.OracleClients).ClusterClient() sync.SddcClient = m.(*client.OracleClients).SddcClient() sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + sync.DatastoreClusterClient = m.(*client.OracleClients).DatastoreClusterClient() if e := tfresource.CreateResource(d, sync); e != nil { return e @@ -249,6 +305,7 @@ func updateOcvpEsxiHost(d *schema.ResourceData, m interface{}) error { sync.D = d sync.Client = m.(*client.OracleClients).EsxiHostClient() sync.WorkRequestClient = m.(*client.OracleClients).OcvpWorkRequestClient() + sync.DatastoreClusterClient = m.(*client.OracleClients).DatastoreClusterClient() if err := tfresource.UpdateResource(d, sync); err != nil { return err @@ -275,6 +332,7 @@ type OcvpEsxiHostResourceCrud struct { WorkRequestClient *oci_ocvp.WorkRequestClient ClusterClient *oci_ocvp.ClusterClient SddcClient *oci_ocvp.SddcClient + DatastoreClusterClient *oci_ocvp.DatastoreClusterClient } func (s *OcvpEsxiHostResourceCrud) ID() string { @@ -429,7 +487,17 @@ func (s *OcvpEsxiHostResourceCrud) Create() error { workId := response.OpcWorkRequestId s.setEsxiHostIdFromWorkRequest(workId) - return s.getEsxiHostFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp"), oci_ocvp.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate)) + _, err = esxiHostWaitForWorkRequest(workId, "esxihost", + oci_ocvp.ActionTypesCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries, s.WorkRequestClient) + if err != nil { + return nil + } + + if err := s.executeAttachDetachDatastoreClusters(); err != nil { + return err + } + + return s.Get() } func (s *OcvpEsxiHostResourceCrud) setEsxiHostIdFromWorkRequest(workId *string) { @@ -618,13 +686,16 @@ func (s *OcvpEsxiHostResourceCrud) Update() error { request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") - response, err := s.Client.UpdateEsxiHost(context.Background(), request) + _, err := s.Client.UpdateEsxiHost(context.Background(), request) if err != nil { return err } - s.Res = &response.EsxiHost - return nil + if err := s.executeAttachDetachDatastoreClusters(); err != nil { + return err + } + + return s.Get() } func (s *OcvpEsxiHostResourceCrud) Delete() error { @@ -693,6 +764,17 @@ func (s *OcvpEsxiHostResourceCrud) SetData() error { s.D.Set("compute_instance_id", *s.Res.ComputeInstanceId) } + datastoreAttachments := []interface{}{} + for _, item := range s.Res.DatastoreAttachments { + datastoreAttachments = append(datastoreAttachments, DatastoreAttachmentToMap(item)) + } + s.D.Set("datastore_attachments", datastoreAttachments) + + s.D.Set("datastore_cluster_ids", s.Res.DatastoreClusterIds) + + //s.D.Set("attach_datastore_cluster_ids", s.D.Get("attach_datastore_cluster_ids")) + //s.D.Set("detach_datastore_cluster_ids", s.D.Get("detach_datastore_cluster_ids")) + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } @@ -871,6 +953,32 @@ func validateReplacementHostDetails(oldHost oci_ocvp.EsxiHost, s *OcvpEsxiHostRe return nil } +func DatastoreAttachmentToMap(obj oci_ocvp.DatastoreAttachment) map[string]interface{} { + result := map[string]interface{}{} + + if obj.BlockVolumeId != nil { + result["block_volume_id"] = string(*obj.BlockVolumeId) + } + + if obj.DatastoreId != nil { + result["datastore_id"] = string(*obj.DatastoreId) + } + + if obj.IpAddress != nil { + result["ip_address"] = string(*obj.IpAddress) + } + + if obj.Port != nil { + result["port"] = int(*obj.Port) + } + + if obj.VolumeIqn != nil { + result["volume_iqn"] = string(*obj.VolumeIqn) + } + + return result +} + func EsxiHostSummaryToMap(obj oci_ocvp.EsxiHostSummary) map[string]interface{} { result := map[string]interface{}{} @@ -901,6 +1009,10 @@ func EsxiHostSummaryToMap(obj oci_ocvp.EsxiHostSummary) map[string]interface{} { result["current_commitment"] = string(obj.CurrentCommitment) result["current_sku"] = string(obj.CurrentCommitment) + if obj.DatastoreClusterIds != nil { + result["datastore_cluster_ids"] = obj.DatastoreClusterIds + } + if obj.DefinedTags != nil { result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) } @@ -978,3 +1090,65 @@ func EsxiHostSummaryToMap(obj oci_ocvp.EsxiHostSummary) map[string]interface{} { return result } + +func (s *OcvpEsxiHostResourceCrud) executeAttachDetachDatastoreClusters() error { + var datastoreClusterIdsToDetach []string + var datastoreClusterIdsToAttach []string + if tmp, ok := s.D.GetOk("detach_datastore_cluster_ids"); ok && s.D.HasChange("detach_datastore_cluster_ids") { + datastoreClusterIdsToDetach = castToSliceOfStrings(tmp) + log.Printf("[DEBUG] datastore_cluster_ids requested to be detached: %v", datastoreClusterIdsToDetach) + } + if tmp, ok := s.D.GetOk("attach_datastore_cluster_ids"); ok && s.D.HasChange("attach_datastore_cluster_ids") { + datastoreClusterIdsToAttach = castToSliceOfStrings(tmp) + log.Printf("[DEBUG] datastore_cluster_ids requested to be attached: %v", datastoreClusterIdsToAttach) + } + for _, datastoreClusterId := range datastoreClusterIdsToDetach { + log.Printf("[DEBUG] detaching datastore cluster %v", datastoreClusterId) + if err := s.detachDatastoreClusterFromEsxiHost(datastoreClusterId); err != nil { + return err + } + } + for _, datastoreClusterId := range datastoreClusterIdsToAttach { + log.Printf("[DEBUG] attaching datastore cluster %v", datastoreClusterId) + if err := s.attachDatastoreClusterToEsxiHost(datastoreClusterId); err != nil { + return err + } + } + return nil +} + +func (s *OcvpEsxiHostResourceCrud) attachDatastoreClusterToEsxiHost(datastoreClusterId string) error { + esxiHostId := s.D.Id() + request := oci_ocvp.AttachDatastoreClusterToEsxiHostRequest{ + DatastoreClusterId: &datastoreClusterId, + AttachDatastoreClusterToEsxiHostDetails: oci_ocvp.AttachDatastoreClusterToEsxiHostDetails{ + EsxiHostId: &esxiHostId, + }, + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + response, err := s.DatastoreClusterClient.AttachDatastoreClusterToEsxiHost(context.Background(), request) + if err != nil { + return err + } + _, err = datastoreClusterWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore-cluster", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), + s.DisableNotFoundRetries, s.WorkRequestClient) + return err +} + +func (s *OcvpEsxiHostResourceCrud) detachDatastoreClusterFromEsxiHost(datastoreClusterId string) error { + esxiHostId := s.D.Id() + request := oci_ocvp.DetachDatastoreClusterFromEsxiHostRequest{ + DatastoreClusterId: &datastoreClusterId, + DetachDatastoreClusterFromEsxiHostDetails: oci_ocvp.DetachDatastoreClusterFromEsxiHostDetails{ + EsxiHostId: &esxiHostId, + }, + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ocvp") + response, err := s.DatastoreClusterClient.DetachDatastoreClusterFromEsxiHost(context.Background(), request) + if err != nil { + return err + } + _, err = datastoreClusterWaitForWorkRequest(response.OpcWorkRequestId, "sddc-datastore-cluster", oci_ocvp.ActionTypesUpdated, s.D.Timeout(schema.TimeoutUpdate), + s.DisableNotFoundRetries, s.WorkRequestClient) + return err +} diff --git a/internal/service/ocvp/ocvp_export.go b/internal/service/ocvp/ocvp_export.go index 8d6f8a30ac3..24ca4738500 100644 --- a/internal/service/ocvp/ocvp_export.go +++ b/internal/service/ocvp/ocvp_export.go @@ -50,10 +50,38 @@ var exportOcvpClusterHints = &tf_export.TerraformResourceHints{ }, } +var exportOcvpDatastoreClusterHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_ocvp_datastore_cluster", + DatasourceClass: "oci_ocvp_datastore_clusters", + DatasourceItemsAttr: "datastore_cluster_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "datastore_cluster", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_ocvp.LifecycleStatesActive), + string(oci_ocvp.LifecycleStatesFailed), + }, +} + +var exportOcvpDatastoreHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_ocvp_datastore", + DatasourceClass: "oci_ocvp_datastores", + DatasourceItemsAttr: "datastore_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "datastore", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_ocvp.LifecycleStatesActive), + string(oci_ocvp.LifecycleStatesFailed), + }, +} + var ocvpResourceGraph = tf_export.TerraformResourceGraph{ "oci_identity_compartment": { {TerraformResourceHints: exportOcvpSddcHints}, {TerraformResourceHints: exportOcvpClusterHints}, + {TerraformResourceHints: exportOcvpDatastoreClusterHints}, + {TerraformResourceHints: exportOcvpDatastoreHints}, }, "oci_ocvp_sddc": { { diff --git a/internal/service/ocvp/ocvp_sddc_resource.go b/internal/service/ocvp/ocvp_sddc_resource.go index e894ec9a6a0..9f780fec79d 100644 --- a/internal/service/ocvp/ocvp_sddc_resource.go +++ b/internal/service/ocvp/ocvp_sddc_resource.go @@ -366,6 +366,11 @@ func OcvpSddcResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -570,6 +575,15 @@ func OcvpSddcResource() *schema.Resource { Computed: true, ForceNew: true, }, + "datastore_cluster_ids": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "datastores": { Type: schema.TypeList, Optional: true, @@ -841,6 +855,31 @@ func (s *OcvpSddcResourceCrud) Create() error { } } + initConf, ok := s.D.GetOk("initial_configuration.0.initial_cluster_configurations.0") + log.Printf("[DEBUG] OK: %v, InitialConfigurations: %+v", ok, initConf) + datastoreClusterIds, ok := s.getOkExistsClusterConfigurationProperty("datastore_cluster_ids") + log.Printf("[DEBUG] datastoreClusterIds: %+v, ok: %v", datastoreClusterIds, ok) + + if ok { + interfaces := datastoreClusterIds.([]interface{}) + tmp := make([]string, len(interfaces)) + for i, datastoreClusterId := range interfaces { + tmp[i] = datastoreClusterId.(string) + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf("%s.%d.%s.%d.%s", "initial_configuration", 0, "initial_cluster_configurations", 0, "datastore_cluster_ids")) { + initialClusterConfiguration.DatastoreClusterIds = tmp + log.Printf("[DEBUG] changing data store cluster ids %s", datastoreClusterIds) + } else { + log.Printf("[DEBUG] failed to detect change data store %s", datastoreClusterIds) + } + + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) if err != nil { @@ -1958,9 +1997,11 @@ func InitialClusterConfigurationToMap(obj oci_ocvp.InitialClusterConfiguration, result["compute_availability_domain"] = string(*obj.ComputeAvailabilityDomain) } + result["datastore_cluster_ids"] = obj.DatastoreClusterIds + datastores := []interface{}{} for _, item := range obj.Datastores { - datastores = append(datastores, DatastoreSummaryToMap(item)) + datastores = append(datastores, DatastoreInfoToMap(item)) } result["datastores"] = datastores @@ -2044,7 +2085,7 @@ func (s *OcvpSddcResourceCrud) mapToDatastoreInfo(fieldKeyFormat string) (oci_oc return result, nil } -func DatastoreSummaryToMap(obj oci_ocvp.DatastoreInfo) map[string]interface{} { +func DatastoreInfoToMap(obj oci_ocvp.DatastoreInfo) map[string]interface{} { result := map[string]interface{}{} result["block_volume_ids"] = obj.BlockVolumeIds diff --git a/internal/service/ocvp/register_datasource.go b/internal/service/ocvp/register_datasource.go index f13e5c66fb0..bf47f5910f7 100644 --- a/internal/service/ocvp/register_datasource.go +++ b/internal/service/ocvp/register_datasource.go @@ -8,6 +8,10 @@ import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterDatasource() { tfresource.RegisterDatasource("oci_ocvp_cluster", OcvpClusterDataSource()) tfresource.RegisterDatasource("oci_ocvp_clusters", OcvpClustersDataSource()) + tfresource.RegisterDatasource("oci_ocvp_datastore", OcvpDatastoreDataSource()) + tfresource.RegisterDatasource("oci_ocvp_datastore_cluster", OcvpDatastoreClusterDataSource()) + tfresource.RegisterDatasource("oci_ocvp_datastore_clusters", OcvpDatastoreClustersDataSource()) + tfresource.RegisterDatasource("oci_ocvp_datastores", OcvpDatastoresDataSource()) tfresource.RegisterDatasource("oci_ocvp_esxi_host", OcvpEsxiHostDataSource()) tfresource.RegisterDatasource("oci_ocvp_esxi_hosts", OcvpEsxiHostsDataSource()) tfresource.RegisterDatasource("oci_ocvp_retrieve_password", OcvpRetrievePasswordDataSource()) diff --git a/internal/service/ocvp/register_resource.go b/internal/service/ocvp/register_resource.go index 36a33ed0ec7..cb9831fd6a2 100644 --- a/internal/service/ocvp/register_resource.go +++ b/internal/service/ocvp/register_resource.go @@ -7,6 +7,8 @@ import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterResource() { tfresource.RegisterResource("oci_ocvp_cluster", OcvpClusterResource()) + tfresource.RegisterResource("oci_ocvp_datastore", OcvpDatastoreResource()) + tfresource.RegisterResource("oci_ocvp_datastore_cluster", OcvpDatastoreClusterResource()) tfresource.RegisterResource("oci_ocvp_esxi_host", OcvpEsxiHostResource()) tfresource.RegisterResource("oci_ocvp_sddc", OcvpSddcResource()) } diff --git a/internal/service/psql/psql_db_system_resource.go b/internal/service/psql/psql_db_system_resource.go index f4d5110c7f3..a927cf57ea7 100644 --- a/internal/service/psql/psql_db_system_resource.go +++ b/internal/service/psql/psql_db_system_resource.go @@ -300,6 +300,9 @@ func PsqlDbSystemResource() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return isNoneManagementPolicy(old, new, d) + }, }, "copy_policy": { Type: schema.TypeList, @@ -340,6 +343,9 @@ func PsqlDbSystemResource() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeInt, }, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return isNoneManagementPolicy(old, new, d) + }, }, "days_of_the_week": { Type: schema.TypeList, @@ -348,6 +354,9 @@ func PsqlDbSystemResource() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return isNoneManagementPolicy(old, new, d) + }, }, "kind": { Type: schema.TypeString, @@ -365,6 +374,9 @@ func PsqlDbSystemResource() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return isNoneManagementPolicy(old, new, d) + }, }, // Computed @@ -1399,10 +1411,6 @@ func (s *PsqlDbSystemResourceCrud) mapToBackupPolicy(fieldKeyFormat string) (oci details.CopyPolicy = &tmp } } - if retentionDays, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "retention_days")); ok { - tmp := retentionDays.(int) - details.RetentionDays = &tmp - } baseObject = details case strings.ToLower("WEEKLY"): details := oci_psql.WeeklyBackupPolicy{} @@ -2132,3 +2140,15 @@ func (s *PsqlDbSystemResourceCrud) isFlexibleConfig(configId *string) bool { } return false } + +func isNoneManagementPolicy(old, new string, d *schema.ResourceData) bool { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "management_policy", 0) + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "backup_policy"), 0) + kindRaw, ok := d.GetOkExists(fmt.Sprintf(fieldKeyFormatNextLevel, "kind")) + if ok { + if kindRaw.(string) == "NONE" { + return true + } + } + return false +} diff --git a/internal/service/resource_analytics/register_datasource.go b/internal/service/resource_analytics/register_datasource.go new file mode 100644 index 00000000000..d1be901fb4e --- /dev/null +++ b/internal/service/resource_analytics/register_datasource.go @@ -0,0 +1,15 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterDatasource() { + tfresource.RegisterDatasource("oci_resource_analytics_monitored_region", ResourceAnalyticsMonitoredRegionDataSource()) + tfresource.RegisterDatasource("oci_resource_analytics_monitored_regions", ResourceAnalyticsMonitoredRegionsDataSource()) + tfresource.RegisterDatasource("oci_resource_analytics_resource_analytics_instance", ResourceAnalyticsResourceAnalyticsInstanceDataSource()) + tfresource.RegisterDatasource("oci_resource_analytics_resource_analytics_instances", ResourceAnalyticsResourceAnalyticsInstancesDataSource()) + tfresource.RegisterDatasource("oci_resource_analytics_tenancy_attachment", ResourceAnalyticsTenancyAttachmentDataSource()) + tfresource.RegisterDatasource("oci_resource_analytics_tenancy_attachments", ResourceAnalyticsTenancyAttachmentsDataSource()) +} diff --git a/internal/service/resource_analytics/register_resource.go b/internal/service/resource_analytics/register_resource.go new file mode 100644 index 00000000000..75e2458d975 --- /dev/null +++ b/internal/service/resource_analytics/register_resource.go @@ -0,0 +1,13 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterResource() { + tfresource.RegisterResource("oci_resource_analytics_monitored_region", ResourceAnalyticsMonitoredRegionResource()) + tfresource.RegisterResource("oci_resource_analytics_resource_analytics_instance", ResourceAnalyticsResourceAnalyticsInstanceResource()) + tfresource.RegisterResource("oci_resource_analytics_resource_analytics_instance_oac_management", ResourceAnalyticsResourceAnalyticsInstanceOacManagementResource()) + tfresource.RegisterResource("oci_resource_analytics_tenancy_attachment", ResourceAnalyticsTenancyAttachmentResource()) +} diff --git a/internal/service/resource_analytics/resource_analytics_export.go b/internal/service/resource_analytics/resource_analytics_export.go new file mode 100644 index 00000000000..ce95e2d3e5d --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_export.go @@ -0,0 +1,60 @@ +package resource_analytics + +import ( + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + tf_export "github.com/oracle/terraform-provider-oci/internal/commonexport" +) + +func init() { + tf_export.RegisterCompartmentGraphs("resource_analytics", resourceAnalyticsResourceGraph) +} + +// Custom overrides for generating composite IDs within the resource discovery framework + +// Hints for discovering and exporting this resource to configuration and state files +var exportResourceAnalyticsResourceAnalyticsInstanceHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_resource_analytics_resource_analytics_instance", + DatasourceClass: "oci_resource_analytics_resource_analytics_instances", + DatasourceItemsAttr: "resource_analytics_instance_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "resource_analytics_instance", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateActive), + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateNeedsAttention), + }, +} + +var exportResourceAnalyticsTenancyAttachmentHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_resource_analytics_tenancy_attachment", + DatasourceClass: "oci_resource_analytics_tenancy_attachments", + DatasourceItemsAttr: "tenancy_attachment_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "tenancy_attachment", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_resource_analytics.TenancyAttachmentLifecycleStateActive), + string(oci_resource_analytics.TenancyAttachmentLifecycleStateNeedsAttention), + }, +} + +var exportResourceAnalyticsMonitoredRegionHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_resource_analytics_monitored_region", + DatasourceClass: "oci_resource_analytics_monitored_regions", + DatasourceItemsAttr: "monitored_region_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "monitored_region", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_resource_analytics.MonitoredRegionLifecycleStateActive), + }, +} + +var resourceAnalyticsResourceGraph = tf_export.TerraformResourceGraph{ + "oci_identity_compartment": { + {TerraformResourceHints: exportResourceAnalyticsResourceAnalyticsInstanceHints}, + {TerraformResourceHints: exportResourceAnalyticsTenancyAttachmentHints}, + {TerraformResourceHints: exportResourceAnalyticsMonitoredRegionHints}, + }, +} diff --git a/internal/service/resource_analytics/resource_analytics_monitored_region_data_source.go b/internal/service/resource_analytics/resource_analytics_monitored_region_data_source.go new file mode 100644 index 00000000000..1049797be5e --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_monitored_region_data_source.go @@ -0,0 +1,96 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsMonitoredRegionDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["monitored_region_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(ResourceAnalyticsMonitoredRegionResource(), fieldMap, readSingularResourceAnalyticsMonitoredRegion) +} + +func readSingularResourceAnalyticsMonitoredRegion(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsMonitoredRegionDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MonitoredRegionClient() + + return tfresource.ReadResource(sync) +} + +type ResourceAnalyticsMonitoredRegionDataSourceCrud struct { + D *schema.ResourceData + Client *oci_resource_analytics.MonitoredRegionClient + Res *oci_resource_analytics.GetMonitoredRegionResponse +} + +func (s *ResourceAnalyticsMonitoredRegionDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ResourceAnalyticsMonitoredRegionDataSourceCrud) Get() error { + request := oci_resource_analytics.GetMonitoredRegionRequest{} + + if monitoredRegionId, ok := s.D.GetOkExists("monitored_region_id"); ok { + tmp := monitoredRegionId.(string) + request.MonitoredRegionId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "resource_analytics") + + response, err := s.Client.GetMonitoredRegion(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ResourceAnalyticsMonitoredRegionDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.RegionId != nil { + s.D.Set("region_id", *s.Res.RegionId) + } + + if s.Res.ResourceAnalyticsInstanceId != nil { + s.D.Set("resource_analytics_instance_id", *s.Res.ResourceAnalyticsInstanceId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} diff --git a/internal/service/resource_analytics/resource_analytics_monitored_region_resource.go b/internal/service/resource_analytics/resource_analytics_monitored_region_resource.go new file mode 100644 index 00000000000..b7c00ab860a --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_monitored_region_resource.go @@ -0,0 +1,412 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsMonitoredRegionResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: &schema.ResourceTimeout{ + Read: &tfresource.TwoHours, + Create: &tfresource.TwoHours, + Update: &tfresource.TwoHours, + Delete: &tfresource.TwoHours, + }, + Create: createResourceAnalyticsMonitoredRegion, + Read: readResourceAnalyticsMonitoredRegion, + Delete: deleteResourceAnalyticsMonitoredRegion, + Schema: map[string]*schema.Schema{ + // Required + "region_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "resource_analytics_instance_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + + // Computed + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createResourceAnalyticsMonitoredRegion(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsMonitoredRegionResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.MonitoredRegionClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + + return tfresource.CreateResource(d, sync) +} + +func readResourceAnalyticsMonitoredRegion(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsMonitoredRegionResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MonitoredRegionClient() + + return tfresource.ReadResource(sync) +} + +func deleteResourceAnalyticsMonitoredRegion(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsMonitoredRegionResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.MonitoredRegionClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type ResourceAnalyticsMonitoredRegionResourceCrud struct { + tfresource.BaseCrud + Client *oci_resource_analytics.MonitoredRegionClient + WorkReqClient *oci_resource_analytics.ResourceAnalyticsInstanceClient + Res *oci_resource_analytics.MonitoredRegion + DisableNotFoundRetries bool +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) CreatedPending() []string { + return []string{ + string(oci_resource_analytics.MonitoredRegionLifecycleStateCreating), + } +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_resource_analytics.MonitoredRegionLifecycleStateActive), + } +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) DeletedPending() []string { + return []string{ + string(oci_resource_analytics.MonitoredRegionLifecycleStateDeleting), + } +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_resource_analytics.MonitoredRegionLifecycleStateDeleted), + } +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) Create() error { + request := oci_resource_analytics.CreateMonitoredRegionRequest{} + + if regionId, ok := s.D.GetOkExists("region_id"); ok { + tmp := regionId.(string) + request.RegionId = &tmp + } + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.CreateMonitoredRegion(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + workRequestResponse := oci_resource_analytics.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkReqClient.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "monitoredregion") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } + return s.getMonitoredRegionFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) getMonitoredRegionFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_resource_analytics.ActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + monitoredRegionId, err := monitoredRegionWaitForWorkRequest(workId, "monitoredregion", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.WorkReqClient) + + if err != nil { + // Try to cancel the work request + log.Printf("[DEBUG] getMonitoredRegionFromWorkRequest: creation failed, attempting to cancel the workrequest: %v for identifier: %v\n", workId, monitoredRegionId) + _, cancelErr := s.WorkReqClient.CancelWorkRequest(context.Background(), + oci_resource_analytics.CancelWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if cancelErr != nil { + log.Printf("[DEBUG] cleanup cancelWorkRequest failed with the error: %v\n", cancelErr) + } + return err + } + s.D.SetId(*monitoredRegionId) + + return s.Get() +} + +func monitoredRegionWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { + startTime := time.Now() + stopTime := startTime.Add(timeout) + return func(response oci_common.OCIOperationResponse) bool { + + // Stop after timeout has elapsed + if time.Now().After(stopTime) { + return false + } + + // Make sure we stop on default rules + if tfresource.ShouldRetry(response, false, "resource_analytics", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_resource_analytics.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func monitoredRegionWaitForWorkRequest(wId *string, entityType string, action oci_resource_analytics.ActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, workReqClient *oci_resource_analytics.ResourceAnalyticsInstanceClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "resource_analytics") + retryPolicy.ShouldRetryOperation = monitoredRegionWorkRequestShouldRetryFunc(timeout) + + response := oci_resource_analytics.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_resource_analytics.OperationStatusInProgress), + string(oci_resource_analytics.OperationStatusAccepted), + string(oci_resource_analytics.OperationStatusCanceling), + }, + Target: []string{ + string(oci_resource_analytics.OperationStatusSucceeded), + string(oci_resource_analytics.OperationStatusFailed), + string(oci_resource_analytics.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = workReqClient.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: wId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + wr := &response.WorkRequest + return wr, string(wr.Status), err + }, + Timeout: timeout, + } + if _, e := stateConf.WaitForState(); e != nil { + return nil, e + } + + var identifier *string + // The work request response contains an array of objects that finished the operation + for _, res := range response.Resources { + if strings.Contains(strings.ToLower(*res.EntityType), entityType) { + if res.ActionType == action { + identifier = res.Identifier + break + } + } + } + + // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled + if identifier == nil || response.Status == oci_resource_analytics.OperationStatusFailed || response.Status == oci_resource_analytics.OperationStatusCanceled { + return nil, getErrorFromResourceAnalyticsMonitoredRegionWorkRequest(workReqClient, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromResourceAnalyticsMonitoredRegionWorkRequest(workReqClient *oci_resource_analytics.ResourceAnalyticsInstanceClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_resource_analytics.ActionTypeEnum) error { + response, err := workReqClient.ListWorkRequestErrors(context.Background(), + oci_resource_analytics.ListWorkRequestErrorsRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return err + } + + allErrs := make([]string, 0) + for _, wrkErr := range response.Items { + allErrs = append(allErrs, *wrkErr.Message) + } + errorMessage := strings.Join(allErrs, "\n") + + workRequestErr := fmt.Errorf("work request did not succeed, workId: %s, entity: %s, action: %s. Message: %s", *workId, entityType, action, errorMessage) + + return workRequestErr +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) Get() error { + request := oci_resource_analytics.GetMonitoredRegionRequest{} + + tmp := s.D.Id() + request.MonitoredRegionId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.GetMonitoredRegion(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.MonitoredRegion + return nil +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) Delete() error { + request := oci_resource_analytics.DeleteMonitoredRegionRequest{} + + tmp := s.D.Id() + request.MonitoredRegionId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.DeleteMonitoredRegion(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := monitoredRegionWaitForWorkRequest(workId, "monitoredregion", + oci_resource_analytics.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.WorkReqClient) + return delWorkRequestErr +} + +func (s *ResourceAnalyticsMonitoredRegionResourceCrud) SetData() error { + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.RegionId != nil { + s.D.Set("region_id", *s.Res.RegionId) + } + + if s.Res.ResourceAnalyticsInstanceId != nil { + s.D.Set("resource_analytics_instance_id", *s.Res.ResourceAnalyticsInstanceId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func MonitoredRegionSummaryToMap(obj oci_resource_analytics.MonitoredRegionSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + if obj.RegionId != nil { + result["region_id"] = string(*obj.RegionId) + } + + if obj.ResourceAnalyticsInstanceId != nil { + result["resource_analytics_instance_id"] = string(*obj.ResourceAnalyticsInstanceId) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + return result +} diff --git a/internal/service/resource_analytics/resource_analytics_monitored_regions_data_source.go b/internal/service/resource_analytics/resource_analytics_monitored_regions_data_source.go new file mode 100644 index 00000000000..55e84dcefd2 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_monitored_regions_data_source.go @@ -0,0 +1,135 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsMonitoredRegionsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readResourceAnalyticsMonitoredRegions, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "id": { + Type: schema.TypeString, + Optional: true, + }, + "resource_analytics_instance_id": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "monitored_region_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(ResourceAnalyticsMonitoredRegionResource()), + }, + }, + }, + }, + }, + } +} + +func readResourceAnalyticsMonitoredRegions(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsMonitoredRegionsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).MonitoredRegionClient() + + return tfresource.ReadResource(sync) +} + +type ResourceAnalyticsMonitoredRegionsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_resource_analytics.MonitoredRegionClient + Res *oci_resource_analytics.ListMonitoredRegionsResponse +} + +func (s *ResourceAnalyticsMonitoredRegionsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ResourceAnalyticsMonitoredRegionsDataSourceCrud) Get() error { + request := oci_resource_analytics.ListMonitoredRegionsRequest{} + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_resource_analytics.MonitoredRegionLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "resource_analytics") + + response, err := s.Client.ListMonitoredRegions(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListMonitoredRegions(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 *ResourceAnalyticsMonitoredRegionsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ResourceAnalyticsMonitoredRegionsDataSource-", ResourceAnalyticsMonitoredRegionsDataSource(), s.D)) + resources := []map[string]interface{}{} + monitoredRegion := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, MonitoredRegionSummaryToMap(item)) + } + monitoredRegion["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, ResourceAnalyticsMonitoredRegionsDataSource().Schema["monitored_region_collection"].Elem.(*schema.Resource).Schema) + monitoredRegion["items"] = items + } + + resources = append(resources, monitoredRegion) + if err := s.D.Set("monitored_region_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_data_source.go b/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_data_source.go new file mode 100644 index 00000000000..a5081048448 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_data_source.go @@ -0,0 +1,114 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsResourceAnalyticsInstanceDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["resource_analytics_instance_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(ResourceAnalyticsResourceAnalyticsInstanceResource(), fieldMap, readSingularResourceAnalyticsResourceAnalyticsInstance) +} + +func readSingularResourceAnalyticsResourceAnalyticsInstance(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ResourceAnalyticsInstanceClient() + + return tfresource.ReadResource(sync) +} + +type ResourceAnalyticsResourceAnalyticsInstanceDataSourceCrud struct { + D *schema.ResourceData + Client *oci_resource_analytics.ResourceAnalyticsInstanceClient + Res *oci_resource_analytics.GetResourceAnalyticsInstanceResponse +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceDataSourceCrud) Get() error { + request := oci_resource_analytics.GetResourceAnalyticsInstanceRequest{} + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "resource_analytics") + + response, err := s.Client.GetResourceAnalyticsInstance(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.AdwId != nil { + s.D.Set("adw_id", *s.Res.AdwId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.OacId != nil { + s.D.Set("oac_id", *s.Res.OacId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} diff --git a/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management_resource.go b/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management_resource.go new file mode 100644 index 00000000000..9b63755dc47 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management_resource.go @@ -0,0 +1,792 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsResourceAnalyticsInstanceOacManagementResource() *schema.Resource { + return &schema.Resource{ + Timeouts: &schema.ResourceTimeout{ + Create: &tfresource.TwoHours, + Update: &tfresource.TwoHours, + Delete: &tfresource.TwoHours, + Read: &tfresource.TwoHours, + }, + Create: createResourceAnalyticsResourceAnalyticsInstanceOacManagement, + Read: readResourceAnalyticsResourceAnalyticsInstanceOacManagement, + Update: updateResourceAnalyticsResourceAnalyticsInstanceOacManagement, + Delete: deleteResourceAnalyticsResourceAnalyticsInstanceOacManagement, + Schema: map[string]*schema.Schema{ + // Required + "resource_analytics_instance_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "enable_oac": { + Type: schema.TypeBool, + Required: true, + }, + + // Optional + "attachment_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + //"enable_oac": { + // Type: schema.TypeBool, + // Required: true, + //}, + + // Optional + "idcs_domain_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "license_model": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "network_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + //"enable_oac": { + // Type: schema.TypeBool, + // Required: true, + //}, + + // Optional + "nsg_ids": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Set: tfresource.LiteralTypeHashCodeForSets, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "subnet_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "nsg_ids": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Set: tfresource.LiteralTypeHashCodeForSets, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "subnet_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "attachment_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + "state": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createResourceAnalyticsResourceAnalyticsInstanceOacManagement(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.ResourceAnalyticsInstanceClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + sync.Res = &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResponse{} + sync.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusSucceeded + return tfresource.CreateResource(d, sync) +} + +func readResourceAnalyticsResourceAnalyticsInstanceOacManagement(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.ResourceAnalyticsInstanceClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + sync.Res = &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResponse{} + + return tfresource.ReadResource(sync) +} + +func updateResourceAnalyticsResourceAnalyticsInstanceOacManagement(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.ResourceAnalyticsInstanceClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + sync.Res = &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResponse{} + + return tfresource.UpdateResource(d, sync) +} + +func deleteResourceAnalyticsResourceAnalyticsInstanceOacManagement(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.ResourceAnalyticsInstanceClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + sync.Res = &ResourceAnalyticsResourceAnalyticsInstanceOacManagementResponse{} + sync.DisableNotFoundRetries = true + + if sync.Res.LifecycleState == "" { + sync.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusSucceeded + } + + return tfresource.DeleteResource(d, sync) +} + +type ResourceAnalyticsResourceAnalyticsInstanceOacManagementResponse struct { + enableResponse *oci_resource_analytics.ResourceAnalyticsInstanceEnableOacResponse + disableResponse *oci_resource_analytics.ResourceAnalyticsInstanceDisableOacResponse + LifecycleState oci_resource_analytics.ListWorkRequestsStatusEnum `mandatory:"true" json:"lifecycleState"` +} + +type ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud struct { + tfresource.BaseCrud + Client *oci_resource_analytics.ResourceAnalyticsInstanceClient + WorkReqClient *oci_resource_analytics.ResourceAnalyticsInstanceClient + Res *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResponse + DisableNotFoundRetries bool +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) ID() string { + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + return resourceAnalyticsInstanceId.(string) + } + return s.D.Id() +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) CreatedPending() []string { + return []string{ + string(oci_resource_analytics.OperationStatusInProgress), + string(oci_resource_analytics.OperationStatusAccepted), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_resource_analytics.OperationStatusSucceeded), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) DeletedPending() []string { + return []string{ + string(oci_resource_analytics.OperationStatusInProgress), + string(oci_resource_analytics.OperationStatusAccepted), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_resource_analytics.OperationStatusSucceeded), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) State() string { + log.Printf("[INFO] State() Before fetch = %v\n", s.Res.LifecycleState) + var err error + retryPolicy := tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + if s.Res.disableResponse != nil { + log.Printf("[INFO] Fetching state from disableResponse: %v\n", s.Res.disableResponse) + s.setResToFetchedWorkRequest(err, s.Res.disableResponse.OpcWorkRequestId, retryPolicy) + } else if s.Res.enableResponse != nil { + log.Printf("[INFO] Fetching state from enableResponse: %v\n", s.Res.enableResponse) + s.setResToFetchedWorkRequest(err, s.Res.enableResponse.OpcWorkRequestId, retryPolicy) + } + log.Printf("[INFO] State() After fetch = %v\n", s.Res.LifecycleState) + return string(s.Res.LifecycleState) +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) Get() error { + // For management resources, we don't need to fetch actual data + // The resource state is managed through the enable/disable operations + // This method is required by the interface but can be a no-op + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) Create() error { + var operation bool + if enableOperation, ok := s.D.GetOkExists("enable_oac"); ok { + operation = enableOperation.(bool) + } + + if operation { + request := oci_resource_analytics.ResourceAnalyticsInstanceEnableOacRequest{} + + if attachmentDetails, ok := s.D.GetOkExists("attachment_details"); ok { + if tmpList := attachmentDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "attachment_details", 0) + tmp, err := s.mapToResourceAnalyticsInstanceOacAttachmentDetails(fieldKeyFormat) + if err != nil { + return err + } + request.AttachmentDetails = &tmp + } + } + + if attachmentType, ok := s.D.GetOkExists("attachment_type"); ok { + request.AttachmentType = oci_resource_analytics.ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum(attachmentType.(string)) + } + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.executeEnableOacRequest(request) + if err != nil { + return err + } + + s.setResToFetchedWorkRequest(err, response.OpcWorkRequestId, request.RequestMetadata.RetryPolicy) + + err = s.getResourceAnalyticsInstanceOacManagementFromWorkRequest(response.OpcWorkRequestId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + return nil + } + + // Disable OAC req + request := oci_resource_analytics.ResourceAnalyticsInstanceDisableOacRequest{} + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.executeDisableOacRequest(request) + if err != nil { + return err + } + + s.setResToFetchedWorkRequest(err, response.OpcWorkRequestId, request.RequestMetadata.RetryPolicy) + + workId := response.OpcWorkRequestId + err = s.getResourceAnalyticsInstanceOacManagementFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + //s.Res.disableResponse = &response + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) setResToFetchedWorkRequest(err error, workId *string, retryPolicy *oci_common.RetryPolicy) *oci_resource_analytics.WorkRequest { + log.Printf("setResToFetchedWorkRequest called with workId: %s, err: %v\n", *workId, err) + wrResponse, err := s.WorkReqClient.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + + log.Printf("setResToFetchedWorkRequest: wrResponse: %v\n", wrResponse) + wr := &wrResponse.WorkRequest + + s.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusEnum(wr.Status) + log.Printf("setResToFetchedWorkRequest: setting state to : %v\n", s.Res.LifecycleState) + return wr +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) getResourceAnalyticsInstanceOacManagementFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_resource_analytics.ActionTypeEnum, timeout time.Duration) error { + + log.Printf("getResourceAnalyticsInstanceOacManagementFromWorkRequest called with workId: %s, actionTypeEnum: %v, timeout: %v\n", *workId, actionTypeEnum, timeout) + + // Wait until it finishes + resourceAnalyticsInstanceOacManagementId, err := resourceAnalyticsInstanceOacManagementWaitForWorkRequest(s, workId, "resourceanalyticsinstance", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) + + log.Printf("getResourceAnalyticsInstanceOacManagementFromWorkRequest. Finished!\n") + + if err != nil { + // Try to cancel the work request + log.Printf("[DEBUG] getResourceAnalyticsInstanceOacManagementFromWorkRequest: creation failed, attempting to cancel the workrequest: %s for identifier: %v\n", *workId, resourceAnalyticsInstanceOacManagementId) + _, cancelErr := s.WorkReqClient.CancelWorkRequest(context.Background(), + oci_resource_analytics.CancelWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if cancelErr != nil { + log.Printf("[DEBUG] cleanup cancelWorkRequest failed with the error: %v\n", cancelErr) + } + return err + } + + return nil +} + +func resourceAnalyticsInstanceOacManagementWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { + startTime := time.Now() + stopTime := startTime.Add(timeout) + return func(response oci_common.OCIOperationResponse) bool { + + // Stop after timeout has elapsed + if time.Now().After(stopTime) { + return false + } + + // Make sure we stop on default rules + if tfresource.ShouldRetry(response, false, "resource_analytics", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_resource_analytics.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func resourceAnalyticsInstanceOacManagementWaitForWorkRequest(s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud, wId *string, entityType string, action oci_resource_analytics.ActionTypeEnum, timeout time.Duration, disableFoundRetries bool, client *oci_resource_analytics.ResourceAnalyticsInstanceClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "resource_analytics") + retryPolicy.ShouldRetryOperation = resourceAnalyticsInstanceOacManagementWorkRequestShouldRetryFunc(timeout) + + response := oci_resource_analytics.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_resource_analytics.OperationStatusInProgress), + string(oci_resource_analytics.OperationStatusAccepted), + string(oci_resource_analytics.OperationStatusCanceling), + }, + Target: []string{ + string(oci_resource_analytics.OperationStatusSucceeded), + string(oci_resource_analytics.OperationStatusFailed), + string(oci_resource_analytics.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + log.Printf("[DEBUG] REFRESH() resourceAnalyticsInstanceOacManagementWaitForWorkRequest. Getting WR...") + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: wId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + wr := &response.WorkRequest + log.Printf("[DEBUG] resourceAnalyticsInstanceOacManagementWaitForWorkRequest | Got Work Request.. : wr.Status: %v\nSetting s.Res.LifecycleState!\n", wr.Status) + s.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusEnum(wr.Status) + log.Printf("[DEBUG] Res.LifecycleState = %s\n", s.Res.LifecycleState) + return wr, string(wr.Status), err + }, + Timeout: timeout, + } + log.Printf("[DEBUG] ABOUT TO WAIT FOR STATE... resourceAnalyticsInstanceOacManagementWaitForWorkRequest: stateConf: %v\n", stateConf) + if _, e := stateConf.WaitForState(); e != nil { + log.Printf("[DEBUG] ABOUT TO WAIT FOR STATE... DONE! Bad :( resourceAnalyticsInstanceOacManagementWaitForWorkRequest: stateConf: %v\n", stateConf) + return nil, e + } + log.Printf("[DEBUG] ABOUT TO WAIT FOR STATE... DONE! GOOD?! resourceAnalyticsInstanceOacManagementWaitForWorkRequest: stateConf: %v\n", stateConf) + + var identifier *string + // The work request response contains an array of objects that finished the operation + for _, res := range response.Resources { + log.Printf("[DEBUG] resourceAnalyticsInstanceOacManagementWaitForWorkRequest: res.entityType: %v = entityType: %v, action: %v = res.ActionType: %v, res: %v\n", strings.ToLower(*res.EntityType), entityType, action, res.ActionType, res) + if strings.Contains(strings.ToLower(*res.EntityType), entityType) { + if res.ActionType == action { + identifier = res.Identifier + log.Printf("[DEBUG] resourceAnalyticsInstanceOacManagementWaitForWorkRequest: MATCH!") + break + } + } + } + + // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled + if identifier == nil || response.Status == oci_resource_analytics.OperationStatusFailed || response.Status == oci_resource_analytics.OperationStatusCanceled { + log.Printf("[DEBUG] resourceAnalyticsInstanceOacManagementWaitForWorkRequest: DIDNT FIND!!!!") + return nil, getErrorFromResourceAnalyticsResourceAnalyticsInstanceOacManagementWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromResourceAnalyticsResourceAnalyticsInstanceOacManagementWorkRequest(client *oci_resource_analytics.ResourceAnalyticsInstanceClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_resource_analytics.ActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_resource_analytics.ListWorkRequestErrorsRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return err + } + + allErrs := make([]string, 0) + for _, wrkErr := range response.Items { + allErrs = append(allErrs, *wrkErr.Message) + } + errorMessage := strings.Join(allErrs, "\n") + + workRequestErr := fmt.Errorf("work request did not succeed, workId: %s, entity: %s, action: %s. Message: %s", *workId, entityType, action, errorMessage) + + return workRequestErr +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) Update() error { + log.Printf("[DEBUG] Update called for resourceAnalyticsInstanceOacManagementResourceCrud") + var operation bool + if enableOperation, ok := s.D.GetOkExists("enable_oac"); ok { + operation = enableOperation.(bool) + } + + if operation { + log.Printf("[DEBUG] ENABLE Update called for resourceAnalyticsInstanceOacManagementResourceCrud") + request := oci_resource_analytics.ResourceAnalyticsInstanceEnableOacRequest{} + + if attachmentDetails, ok := s.D.GetOkExists("attachment_details"); ok { + if tmpList := attachmentDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "attachment_details", 0) + tmp, err := s.mapToResourceAnalyticsInstanceOacAttachmentDetails(fieldKeyFormat) + if err != nil { + return err + } + request.AttachmentDetails = &tmp + } + } + + if attachmentType, ok := s.D.GetOkExists("attachment_type"); ok { + request.AttachmentType = oci_resource_analytics.ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum(attachmentType.(string)) + } + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.executeEnableOacRequest(request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + err = s.getResourceAnalyticsInstanceOacManagementFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + + s.setResToFetchedWorkRequest(err, response.OpcWorkRequestId, request.RequestMetadata.RetryPolicy) + + return nil + } + + log.Printf("[DEBUG] DISABLE Update called for resourceAnalyticsInstanceOacManagementResourceCrud") + request := oci_resource_analytics.ResourceAnalyticsInstanceDisableOacRequest{} + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + // Set a small JSON payload to ensure Content-Length header is properly set + // requestBody := "{}" + // request.RequestBody = &requestBody + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.executeDisableOacRequest(request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + err = s.getResourceAnalyticsInstanceOacManagementFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + s.setResToFetchedWorkRequest(err, response.OpcWorkRequestId, request.RequestMetadata.RetryPolicy) + + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) executeEnableOacRequest(request oci_resource_analytics.ResourceAnalyticsInstanceEnableOacRequest) (oci_resource_analytics.ResourceAnalyticsInstanceEnableOacResponse, error) { + + s.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusInProgress + log.Printf("[DEBUG] executeEnableOacRequest: pre - SETTING LifeCycleState to: %v\n", s.Res.LifecycleState) + response, err := s.Client.ResourceAnalyticsInstanceEnableOac(context.Background(), request) + s.Res.enableResponse = &response + s.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusSucceeded + log.Printf("[DEBUG] executeEnableOacRequest: post - SETTING LifeCycleState to: %v\n", s.Res.LifecycleState) + return response, err +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) executeDisableOacRequest(request oci_resource_analytics.ResourceAnalyticsInstanceDisableOacRequest) (oci_resource_analytics.ResourceAnalyticsInstanceDisableOacResponse, error) { + s.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusInProgress + log.Printf("[DEBUG] executeDisableOacRequest: pre - SETTING LifeCycleState to: %v\n", s.Res.LifecycleState) + response, err := s.Client.ResourceAnalyticsInstanceDisableOac(context.Background(), request) + s.Res.disableResponse = &response + s.Res.LifecycleState = oci_resource_analytics.ListWorkRequestsStatusSucceeded + log.Printf("[DEBUG] executeDisableOacRequest: post - SETTING LifeCycleState to: %v\n", s.Res.LifecycleState) + return response, err +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) Delete() error { + var operation bool + if enableOperation, ok := s.D.GetOkExists("enable_oac"); ok { + operation = enableOperation.(bool) + } + + if !operation { + return nil + } + + request := oci_resource_analytics.ResourceAnalyticsInstanceDisableOacRequest{} + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + // Set a small JSON payload to ensure Content-Length header is properly set + // requestBody := "{}" + // request.RequestBody = &requestBody + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.ResourceAnalyticsInstanceDisableOac(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + err = s.getResourceAnalyticsInstanceOacManagementFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + + s.setResToFetchedWorkRequest(err, response.OpcWorkRequestId, request.RequestMetadata.RetryPolicy) + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) SetData() error { + // Check if we have any response data to work with + if s.Res == nil { + return fmt.Errorf("resource state is nil") + } + + // Check if we have either enable or disable response + //if s.Res.enableResponse == nil && s.Res.disableResponse == nil { + // return fmt.Errorf("no valid response data available for state synchronization") + //} + + // Set the resource analytics instance ID if available + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + s.D.Set("resource_analytics_instance_id", resourceAnalyticsInstanceId) + } + + // Set the enable operation status + if enableOperation, ok := s.D.GetOkExists("enable_oac"); ok { + s.D.Set("enable_oac", enableOperation) + //s.D.Set("state", s.Res.LifecycleState) + //s.D.Set("state", s.Res.LifecycleState) + //if s.Res.enableResponse != nil { + // s.D.Set("state", oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateActive) + //} else { + // s.D.Set("state", oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateDeleted) + //} + } + + // Set attachment details if they exist + if attachmentDetails, ok := s.D.GetOkExists("attachment_details"); ok { + s.D.Set("attachment_details", attachmentDetails) + } + + // Set attachment type if it exists + if attachmentType, ok := s.D.GetOkExists("attachment_type"); ok { + s.D.Set("attachment_type", attachmentType) + } + + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) mapToResourceAnalyticsInstanceOacAttachmentDetails(fieldKeyFormat string) (oci_resource_analytics.ResourceAnalyticsInstanceOacAttachmentDetails, error) { + result := oci_resource_analytics.ResourceAnalyticsInstanceOacAttachmentDetails{} + + if idcsDomainId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "idcs_domain_id")); ok { + tmp := idcsDomainId.(string) + result.IdcsDomainId = &tmp + } + + if licenseModel, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "license_model")); ok { + result.LicenseModel = oci_resource_analytics.ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum(licenseModel.(string)) + } + + if networkDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "network_details")); ok { + if tmpList := networkDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "network_details"), 0) + tmp, err := s.mapToResourceAnalyticsInstanceOacNetworkDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert network_details, encountered error: %v", err) + } + result.NetworkDetails = &tmp + } + } + + if nsgIds, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "nsg_ids")); ok { + set := nsgIds.(*schema.Set) + interfaces := set.List() + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "nsg_ids")) { + result.NsgIds = tmp + } + } + + if subnetId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "subnet_id")); ok { + tmp := subnetId.(string) + result.SubnetId = &tmp + } + + return result, nil +} + +func ResourceAnalyticsInstanceOacAttachmentDetailsToMap(obj *oci_resource_analytics.ResourceAnalyticsInstanceOacAttachmentDetails, datasource bool) map[string]interface{} { + result := map[string]interface{}{} + + if obj.IdcsDomainId != nil { + result["idcs_domain_id"] = string(*obj.IdcsDomainId) + } + + result["license_model"] = string(obj.LicenseModel) + + if obj.NetworkDetails != nil { + result["network_details"] = []interface{}{ResourceAnalyticsInstanceOacNetworkDetailsToMap(obj.NetworkDetails, false)} + } + + nsgIds := []interface{}{} + for _, item := range obj.NsgIds { + nsgIds = append(nsgIds, item) + } + if datasource { + result["nsg_ids"] = nsgIds + } else { + result["nsg_ids"] = schema.NewSet(tfresource.LiteralTypeHashCodeForSets, nsgIds) + } + + if obj.SubnetId != nil { + result["subnet_id"] = string(*obj.SubnetId) + } + + return result +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceOacManagementResourceCrud) mapToResourceAnalyticsInstanceOacNetworkDetails(fieldKeyFormat string) (oci_resource_analytics.ResourceAnalyticsInstanceOacNetworkDetails, error) { + result := oci_resource_analytics.ResourceAnalyticsInstanceOacNetworkDetails{} + + if nsgIds, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "nsg_ids")); ok { + set := nsgIds.(*schema.Set) + interfaces := set.List() + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "nsg_ids")) { + result.NsgIds = tmp + } + } + + if subnetId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "subnet_id")); ok { + tmp := subnetId.(string) + result.SubnetId = &tmp + } + + return result, nil +} + +func ResourceAnalyticsInstanceOacNetworkDetailsToMap(obj *oci_resource_analytics.ResourceAnalyticsInstanceOacNetworkDetails, datasource bool) map[string]interface{} { + result := map[string]interface{}{} + + nsgIds := []interface{}{} + for _, item := range obj.NsgIds { + nsgIds = append(nsgIds, item) + } + if datasource { + result["nsg_ids"] = nsgIds + } else { + result["nsg_ids"] = schema.NewSet(tfresource.LiteralTypeHashCodeForSets, nsgIds) + } + + if obj.SubnetId != nil { + result["subnet_id"] = string(*obj.SubnetId) + } + + return result +} diff --git a/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_resource.go b/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_resource.go new file mode 100644 index 00000000000..519e4a8efa1 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_resource_analytics_instance_resource.go @@ -0,0 +1,716 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsResourceAnalyticsInstanceResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: &schema.ResourceTimeout{ + Create: &tfresource.TwoHours, + Update: &tfresource.TwoHours, + Delete: &tfresource.TwoHours, + Read: &tfresource.TwoHours, + }, + Create: createResourceAnalyticsResourceAnalyticsInstance, + Read: readResourceAnalyticsResourceAnalyticsInstance, + Update: updateResourceAnalyticsResourceAnalyticsInstance, + Delete: deleteResourceAnalyticsResourceAnalyticsInstance, + Schema: map[string]*schema.Schema{ + // Required + "adw_admin_password": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "password_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Sensitive: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "PLAIN_TEXT", + "VAULT_SECRET", + }, true), + }, + + // Optional + "password": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Sensitive: true, + }, + "secret_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "subnet_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + "is_mutual_tls_required": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, + "license_model": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "nsg_ids": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + Set: tfresource.LiteralTypeHashCodeForSets, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + + // Computed + "adw_id": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "oac_id": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createResourceAnalyticsResourceAnalyticsInstance(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ResourceAnalyticsInstanceClient() + + return tfresource.CreateResource(d, sync) +} + +func readResourceAnalyticsResourceAnalyticsInstance(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ResourceAnalyticsInstanceClient() + + return tfresource.ReadResource(sync) +} + +func updateResourceAnalyticsResourceAnalyticsInstance(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ResourceAnalyticsInstanceClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteResourceAnalyticsResourceAnalyticsInstance(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ResourceAnalyticsInstanceClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type ResourceAnalyticsResourceAnalyticsInstanceResourceCrud struct { + tfresource.BaseCrud + Client *oci_resource_analytics.ResourceAnalyticsInstanceClient + Res *oci_resource_analytics.ResourceAnalyticsInstance + DisableNotFoundRetries bool +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) CreatedPending() []string { + return []string{ + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateCreating), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateActive), + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateNeedsAttention), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) DeletedPending() []string { + return []string{ + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateDeleting), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateDeleted), + } +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) Create() error { + request := oci_resource_analytics.CreateResourceAnalyticsInstanceRequest{} + + if adwAdminPassword, ok := s.D.GetOkExists("adw_admin_password"); ok { + if tmpList := adwAdminPassword.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "adw_admin_password", 0) + tmp, err := s.mapToAdwAdminPasswordDetails(fieldKeyFormat) + if err != nil { + return err + } + request.AdwAdminPassword = tmp + } + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if isMutualTlsRequired, ok := s.D.GetOkExists("is_mutual_tls_required"); ok { + tmp := isMutualTlsRequired.(bool) + request.IsMutualTlsRequired = &tmp + } + + if licenseModel, ok := s.D.GetOkExists("license_model"); ok { + request.LicenseModel = oci_resource_analytics.CreateResourceAnalyticsInstanceDetailsLicenseModelEnum(licenseModel.(string)) + } + + if nsgIds, ok := s.D.GetOkExists("nsg_ids"); ok { + set := nsgIds.(*schema.Set) + interfaces := set.List() + tmp := make([]string, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = interfaces[i].(string) + } + } + if len(tmp) != 0 || s.D.HasChange("nsg_ids") { + request.NsgIds = tmp + } + } + + if subnetId, ok := s.D.GetOkExists("subnet_id"); ok { + tmp := subnetId.(string) + request.SubnetId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.CreateResourceAnalyticsInstance(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + workRequestResponse := oci_resource_analytics.GetWorkRequestResponse{} + workRequestResponse, err = s.Client.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "resourceanalyticsinstance") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } + return s.getResourceAnalyticsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) getResourceAnalyticsInstanceFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_resource_analytics.ActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + resourceAnalyticsInstanceId, err := resourceAnalyticsInstanceWaitForWorkRequest(workId, "resourceanalyticsinstance", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) + + if err != nil { + // Try to cancel the work request + log.Printf("[DEBUG] creation failed, attempting to cancel the workrequest: %v for identifier: %v\n", workId, resourceAnalyticsInstanceId) + _, cancelErr := s.Client.CancelWorkRequest(context.Background(), + oci_resource_analytics.CancelWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if cancelErr != nil { + log.Printf("[DEBUG] cleanup cancelWorkRequest failed with the error: %v\n", cancelErr) + } + return err + } + s.D.SetId(*resourceAnalyticsInstanceId) + + return s.Get() +} + +func resourceAnalyticsInstanceWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { + startTime := time.Now() + stopTime := startTime.Add(timeout) + return func(response oci_common.OCIOperationResponse) bool { + + // Stop after timeout has elapsed + if time.Now().After(stopTime) { + return false + } + + // Make sure we stop on default rules + if tfresource.ShouldRetry(response, false, "resource_analytics", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_resource_analytics.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func resourceAnalyticsInstanceWaitForWorkRequest(wId *string, entityType string, action oci_resource_analytics.ActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_resource_analytics.ResourceAnalyticsInstanceClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "resource_analytics") + retryPolicy.ShouldRetryOperation = resourceAnalyticsInstanceWorkRequestShouldRetryFunc(timeout) + + response := oci_resource_analytics.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_resource_analytics.OperationStatusInProgress), + string(oci_resource_analytics.OperationStatusAccepted), + string(oci_resource_analytics.OperationStatusCanceling), + }, + Target: []string{ + string(oci_resource_analytics.OperationStatusSucceeded), + string(oci_resource_analytics.OperationStatusFailed), + string(oci_resource_analytics.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: wId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + wr := &response.WorkRequest + return wr, string(wr.Status), err + }, + Timeout: timeout, + } + if _, e := stateConf.WaitForState(); e != nil { + return nil, e + } + + var identifier *string + // The work request response contains an array of objects that finished the operation + for _, res := range response.Resources { + if strings.Contains(strings.ToLower(*res.EntityType), entityType) { + if res.ActionType == action { + identifier = res.Identifier + break + } + } + } + + // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled + if identifier == nil || response.Status == oci_resource_analytics.OperationStatusFailed || response.Status == oci_resource_analytics.OperationStatusCanceled { + return nil, getErrorFromResourceAnalyticsResourceAnalyticsInstanceWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromResourceAnalyticsResourceAnalyticsInstanceWorkRequest(client *oci_resource_analytics.ResourceAnalyticsInstanceClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_resource_analytics.ActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_resource_analytics.ListWorkRequestErrorsRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return err + } + + allErrs := make([]string, 0) + for _, wrkErr := range response.Items { + allErrs = append(allErrs, *wrkErr.Message) + } + errorMessage := strings.Join(allErrs, "\n") + + workRequestErr := fmt.Errorf("work request did not succeed, workId: %s, entity: %s, action: %s. Message: %s", *workId, entityType, action, errorMessage) + + return workRequestErr +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) Get() error { + request := oci_resource_analytics.GetResourceAnalyticsInstanceRequest{} + + tmp := s.D.Id() + request.ResourceAnalyticsInstanceId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.GetResourceAnalyticsInstance(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ResourceAnalyticsInstance + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) Update() error { + if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { + oldRaw, newRaw := s.D.GetChange("compartment_id") + if newRaw != "" && oldRaw != "" { + err := s.updateCompartment(compartment) + if err != nil { + return err + } + } + } + request := oci_resource_analytics.UpdateResourceAnalyticsInstanceRequest{} + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + tmp := s.D.Id() + request.ResourceAnalyticsInstanceId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.UpdateResourceAnalyticsInstance(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getResourceAnalyticsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) Delete() error { + request := oci_resource_analytics.DeleteResourceAnalyticsInstanceRequest{} + + tmp := s.D.Id() + request.ResourceAnalyticsInstanceId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.DeleteResourceAnalyticsInstance(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := resourceAnalyticsInstanceWaitForWorkRequest(workId, "resourceanalyticsinstance", + oci_resource_analytics.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) + return delWorkRequestErr +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) SetData() error { + if s.Res.AdwId != nil { + s.D.Set("adw_id", *s.Res.AdwId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.OacId != nil { + s.D.Set("oac_id", *s.Res.OacId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) mapToAdwAdminPasswordDetails(fieldKeyFormat string) (oci_resource_analytics.AdwAdminPasswordDetails, error) { + var baseObject oci_resource_analytics.AdwAdminPasswordDetails + //discriminator + passwordTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "password_type")) + var passwordType string + if ok { + passwordType = passwordTypeRaw.(string) + } else { + passwordType = "" // default value + } + switch strings.ToLower(passwordType) { + case strings.ToLower("PLAIN_TEXT"): + details := oci_resource_analytics.PlainTextPasswordDetails{} + if password, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "password")); ok { + tmp := password.(string) + details.Password = &tmp + } + baseObject = details + case strings.ToLower("VAULT_SECRET"): + details := oci_resource_analytics.VaultSecretPasswordDetails{} + if secretId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "secret_id")); ok { + tmp := secretId.(string) + details.SecretId = &tmp + } + baseObject = details + default: + return nil, fmt.Errorf("unknown password_type '%v' was specified", passwordType) + } + return baseObject, nil +} + +func AdwAdminPasswordDetailsToMap(obj *oci_resource_analytics.AdwAdminPasswordDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_resource_analytics.PlainTextPasswordDetails: + result["password_type"] = "PLAIN_TEXT" + + if v.Password != nil { + result["password"] = string(*v.Password) + } + case oci_resource_analytics.VaultSecretPasswordDetails: + result["password_type"] = "VAULT_SECRET" + + if v.SecretId != nil { + result["secret_id"] = string(*v.SecretId) + } + default: + log.Printf("[WARN] Received 'password_type' of unknown type %v", *obj) + return nil + } + + return result +} + +func ResourceAnalyticsInstanceSummaryToMap(obj oci_resource_analytics.ResourceAnalyticsInstanceSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + return result +} + +func (s *ResourceAnalyticsResourceAnalyticsInstanceResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_resource_analytics.ChangeResourceAnalyticsInstanceCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.ResourceAnalyticsInstanceId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.ChangeResourceAnalyticsInstanceCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getResourceAnalyticsInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} diff --git a/internal/service/resource_analytics/resource_analytics_resource_analytics_instances_data_source.go b/internal/service/resource_analytics/resource_analytics_resource_analytics_instances_data_source.go new file mode 100644 index 00000000000..79f9859c897 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_resource_analytics_instances_data_source.go @@ -0,0 +1,144 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsResourceAnalyticsInstancesDataSource() *schema.Resource { + return &schema.Resource{ + Read: readResourceAnalyticsResourceAnalyticsInstances, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "resource_analytics_instance_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(ResourceAnalyticsResourceAnalyticsInstanceResource()), + }, + }, + }, + }, + }, + } +} + +func readResourceAnalyticsResourceAnalyticsInstances(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsResourceAnalyticsInstancesDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ResourceAnalyticsInstanceClient() + + return tfresource.ReadResource(sync) +} + +type ResourceAnalyticsResourceAnalyticsInstancesDataSourceCrud struct { + D *schema.ResourceData + Client *oci_resource_analytics.ResourceAnalyticsInstanceClient + Res *oci_resource_analytics.ListResourceAnalyticsInstancesResponse +} + +func (s *ResourceAnalyticsResourceAnalyticsInstancesDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ResourceAnalyticsResourceAnalyticsInstancesDataSourceCrud) Get() error { + request := oci_resource_analytics.ListResourceAnalyticsInstancesRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_resource_analytics.ResourceAnalyticsInstanceLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "resource_analytics") + + response, err := s.Client.ListResourceAnalyticsInstances(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListResourceAnalyticsInstances(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 *ResourceAnalyticsResourceAnalyticsInstancesDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ResourceAnalyticsResourceAnalyticsInstancesDataSource-", ResourceAnalyticsResourceAnalyticsInstancesDataSource(), s.D)) + resources := []map[string]interface{}{} + resourceAnalyticsInstance := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, ResourceAnalyticsInstanceSummaryToMap(item)) + } + resourceAnalyticsInstance["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, ResourceAnalyticsResourceAnalyticsInstancesDataSource().Schema["resource_analytics_instance_collection"].Elem.(*schema.Resource).Schema) + resourceAnalyticsInstance["items"] = items + } + + resources = append(resources, resourceAnalyticsInstance) + if err := s.D.Set("resource_analytics_instance_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/resource_analytics/resource_analytics_tenancy_attachment_data_source.go b/internal/service/resource_analytics/resource_analytics_tenancy_attachment_data_source.go new file mode 100644 index 00000000000..a65360d6033 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_tenancy_attachment_data_source.go @@ -0,0 +1,104 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsTenancyAttachmentDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["tenancy_attachment_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(ResourceAnalyticsTenancyAttachmentResource(), fieldMap, readSingularResourceAnalyticsTenancyAttachment) +} + +func readSingularResourceAnalyticsTenancyAttachment(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsTenancyAttachmentDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).TenancyAttachmentClient() + + return tfresource.ReadResource(sync) +} + +type ResourceAnalyticsTenancyAttachmentDataSourceCrud struct { + D *schema.ResourceData + Client *oci_resource_analytics.TenancyAttachmentClient + Res *oci_resource_analytics.GetTenancyAttachmentResponse +} + +func (s *ResourceAnalyticsTenancyAttachmentDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ResourceAnalyticsTenancyAttachmentDataSourceCrud) Get() error { + request := oci_resource_analytics.GetTenancyAttachmentRequest{} + + if tenancyAttachmentId, ok := s.D.GetOkExists("tenancy_attachment_id"); ok { + tmp := tenancyAttachmentId.(string) + request.TenancyAttachmentId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "resource_analytics") + + response, err := s.Client.GetTenancyAttachment(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ResourceAnalyticsTenancyAttachmentDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.IsReportingTenancy != nil { + s.D.Set("is_reporting_tenancy", *s.Res.IsReportingTenancy) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.ResourceAnalyticsInstanceId != nil { + s.D.Set("resource_analytics_instance_id", *s.Res.ResourceAnalyticsInstanceId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TenancyId != nil { + s.D.Set("tenancy_id", *s.Res.TenancyId) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} diff --git a/internal/service/resource_analytics/resource_analytics_tenancy_attachment_resource.go b/internal/service/resource_analytics/resource_analytics_tenancy_attachment_resource.go new file mode 100644 index 00000000000..13dded9c6d3 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_tenancy_attachment_resource.go @@ -0,0 +1,478 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsTenancyAttachmentResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: &schema.ResourceTimeout{ + Create: &tfresource.TwoHours, + Update: &tfresource.TwoHours, + Delete: &tfresource.TwoHours, + Read: &tfresource.TwoHours, + }, + Create: createResourceAnalyticsTenancyAttachment, + Read: readResourceAnalyticsTenancyAttachment, + Update: updateResourceAnalyticsTenancyAttachment, + Delete: deleteResourceAnalyticsTenancyAttachment, + Schema: map[string]*schema.Schema{ + // Required + "resource_analytics_instance_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "tenancy_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "is_reporting_tenancy": { + Type: schema.TypeBool, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createResourceAnalyticsTenancyAttachment(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsTenancyAttachmentResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.TenancyAttachmentClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + + return tfresource.CreateResource(d, sync) +} + +func readResourceAnalyticsTenancyAttachment(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsTenancyAttachmentResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).TenancyAttachmentClient() + + return tfresource.ReadResource(sync) +} + +func updateResourceAnalyticsTenancyAttachment(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsTenancyAttachmentResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.TenancyAttachmentClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteResourceAnalyticsTenancyAttachment(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsTenancyAttachmentResourceCrud{} + sync.D = d + clients := m.(*client.OracleClients) + sync.Client = clients.TenancyAttachmentClient() + sync.WorkReqClient = clients.ResourceAnalyticsInstanceClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type ResourceAnalyticsTenancyAttachmentResourceCrud struct { + tfresource.BaseCrud + Client *oci_resource_analytics.TenancyAttachmentClient + WorkReqClient *oci_resource_analytics.ResourceAnalyticsInstanceClient + Res *oci_resource_analytics.TenancyAttachment + DisableNotFoundRetries bool +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) CreatedPending() []string { + return []string{ + string(oci_resource_analytics.TenancyAttachmentLifecycleStateCreating), + } +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_resource_analytics.TenancyAttachmentLifecycleStateActive), + string(oci_resource_analytics.TenancyAttachmentLifecycleStateNeedsAttention), + } +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) DeletedPending() []string { + return []string{ + string(oci_resource_analytics.TenancyAttachmentLifecycleStateDeleting), + } +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_resource_analytics.TenancyAttachmentLifecycleStateDeleted), + } +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) Create() error { + request := oci_resource_analytics.CreateTenancyAttachmentRequest{} + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + if tenancyId, ok := s.D.GetOkExists("tenancy_id"); ok { + tmp := tenancyId.(string) + request.TenancyId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.CreateTenancyAttachment(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + workRequestResponse := oci_resource_analytics.GetWorkRequestResponse{} + workRequestResponse, err = s.WorkReqClient.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), + }, + }) + if err == nil { + // The work request response contains an array of objects + for _, res := range workRequestResponse.Resources { + if res.EntityType != nil && strings.Contains(strings.ToLower(*res.EntityType), "tenancyattachment") && res.Identifier != nil { + s.D.SetId(*res.Identifier) + break + } + } + } + return s.getTenancyAttachmentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) getTenancyAttachmentFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_resource_analytics.ActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + tenancyAttachmentId, err := tenancyAttachmentWaitForWorkRequest(workId, "tenancyattachment", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.WorkReqClient) + + if err != nil { + // Try to cancel the work request + log.Printf("[DEBUG] getTenancyAttachmentFromWorkRequest: creation failed, attempting to cancel the workrequest: %v for identifier: %v\n", workId, tenancyAttachmentId) + _, cancelErr := s.WorkReqClient.CancelWorkRequest(context.Background(), + oci_resource_analytics.CancelWorkRequestRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if cancelErr != nil { + log.Printf("[DEBUG] cleanup cancelWorkRequest failed with the error: %v\n", cancelErr) + } + return err + } + s.D.SetId(*tenancyAttachmentId) + + return s.Get() +} + +func tenancyAttachmentWorkRequestShouldRetryFunc(timeout time.Duration) func(response oci_common.OCIOperationResponse) bool { + startTime := time.Now() + stopTime := startTime.Add(timeout) + return func(response oci_common.OCIOperationResponse) bool { + + // Stop after timeout has elapsed + if time.Now().After(stopTime) { + return false + } + + // Make sure we stop on default rules + if tfresource.ShouldRetry(response, false, "resource_analytics", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_resource_analytics.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func tenancyAttachmentWaitForWorkRequest(wId *string, entityType string, action oci_resource_analytics.ActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, workReqClient *oci_resource_analytics.ResourceAnalyticsInstanceClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "resource_analytics") + retryPolicy.ShouldRetryOperation = tenancyAttachmentWorkRequestShouldRetryFunc(timeout) + + response := oci_resource_analytics.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_resource_analytics.OperationStatusInProgress), + string(oci_resource_analytics.OperationStatusAccepted), + string(oci_resource_analytics.OperationStatusCanceling), + }, + Target: []string{ + string(oci_resource_analytics.OperationStatusSucceeded), + string(oci_resource_analytics.OperationStatusFailed), + string(oci_resource_analytics.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = workReqClient.GetWorkRequest(context.Background(), + oci_resource_analytics.GetWorkRequestRequest{ + WorkRequestId: wId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + wr := &response.WorkRequest + return wr, string(wr.Status), err + }, + Timeout: timeout, + } + if _, e := stateConf.WaitForState(); e != nil { + return nil, e + } + + fmt.Printf("[DEBUG] Searching in WR.resources for [%v] to become [%v] \n", entityType, action) + + var identifier *string + // The work request response contains an array of objects that finished the operation + for _, res := range response.Resources { + if strings.Contains(strings.ToLower(*res.EntityType), entityType) { + if res.ActionType == action { + identifier = res.Identifier + break + } + } + } + + // The workrequest may have failed, check for errors if identifier is not found or work failed or got cancelled + if identifier == nil || response.Status == oci_resource_analytics.OperationStatusFailed || response.Status == oci_resource_analytics.OperationStatusCanceled { + return nil, getErrorFromResourceAnalyticsTenancyAttachmentWorkRequest(workReqClient, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromResourceAnalyticsTenancyAttachmentWorkRequest(workReqClient *oci_resource_analytics.ResourceAnalyticsInstanceClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_resource_analytics.ActionTypeEnum) error { + response, err := workReqClient.ListWorkRequestErrors(context.Background(), + oci_resource_analytics.ListWorkRequestErrorsRequest{ + WorkRequestId: workId, + RequestMetadata: oci_common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + if err != nil { + return err + } + + allErrs := make([]string, 0) + for _, wrkErr := range response.Items { + allErrs = append(allErrs, *wrkErr.Message) + } + errorMessage := strings.Join(allErrs, "\n") + + workRequestErr := fmt.Errorf("work request did not succeed, workId: %s, entity: %s, action: %s. Message: %s", *workId, entityType, action, errorMessage) + + return workRequestErr +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) Get() error { + request := oci_resource_analytics.GetTenancyAttachmentRequest{} + + tmp := s.D.Id() + request.TenancyAttachmentId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.GetTenancyAttachment(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.TenancyAttachment + return nil +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) Update() error { + request := oci_resource_analytics.UpdateTenancyAttachmentRequest{} + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + tmp := s.D.Id() + request.TenancyAttachmentId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.UpdateTenancyAttachment(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getTenancyAttachmentFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics"), oci_resource_analytics.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) Delete() error { + request := oci_resource_analytics.DeleteTenancyAttachmentRequest{} + + tmp := s.D.Id() + request.TenancyAttachmentId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "resource_analytics") + + response, err := s.Client.DeleteTenancyAttachment(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := tenancyAttachmentWaitForWorkRequest(workId, "tenancyattachment", + oci_resource_analytics.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.WorkReqClient) + return delWorkRequestErr +} + +func (s *ResourceAnalyticsTenancyAttachmentResourceCrud) SetData() error { + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.IsReportingTenancy != nil { + s.D.Set("is_reporting_tenancy", *s.Res.IsReportingTenancy) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.ResourceAnalyticsInstanceId != nil { + s.D.Set("resource_analytics_instance_id", *s.Res.ResourceAnalyticsInstanceId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TenancyId != nil { + s.D.Set("tenancy_id", *s.Res.TenancyId) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func TenancyAttachmentSummaryToMap(obj oci_resource_analytics.TenancyAttachmentSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.IsReportingTenancy != nil { + result["is_reporting_tenancy"] = bool(*obj.IsReportingTenancy) + } + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + if obj.ResourceAnalyticsInstanceId != nil { + result["resource_analytics_instance_id"] = string(*obj.ResourceAnalyticsInstanceId) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TenancyId != nil { + result["tenancy_id"] = string(*obj.TenancyId) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + return result +} diff --git a/internal/service/resource_analytics/resource_analytics_tenancy_attachments_data_source.go b/internal/service/resource_analytics/resource_analytics_tenancy_attachments_data_source.go new file mode 100644 index 00000000000..16c49d64d72 --- /dev/null +++ b/internal/service/resource_analytics/resource_analytics_tenancy_attachments_data_source.go @@ -0,0 +1,135 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package resource_analytics + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_resource_analytics "github.com/oracle/oci-go-sdk/v65/resourceanalytics" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ResourceAnalyticsTenancyAttachmentsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readResourceAnalyticsTenancyAttachments, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "id": { + Type: schema.TypeString, + Optional: true, + }, + "resource_analytics_instance_id": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "tenancy_attachment_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(ResourceAnalyticsTenancyAttachmentResource()), + }, + }, + }, + }, + }, + } +} + +func readResourceAnalyticsTenancyAttachments(d *schema.ResourceData, m interface{}) error { + sync := &ResourceAnalyticsTenancyAttachmentsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).TenancyAttachmentClient() + + return tfresource.ReadResource(sync) +} + +type ResourceAnalyticsTenancyAttachmentsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_resource_analytics.TenancyAttachmentClient + Res *oci_resource_analytics.ListTenancyAttachmentsResponse +} + +func (s *ResourceAnalyticsTenancyAttachmentsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ResourceAnalyticsTenancyAttachmentsDataSourceCrud) Get() error { + request := oci_resource_analytics.ListTenancyAttachmentsRequest{} + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if resourceAnalyticsInstanceId, ok := s.D.GetOkExists("resource_analytics_instance_id"); ok { + tmp := resourceAnalyticsInstanceId.(string) + request.ResourceAnalyticsInstanceId = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_resource_analytics.TenancyAttachmentLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "resource_analytics") + + response, err := s.Client.ListTenancyAttachments(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListTenancyAttachments(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 *ResourceAnalyticsTenancyAttachmentsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ResourceAnalyticsTenancyAttachmentsDataSource-", ResourceAnalyticsTenancyAttachmentsDataSource(), s.D)) + resources := []map[string]interface{}{} + tenancyAttachment := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, TenancyAttachmentSummaryToMap(item)) + } + tenancyAttachment["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, ResourceAnalyticsTenancyAttachmentsDataSource().Schema["tenancy_attachment_collection"].Elem.(*schema.Resource).Schema) + tenancyAttachment["items"] = items + } + + resources = append(resources, tenancyAttachment) + if err := s.D.Set("tenancy_attachment_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/tfresource/crud_helpers.go b/internal/tfresource/crud_helpers.go index 775bcc44752..f6c9ab17ae5 100644 --- a/internal/tfresource/crud_helpers.go +++ b/internal/tfresource/crud_helpers.go @@ -11,7 +11,6 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "io" "io/ioutil" "log" @@ -24,6 +23,8 @@ import ( "strings" "time" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" + "hash/crc32" "github.com/oracle/terraform-provider-oci/internal/utils" @@ -1660,3 +1661,50 @@ func ReadResourceWithContext(ctx context.Context, sync ResourceReaderWithContext return nil } + +func WaitForUpdatedStateWithContext(d schemaResourceData, sync ResourceUpdaterWithContext) error { + if stateful, ok := sync.(StatefullyUpdatedResource); ok { + if e := waitForStateRefreshVar(stateful, d.Timeout(schema.TimeoutUpdate), "update", stateful.UpdatedPending(), stateful.UpdatedTarget()); e != nil { + return e + } + } + + return nil +} + +func WaitForResourceConditionWithContext(ctx context.Context, s ResourceFetcherWithContext, resourceChangedFunc func() bool, timeout time.Duration) error { + backoffTime := time.Second + startTime := time.Now() + endTime := startTime.Add(timeout) + lastAttempt := false + for { + if err := s.GetWithContext(ctx); err != nil { + return err + } + + if resourceChangedFunc() { + break + } + + if lastAttempt || time.Now().After(endTime) { + return fmt.Errorf("Timed out waiting for configuration to reach specified condition.") + } + + backoffTime = backoffTime * 2 + + // If next attempt occurs after timeout, then retry earlier + nextAttemptTime := time.Now().Add(backoffTime) + if nextAttemptTime.After(endTime) { + backoffTime = endTime.Sub(time.Now()) + lastAttempt = true + } + + if httpreplay.ShouldRetryImmediately() { + backoffTime = 10 * time.Millisecond + } + + time.Sleep(backoffTime) + } + + return nil +} diff --git a/internal/tfresource/crud_helpers_test.go b/internal/tfresource/crud_helpers_test.go index ef0399beb65..61d82eb1581 100644 --- a/internal/tfresource/crud_helpers_test.go +++ b/internal/tfresource/crud_helpers_test.go @@ -46,6 +46,10 @@ type ResourceCrud struct { extraWaitPostCreateDelete } +func (b ResourceCrud) CreateWithContext(ctx context.Context) error { + return nil +} + func (b ResourceCrud) Create() error { if b.id == "4" { return errors.New("") @@ -108,6 +112,10 @@ type readResourceCrud struct { statefullyDeletedResource } +func (b readResourceCrud) GetWithContext(ctx context.Context) error { + return nil +} + func (b readResourceCrud) Create() error { return nil } @@ -148,6 +156,10 @@ type updateResourceCrud struct { statefullyUpdatedResource } +func (b updateResourceCrud) UpdateWithContext(ctx context.Context) error { + return nil +} + func (b updateResourceCrud) Update() error { return nil } @@ -187,6 +199,10 @@ type deleteResourceCrud struct { extraWaitPostDelete } +func (b deleteResourceCrud) DeleteWithContext(ctx context.Context) error { + return nil +} + func (b deleteResourceCrud) Delete() error { return nil } @@ -318,6 +334,10 @@ type TestResource struct { ActualGetAttempts int } +func (t *TestResource) GetWithContext(ctx context.Context) error { + return nil +} + func (t *TestResource) Get() error { t.ActualGetAttempts++ t.GetAttempts-- @@ -2483,3 +2503,216 @@ func TestUnitValidateNotEmptyString(t *testing.T) { ValidateNotEmptyString()(test.args.i, test.args.k) } } + +func TestUnitWaitForUpdatedStateWithContext(t *testing.T) { + s := &updateResourceCrud{} + reqResourceData := &mockResourceData{} + s.D = reqResourceData + + type args struct { + d *mockResourceData + sync ResourceUpdaterWithContext + } + type testFormat struct { + name string + args args + gotError bool + mockFunc func() + } + tests := []testFormat{ + { + name: "Test error is returned", + args: args{sync: s, d: reqResourceData}, + gotError: true, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + return errors.New("default") + } + }, + }, + { + name: "Test no error is returned", + args: args{sync: s, d: reqResourceData}, + gotError: false, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + return nil + } + }, + }, + } + for _, test := range tests { + t.Logf("Running %s", test.name) + test.mockFunc() + if res := WaitForUpdatedStateWithContext(test.args.d, test.args.sync); (res != nil) != test.gotError { + t.Errorf("Output error - %q which is not equal to expected error - %t", res, test.gotError) + } + } +} + +func TestUnitUpdateResourceWithContext(t *testing.T) { + s := &updateResourceCrud{} + reqResourceData := &mockResourceData{} + s.D = reqResourceData + + type args struct { + d *mockResourceData + sync ResourceUpdaterWithContext + } + type testFormat struct { + name string + args args + gotError bool + mockFunc func() + } + tests := []testFormat{ + { + name: "Test", + args: args{sync: s, d: reqResourceData}, + gotError: true, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + return errors.New("default") + } + }, + }, + { + name: "Test", + args: args{sync: s, d: reqResourceData}, + gotError: false, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + return nil + } + }, + }, + } + for _, test := range tests { + t.Logf("Running %s", test.name) + test.mockFunc() + if res := UpdateResourceWithContext(context.Background(), test.args.d, test.args.sync); (res != nil) != test.gotError { + t.Errorf("Output error - %q which is not equal to expected error - %t", res, test.gotError) + } + } +} + +func TestUnitDeleteResourceWithContext(t *testing.T) { + s := &deleteResourceCrud{} + reqResourceData := &mockResourceData{} + s.D = reqResourceData + + type args struct { + d *mockResourceData + sync ResourceDeleterWithContext + } + type testFormat struct { + name string + args args + gotError bool + mockFunc func() + } + tests := []testFormat{ + { + name: "Test", + args: args{sync: s, d: reqResourceData}, + gotError: true, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + return errors.New("default") + } + }, + }, + { + name: "Test", + args: args{sync: s, d: reqResourceData}, + gotError: false, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + return nil + } + }, + }, + } + for _, test := range tests { + t.Logf("Running %s", test.name) + test.mockFunc() + if res := DeleteResourceWithContext(context.Background(), test.args.d, test.args.sync); (res != nil) != test.gotError { + t.Errorf("Output error - %q which is not equal to expected error - %t", res, test.gotError) + } + } +} + +func TestUnitCreateResourceWithContext(t *testing.T) { + s := &ResourceCrud{} + reqResourceData := &mockResourceData{} + s.D = reqResourceData + + type args struct { + d *mockResourceData + sync ResourceCreatorWithContext + } + type testFormat struct { + name string + args args + gotError bool + mockFunc func() + } + tests := []testFormat{ + { + name: "Test error is returned", + args: args{sync: s, d: reqResourceData}, + gotError: true, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + return errors.New("default") + //return nil + } + }, + }, + { + name: "Test no error is returned", + args: args{sync: s, d: reqResourceData}, + gotError: false, + mockFunc: func() { + waitForStateRefreshVar = func(sr StatefulResource, timeout time.Duration, operationName string, pending []string, target []string) error { + //return errors.New("default") + return nil + } + }, + }, + } + for _, test := range tests { + test.mockFunc() + if res := CreateResourceWithContext(context.Background(), test.args.d, test.args.sync); (res != nil) != test.gotError { + t.Errorf("Output error - %q which is not equal to expected error - %t", res, test.gotError) + } + } +} + +func TestUnitReadResourceWithContext(t *testing.T) { + s := &readResourceCrud{} + reqResourceData := &mockResourceData{} + s.D = reqResourceData + + type args struct { + sync ResourceReaderWithContext + } + type testFormat struct { + name string + args args + gotError bool + } + tests := []testFormat{ + { + name: "Test", + args: args{sync: s}, + gotError: false, + }, + } + for _, test := range tests { + t.Logf("Running %s", test.name) + if res := ReadResourceWithContext(context.Background(), test.args.sync); (res != nil) != test.gotError { + t.Errorf("Output error - %q which is not equal to expected error - %t", res, test.gotError) + } + } +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go index 02988a9f90a..da486ae38a1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go @@ -4,366 +4,366 @@ package common const ( - //RegionAPChuncheon1 region Chuncheon - RegionAPChuncheon1 Region = "ap-chuncheon-1" - //RegionAPHyderabad1 region Hyderabad - RegionAPHyderabad1 Region = "ap-hyderabad-1" - //RegionAPMelbourne1 region Melbourne - RegionAPMelbourne1 Region = "ap-melbourne-1" - //RegionAPMumbai1 region Mumbai - RegionAPMumbai1 Region = "ap-mumbai-1" - //RegionAPOsaka1 region Osaka - RegionAPOsaka1 Region = "ap-osaka-1" - //RegionAPSeoul1 region Seoul - RegionAPSeoul1 Region = "ap-seoul-1" - //RegionAPSydney1 region Sydney - RegionAPSydney1 Region = "ap-sydney-1" - //RegionAPTokyo1 region Tokyo - RegionAPTokyo1 Region = "ap-tokyo-1" - //RegionCAMontreal1 region Montreal - RegionCAMontreal1 Region = "ca-montreal-1" - //RegionCAToronto1 region Toronto - RegionCAToronto1 Region = "ca-toronto-1" - //RegionEUAmsterdam1 region Amsterdam - RegionEUAmsterdam1 Region = "eu-amsterdam-1" - //RegionFRA region Frankfurt - RegionFRA Region = "eu-frankfurt-1" - //RegionEUZurich1 region Zurich - RegionEUZurich1 Region = "eu-zurich-1" - //RegionMEJeddah1 region Jeddah - RegionMEJeddah1 Region = "me-jeddah-1" - //RegionMEDubai1 region Dubai - RegionMEDubai1 Region = "me-dubai-1" - //RegionSASaopaulo1 region Saopaulo - RegionSASaopaulo1 Region = "sa-saopaulo-1" - //RegionUKCardiff1 region Cardiff - RegionUKCardiff1 Region = "uk-cardiff-1" - //RegionLHR region London - RegionLHR Region = "uk-london-1" - //RegionIAD region Ashburn - RegionIAD Region = "us-ashburn-1" - //RegionPHX region Phoenix - RegionPHX Region = "us-phoenix-1" - //RegionSJC1 region Sanjose - RegionSJC1 Region = "us-sanjose-1" - //RegionSAVinhedo1 region Vinhedo - RegionSAVinhedo1 Region = "sa-vinhedo-1" - //RegionSASantiago1 region Santiago - RegionSASantiago1 Region = "sa-santiago-1" - //RegionILJerusalem1 region Jerusalem - RegionILJerusalem1 Region = "il-jerusalem-1" - //RegionEUMarseille1 region Marseille - RegionEUMarseille1 Region = "eu-marseille-1" - //RegionAPSingapore1 region Singapore - RegionAPSingapore1 Region = "ap-singapore-1" - //RegionMEAbudhabi1 region Abudhabi - RegionMEAbudhabi1 Region = "me-abudhabi-1" - //RegionEUMilan1 region Milan - RegionEUMilan1 Region = "eu-milan-1" - //RegionEUStockholm1 region Stockholm - RegionEUStockholm1 Region = "eu-stockholm-1" - //RegionAFJohannesburg1 region Johannesburg - RegionAFJohannesburg1 Region = "af-johannesburg-1" - //RegionEUParis1 region Paris - RegionEUParis1 Region = "eu-paris-1" - //RegionMXQueretaro1 region Queretaro - RegionMXQueretaro1 Region = "mx-queretaro-1" - //RegionEUMadrid1 region Madrid - RegionEUMadrid1 Region = "eu-madrid-1" - //RegionUSChicago1 region Chicago - RegionUSChicago1 Region = "us-chicago-1" - //RegionMXMonterrey1 region Monterrey - RegionMXMonterrey1 Region = "mx-monterrey-1" - //RegionUSSaltlake2 region Saltlake - RegionUSSaltlake2 Region = "us-saltlake-2" - //RegionSABogota1 region Bogota - RegionSABogota1 Region = "sa-bogota-1" - //RegionSAValparaiso1 region Valparaiso - RegionSAValparaiso1 Region = "sa-valparaiso-1" - //RegionAPSingapore2 region Singapore - RegionAPSingapore2 Region = "ap-singapore-2" - //RegionMERiyadh1 region Riyadh - RegionMERiyadh1 Region = "me-riyadh-1" - //RegionAPDelhi1 region Delhi - RegionAPDelhi1 Region = "ap-delhi-1" - //RegionAPBatam1 region Batam - RegionAPBatam1 Region = "ap-batam-1" - //RegionUSLangley1 region Langley - RegionUSLangley1 Region = "us-langley-1" - //RegionUSLuke1 region Luke - RegionUSLuke1 Region = "us-luke-1" - //RegionUSGovAshburn1 gov region Ashburn - RegionUSGovAshburn1 Region = "us-gov-ashburn-1" - //RegionUSGovChicago1 gov region Chicago - RegionUSGovChicago1 Region = "us-gov-chicago-1" - //RegionUSGovPhoenix1 gov region Phoenix - RegionUSGovPhoenix1 Region = "us-gov-phoenix-1" - //RegionUKGovLondon1 gov region London - RegionUKGovLondon1 Region = "uk-gov-london-1" - //RegionUKGovCardiff1 gov region Cardiff - RegionUKGovCardiff1 Region = "uk-gov-cardiff-1" - //RegionAPChiyoda1 region Chiyoda - RegionAPChiyoda1 Region = "ap-chiyoda-1" - //RegionAPIbaraki1 region Ibaraki - RegionAPIbaraki1 Region = "ap-ibaraki-1" - //RegionMEDccMuscat1 region Muscat - RegionMEDccMuscat1 Region = "me-dcc-muscat-1" - //RegionMEIbri1 region Ibri - RegionMEIbri1 Region = "me-ibri-1" - //RegionAPDccCanberra1 region Canberra - RegionAPDccCanberra1 Region = "ap-dcc-canberra-1" - //RegionEUDccMilan1 region Milan - RegionEUDccMilan1 Region = "eu-dcc-milan-1" - //RegionEUDccMilan2 region Milan - RegionEUDccMilan2 Region = "eu-dcc-milan-2" - //RegionEUDccDublin2 region Dublin - RegionEUDccDublin2 Region = "eu-dcc-dublin-2" - //RegionEUDccRating2 region Rating - RegionEUDccRating2 Region = "eu-dcc-rating-2" - //RegionEUDccRating1 region Rating - RegionEUDccRating1 Region = "eu-dcc-rating-1" - //RegionEUDccDublin1 region Dublin - RegionEUDccDublin1 Region = "eu-dcc-dublin-1" - //RegionAPDccGazipur1 region Gazipur - RegionAPDccGazipur1 Region = "ap-dcc-gazipur-1" - //RegionEUMadrid2 region Madrid - RegionEUMadrid2 Region = "eu-madrid-2" - //RegionEUFrankfurt2 region Frankfurt - RegionEUFrankfurt2 Region = "eu-frankfurt-2" - //RegionEUJovanovac1 region Jovanovac - RegionEUJovanovac1 Region = "eu-jovanovac-1" - //RegionMEDccDoha1 region Doha - RegionMEDccDoha1 Region = "me-dcc-doha-1" - //RegionUSSomerset1 region Somerset - RegionUSSomerset1 Region = "us-somerset-1" - //RegionUSThames1 region Thames - RegionUSThames1 Region = "us-thames-1" - //RegionEUDccZurich1 region Zurich - RegionEUDccZurich1 Region = "eu-dcc-zurich-1" - //RegionEUCrissier1 region Crissier - RegionEUCrissier1 Region = "eu-crissier-1" - //RegionMEAbudhabi3 region Abudhabi - RegionMEAbudhabi3 Region = "me-abudhabi-3" - //RegionMEAlain1 region Alain - RegionMEAlain1 Region = "me-alain-1" - //RegionMEAbudhabi2 region Abudhabi - RegionMEAbudhabi2 Region = "me-abudhabi-2" - //RegionMEAbudhabi4 region Abudhabi - RegionMEAbudhabi4 Region = "me-abudhabi-4" - //RegionAPSeoul2 region Seoul - RegionAPSeoul2 Region = "ap-seoul-2" - //RegionAPSuwon1 region Suwon - RegionAPSuwon1 Region = "ap-suwon-1" - //RegionAPChuncheon2 region Chuncheon - RegionAPChuncheon2 Region = "ap-chuncheon-2" - //RegionUSAshburn2 region Ashburn - RegionUSAshburn2 Region = "us-ashburn-2" - //RegionUSNewark1 region Newark - RegionUSNewark1 Region = "us-newark-1" - //RegionEUBudapest1 region Budapest - RegionEUBudapest1 Region = "eu-budapest-1" + //RegionAPChuncheon1 region Chuncheon + RegionAPChuncheon1 Region = "ap-chuncheon-1" + //RegionAPHyderabad1 region Hyderabad + RegionAPHyderabad1 Region = "ap-hyderabad-1" + //RegionAPMelbourne1 region Melbourne + RegionAPMelbourne1 Region = "ap-melbourne-1" + //RegionAPMumbai1 region Mumbai + RegionAPMumbai1 Region = "ap-mumbai-1" + //RegionAPOsaka1 region Osaka + RegionAPOsaka1 Region = "ap-osaka-1" + //RegionAPSeoul1 region Seoul + RegionAPSeoul1 Region = "ap-seoul-1" + //RegionAPSydney1 region Sydney + RegionAPSydney1 Region = "ap-sydney-1" + //RegionAPTokyo1 region Tokyo + RegionAPTokyo1 Region = "ap-tokyo-1" + //RegionCAMontreal1 region Montreal + RegionCAMontreal1 Region = "ca-montreal-1" + //RegionCAToronto1 region Toronto + RegionCAToronto1 Region = "ca-toronto-1" + //RegionEUAmsterdam1 region Amsterdam + RegionEUAmsterdam1 Region = "eu-amsterdam-1" + //RegionFRA region Frankfurt + RegionFRA Region = "eu-frankfurt-1" + //RegionEUZurich1 region Zurich + RegionEUZurich1 Region = "eu-zurich-1" + //RegionMEJeddah1 region Jeddah + RegionMEJeddah1 Region = "me-jeddah-1" + //RegionMEDubai1 region Dubai + RegionMEDubai1 Region = "me-dubai-1" + //RegionSASaopaulo1 region Saopaulo + RegionSASaopaulo1 Region = "sa-saopaulo-1" + //RegionUKCardiff1 region Cardiff + RegionUKCardiff1 Region = "uk-cardiff-1" + //RegionLHR region London + RegionLHR Region = "uk-london-1" + //RegionIAD region Ashburn + RegionIAD Region = "us-ashburn-1" + //RegionPHX region Phoenix + RegionPHX Region = "us-phoenix-1" + //RegionSJC1 region Sanjose + RegionSJC1 Region = "us-sanjose-1" + //RegionSAVinhedo1 region Vinhedo + RegionSAVinhedo1 Region = "sa-vinhedo-1" + //RegionSASantiago1 region Santiago + RegionSASantiago1 Region = "sa-santiago-1" + //RegionILJerusalem1 region Jerusalem + RegionILJerusalem1 Region = "il-jerusalem-1" + //RegionEUMarseille1 region Marseille + RegionEUMarseille1 Region = "eu-marseille-1" + //RegionAPSingapore1 region Singapore + RegionAPSingapore1 Region = "ap-singapore-1" + //RegionMEAbudhabi1 region Abudhabi + RegionMEAbudhabi1 Region = "me-abudhabi-1" + //RegionEUMilan1 region Milan + RegionEUMilan1 Region = "eu-milan-1" + //RegionEUStockholm1 region Stockholm + RegionEUStockholm1 Region = "eu-stockholm-1" + //RegionAFJohannesburg1 region Johannesburg + RegionAFJohannesburg1 Region = "af-johannesburg-1" + //RegionEUParis1 region Paris + RegionEUParis1 Region = "eu-paris-1" + //RegionMXQueretaro1 region Queretaro + RegionMXQueretaro1 Region = "mx-queretaro-1" + //RegionEUMadrid1 region Madrid + RegionEUMadrid1 Region = "eu-madrid-1" + //RegionUSChicago1 region Chicago + RegionUSChicago1 Region = "us-chicago-1" + //RegionMXMonterrey1 region Monterrey + RegionMXMonterrey1 Region = "mx-monterrey-1" + //RegionUSSaltlake2 region Saltlake + RegionUSSaltlake2 Region = "us-saltlake-2" + //RegionSABogota1 region Bogota + RegionSABogota1 Region = "sa-bogota-1" + //RegionSAValparaiso1 region Valparaiso + RegionSAValparaiso1 Region = "sa-valparaiso-1" + //RegionAPSingapore2 region Singapore + RegionAPSingapore2 Region = "ap-singapore-2" + //RegionMERiyadh1 region Riyadh + RegionMERiyadh1 Region = "me-riyadh-1" + //RegionAPDelhi1 region Delhi + RegionAPDelhi1 Region = "ap-delhi-1" + //RegionAPBatam1 region Batam + RegionAPBatam1 Region = "ap-batam-1" + //RegionUSLangley1 region Langley + RegionUSLangley1 Region = "us-langley-1" + //RegionUSLuke1 region Luke + RegionUSLuke1 Region = "us-luke-1" + //RegionUSGovAshburn1 gov region Ashburn + RegionUSGovAshburn1 Region = "us-gov-ashburn-1" + //RegionUSGovChicago1 gov region Chicago + RegionUSGovChicago1 Region = "us-gov-chicago-1" + //RegionUSGovPhoenix1 gov region Phoenix + RegionUSGovPhoenix1 Region = "us-gov-phoenix-1" + //RegionUKGovLondon1 gov region London + RegionUKGovLondon1 Region = "uk-gov-london-1" + //RegionUKGovCardiff1 gov region Cardiff + RegionUKGovCardiff1 Region = "uk-gov-cardiff-1" + //RegionAPChiyoda1 region Chiyoda + RegionAPChiyoda1 Region = "ap-chiyoda-1" + //RegionAPIbaraki1 region Ibaraki + RegionAPIbaraki1 Region = "ap-ibaraki-1" + //RegionMEDccMuscat1 region Muscat + RegionMEDccMuscat1 Region = "me-dcc-muscat-1" + //RegionMEIbri1 region Ibri + RegionMEIbri1 Region = "me-ibri-1" + //RegionAPDccCanberra1 region Canberra + RegionAPDccCanberra1 Region = "ap-dcc-canberra-1" + //RegionEUDccMilan1 region Milan + RegionEUDccMilan1 Region = "eu-dcc-milan-1" + //RegionEUDccMilan2 region Milan + RegionEUDccMilan2 Region = "eu-dcc-milan-2" + //RegionEUDccDublin2 region Dublin + RegionEUDccDublin2 Region = "eu-dcc-dublin-2" + //RegionEUDccRating2 region Rating + RegionEUDccRating2 Region = "eu-dcc-rating-2" + //RegionEUDccRating1 region Rating + RegionEUDccRating1 Region = "eu-dcc-rating-1" + //RegionEUDccDublin1 region Dublin + RegionEUDccDublin1 Region = "eu-dcc-dublin-1" + //RegionAPDccGazipur1 region Gazipur + RegionAPDccGazipur1 Region = "ap-dcc-gazipur-1" + //RegionEUMadrid2 region Madrid + RegionEUMadrid2 Region = "eu-madrid-2" + //RegionEUFrankfurt2 region Frankfurt + RegionEUFrankfurt2 Region = "eu-frankfurt-2" + //RegionEUJovanovac1 region Jovanovac + RegionEUJovanovac1 Region = "eu-jovanovac-1" + //RegionMEDccDoha1 region Doha + RegionMEDccDoha1 Region = "me-dcc-doha-1" + //RegionUSSomerset1 region Somerset + RegionUSSomerset1 Region = "us-somerset-1" + //RegionUSThames1 region Thames + RegionUSThames1 Region = "us-thames-1" + //RegionEUDccZurich1 region Zurich + RegionEUDccZurich1 Region = "eu-dcc-zurich-1" + //RegionEUCrissier1 region Crissier + RegionEUCrissier1 Region = "eu-crissier-1" + //RegionMEAbudhabi3 region Abudhabi + RegionMEAbudhabi3 Region = "me-abudhabi-3" + //RegionMEAlain1 region Alain + RegionMEAlain1 Region = "me-alain-1" + //RegionMEAbudhabi2 region Abudhabi + RegionMEAbudhabi2 Region = "me-abudhabi-2" + //RegionMEAbudhabi4 region Abudhabi + RegionMEAbudhabi4 Region = "me-abudhabi-4" + //RegionAPSeoul2 region Seoul + RegionAPSeoul2 Region = "ap-seoul-2" + //RegionAPSuwon1 region Suwon + RegionAPSuwon1 Region = "ap-suwon-1" + //RegionAPChuncheon2 region Chuncheon + RegionAPChuncheon2 Region = "ap-chuncheon-2" + //RegionUSAshburn2 region Ashburn + RegionUSAshburn2 Region = "us-ashburn-2" + //RegionUSNewark1 region Newark + RegionUSNewark1 Region = "us-newark-1" + //RegionEUBudapest1 region Budapest + RegionEUBudapest1 Region = "eu-budapest-1" ) var shortNameRegion = map[string]Region{ - "yny": RegionAPChuncheon1, - "hyd": RegionAPHyderabad1, - "mel": RegionAPMelbourne1, - "bom": RegionAPMumbai1, - "kix": RegionAPOsaka1, - "icn": RegionAPSeoul1, - "syd": RegionAPSydney1, - "nrt": RegionAPTokyo1, - "yul": RegionCAMontreal1, - "yyz": RegionCAToronto1, - "ams": RegionEUAmsterdam1, - "fra": RegionFRA, - "zrh": RegionEUZurich1, - "jed": RegionMEJeddah1, - "dxb": RegionMEDubai1, - "gru": RegionSASaopaulo1, - "cwl": RegionUKCardiff1, - "lhr": RegionLHR, - "iad": RegionIAD, - "phx": RegionPHX, - "sjc": RegionSJC1, - "vcp": RegionSAVinhedo1, - "scl": RegionSASantiago1, - "mtz": RegionILJerusalem1, - "mrs": RegionEUMarseille1, - "sin": RegionAPSingapore1, - "auh": RegionMEAbudhabi1, - "lin": RegionEUMilan1, - "arn": RegionEUStockholm1, - "jnb": RegionAFJohannesburg1, - "cdg": RegionEUParis1, - "qro": RegionMXQueretaro1, - "mad": RegionEUMadrid1, - "ord": RegionUSChicago1, - "mty": RegionMXMonterrey1, - "aga": RegionUSSaltlake2, - "bog": RegionSABogota1, - "vap": RegionSAValparaiso1, - "xsp": RegionAPSingapore2, - "ruh": RegionMERiyadh1, - "onm": RegionAPDelhi1, - "hsg": RegionAPBatam1, - "lfi": RegionUSLangley1, - "luf": RegionUSLuke1, - "ric": RegionUSGovAshburn1, - "pia": RegionUSGovChicago1, - "tus": RegionUSGovPhoenix1, - "ltn": RegionUKGovLondon1, - "brs": RegionUKGovCardiff1, - "nja": RegionAPChiyoda1, - "ukb": RegionAPIbaraki1, - "mct": RegionMEDccMuscat1, - "ibr": RegionMEIbri1, - "wga": RegionAPDccCanberra1, - "bgy": RegionEUDccMilan1, - "mxp": RegionEUDccMilan2, - "snn": RegionEUDccDublin2, - "dtm": RegionEUDccRating2, - "dus": RegionEUDccRating1, - "ork": RegionEUDccDublin1, - "dac": RegionAPDccGazipur1, - "vll": RegionEUMadrid2, - "str": RegionEUFrankfurt2, - "beg": RegionEUJovanovac1, - "doh": RegionMEDccDoha1, - "ebb": RegionUSSomerset1, - "ebl": RegionUSThames1, - "avz": RegionEUDccZurich1, - "avf": RegionEUCrissier1, - "ahu": RegionMEAbudhabi3, - "rba": RegionMEAlain1, - "rkt": RegionMEAbudhabi2, - "shj": RegionMEAbudhabi4, - "dtz": RegionAPSeoul2, - "dln": RegionAPSuwon1, - "bno": RegionAPChuncheon2, - "yxj": RegionUSAshburn2, - "pgc": RegionUSNewark1, - "jsk": RegionEUBudapest1, + "yny": RegionAPChuncheon1, + "hyd": RegionAPHyderabad1, + "mel": RegionAPMelbourne1, + "bom": RegionAPMumbai1, + "kix": RegionAPOsaka1, + "icn": RegionAPSeoul1, + "syd": RegionAPSydney1, + "nrt": RegionAPTokyo1, + "yul": RegionCAMontreal1, + "yyz": RegionCAToronto1, + "ams": RegionEUAmsterdam1, + "fra": RegionFRA, + "zrh": RegionEUZurich1, + "jed": RegionMEJeddah1, + "dxb": RegionMEDubai1, + "gru": RegionSASaopaulo1, + "cwl": RegionUKCardiff1, + "lhr": RegionLHR, + "iad": RegionIAD, + "phx": RegionPHX, + "sjc": RegionSJC1, + "vcp": RegionSAVinhedo1, + "scl": RegionSASantiago1, + "mtz": RegionILJerusalem1, + "mrs": RegionEUMarseille1, + "sin": RegionAPSingapore1, + "auh": RegionMEAbudhabi1, + "lin": RegionEUMilan1, + "arn": RegionEUStockholm1, + "jnb": RegionAFJohannesburg1, + "cdg": RegionEUParis1, + "qro": RegionMXQueretaro1, + "mad": RegionEUMadrid1, + "ord": RegionUSChicago1, + "mty": RegionMXMonterrey1, + "aga": RegionUSSaltlake2, + "bog": RegionSABogota1, + "vap": RegionSAValparaiso1, + "xsp": RegionAPSingapore2, + "ruh": RegionMERiyadh1, + "onm": RegionAPDelhi1, + "hsg": RegionAPBatam1, + "lfi": RegionUSLangley1, + "luf": RegionUSLuke1, + "ric": RegionUSGovAshburn1, + "pia": RegionUSGovChicago1, + "tus": RegionUSGovPhoenix1, + "ltn": RegionUKGovLondon1, + "brs": RegionUKGovCardiff1, + "nja": RegionAPChiyoda1, + "ukb": RegionAPIbaraki1, + "mct": RegionMEDccMuscat1, + "ibr": RegionMEIbri1, + "wga": RegionAPDccCanberra1, + "bgy": RegionEUDccMilan1, + "mxp": RegionEUDccMilan2, + "snn": RegionEUDccDublin2, + "dtm": RegionEUDccRating2, + "dus": RegionEUDccRating1, + "ork": RegionEUDccDublin1, + "dac": RegionAPDccGazipur1, + "vll": RegionEUMadrid2, + "str": RegionEUFrankfurt2, + "beg": RegionEUJovanovac1, + "doh": RegionMEDccDoha1, + "ebb": RegionUSSomerset1, + "ebl": RegionUSThames1, + "avz": RegionEUDccZurich1, + "avf": RegionEUCrissier1, + "ahu": RegionMEAbudhabi3, + "rba": RegionMEAlain1, + "rkt": RegionMEAbudhabi2, + "shj": RegionMEAbudhabi4, + "dtz": RegionAPSeoul2, + "dln": RegionAPSuwon1, + "bno": RegionAPChuncheon2, + "yxj": RegionUSAshburn2, + "pgc": RegionUSNewark1, + "jsk": RegionEUBudapest1, } var realm = map[string]string{ - "oc1": "oraclecloud.com", - "oc2": "oraclegovcloud.com", - "oc3": "oraclegovcloud.com", - "oc4": "oraclegovcloud.uk", - "oc8": "oraclecloud8.com", - "oc9": "oraclecloud9.com", - "oc10": "oraclecloud10.com", - "oc14": "oraclecloud14.com", - "oc15": "oraclecloud15.com", - "oc19": "oraclecloud.eu", - "oc20": "oraclecloud20.com", - "oc21": "oraclecloud21.com", - "oc23": "oraclecloud23.com", - "oc24": "oraclecloud24.com", - "oc26": "oraclecloud26.com", - "oc29": "oraclecloud29.com", - "oc35": "oraclecloud35.com", - "oc42": "oraclecloud42.com", - "oc51": "oraclecloud51.com", + "oc1": "oraclecloud.com", + "oc2": "oraclegovcloud.com", + "oc3": "oraclegovcloud.com", + "oc4": "oraclegovcloud.uk", + "oc8": "oraclecloud8.com", + "oc9": "oraclecloud9.com", + "oc10": "oraclecloud10.com", + "oc14": "oraclecloud14.com", + "oc15": "oraclecloud15.com", + "oc19": "oraclecloud.eu", + "oc20": "oraclecloud20.com", + "oc21": "oraclecloud21.com", + "oc23": "oraclecloud23.com", + "oc24": "oraclecloud24.com", + "oc26": "oraclecloud26.com", + "oc29": "oraclecloud29.com", + "oc35": "oraclecloud35.com", + "oc42": "oraclecloud42.com", + "oc51": "oraclecloud51.com", } var regionRealm = map[Region]string{ - RegionAPChuncheon1: "oc1", - RegionAPHyderabad1: "oc1", - RegionAPMelbourne1: "oc1", - RegionAPMumbai1: "oc1", - RegionAPOsaka1: "oc1", - RegionAPSeoul1: "oc1", - RegionAPSydney1: "oc1", - RegionAPTokyo1: "oc1", - RegionCAMontreal1: "oc1", - RegionCAToronto1: "oc1", - RegionEUAmsterdam1: "oc1", - RegionFRA: "oc1", - RegionEUZurich1: "oc1", - RegionMEJeddah1: "oc1", - RegionMEDubai1: "oc1", - RegionSASaopaulo1: "oc1", - RegionUKCardiff1: "oc1", - RegionLHR: "oc1", - RegionIAD: "oc1", - RegionPHX: "oc1", - RegionSJC1: "oc1", - RegionSAVinhedo1: "oc1", - RegionSASantiago1: "oc1", - RegionILJerusalem1: "oc1", - RegionEUMarseille1: "oc1", - RegionAPSingapore1: "oc1", - RegionMEAbudhabi1: "oc1", - RegionEUMilan1: "oc1", - RegionEUStockholm1: "oc1", - RegionAFJohannesburg1: "oc1", - RegionEUParis1: "oc1", - RegionMXQueretaro1: "oc1", - RegionEUMadrid1: "oc1", - RegionUSChicago1: "oc1", - RegionMXMonterrey1: "oc1", - RegionUSSaltlake2: "oc1", - RegionSABogota1: "oc1", - RegionSAValparaiso1: "oc1", - RegionAPSingapore2: "oc1", - RegionMERiyadh1: "oc1", - RegionAPDelhi1: "oc1", - RegionAPBatam1: "oc1", + RegionAPChuncheon1: "oc1", + RegionAPHyderabad1: "oc1", + RegionAPMelbourne1: "oc1", + RegionAPMumbai1: "oc1", + RegionAPOsaka1: "oc1", + RegionAPSeoul1: "oc1", + RegionAPSydney1: "oc1", + RegionAPTokyo1: "oc1", + RegionCAMontreal1: "oc1", + RegionCAToronto1: "oc1", + RegionEUAmsterdam1: "oc1", + RegionFRA: "oc1", + RegionEUZurich1: "oc1", + RegionMEJeddah1: "oc1", + RegionMEDubai1: "oc1", + RegionSASaopaulo1: "oc1", + RegionUKCardiff1: "oc1", + RegionLHR: "oc1", + RegionIAD: "oc1", + RegionPHX: "oc1", + RegionSJC1: "oc1", + RegionSAVinhedo1: "oc1", + RegionSASantiago1: "oc1", + RegionILJerusalem1: "oc1", + RegionEUMarseille1: "oc1", + RegionAPSingapore1: "oc1", + RegionMEAbudhabi1: "oc1", + RegionEUMilan1: "oc1", + RegionEUStockholm1: "oc1", + RegionAFJohannesburg1: "oc1", + RegionEUParis1: "oc1", + RegionMXQueretaro1: "oc1", + RegionEUMadrid1: "oc1", + RegionUSChicago1: "oc1", + RegionMXMonterrey1: "oc1", + RegionUSSaltlake2: "oc1", + RegionSABogota1: "oc1", + RegionSAValparaiso1: "oc1", + RegionAPSingapore2: "oc1", + RegionMERiyadh1: "oc1", + RegionAPDelhi1: "oc1", + RegionAPBatam1: "oc1", - RegionUSLangley1: "oc2", - RegionUSLuke1: "oc2", + RegionUSLangley1: "oc2", + RegionUSLuke1: "oc2", - RegionUSGovAshburn1: "oc3", - RegionUSGovChicago1: "oc3", - RegionUSGovPhoenix1: "oc3", + RegionUSGovAshburn1: "oc3", + RegionUSGovChicago1: "oc3", + RegionUSGovPhoenix1: "oc3", - RegionUKGovLondon1: "oc4", - RegionUKGovCardiff1: "oc4", + RegionUKGovLondon1: "oc4", + RegionUKGovCardiff1: "oc4", - RegionAPChiyoda1: "oc8", - RegionAPIbaraki1: "oc8", + RegionAPChiyoda1: "oc8", + RegionAPIbaraki1: "oc8", - RegionMEDccMuscat1: "oc9", - RegionMEIbri1: "oc9", + RegionMEDccMuscat1: "oc9", + RegionMEIbri1: "oc9", - RegionAPDccCanberra1: "oc10", + RegionAPDccCanberra1: "oc10", - RegionEUDccMilan1: "oc14", - RegionEUDccMilan2: "oc14", - RegionEUDccDublin2: "oc14", - RegionEUDccRating2: "oc14", - RegionEUDccRating1: "oc14", - RegionEUDccDublin1: "oc14", + RegionEUDccMilan1: "oc14", + RegionEUDccMilan2: "oc14", + RegionEUDccDublin2: "oc14", + RegionEUDccRating2: "oc14", + RegionEUDccRating1: "oc14", + RegionEUDccDublin1: "oc14", - RegionAPDccGazipur1: "oc15", + RegionAPDccGazipur1: "oc15", - RegionEUMadrid2: "oc19", - RegionEUFrankfurt2: "oc19", + RegionEUMadrid2: "oc19", + RegionEUFrankfurt2: "oc19", - RegionEUJovanovac1: "oc20", + RegionEUJovanovac1: "oc20", - RegionMEDccDoha1: "oc21", + RegionMEDccDoha1: "oc21", - RegionUSSomerset1: "oc23", - RegionUSThames1: "oc23", + RegionUSSomerset1: "oc23", + RegionUSThames1: "oc23", - RegionEUDccZurich1: "oc24", - RegionEUCrissier1: "oc24", + RegionEUDccZurich1: "oc24", + RegionEUCrissier1: "oc24", - RegionMEAbudhabi3: "oc26", - RegionMEAlain1: "oc26", + RegionMEAbudhabi3: "oc26", + RegionMEAlain1: "oc26", - RegionMEAbudhabi2: "oc29", - RegionMEAbudhabi4: "oc29", + RegionMEAbudhabi2: "oc29", + RegionMEAbudhabi4: "oc29", - RegionAPSeoul2: "oc35", - RegionAPSuwon1: "oc35", - RegionAPChuncheon2: "oc35", + RegionAPSeoul2: "oc35", + RegionAPSuwon1: "oc35", + RegionAPChuncheon2: "oc35", - RegionUSAshburn2: "oc42", - RegionUSNewark1: "oc42", + RegionUSAshburn2: "oc42", + RegionUSNewark1: "oc42", - RegionEUBudapest1: "oc51", + RegionEUBudapest1: "oc51", } 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 7f93f362efd..baafa17eda9 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 = "101" - patch = "0" + patch = "1" tag = "" ) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_launch_instance_platform_config.go index 9fd7dc79004..94bf196fd50 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_launch_instance_platform_config.go @@ -126,6 +126,7 @@ const ( AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1 AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2 AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4 AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6 AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -133,6 +134,7 @@ var mappingAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map "NPS1": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +142,7 @@ var mappingAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerC "nps1": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -158,6 +161,7 @@ func GetAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumStringVal "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_platform_config.go index 6fb119fbc41..94671e52549 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_gpu_platform_config.go @@ -126,6 +126,7 @@ const ( AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps1 AmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps2 AmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps4 AmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps6 AmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum = map[string]AmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum{ @@ -133,6 +134,7 @@ var mappingAmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum = map[string]AmdMil "NPS1": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps6, } var mappingAmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +142,7 @@ var mappingAmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnumLowerCase = map[stri "nps1": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps1, "nps2": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps2, "nps4": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdMilanBmGpuPlatformConfigNumaNodesPerSocketNps6, } // GetAmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnum @@ -158,6 +161,7 @@ func GetAmdMilanBmGpuPlatformConfigNumaNodesPerSocketEnumStringValues() []string "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_launch_instance_platform_config.go index 61a5501cc6b..43e5150085e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_launch_instance_platform_config.go @@ -134,6 +134,7 @@ const ( AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6 AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -141,6 +142,7 @@ var mappingAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[st "NPS1": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -148,6 +150,7 @@ var mappingAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase "nps1": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -166,6 +169,7 @@ func GetAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumStringValues "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_platform_config.go index aa44163d42c..e7e9ff89425 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_milan_bm_platform_config.go @@ -134,6 +134,7 @@ const ( AmdMilanBmPlatformConfigNumaNodesPerSocketNps1 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdMilanBmPlatformConfigNumaNodesPerSocketNps2 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdMilanBmPlatformConfigNumaNodesPerSocketNps4 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdMilanBmPlatformConfigNumaNodesPerSocketNps6 AmdMilanBmPlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdMilanBmPlatformConfigNumaNodesPerSocketEnum = map[string]AmdMilanBmPlatformConfigNumaNodesPerSocketEnum{ @@ -141,6 +142,7 @@ var mappingAmdMilanBmPlatformConfigNumaNodesPerSocketEnum = map[string]AmdMilanB "NPS1": AmdMilanBmPlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdMilanBmPlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdMilanBmPlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdMilanBmPlatformConfigNumaNodesPerSocketNps6, } var mappingAmdMilanBmPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdMilanBmPlatformConfigNumaNodesPerSocketEnum{ @@ -148,6 +150,7 @@ var mappingAmdMilanBmPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string] "nps1": AmdMilanBmPlatformConfigNumaNodesPerSocketNps1, "nps2": AmdMilanBmPlatformConfigNumaNodesPerSocketNps2, "nps4": AmdMilanBmPlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdMilanBmPlatformConfigNumaNodesPerSocketNps6, } // GetAmdMilanBmPlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdMilanBmPlatformConfigNumaNodesPerSocketEnum @@ -166,6 +169,7 @@ func GetAmdMilanBmPlatformConfigNumaNodesPerSocketEnumStringValues() []string { "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_launch_instance_platform_config.go index d81b8661dc6..29013468523 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_launch_instance_platform_config.go @@ -126,6 +126,7 @@ const ( AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1 AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2 AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4 AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6 AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -133,6 +134,7 @@ var mappingAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[ "NPS1": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +142,7 @@ var mappingAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCa "nps1": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -158,6 +161,7 @@ func GetAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumStringValu "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_platform_config.go index c0572020819..ce3f562160e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_gpu_platform_config.go @@ -126,6 +126,7 @@ const ( AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps1 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps2 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps4 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps6 AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = map[string]AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum{ @@ -133,6 +134,7 @@ var mappingAmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum = map[string]AmdRome "NPS1": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps6, } var mappingAmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +142,7 @@ var mappingAmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnumLowerCase = map[strin "nps1": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps1, "nps2": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps2, "nps4": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdRomeBmGpuPlatformConfigNumaNodesPerSocketNps6, } // GetAmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnum @@ -158,6 +161,7 @@ func GetAmdRomeBmGpuPlatformConfigNumaNodesPerSocketEnumStringValues() []string "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_launch_instance_platform_config.go index 410baf33602..b76373c8b2a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_launch_instance_platform_config.go @@ -134,6 +134,7 @@ const ( AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1 AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2 AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4 AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6 AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -141,6 +142,7 @@ var mappingAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[str "NPS1": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -148,6 +150,7 @@ var mappingAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase "nps1": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -166,6 +169,7 @@ func GetAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumStringValues( "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_platform_config.go index 60401c1d682..f3320a54208 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/amd_rome_bm_platform_config.go @@ -133,6 +133,7 @@ const ( AmdRomeBmPlatformConfigNumaNodesPerSocketNps1 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS1" AmdRomeBmPlatformConfigNumaNodesPerSocketNps2 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS2" AmdRomeBmPlatformConfigNumaNodesPerSocketNps4 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS4" + AmdRomeBmPlatformConfigNumaNodesPerSocketNps6 AmdRomeBmPlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingAmdRomeBmPlatformConfigNumaNodesPerSocketEnum = map[string]AmdRomeBmPlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +141,7 @@ var mappingAmdRomeBmPlatformConfigNumaNodesPerSocketEnum = map[string]AmdRomeBmP "NPS1": AmdRomeBmPlatformConfigNumaNodesPerSocketNps1, "NPS2": AmdRomeBmPlatformConfigNumaNodesPerSocketNps2, "NPS4": AmdRomeBmPlatformConfigNumaNodesPerSocketNps4, + "NPS6": AmdRomeBmPlatformConfigNumaNodesPerSocketNps6, } var mappingAmdRomeBmPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]AmdRomeBmPlatformConfigNumaNodesPerSocketEnum{ @@ -147,6 +149,7 @@ var mappingAmdRomeBmPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]A "nps1": AmdRomeBmPlatformConfigNumaNodesPerSocketNps1, "nps2": AmdRomeBmPlatformConfigNumaNodesPerSocketNps2, "nps4": AmdRomeBmPlatformConfigNumaNodesPerSocketNps4, + "nps6": AmdRomeBmPlatformConfigNumaNodesPerSocketNps6, } // GetAmdRomeBmPlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for AmdRomeBmPlatformConfigNumaNodesPerSocketEnum @@ -165,6 +168,7 @@ func GetAmdRomeBmPlatformConfigNumaNodesPerSocketEnumStringValues() []string { "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/compute_image_capability_schema.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/compute_image_capability_schema.go index 5fcfb45516b..b68ec1e2d41 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/compute_image_capability_schema.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/compute_image_capability_schema.go @@ -53,6 +53,9 @@ type ComputeImageCapabilitySchema struct { // The OCID of the compartment that contains the resource. CompartmentId *string `mandatory:"false" json:"compartmentId"` + // The ComputeImageCapabilitySchema current lifecycle state. + LifecycleState ComputeImageCapabilitySchemaLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + // Defined tags for this resource. Each key is predefined and scoped to a // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` @@ -74,6 +77,9 @@ func (m ComputeImageCapabilitySchema) String() string { func (m ComputeImageCapabilitySchema) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingComputeImageCapabilitySchemaLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetComputeImageCapabilitySchemaLifecycleStateEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) } @@ -83,16 +89,17 @@ func (m ComputeImageCapabilitySchema) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *ComputeImageCapabilitySchema) UnmarshalJSON(data []byte) (e error) { model := struct { - CompartmentId *string `json:"compartmentId"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - FreeformTags map[string]string `json:"freeformTags"` - Id *string `json:"id"` - ComputeGlobalImageCapabilitySchemaId *string `json:"computeGlobalImageCapabilitySchemaId"` - ComputeGlobalImageCapabilitySchemaVersionName *string `json:"computeGlobalImageCapabilitySchemaVersionName"` - ImageId *string `json:"imageId"` - DisplayName *string `json:"displayName"` - SchemaData map[string]imagecapabilityschemadescriptor `json:"schemaData"` - TimeCreated *common.SDKTime `json:"timeCreated"` + CompartmentId *string `json:"compartmentId"` + LifecycleState ComputeImageCapabilitySchemaLifecycleStateEnum `json:"lifecycleState"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + FreeformTags map[string]string `json:"freeformTags"` + Id *string `json:"id"` + ComputeGlobalImageCapabilitySchemaId *string `json:"computeGlobalImageCapabilitySchemaId"` + ComputeGlobalImageCapabilitySchemaVersionName *string `json:"computeGlobalImageCapabilitySchemaVersionName"` + ImageId *string `json:"imageId"` + DisplayName *string `json:"displayName"` + SchemaData map[string]imagecapabilityschemadescriptor `json:"schemaData"` + TimeCreated *common.SDKTime `json:"timeCreated"` }{} e = json.Unmarshal(data, &model) @@ -102,6 +109,8 @@ func (m *ComputeImageCapabilitySchema) UnmarshalJSON(data []byte) (e error) { var nn interface{} m.CompartmentId = model.CompartmentId + m.LifecycleState = model.LifecycleState + m.DefinedTags = model.DefinedTags m.FreeformTags = model.FreeformTags @@ -133,3 +142,49 @@ func (m *ComputeImageCapabilitySchema) UnmarshalJSON(data []byte) (e error) { return } + +// ComputeImageCapabilitySchemaLifecycleStateEnum Enum with underlying type: string +type ComputeImageCapabilitySchemaLifecycleStateEnum string + +// Set of constants representing the allowable values for ComputeImageCapabilitySchemaLifecycleStateEnum +const ( + ComputeImageCapabilitySchemaLifecycleStateCreating ComputeImageCapabilitySchemaLifecycleStateEnum = "CREATING" + ComputeImageCapabilitySchemaLifecycleStateActive ComputeImageCapabilitySchemaLifecycleStateEnum = "ACTIVE" + ComputeImageCapabilitySchemaLifecycleStateDeleted ComputeImageCapabilitySchemaLifecycleStateEnum = "DELETED" +) + +var mappingComputeImageCapabilitySchemaLifecycleStateEnum = map[string]ComputeImageCapabilitySchemaLifecycleStateEnum{ + "CREATING": ComputeImageCapabilitySchemaLifecycleStateCreating, + "ACTIVE": ComputeImageCapabilitySchemaLifecycleStateActive, + "DELETED": ComputeImageCapabilitySchemaLifecycleStateDeleted, +} + +var mappingComputeImageCapabilitySchemaLifecycleStateEnumLowerCase = map[string]ComputeImageCapabilitySchemaLifecycleStateEnum{ + "creating": ComputeImageCapabilitySchemaLifecycleStateCreating, + "active": ComputeImageCapabilitySchemaLifecycleStateActive, + "deleted": ComputeImageCapabilitySchemaLifecycleStateDeleted, +} + +// GetComputeImageCapabilitySchemaLifecycleStateEnumValues Enumerates the set of values for ComputeImageCapabilitySchemaLifecycleStateEnum +func GetComputeImageCapabilitySchemaLifecycleStateEnumValues() []ComputeImageCapabilitySchemaLifecycleStateEnum { + values := make([]ComputeImageCapabilitySchemaLifecycleStateEnum, 0) + for _, v := range mappingComputeImageCapabilitySchemaLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetComputeImageCapabilitySchemaLifecycleStateEnumStringValues Enumerates the set of values in String for ComputeImageCapabilitySchemaLifecycleStateEnum +func GetComputeImageCapabilitySchemaLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "DELETED", + } +} + +// GetMappingComputeImageCapabilitySchemaLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingComputeImageCapabilitySchemaLifecycleStateEnum(val string) (ComputeImageCapabilitySchemaLifecycleStateEnum, bool) { + enum, ok := mappingComputeImageCapabilitySchemaLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/core_compute_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/core_compute_client.go index 3106a9f864e..39a9a85245c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/core_compute_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/core_compute_client.go @@ -7048,7 +7048,7 @@ func (client ComputeClient) updateComputeGpuMemoryCluster(ctx context.Context, r return response, err } -// UpdateComputeGpuMemoryFabric Customer can update displayName and tags for compute GPU memory fabric record +// UpdateComputeGpuMemoryFabric Customer can update displayName, tags and for compute GPU memory fabric record // // # See also // diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/cross_connect_group.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/cross_connect_group.go index 5e75cef87f8..c3bd30243de 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/cross_connect_group.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/cross_connect_group.go @@ -54,6 +54,10 @@ type CrossConnectGroup struct { // The cross-connect group's Oracle ID (OCID). Id *string `mandatory:"false" json:"id"` + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{ "orcl-cloud": { "free-tier-retained": "true" } }` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + // The cross-connect group's current state. LifecycleState CrossConnectGroupLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/drg_customer.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/drg_customer.go new file mode 100644 index 00000000000..31c98acc780 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/drg_customer.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Core Services API +// +// Use the Core Services API to manage resources such as virtual cloud networks (VCNs), +// compute instances, and block storage volumes. For more information, see the console +// documentation for the Networking (https://docs.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. +// The required permissions are documented in the +// Details for the Core Services (https://docs.oracle.com/iaas/Content/Identity/Reference/corepolicyreference.htm) article. +// + +package core + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DrgCustomer The list of IPSEC / FC / RPC info for a given DRG +type DrgCustomer struct { + + // OCID of the DRG + DrgId *string `mandatory:"true" json:"drgId"` + + // A List of the RPC connections on this DRG + RemotePeeringConnections []DrgCustomerResource `mandatory:"false" json:"remotePeeringConnections"` + + // A List of the VCs on this DRG + VirtualCircuits []DrgCustomerResource `mandatory:"false" json:"virtualCircuits"` + + // A List of the IPSec connections on this DRG + IpsecConnections []DrgCustomerResource `mandatory:"false" json:"ipsecConnections"` +} + +func (m DrgCustomer) 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 DrgCustomer) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/drg_customer_resource.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/drg_customer_resource.go new file mode 100644 index 00000000000..3f4729ebfe2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/drg_customer_resource.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Core Services API +// +// Use the Core Services API to manage resources such as virtual cloud networks (VCNs), +// compute instances, and block storage volumes. For more information, see the console +// documentation for the Networking (https://docs.oracle.com/iaas/Content/Network/Concepts/overview.htm), +// Compute (https://docs.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and +// Block Volume (https://docs.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. +// The required permissions are documented in the +// Details for the Core Services (https://docs.oracle.com/iaas/Content/Identity/Reference/corepolicyreference.htm) article. +// + +package core + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DrgCustomerResource The IPSEC / FC / RPC info returned in DrgCustomerResponse +type DrgCustomerResource struct { + + // OCID of the IPSEC / FC / RPC + Id *string `mandatory:"false" json:"id"` + + // The friendly name of the node. + DisplayName *string `mandatory:"false" json:"displayName"` + + // the compartment id of the DRG + CompartmentId *string `mandatory:"false" json:"compartmentId"` + + // the lifeCycleState of the IPSEC / FC / RPC + State *string `mandatory:"false" json:"state"` +} + +func (m DrgCustomerResource) 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 DrgCustomerResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_launch_instance_platform_config.go index a9709c6a6ab..54b9f341967 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_launch_instance_platform_config.go @@ -133,6 +133,7 @@ const ( GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1 GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2 GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4 GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6 GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +141,7 @@ var mappingGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[str "NPS1": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -147,6 +149,7 @@ var mappingGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase "nps1": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for GenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -165,6 +168,7 @@ func GetGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumStringValues( "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_platform_config.go index e4baf9c7118..9866d42d2ee 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/generic_bm_platform_config.go @@ -133,6 +133,7 @@ const ( GenericBmPlatformConfigNumaNodesPerSocketNps1 GenericBmPlatformConfigNumaNodesPerSocketEnum = "NPS1" GenericBmPlatformConfigNumaNodesPerSocketNps2 GenericBmPlatformConfigNumaNodesPerSocketEnum = "NPS2" GenericBmPlatformConfigNumaNodesPerSocketNps4 GenericBmPlatformConfigNumaNodesPerSocketEnum = "NPS4" + GenericBmPlatformConfigNumaNodesPerSocketNps6 GenericBmPlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingGenericBmPlatformConfigNumaNodesPerSocketEnum = map[string]GenericBmPlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +141,7 @@ var mappingGenericBmPlatformConfigNumaNodesPerSocketEnum = map[string]GenericBmP "NPS1": GenericBmPlatformConfigNumaNodesPerSocketNps1, "NPS2": GenericBmPlatformConfigNumaNodesPerSocketNps2, "NPS4": GenericBmPlatformConfigNumaNodesPerSocketNps4, + "NPS6": GenericBmPlatformConfigNumaNodesPerSocketNps6, } var mappingGenericBmPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]GenericBmPlatformConfigNumaNodesPerSocketEnum{ @@ -147,6 +149,7 @@ var mappingGenericBmPlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]G "nps1": GenericBmPlatformConfigNumaNodesPerSocketNps1, "nps2": GenericBmPlatformConfigNumaNodesPerSocketNps2, "nps4": GenericBmPlatformConfigNumaNodesPerSocketNps4, + "nps6": GenericBmPlatformConfigNumaNodesPerSocketNps6, } // GetGenericBmPlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for GenericBmPlatformConfigNumaNodesPerSocketEnum @@ -165,6 +168,7 @@ func GetGenericBmPlatformConfigNumaNodesPerSocketEnumStringValues() []string { "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance.go index cf02266ef37..ddb8157c595 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance.go @@ -77,6 +77,9 @@ type Instance struct { PlacementConstraintDetails PlacementConstraintDetails `mandatory:"false" json:"placementConstraintDetails"` + // Whether AI enterprise is enabled on the instance. + IsAIEnterpriseEnabled *bool `mandatory:"false" json:"isAIEnterpriseEnabled"` + // The OCID of the cluster placement group of the instance. ClusterPlacementGroupId *string `mandatory:"false" json:"clusterPlacementGroupId"` @@ -226,6 +229,7 @@ func (m *Instance) UnmarshalJSON(data []byte) (e error) { model := struct { CapacityReservationId *string `json:"capacityReservationId"` PlacementConstraintDetails placementconstraintdetails `json:"placementConstraintDetails"` + IsAIEnterpriseEnabled *bool `json:"isAIEnterpriseEnabled"` ClusterPlacementGroupId *string `json:"clusterPlacementGroupId"` DedicatedVmHostId *string `json:"dedicatedVmHostId"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` @@ -278,6 +282,8 @@ func (m *Instance) UnmarshalJSON(data []byte) (e error) { m.PlacementConstraintDetails = nil } + m.IsAIEnterpriseEnabled = model.IsAIEnterpriseEnabled + m.ClusterPlacementGroupId = model.ClusterPlacementGroupId m.DedicatedVmHostId = model.DedicatedVmHostId diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_gpu_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_gpu_launch_instance_platform_config.go index b2b954ab56e..7215e42ac01 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_gpu_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_gpu_launch_instance_platform_config.go @@ -126,6 +126,7 @@ const ( InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1 InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2 InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4 InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6 InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingInstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -133,6 +134,7 @@ var mappingInstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNod "NPS1": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingInstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +142,7 @@ var mappingInstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNod "nps1": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetInstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for InstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -158,6 +161,7 @@ func GetInstanceConfigurationAmdMilanBmGpuLaunchInstancePlatformConfigNumaNodesP "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_launch_instance_platform_config.go index 3c9f0a2d640..3d40fe9c9bd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_milan_bm_launch_instance_platform_config.go @@ -134,6 +134,7 @@ const ( InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1 InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2 InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4 InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6 InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingInstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -141,6 +142,7 @@ var mappingInstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesP "NPS1": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingInstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -148,6 +150,7 @@ var mappingInstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesP "nps1": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetInstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for InstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -166,6 +169,7 @@ func GetInstanceConfigurationAmdMilanBmLaunchInstancePlatformConfigNumaNodesPerS "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_gpu_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_gpu_launch_instance_platform_config.go index 3dee4f66f41..b9d9582ef9c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_gpu_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_gpu_launch_instance_platform_config.go @@ -126,6 +126,7 @@ const ( InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1 InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2 InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4 InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6 InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingInstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -133,6 +134,7 @@ var mappingInstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNode "NPS1": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingInstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +142,7 @@ var mappingInstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNode "nps1": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetInstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for InstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -158,6 +161,7 @@ func GetInstanceConfigurationAmdRomeBmGpuLaunchInstancePlatformConfigNumaNodesPe "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_launch_instance_platform_config.go index ea87c985910..c3ea8607ae5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_amd_rome_bm_launch_instance_platform_config.go @@ -134,6 +134,7 @@ const ( InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1 InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2 InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4 InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6 InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingInstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -141,6 +142,7 @@ var mappingInstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPe "NPS1": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingInstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -148,6 +150,7 @@ var mappingInstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPe "nps1": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetInstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for InstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -166,6 +169,7 @@ func GetInstanceConfigurationAmdRomeBmLaunchInstancePlatformConfigNumaNodesPerSo "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_generic_bm_launch_instance_platform_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_generic_bm_launch_instance_platform_config.go index 2699ebfbf88..160e2c5337f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_generic_bm_launch_instance_platform_config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_generic_bm_launch_instance_platform_config.go @@ -133,6 +133,7 @@ const ( InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1 InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS1" InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2 InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS2" InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4 InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS4" + InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6 InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = "NPS6" ) var mappingInstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum = map[string]InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -140,6 +141,7 @@ var mappingInstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPe "NPS1": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "NPS2": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "NPS4": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "NPS6": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } var mappingInstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumLowerCase = map[string]InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum{ @@ -147,6 +149,7 @@ var mappingInstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPe "nps1": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps1, "nps2": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps2, "nps4": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps4, + "nps6": InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketNps6, } // GetInstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnumValues Enumerates the set of values for InstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSocketEnum @@ -165,6 +168,7 @@ func GetInstanceConfigurationGenericBmLaunchInstancePlatformConfigNumaNodesPerSo "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_launch_instance_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_launch_instance_details.go index 26a5ec37e16..71fe400179c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_launch_instance_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_configuration_launch_instance_details.go @@ -31,6 +31,9 @@ type InstanceConfigurationLaunchInstanceDetails struct { // Example: `Uocm:PHX-AD-1` AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"` + // Whether to enable AI enterprise on the instance. + IsAIEnterpriseEnabled *bool `mandatory:"false" json:"isAIEnterpriseEnabled"` + // The OCID of the compute capacity reservation this instance is launched under. CapacityReservationId *string `mandatory:"false" json:"capacityReservationId"` @@ -220,6 +223,7 @@ func (m InstanceConfigurationLaunchInstanceDetails) ValidateEnumValue() (bool, e func (m *InstanceConfigurationLaunchInstanceDetails) UnmarshalJSON(data []byte) (e error) { model := struct { AvailabilityDomain *string `json:"availabilityDomain"` + IsAIEnterpriseEnabled *bool `json:"isAIEnterpriseEnabled"` CapacityReservationId *string `json:"capacityReservationId"` PlacementConstraintDetails instanceconfigurationplacementconstraintdetails `json:"placementConstraintDetails"` ComputeClusterId *string `json:"computeClusterId"` @@ -257,6 +261,8 @@ func (m *InstanceConfigurationLaunchInstanceDetails) UnmarshalJSON(data []byte) var nn interface{} m.AvailabilityDomain = model.AvailabilityDomain + m.IsAIEnterpriseEnabled = model.IsAIEnterpriseEnabled + m.CapacityReservationId = model.CapacityReservationId nn, e = model.PlacementConstraintDetails.UnmarshalPolymorphicJSON(model.PlacementConstraintDetails.JsonData) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/launch_instance_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/launch_instance_details.go index 3fcbeb39121..54e596a3462 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/launch_instance_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/launch_instance_details.go @@ -197,6 +197,9 @@ type LaunchInstanceDetails struct { PlacementConstraintDetails PlacementConstraintDetails `mandatory:"false" json:"placementConstraintDetails"` + // Whether to enable AI enterprise on the instance. + IsAIEnterpriseEnabled *bool `mandatory:"false" json:"isAIEnterpriseEnabled"` + // The OCID of the Instance Configuration containing instance launch details. Any other fields supplied in this instance launch request will override the details stored in the Instance Configuration for this instance launch. InstanceConfigurationId *string `mandatory:"false" json:"instanceConfigurationId"` @@ -251,6 +254,7 @@ func (m *LaunchInstanceDetails) UnmarshalJSON(data []byte) (e error) { IsPvEncryptionInTransitEnabled *bool `json:"isPvEncryptionInTransitEnabled"` PlatformConfig launchinstanceplatformconfig `json:"platformConfig"` PlacementConstraintDetails placementconstraintdetails `json:"placementConstraintDetails"` + IsAIEnterpriseEnabled *bool `json:"isAIEnterpriseEnabled"` InstanceConfigurationId *string `json:"instanceConfigurationId"` LicensingConfigs []launchinstancelicensingconfig `json:"licensingConfigs"` AvailabilityDomain *string `json:"availabilityDomain"` @@ -352,6 +356,8 @@ func (m *LaunchInstanceDetails) UnmarshalJSON(data []byte) (e error) { m.PlacementConstraintDetails = nil } + m.IsAIEnterpriseEnabled = model.IsAIEnterpriseEnabled + m.InstanceConfigurationId = model.InstanceConfigurationId m.LicensingConfigs = make([]LaunchInstanceLicensingConfig, len(model.LicensingConfigs)) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/shape_numa_nodes_per_socket_platform_options.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/shape_numa_nodes_per_socket_platform_options.go index 5f50cb97ae4..c250466c517 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/shape_numa_nodes_per_socket_platform_options.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/shape_numa_nodes_per_socket_platform_options.go @@ -62,6 +62,7 @@ const ( ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps1 ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum = "NPS1" ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps2 ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum = "NPS2" ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps4 ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum = "NPS4" + ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps6 ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum = "NPS6" ) var mappingShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum = map[string]ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum{ @@ -69,6 +70,7 @@ var mappingShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum = map[string] "NPS1": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps1, "NPS2": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps2, "NPS4": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps4, + "NPS6": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps6, } var mappingShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnumLowerCase = map[string]ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum{ @@ -76,6 +78,7 @@ var mappingShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnumLowerCase = ma "nps1": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps1, "nps2": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps2, "nps4": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps4, + "nps6": ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesNps6, } // GetShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnumValues Enumerates the set of values for ShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnum @@ -94,6 +97,7 @@ func GetShapeNumaNodesPerSocketPlatformOptionsAllowedValuesEnumStringValues() [] "NPS1", "NPS2", "NPS4", + "NPS6", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_details.go index 5a07caf0d90..eb828d0eb5e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_details.go @@ -25,6 +25,9 @@ import ( // UpdateInstanceDetails The representation of UpdateInstanceDetails type UpdateInstanceDetails struct { + // Whether to enable AI enterprise on the instance. + IsAIEnterpriseEnabled *bool `mandatory:"false" json:"isAIEnterpriseEnabled"` + // The OCID of the compute capacity reservation this instance is launched under. // You can remove the instance from a reservation by specifying an empty string as input for this field. // For more information, see Capacity Reservations (https://docs.oracle.com/iaas/Content/Compute/Tasks/reserve-capacity.htm#default). @@ -168,6 +171,7 @@ func (m UpdateInstanceDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *UpdateInstanceDetails) UnmarshalJSON(data []byte) (e error) { model := struct { + IsAIEnterpriseEnabled *bool `json:"isAIEnterpriseEnabled"` CapacityReservationId *string `json:"capacityReservationId"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` SecurityAttributes map[string]map[string]interface{} `json:"securityAttributes"` @@ -195,6 +199,8 @@ func (m *UpdateInstanceDetails) UnmarshalJSON(data []byte) (e error) { return } var nn interface{} + m.IsAIEnterpriseEnabled = model.IsAIEnterpriseEnabled + m.CapacityReservationId = model.CapacityReservationId m.DefinedTags = model.DefinedTags 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 a6989d5ece4..2f3470c7a7f 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 @@ -489,6 +489,10 @@ type AutonomousDatabase struct { // The Autonomous Database clone type. CloneType AutonomousDatabaseCloneTypeEnum `mandatory:"false" json:"cloneType,omitempty"` + + // Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. + // Example: `{ "gcpAccountName": "gcpName" }` + AdditionalAttributes map[string]string `mandatory:"false" json:"additionalAttributes"` } func (m AutonomousDatabase) String() string { @@ -696,6 +700,7 @@ func (m *AutonomousDatabase) UnmarshalJSON(data []byte) (e error) { ClusterPlacementGroupId *string `json:"clusterPlacementGroupId"` CloneTableSpaceList []int `json:"cloneTableSpaceList"` CloneType AutonomousDatabaseCloneTypeEnum `json:"cloneType"` + AdditionalAttributes map[string]string `json:"additionalAttributes"` Id *string `json:"id"` CompartmentId *string `json:"compartmentId"` LifecycleState AutonomousDatabaseLifecycleStateEnum `json:"lifecycleState"` @@ -968,6 +973,8 @@ func (m *AutonomousDatabase) UnmarshalJSON(data []byte) (e error) { copy(m.CloneTableSpaceList, model.CloneTableSpaceList) m.CloneType = model.CloneType + m.AdditionalAttributes = model.AdditionalAttributes + m.Id = model.Id m.CompartmentId = model.CompartmentId diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_encryption_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_encryption_key_details.go index 3c7e2ba2b59..1818dea5086 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_encryption_key_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_database_encryption_key_details.go @@ -66,6 +66,10 @@ func (m *autonomousdatabaseencryptionkeydetails) UnmarshalPolymorphicJSON(data [ mm := OciKeyDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "GCP": + mm := GcpKeyDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "ORACLE_MANAGED": mm := OracleManagedKeyDetails{} err = json.Unmarshal(data, &mm) 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 e54d761ff7f..0d68eed0b63 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 @@ -491,6 +491,10 @@ type AutonomousDatabaseSummary struct { // The Autonomous Database clone type. CloneType AutonomousDatabaseSummaryCloneTypeEnum `mandatory:"false" json:"cloneType,omitempty"` + + // Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. + // Example: `{ "gcpAccountName": "gcpName" }` + AdditionalAttributes map[string]string `mandatory:"false" json:"additionalAttributes"` } func (m AutonomousDatabaseSummary) String() string { @@ -698,6 +702,7 @@ func (m *AutonomousDatabaseSummary) UnmarshalJSON(data []byte) (e error) { ClusterPlacementGroupId *string `json:"clusterPlacementGroupId"` CloneTableSpaceList []int `json:"cloneTableSpaceList"` CloneType AutonomousDatabaseSummaryCloneTypeEnum `json:"cloneType"` + AdditionalAttributes map[string]string `json:"additionalAttributes"` Id *string `json:"id"` CompartmentId *string `json:"compartmentId"` LifecycleState AutonomousDatabaseSummaryLifecycleStateEnum `json:"lifecycleState"` @@ -970,6 +975,8 @@ func (m *AutonomousDatabaseSummary) UnmarshalJSON(data []byte) (e error) { copy(m.CloneTableSpaceList, model.CloneTableSpaceList) m.CloneType = model.CloneType + m.AdditionalAttributes = model.AdditionalAttributes + m.Id = model.Id m.CompartmentId = model.CompartmentId diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_dw_database.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_dw_database.go index 82928cc43ee..af425f8796e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_dw_database.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/autonomous_dw_database.go @@ -489,6 +489,10 @@ type AutonomousDwDatabase struct { // The Autonomous Database clone type. CloneType AutonomousDwDatabaseCloneTypeEnum `mandatory:"false" json:"cloneType,omitempty"` + + // Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. + // Example: `{ "gcpAccountName": "gcpName" }` + AdditionalAttributes map[string]string `mandatory:"false" json:"additionalAttributes"` } func (m AutonomousDwDatabase) String() string { @@ -696,6 +700,7 @@ func (m *AutonomousDwDatabase) UnmarshalJSON(data []byte) (e error) { ClusterPlacementGroupId *string `json:"clusterPlacementGroupId"` CloneTableSpaceList []int `json:"cloneTableSpaceList"` CloneType AutonomousDwDatabaseCloneTypeEnum `json:"cloneType"` + AdditionalAttributes map[string]string `json:"additionalAttributes"` Id *string `json:"id"` CompartmentId *string `json:"compartmentId"` LifecycleState AutonomousDwDatabaseLifecycleStateEnum `json:"lifecycleState"` @@ -968,6 +973,8 @@ func (m *AutonomousDwDatabase) UnmarshalJSON(data []byte) (e error) { copy(m.CloneTableSpaceList, model.CloneTableSpaceList) m.CloneType = model.CloneType + m.AdditionalAttributes = model.AdditionalAttributes + m.Id = model.Id m.CompartmentId = model.CompartmentId diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_vm_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_vm_cluster_details.go index 22b791c9eae..c1e998863b3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_vm_cluster_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cloud_vm_cluster_details.go @@ -27,15 +27,19 @@ type CreateCloudVmClusterDetails struct { // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup network subnet associated with the cloud VM cluster. BackupSubnetId *string `mandatory:"true" json:"backupSubnetId"` - // The number of ECPUs (X11M and higher) or number of OCPUs (X10M and earlier) to enable for the VM cluster. - // + // For fixed shapes, this is the total number of OCPUs to enable across the VM cluster. // - Exadata.Base.48 - Specify a multiple of 2, from 0 to 48. - // - Exadata.Quarter1.84 - Specify a multiple of 2, from 22 to 84. - // - Exadata.Half1.168 - Specify a multiple of 4, from 44 to 168. - // - Exadata.Full1.336 - Specify a multiple of 8, from 88 to 336. - // - Exadata.Quarter2.92 - Specify a multiple of 2, from 0 to 92. - // - Exadata.Half2.184 - Specify a multiple of 4, from 0 to 184. - // - Exadata.Full2.368 - Specify a multiple of 8, from 0 to 368. + // - Exadata.Quarter3.100 - Specify a multiple of 2, from 0 to 100. + // - Exadata.Half3.200 - Specify a multiple of 4, from 0 to 200. + // - Exadata.Full3.400 - Specify a multiple of 8, from 0 to 400. + // The API specification for fixed shape values is https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbSystemShapeSummary + // + // For flexible shapes X8M and X9M, this is the total number of OCPUs to enable across the VM cluster. The number available for the VM cluster will be based on the number of database servers selected for provisioning the VM cluster on the Exadata Infrastructure. + // - Exadata.X8M - Specify a multiple of 2, from 2 to 50 per X8M database server. + // - Exadata.X9M - Specify a multiple of 2, from 2 to 126 per X9M database server. + // For flexible shapes X11M and higher, this is the total number of ECPUs to enable across the VM cluster. The number available for the VM cluster will be based on the number of database servers selected for provisioning the VM cluster on the Exadata Infrastructure. + // - Exadata.X11M - Specify a multiple of 8, from 8 to 760 per X11M database server. + // The API specification for flexible shape values is https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/FlexComponentSummary CpuCoreCount *int `mandatory:"true" json:"cpuCoreCount"` // The user-friendly name for the cloud VM cluster. The name does not need to be unique. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/db_system_shape_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/db_system_shape_summary.go index 63214fdee91..10e74320384 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/db_system_shape_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/db_system_shape_summary.go @@ -16,6 +16,7 @@ import ( ) // DbSystemShapeSummary The shape of the DB system. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes. +// For Exadata fixed and flexible shapes, detailed specifications can be found in https://docs.oracle.com/en/engineered-systems/exadata-cloud-service/ecscm/exa-service-desc.html#GUID-9E090174-5C57-4EB1-9243-B470F9F10D6B // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. // If you're an administrator who needs to write policies to give users access, // see Getting Started with Policies (https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/flex_component_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/flex_component_summary.go index ab31a3d6791..bf2a81fa1ca 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/flex_component_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/flex_component_summary.go @@ -16,6 +16,7 @@ import ( ) // FlexComponentSummary The Flex Components for a DB system. The Flex Component determines resources to allocate to the DB system - CPU cores, memory and storage for Flex shapes. +// For Exadata flexible shapes, detailed specifications can be found in https://docs.oracle.com/en/engineered-systems/exadata-cloud-service/ecscm/exa-service-desc.html#GUID-9E090174-5C57-4EB1-9243-B470F9F10D6B // To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. // If you're an administrator who needs to write policies to give users access, // see Getting Started with Policies (https://docs.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/gcp_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/gcp_key_details.go new file mode 100644 index 00000000000..7bc05c229ad --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/gcp_key_details.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Database Service API +// +// The API for the Database Service. Use this API to manage resources such as databases and DB Systems. For more information, see Overview of the Database Service (https://docs.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GcpKeyDetails Details for GCP encryption key. +type GcpKeyDetails struct { + + // GCP key name + KeyName *string `mandatory:"true" json:"keyName"` + + // GCP project name + Project *string `mandatory:"true" json:"project"` + + // GCP key ring location + Location *string `mandatory:"true" json:"location"` + + // GCP key ring + KeyRing *string `mandatory:"true" json:"keyRing"` + + // GCP kms REST API endpoint + KmsRestEndpoint *string `mandatory:"false" json:"kmsRestEndpoint"` +} + +func (m GcpKeyDetails) 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 GcpKeyDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GcpKeyDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGcpKeyDetails GcpKeyDetails + s := struct { + DiscriminatorParam string `json:"provider"` + MarshalTypeGcpKeyDetails + }{ + "GCP", + (MarshalTypeGcpKeyDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/update_cloud_vm_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/update_cloud_vm_cluster_details.go index 3bef2a5da7d..73d8133bb98 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/update_cloud_vm_cluster_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/update_cloud_vm_cluster_details.go @@ -21,7 +21,25 @@ type UpdateCloudVmClusterDetails struct { // The user-friendly name for the cloud VM cluster. The name does not need to be unique. DisplayName *string `mandatory:"false" json:"displayName"` - // The number of CPU cores to enable for the cloud VM cluster. + // For fixed shapes, this is the total number of OCPUs to enable across the VM cluster. + // - Exadata.Base.48 - Specify a multiple of 2, from 0 to 48. + // - Exadata.Quarter1.84 - Specify a multiple of 2, from 22 to 84. + // - Exadata.Half1.168 - Specify a multiple of 4, from 44 to 168. + // - Exadata.Full1.336 - Specify a multiple of 8, from 88 to 336. + // - Exadata.Quarter2.92 - Specify a multiple of 2, from 0 to 92. + // - Exadata.Half2.184 - Specify a multiple of 4, from 0 to 184. + // - Exadata.Full2.368 - Specify a multiple of 8, from 0 to 368. + // - Exadata.Quarter3.100 - Specify a multiple of 2, from 0 to 100. + // - Exadata.Half3.200 - Specify a multiple of 4, from 0 to 200. + // - Exadata.Full3.400 - Specify a multiple of 8, from 0 to 400. + // The API specification for fixed shape values is https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbSystemShapeSummary + // + // For flexible shapes X8M and X9M, this is the total number of OCPUs to enable across the VM cluster. The number available for the VM cluster will be based on the number of database servers selected for provisioning the VM cluster on the Exadata Infrastructure. + // - Exadata.X8M - Specify a multiple of 2, from 2 to 50 per X8M database server. + // - Exadata.X9M - Specify a multiple of 2, from 2 to 126 per X9M database server. + // For flexible shapes X11M and higher, this is the total number of ECPUs to enable across the VM cluster. The number available for the VM cluster will be based on the number of database servers selected for provisioning the VM cluster on the Exadata Infrastructure. + // - Exadata.X11M - Specify a multiple of 8, from 8 to 760 per X11M database server. + // The API specification for flexible shape values is https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/datatypes/FlexComponentSummary CpuCoreCount *int `mandatory:"false" json:"cpuCoreCount"` // The number of OCPU cores to enable for a cloud VM cluster. Only 1 decimal place is allowed for the fractional part. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/add_fsu_collection_targets_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/add_fsu_collection_targets_details.go index 4c095de7293..ba1bd4d3d58 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/add_fsu_collection_targets_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/add_fsu_collection_targets_details.go @@ -16,7 +16,9 @@ import ( "strings" ) -// AddFsuCollectionTargetsDetails Add Targets to a Exadata Fleet Update Collection. +// AddFsuCollectionTargetsDetails Add Targets to an Exadata Fleet Update Collection. +// Targets belonging to another Exadata Fleet Update Collection of the same type will be rejected. +// If automated maintenance is enabled for the Exadata Fleet Update Collection, then ensure that the scheduling policy and window can accommodate the targets being added. type AddFsuCollectionTargetsDetails struct { // List of Targets to add into the Exadata Fleet Update Collection. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/clone_fsu_cycle_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/clone_fsu_cycle_details.go index facf4eaa572..1e82136da5d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/clone_fsu_cycle_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/clone_fsu_cycle_details.go @@ -21,14 +21,14 @@ import ( type CloneFsuCycleDetails struct { GoalVersionDetails FsuGoalVersionDetails `mandatory:"true" json:"goalVersionDetails"` - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. DisplayName *string `mandatory:"false" json:"displayName"` - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"false" json:"compartmentId"` - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle will be assigned to. - // If not specified, it will be assigned to the same Collection as the source Exadata Fleet Update Cycle. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection which will be updated by the Exadata Fleet Update Cycle being created. + // If not specified, the cloned Exadata Fleet Update Cycle will be assigned to the same Exadata Fleet Update Collection as the source Exadata Fleet Update Cycle. FsuCollectionId *string `mandatory:"false" json:"fsuCollectionId"` BatchingStrategy CreateBatchingStrategyDetails `mandatory:"false" json:"batchingStrategy"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/cloud_vm_cluster_target_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/cloud_vm_cluster_target_summary.go index b7ba508a558..6848e0cfb77 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/cloud_vm_cluster_target_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/cloud_vm_cluster_target_summary.go @@ -34,6 +34,9 @@ type CloudVmClusterTargetSummary struct { // OCID of the Grid Infrastructure software image. SoftwareImageId *string `mandatory:"false" json:"softwareImageId"` + + // Exadata Image (Guest OS) version. + SystemVersion *string `mandatory:"false" json:"systemVersion"` } // GetId returns Id diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/collection_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/collection_types.go index bf2ac23f4a6..82201b765f5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/collection_types.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/collection_types.go @@ -19,18 +19,24 @@ type CollectionTypesEnum string // Set of constants representing the allowable values for CollectionTypesEnum const ( - CollectionTypesDb CollectionTypesEnum = "DB" - CollectionTypesGi CollectionTypesEnum = "GI" + CollectionTypesDb CollectionTypesEnum = "DB" + CollectionTypesGi CollectionTypesEnum = "GI" + CollectionTypesGuestOs CollectionTypesEnum = "GUEST_OS" + CollectionTypesExadbStack CollectionTypesEnum = "EXADB_STACK" ) var mappingCollectionTypesEnum = map[string]CollectionTypesEnum{ - "DB": CollectionTypesDb, - "GI": CollectionTypesGi, + "DB": CollectionTypesDb, + "GI": CollectionTypesGi, + "GUEST_OS": CollectionTypesGuestOs, + "EXADB_STACK": CollectionTypesExadbStack, } var mappingCollectionTypesEnumLowerCase = map[string]CollectionTypesEnum{ - "db": CollectionTypesDb, - "gi": CollectionTypesGi, + "db": CollectionTypesDb, + "gi": CollectionTypesGi, + "guest_os": CollectionTypesGuestOs, + "exadb_stack": CollectionTypesExadbStack, } // GetCollectionTypesEnumValues Enumerates the set of values for CollectionTypesEnum @@ -47,6 +53,8 @@ func GetCollectionTypesEnumStringValues() []string { return []string{ "DB", "GI", + "GUEST_OS", + "EXADB_STACK", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_db_fsu_collection_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_db_fsu_collection_details.go index 99de7999ffd..584223ff462 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_db_fsu_collection_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_db_fsu_collection_details.go @@ -18,12 +18,13 @@ import ( ) // CreateDbFsuCollectionDetails Details to create a 'DB' type Exadata Fleet Update Collection. +// Targets belonging to another 'DB' type Exadata Fleet Update Collection will be rejected. type CreateDbFsuCollectionDetails struct { - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Exadata Fleet Update Collection Identifier. + // The user-friendly name for the Exadata Fleet Update Collection. DisplayName *string `mandatory:"false" json:"displayName"` // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_exadb_stack_fsu_collection_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_exadb_stack_fsu_collection_details.go new file mode 100644 index 00000000000..bdb21794959 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_exadb_stack_fsu_collection_details.go @@ -0,0 +1,144 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateExadbStackFsuCollectionDetails Details to create an 'EXADB_STACK' type Exadata Fleet Update Collection. +// Currently, components allowed in an Exadata software stack are 'GUEST_OS' and 'GI'. +// At least two distinct component types are required for an Exadata software stack. +// Targets belonging to another 'EXADB_STACK' type Exadata Fleet Update Collection will be rejected. +type CreateExadbStackFsuCollectionDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Details of components in an Exadata software stack. + Components []CreateSoftwareComponentDetails `mandatory:"true" json:"components"` + + // The user-friendly name for the Exadata Fleet Update Collection. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Exadata service type for the target resource members. + ServiceType CollectionServiceTypesEnum `mandatory:"true" json:"serviceType"` +} + +// GetDisplayName returns DisplayName +func (m CreateExadbStackFsuCollectionDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetServiceType returns ServiceType +func (m CreateExadbStackFsuCollectionDetails) GetServiceType() CollectionServiceTypesEnum { + return m.ServiceType +} + +// GetCompartmentId returns CompartmentId +func (m CreateExadbStackFsuCollectionDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetFreeformTags returns FreeformTags +func (m CreateExadbStackFsuCollectionDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateExadbStackFsuCollectionDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateExadbStackFsuCollectionDetails) 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 CreateExadbStackFsuCollectionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCollectionServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetCollectionServiceTypesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateExadbStackFsuCollectionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateExadbStackFsuCollectionDetails CreateExadbStackFsuCollectionDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateExadbStackFsuCollectionDetails + }{ + "EXADB_STACK", + (MarshalTypeCreateExadbStackFsuCollectionDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateExadbStackFsuCollectionDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + ServiceType CollectionServiceTypesEnum `json:"serviceType"` + CompartmentId *string `json:"compartmentId"` + Components []createsoftwarecomponentdetails `json:"components"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.ServiceType = model.ServiceType + + m.CompartmentId = model.CompartmentId + + m.Components = make([]CreateSoftwareComponentDetails, len(model.Components)) + for i, n := range model.Components { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Components[i] = nn.(CreateSoftwareComponentDetails) + } else { + m.Components[i] = nil + } + } + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_collection_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_collection_details.go index 40521a4bb38..e09794dec9d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_collection_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_collection_details.go @@ -17,16 +17,17 @@ import ( "strings" ) -// CreateFsuCollectionDetails The information about new Exadata Fleet Update Collection. +// CreateFsuCollectionDetails Details to create a new Exadata Fleet Update Collection. +// Targets belonging to another Exadata Fleet Update Collection of the same type will be rejected. type CreateFsuCollectionDetails interface { // Exadata service type for the target resource members. GetServiceType() CollectionServiceTypesEnum - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. GetCompartmentId() *string - // Exadata Fleet Update Collection Identifier. + // The user-friendly name for the Exadata Fleet Update Collection. GetDisplayName() *string // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. @@ -86,6 +87,14 @@ func (m *createfsucollectiondetails) UnmarshalPolymorphicJSON(data []byte) (inte mm := CreateGiFsuCollectionDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "GUEST_OS": + mm := CreateGuestOsFsuCollectionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "EXADB_STACK": + mm := CreateExadbStackFsuCollectionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: common.Logf("Received unsupported enum value for CreateFsuCollectionDetails: %s.", m.Type) return *m, nil diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_cycle_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_cycle_details.go index fbac2127367..8f07aaf114d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_cycle_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_fsu_cycle_details.go @@ -17,18 +17,18 @@ import ( "strings" ) -// CreateFsuCycleDetails Exadata Fleet Update Cycle resource creation details. +// CreateFsuCycleDetails Details to create an Exadata Fleet Update Cycle. type CreateFsuCycleDetails interface { - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. GetCompartmentId() *string - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle will be assigned to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection which will be updated by the Exadata Fleet Update Cycle being created. GetFsuCollectionId() *string GetGoalVersionDetails() FsuGoalVersionDetails - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. GetDisplayName() *string GetBatchingStrategy() CreateBatchingStrategyDetails diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_gi_fsu_collection_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_gi_fsu_collection_details.go index d357ffd7e43..50af7a28a31 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_gi_fsu_collection_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_gi_fsu_collection_details.go @@ -18,12 +18,13 @@ import ( ) // CreateGiFsuCollectionDetails Details to create a 'GI' type Exadata Fleet Update Collection. +// Targets belonging to another 'GI' type Exadata Fleet Update Collection will be rejected. type CreateGiFsuCollectionDetails struct { - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // Exadata Fleet Update Collection Identifier. + // The user-friendly name for the Exadata Fleet Update Collection. DisplayName *string `mandatory:"false" json:"displayName"` // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_gi_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_gi_software_component_details.go new file mode 100644 index 00000000000..7393405062c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_gi_software_component_details.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateGiSoftwareComponentDetails Details to create 'GI' component in an Exadata software stack. +type CreateGiSoftwareComponentDetails struct { + FleetDiscovery GiFleetDiscoveryDetails `mandatory:"false" json:"fleetDiscovery"` + + // Grid Infrastructure Major Version of targets to be included in the Exadata Fleet Update Collection. + // Only GI targets that match the version specified in this value would be added to the Exadata Fleet Update Collection. + SourceMajorVersion GiSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m CreateGiSoftwareComponentDetails) 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 CreateGiSoftwareComponentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGiSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGiSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateGiSoftwareComponentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateGiSoftwareComponentDetails CreateGiSoftwareComponentDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeCreateGiSoftwareComponentDetails + }{ + "GI", + (MarshalTypeCreateGiSoftwareComponentDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateGiSoftwareComponentDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + FleetDiscovery gifleetdiscoverydetails `json:"fleetDiscovery"` + SourceMajorVersion GiSourceMajorVersionsEnum `json:"sourceMajorVersion"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.FleetDiscovery.UnmarshalPolymorphicJSON(model.FleetDiscovery.JsonData) + if e != nil { + return + } + if nn != nil { + m.FleetDiscovery = nn.(GiFleetDiscoveryDetails) + } else { + m.FleetDiscovery = nil + } + + m.SourceMajorVersion = model.SourceMajorVersion + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_guest_os_fsu_collection_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_guest_os_fsu_collection_details.go new file mode 100644 index 00000000000..3581cb1e318 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_guest_os_fsu_collection_details.go @@ -0,0 +1,150 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateGuestOsFsuCollectionDetails Details to create a 'GUEST_OS' type Exadata Fleet Update Collection. +// Targets belonging to another 'GUEST_OS' type Exadata Fleet Update Collection will be rejected. +type CreateGuestOsFsuCollectionDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The user-friendly name for the Exadata Fleet Update Collection. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + FleetDiscovery GuestOsFleetDiscoveryDetails `mandatory:"false" json:"fleetDiscovery"` + + // Exadata service type for the target resource members. + ServiceType CollectionServiceTypesEnum `mandatory:"true" json:"serviceType"` + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the Exadata Fleet Update Collection. + // Only Exadata VM Clusters whose 'systemVersion' is related to the major version will be added to the Exadata Fleet Update Collection. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +// GetDisplayName returns DisplayName +func (m CreateGuestOsFsuCollectionDetails) GetDisplayName() *string { + return m.DisplayName +} + +// GetServiceType returns ServiceType +func (m CreateGuestOsFsuCollectionDetails) GetServiceType() CollectionServiceTypesEnum { + return m.ServiceType +} + +// GetCompartmentId returns CompartmentId +func (m CreateGuestOsFsuCollectionDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetFreeformTags returns FreeformTags +func (m CreateGuestOsFsuCollectionDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateGuestOsFsuCollectionDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateGuestOsFsuCollectionDetails) 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 CreateGuestOsFsuCollectionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCollectionServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetCollectionServiceTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateGuestOsFsuCollectionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateGuestOsFsuCollectionDetails CreateGuestOsFsuCollectionDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeCreateGuestOsFsuCollectionDetails + }{ + "GUEST_OS", + (MarshalTypeCreateGuestOsFsuCollectionDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateGuestOsFsuCollectionDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + FleetDiscovery guestosfleetdiscoverydetails `json:"fleetDiscovery"` + ServiceType CollectionServiceTypesEnum `json:"serviceType"` + CompartmentId *string `json:"compartmentId"` + SourceMajorVersion GuestOsSourceMajorVersionsEnum `json:"sourceMajorVersion"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + nn, e = model.FleetDiscovery.UnmarshalPolymorphicJSON(model.FleetDiscovery.JsonData) + if e != nil { + return + } + if nn != nil { + m.FleetDiscovery = nn.(GuestOsFleetDiscoveryDetails) + } else { + m.FleetDiscovery = nil + } + + m.ServiceType = model.ServiceType + + m.CompartmentId = model.CompartmentId + + m.SourceMajorVersion = model.SourceMajorVersion + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_guest_os_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_guest_os_software_component_details.go new file mode 100644 index 00000000000..e579af55313 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_guest_os_software_component_details.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateGuestOsSoftwareComponentDetails Details to create 'GUEST_OS' component in an Exadata software stack. +type CreateGuestOsSoftwareComponentDetails struct { + FleetDiscovery GuestOsFleetDiscoveryDetails `mandatory:"false" json:"fleetDiscovery"` + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in an Exadata Fleet Update Collection. + // Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m CreateGuestOsSoftwareComponentDetails) 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 CreateGuestOsSoftwareComponentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CreateGuestOsSoftwareComponentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateGuestOsSoftwareComponentDetails CreateGuestOsSoftwareComponentDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeCreateGuestOsSoftwareComponentDetails + }{ + "GUEST_OS", + (MarshalTypeCreateGuestOsSoftwareComponentDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateGuestOsSoftwareComponentDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + FleetDiscovery guestosfleetdiscoverydetails `json:"fleetDiscovery"` + SourceMajorVersion GuestOsSourceMajorVersionsEnum `json:"sourceMajorVersion"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.FleetDiscovery.UnmarshalPolymorphicJSON(model.FleetDiscovery.JsonData) + if e != nil { + return + } + if nn != nil { + m.FleetDiscovery = nn.(GuestOsFleetDiscoveryDetails) + } else { + m.FleetDiscovery = nil + } + + m.SourceMajorVersion = model.SourceMajorVersion + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_patch_fsu_cycle.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_patch_fsu_cycle.go index 062fd1f15fe..60d9d7be87c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_patch_fsu_cycle.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_patch_fsu_cycle.go @@ -17,18 +17,18 @@ import ( "strings" ) -// CreatePatchFsuCycle Patch Exadata Fleet Update Cycle resource creation details. +// CreatePatchFsuCycle Details to create an Exadata Fleet Update Cycle for a single maintenance update for an Exadata Fleet Update Collection. type CreatePatchFsuCycle struct { - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle will be assigned to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection which will be updated by the Exadata Fleet Update Cycle being created. FsuCollectionId *string `mandatory:"true" json:"fsuCollectionId"` GoalVersionDetails FsuGoalVersionDetails `mandatory:"true" json:"goalVersionDetails"` - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. DisplayName *string `mandatory:"false" json:"displayName"` BatchingStrategy CreateBatchingStrategyDetails `mandatory:"false" json:"batchingStrategy"` @@ -47,17 +47,18 @@ type CreatePatchFsuCycle struct { // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` - // Ignore all patches between the source and target homes during patching. + // Ignore patch conflicts or missing patches between the source and goal homes. + // This attribute will be ignored for Exadata Image (Guest OS) maintenance update. IsIgnorePatches *bool `mandatory:"false" json:"isIgnorePatches"` - // List of patch IDs to ignore. + // List of identifiers of patches to ignore. + // This attribute will be ignored for Exadata Image (Guest OS) maintenance update. IsIgnoreMissingPatches []string `mandatory:"false" json:"isIgnoreMissingPatches"` - // Service drain timeout specified in seconds. + // Timeout for session draining for database services specified in seconds. MaxDrainTimeoutInSeconds *int `mandatory:"false" json:"maxDrainTimeoutInSeconds"` - // Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same - // instances before and after the move operation. + // Ensure that database services are online on the same VMs before and after the maintenance update. IsKeepPlacement *bool `mandatory:"false" json:"isKeepPlacement"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_software_component_details.go new file mode 100644 index 00000000000..bd5e2db3ef9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_software_component_details.go @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateSoftwareComponentDetails Details to create a component in an Exadata software stack. +type CreateSoftwareComponentDetails interface { +} + +type createsoftwarecomponentdetails struct { + JsonData []byte + ComponentType string `json:"componentType"` +} + +// UnmarshalJSON unmarshals json +func (m *createsoftwarecomponentdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatesoftwarecomponentdetails createsoftwarecomponentdetails + s := struct { + Model Unmarshalercreatesoftwarecomponentdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ComponentType = s.Model.ComponentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createsoftwarecomponentdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ComponentType { + case "GI": + mm := CreateGiSoftwareComponentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GUEST_OS": + mm := CreateGuestOsSoftwareComponentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for CreateSoftwareComponentDetails: %s.", m.ComponentType) + return *m, nil + } +} + +func (m createsoftwarecomponentdetails) 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 createsoftwarecomponentdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_upgrade_fsu_cycle.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_upgrade_fsu_cycle.go index 5ca96264cb7..5cd40e03091 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_upgrade_fsu_cycle.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/create_upgrade_fsu_cycle.go @@ -21,15 +21,15 @@ import ( // For GI upgrade case, Batching strategy may be NON_ROLLING or SEQUENTIAL(default). type CreateUpgradeFsuCycle struct { - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle will be assigned to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection which will be updated by the Exadata Fleet Update Cycle being created. FsuCollectionId *string `mandatory:"true" json:"fsuCollectionId"` GoalVersionDetails FsuGoalVersionDetails `mandatory:"true" json:"goalVersionDetails"` - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. DisplayName *string `mandatory:"false" json:"displayName"` BatchingStrategy CreateBatchingStrategyDetails `mandatory:"false" json:"batchingStrategy"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/custom_gi_goal_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/custom_gi_goal_version_details.go new file mode 100644 index 00000000000..00c14198985 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/custom_gi_goal_version_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CustomGiGoalVersionDetails Details of a custom 'GI' software image. +type CustomGiGoalVersionDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom 'GI' software image. + GoalSoftwareImageId *string `mandatory:"true" json:"goalSoftwareImageId"` +} + +func (m CustomGiGoalVersionDetails) 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 CustomGiGoalVersionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CustomGiGoalVersionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCustomGiGoalVersionDetails CustomGiGoalVersionDetails + s := struct { + DiscriminatorParam string `json:"goalType"` + MarshalTypeCustomGiGoalVersionDetails + }{ + "GI_CUSTOM_IMAGE", + (MarshalTypeCustomGiGoalVersionDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_collection.go index 30170c2a1da..275f5aa883e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_collection.go @@ -20,13 +20,13 @@ import ( // DbCollection 'DB' type Exadata Fleet Update Collection details. type DbCollection struct { - // OCID identifier for the Exadata Fleet Update Collection. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. Id *string `mandatory:"true" json:"id"` - // Exadata Fleet Update Collection resource display name. + // The user-friendly name for the Exadata Fleet Update Collection. DisplayName *string `mandatory:"true" json:"displayName"` - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_fsu_collection_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_fsu_collection_summary.go index 36e7a4f7b59..389d1c7cf2a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_fsu_collection_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/db_fsu_collection_summary.go @@ -20,13 +20,13 @@ import ( // DbFsuCollectionSummary 'DB' type Exadata Fleet Update Collection summary. type DbFsuCollectionSummary struct { - // OCID identifier for the Exadata Fleet Update Collection. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. Id *string `mandatory:"true" json:"id"` - // Exadata Fleet Update Collection resource display name. + // The user-friendly name for the Exadata Fleet Update Collection. DisplayName *string `mandatory:"true" json:"displayName"` - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_details.go index 4a52af9146e..7460be4ca4c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_details.go @@ -64,6 +64,14 @@ func (m *discoverydetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, e mm := DbDiscoveryDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "EXADB_STACK": + mm := ExadbStackDiscoveryDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GUEST_OS": + mm := GuestOsDiscoveryDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: common.Logf("Received unsupported enum value for DiscoveryDetails: %s.", m.Type) return *m, nil diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_types.go index 95d7d6eb290..ed760af7558 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_types.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/discovery_types.go @@ -19,18 +19,24 @@ type DiscoveryTypesEnum string // Set of constants representing the allowable values for DiscoveryTypesEnum const ( - DiscoveryTypesDb DiscoveryTypesEnum = "DB" - DiscoveryTypesGi DiscoveryTypesEnum = "GI" + DiscoveryTypesDb DiscoveryTypesEnum = "DB" + DiscoveryTypesGi DiscoveryTypesEnum = "GI" + DiscoveryTypesGuestOs DiscoveryTypesEnum = "GUEST_OS" + DiscoveryTypesExadbStack DiscoveryTypesEnum = "EXADB_STACK" ) var mappingDiscoveryTypesEnum = map[string]DiscoveryTypesEnum{ - "DB": DiscoveryTypesDb, - "GI": DiscoveryTypesGi, + "DB": DiscoveryTypesDb, + "GI": DiscoveryTypesGi, + "GUEST_OS": DiscoveryTypesGuestOs, + "EXADB_STACK": DiscoveryTypesExadbStack, } var mappingDiscoveryTypesEnumLowerCase = map[string]DiscoveryTypesEnum{ - "db": DiscoveryTypesDb, - "gi": DiscoveryTypesGi, + "db": DiscoveryTypesDb, + "gi": DiscoveryTypesGi, + "guest_os": DiscoveryTypesGuestOs, + "exadb_stack": DiscoveryTypesExadbStack, } // GetDiscoveryTypesEnumValues Enumerates the set of values for DiscoveryTypesEnum @@ -47,6 +53,8 @@ func GetDiscoveryTypesEnumStringValues() []string { return []string{ "DB", "GI", + "GUEST_OS", + "EXADB_STACK", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadata_release_versions.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadata_release_versions.go new file mode 100644 index 00000000000..3a58202a504 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadata_release_versions.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "strings" +) + +// ExadataReleaseVersionsEnum Enum with underlying type: string +type ExadataReleaseVersionsEnum string + +// Set of constants representing the allowable values for ExadataReleaseVersionsEnum +const ( + ExadataReleaseVersionsExaOl5111 ExadataReleaseVersionsEnum = "EXA_OL_5_11_1" + ExadataReleaseVersionsExaOl5112 ExadataReleaseVersionsEnum = "EXA_OL_5_11_2" + ExadataReleaseVersionsExaOl5121 ExadataReleaseVersionsEnum = "EXA_OL_5_12_1" + ExadataReleaseVersionsExaOl6122 ExadataReleaseVersionsEnum = "EXA_OL_6_12_2" + ExadataReleaseVersionsExaOl6181 ExadataReleaseVersionsEnum = "EXA_OL_6_18_1" + ExadataReleaseVersionsExaOl7191 ExadataReleaseVersionsEnum = "EXA_OL_7_19_1" + ExadataReleaseVersionsExaOl7192 ExadataReleaseVersionsEnum = "EXA_OL_7_19_2" + ExadataReleaseVersionsExaOl7193 ExadataReleaseVersionsEnum = "EXA_OL_7_19_3" + ExadataReleaseVersionsExaOl7201 ExadataReleaseVersionsEnum = "EXA_OL_7_20_1" + ExadataReleaseVersionsExaOl7212 ExadataReleaseVersionsEnum = "EXA_OL_7_21_2" + ExadataReleaseVersionsExaOl7221 ExadataReleaseVersionsEnum = "EXA_OL_7_22_1" + ExadataReleaseVersionsExaOl8231 ExadataReleaseVersionsEnum = "EXA_OL_8_23_1" + ExadataReleaseVersionsExaOl8241 ExadataReleaseVersionsEnum = "EXA_OL_8_24_1" +) + +var mappingExadataReleaseVersionsEnum = map[string]ExadataReleaseVersionsEnum{ + "EXA_OL_5_11_1": ExadataReleaseVersionsExaOl5111, + "EXA_OL_5_11_2": ExadataReleaseVersionsExaOl5112, + "EXA_OL_5_12_1": ExadataReleaseVersionsExaOl5121, + "EXA_OL_6_12_2": ExadataReleaseVersionsExaOl6122, + "EXA_OL_6_18_1": ExadataReleaseVersionsExaOl6181, + "EXA_OL_7_19_1": ExadataReleaseVersionsExaOl7191, + "EXA_OL_7_19_2": ExadataReleaseVersionsExaOl7192, + "EXA_OL_7_19_3": ExadataReleaseVersionsExaOl7193, + "EXA_OL_7_20_1": ExadataReleaseVersionsExaOl7201, + "EXA_OL_7_21_2": ExadataReleaseVersionsExaOl7212, + "EXA_OL_7_22_1": ExadataReleaseVersionsExaOl7221, + "EXA_OL_8_23_1": ExadataReleaseVersionsExaOl8231, + "EXA_OL_8_24_1": ExadataReleaseVersionsExaOl8241, +} + +var mappingExadataReleaseVersionsEnumLowerCase = map[string]ExadataReleaseVersionsEnum{ + "exa_ol_5_11_1": ExadataReleaseVersionsExaOl5111, + "exa_ol_5_11_2": ExadataReleaseVersionsExaOl5112, + "exa_ol_5_12_1": ExadataReleaseVersionsExaOl5121, + "exa_ol_6_12_2": ExadataReleaseVersionsExaOl6122, + "exa_ol_6_18_1": ExadataReleaseVersionsExaOl6181, + "exa_ol_7_19_1": ExadataReleaseVersionsExaOl7191, + "exa_ol_7_19_2": ExadataReleaseVersionsExaOl7192, + "exa_ol_7_19_3": ExadataReleaseVersionsExaOl7193, + "exa_ol_7_20_1": ExadataReleaseVersionsExaOl7201, + "exa_ol_7_21_2": ExadataReleaseVersionsExaOl7212, + "exa_ol_7_22_1": ExadataReleaseVersionsExaOl7221, + "exa_ol_8_23_1": ExadataReleaseVersionsExaOl8231, + "exa_ol_8_24_1": ExadataReleaseVersionsExaOl8241, +} + +// GetExadataReleaseVersionsEnumValues Enumerates the set of values for ExadataReleaseVersionsEnum +func GetExadataReleaseVersionsEnumValues() []ExadataReleaseVersionsEnum { + values := make([]ExadataReleaseVersionsEnum, 0) + for _, v := range mappingExadataReleaseVersionsEnum { + values = append(values, v) + } + return values +} + +// GetExadataReleaseVersionsEnumStringValues Enumerates the set of values in String for ExadataReleaseVersionsEnum +func GetExadataReleaseVersionsEnumStringValues() []string { + return []string{ + "EXA_OL_5_11_1", + "EXA_OL_5_11_2", + "EXA_OL_5_12_1", + "EXA_OL_6_12_2", + "EXA_OL_6_18_1", + "EXA_OL_7_19_1", + "EXA_OL_7_19_2", + "EXA_OL_7_19_3", + "EXA_OL_7_20_1", + "EXA_OL_7_21_2", + "EXA_OL_7_22_1", + "EXA_OL_8_23_1", + "EXA_OL_8_24_1", + } +} + +// GetMappingExadataReleaseVersionsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExadataReleaseVersionsEnum(val string) (ExadataReleaseVersionsEnum, bool) { + enum, ok := mappingExadataReleaseVersionsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_collection.go new file mode 100644 index 00000000000..d1b5c9af5e8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_collection.go @@ -0,0 +1,246 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExadbStackCollection Details of 'EXADB_STACK' type Exadata Fleet Update Collection. +// Currently, components allowed in an Exadata software stack are 'GUEST_OS' and 'GI'. +// At least two distinct component types are required for an Exadata software stack. +type ExadbStackCollection struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. + Id *string `mandatory:"true" json:"id"` + + // The user-friendly name for the Exadata Fleet Update Collection. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Details of components in an Exadata software stack. + Components []SoftwareComponentDetails `mandatory:"true" json:"components"` + + ActiveFsuCycle *ActiveCycleDetails `mandatory:"false" json:"activeFsuCycle"` + + // Number of targets that are members of this Collection. + TargetCount *int `mandatory:"false" json:"targetCount"` + + // The time the Exadata Fleet Update Collection was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle. + LastCompletedFsuCycleId *string `mandatory:"false" json:"lastCompletedFsuCycleId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Exadata service type for the target resource members. + ServiceType CollectionServiceTypesEnum `mandatory:"true" json:"serviceType"` + + // The current state of the Exadata Fleet Update Collection. + LifecycleState CollectionLifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m ExadbStackCollection) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m ExadbStackCollection) GetDisplayName() *string { + return m.DisplayName +} + +// GetServiceType returns ServiceType +func (m ExadbStackCollection) GetServiceType() CollectionServiceTypesEnum { + return m.ServiceType +} + +// GetCompartmentId returns CompartmentId +func (m ExadbStackCollection) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetActiveFsuCycle returns ActiveFsuCycle +func (m ExadbStackCollection) GetActiveFsuCycle() *ActiveCycleDetails { + return m.ActiveFsuCycle +} + +// GetTargetCount returns TargetCount +func (m ExadbStackCollection) GetTargetCount() *int { + return m.TargetCount +} + +// GetTimeCreated returns TimeCreated +func (m ExadbStackCollection) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m ExadbStackCollection) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m ExadbStackCollection) GetLifecycleState() CollectionLifecycleStatesEnum { + return m.LifecycleState +} + +// GetLifecycleDetails returns LifecycleDetails +func (m ExadbStackCollection) GetLifecycleDetails() *string { + return m.LifecycleDetails +} + +// GetLastCompletedFsuCycleId returns LastCompletedFsuCycleId +func (m ExadbStackCollection) GetLastCompletedFsuCycleId() *string { + return m.LastCompletedFsuCycleId +} + +// GetFreeformTags returns FreeformTags +func (m ExadbStackCollection) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m ExadbStackCollection) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m ExadbStackCollection) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m ExadbStackCollection) 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 ExadbStackCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCollectionServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetCollectionServiceTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingCollectionLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCollectionLifecycleStatesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ExadbStackCollection) MarshalJSON() (buff []byte, e error) { + type MarshalTypeExadbStackCollection ExadbStackCollection + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeExadbStackCollection + }{ + "EXADB_STACK", + (MarshalTypeExadbStackCollection)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *ExadbStackCollection) UnmarshalJSON(data []byte) (e error) { + model := struct { + ActiveFsuCycle *ActiveCycleDetails `json:"activeFsuCycle"` + TargetCount *int `json:"targetCount"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleDetails *string `json:"lifecycleDetails"` + LastCompletedFsuCycleId *string `json:"lastCompletedFsuCycleId"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + ServiceType CollectionServiceTypesEnum `json:"serviceType"` + CompartmentId *string `json:"compartmentId"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState CollectionLifecycleStatesEnum `json:"lifecycleState"` + Components []softwarecomponentdetails `json:"components"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.ActiveFsuCycle = model.ActiveFsuCycle + + m.TargetCount = model.TargetCount + + m.TimeUpdated = model.TimeUpdated + + m.LifecycleDetails = model.LifecycleDetails + + m.LastCompletedFsuCycleId = model.LastCompletedFsuCycleId + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.ServiceType = model.ServiceType + + m.CompartmentId = model.CompartmentId + + m.TimeCreated = model.TimeCreated + + m.LifecycleState = model.LifecycleState + + m.Components = make([]SoftwareComponentDetails, len(model.Components)) + for i, n := range model.Components { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Components[i] = nn.(SoftwareComponentDetails) + } else { + m.Components[i] = nil + } + } + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_components.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_components.go new file mode 100644 index 00000000000..c47e5d36e59 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_components.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "strings" +) + +// ExadbStackComponentsEnum Enum with underlying type: string +type ExadbStackComponentsEnum string + +// Set of constants representing the allowable values for ExadbStackComponentsEnum +const ( + ExadbStackComponentsGi ExadbStackComponentsEnum = "GI" + ExadbStackComponentsGuestOs ExadbStackComponentsEnum = "GUEST_OS" +) + +var mappingExadbStackComponentsEnum = map[string]ExadbStackComponentsEnum{ + "GI": ExadbStackComponentsGi, + "GUEST_OS": ExadbStackComponentsGuestOs, +} + +var mappingExadbStackComponentsEnumLowerCase = map[string]ExadbStackComponentsEnum{ + "gi": ExadbStackComponentsGi, + "guest_os": ExadbStackComponentsGuestOs, +} + +// GetExadbStackComponentsEnumValues Enumerates the set of values for ExadbStackComponentsEnum +func GetExadbStackComponentsEnumValues() []ExadbStackComponentsEnum { + values := make([]ExadbStackComponentsEnum, 0) + for _, v := range mappingExadbStackComponentsEnum { + values = append(values, v) + } + return values +} + +// GetExadbStackComponentsEnumStringValues Enumerates the set of values in String for ExadbStackComponentsEnum +func GetExadbStackComponentsEnumStringValues() []string { + return []string{ + "GI", + "GUEST_OS", + } +} + +// GetMappingExadbStackComponentsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingExadbStackComponentsEnum(val string) (ExadbStackComponentsEnum, bool) { + enum, ok := mappingExadbStackComponentsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_discovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_discovery_details.go new file mode 100644 index 00000000000..13d3d002c1c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_discovery_details.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExadbStackDiscoveryDetails Details to create an 'EXADB_STACK' type Exadata Fleet Update Discovery. +// Currently, components allowed in an Exadata software stack are 'GUEST_OS' and 'GI'. +// At least two distinct component types are required for an Exadata software stack. +type ExadbStackDiscoveryDetails struct { + + // Discovery filter details of components in an Exadata software stack. + Components []SoftwareComponentDiscoveryDetails `mandatory:"true" json:"components"` + + // Exadata service type for the target resource members. + ServiceType DiscoveryServiceTypesEnum `mandatory:"true" json:"serviceType"` +} + +// GetServiceType returns ServiceType +func (m ExadbStackDiscoveryDetails) GetServiceType() DiscoveryServiceTypesEnum { + return m.ServiceType +} + +func (m ExadbStackDiscoveryDetails) 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 ExadbStackDiscoveryDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDiscoveryServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetDiscoveryServiceTypesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ExadbStackDiscoveryDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeExadbStackDiscoveryDetails ExadbStackDiscoveryDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeExadbStackDiscoveryDetails + }{ + "EXADB_STACK", + (MarshalTypeExadbStackDiscoveryDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *ExadbStackDiscoveryDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + ServiceType DiscoveryServiceTypesEnum `json:"serviceType"` + Components []softwarecomponentdiscoverydetails `json:"components"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.ServiceType = model.ServiceType + + m.Components = make([]SoftwareComponentDiscoveryDetails, len(model.Components)) + for i, n := range model.Components { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Components[i] = nn.(SoftwareComponentDiscoveryDetails) + } else { + m.Components[i] = nil + } + } + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_fsu_collection_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_fsu_collection_summary.go new file mode 100644 index 00000000000..4c0d93ad364 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_fsu_collection_summary.go @@ -0,0 +1,246 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExadbStackFsuCollectionSummary Summary of 'EXADB_STACK' type Exadata Fleet Update Collection. +// Currently, components allowed in an Exadata software stack are 'GUEST_OS' and 'GI'. +// At least two distinct component types are required for an Exadata software stack. +type ExadbStackFsuCollectionSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. + Id *string `mandatory:"true" json:"id"` + + // The user-friendly name for the Exadata Fleet Update Collection. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Summary of components in an Exadata software stack. + Components []SoftwareComponentSummary `mandatory:"true" json:"components"` + + ActiveFsuCycle *ActiveCycleDetails `mandatory:"false" json:"activeFsuCycle"` + + // Number of targets that are members of this Collection. + TargetCount *int `mandatory:"false" json:"targetCount"` + + // The time the Exadata Fleet Update Collection was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle. + LastCompletedFsuCycleId *string `mandatory:"false" json:"lastCompletedFsuCycleId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Exadata service type for the target resource members. + ServiceType CollectionServiceTypesEnum `mandatory:"true" json:"serviceType"` + + // The current state of the Exadata Fleet Update Collection. + LifecycleState CollectionLifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` +} + +// GetId returns Id +func (m ExadbStackFsuCollectionSummary) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m ExadbStackFsuCollectionSummary) GetDisplayName() *string { + return m.DisplayName +} + +// GetServiceType returns ServiceType +func (m ExadbStackFsuCollectionSummary) GetServiceType() CollectionServiceTypesEnum { + return m.ServiceType +} + +// GetCompartmentId returns CompartmentId +func (m ExadbStackFsuCollectionSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetActiveFsuCycle returns ActiveFsuCycle +func (m ExadbStackFsuCollectionSummary) GetActiveFsuCycle() *ActiveCycleDetails { + return m.ActiveFsuCycle +} + +// GetTargetCount returns TargetCount +func (m ExadbStackFsuCollectionSummary) GetTargetCount() *int { + return m.TargetCount +} + +// GetTimeCreated returns TimeCreated +func (m ExadbStackFsuCollectionSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m ExadbStackFsuCollectionSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m ExadbStackFsuCollectionSummary) GetLifecycleState() CollectionLifecycleStatesEnum { + return m.LifecycleState +} + +// GetLifecycleDetails returns LifecycleDetails +func (m ExadbStackFsuCollectionSummary) GetLifecycleDetails() *string { + return m.LifecycleDetails +} + +// GetLastCompletedFsuCycleId returns LastCompletedFsuCycleId +func (m ExadbStackFsuCollectionSummary) GetLastCompletedFsuCycleId() *string { + return m.LastCompletedFsuCycleId +} + +// GetFreeformTags returns FreeformTags +func (m ExadbStackFsuCollectionSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m ExadbStackFsuCollectionSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m ExadbStackFsuCollectionSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m ExadbStackFsuCollectionSummary) 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 ExadbStackFsuCollectionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCollectionServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetCollectionServiceTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingCollectionLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCollectionLifecycleStatesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ExadbStackFsuCollectionSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeExadbStackFsuCollectionSummary ExadbStackFsuCollectionSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeExadbStackFsuCollectionSummary + }{ + "EXADB_STACK", + (MarshalTypeExadbStackFsuCollectionSummary)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *ExadbStackFsuCollectionSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + ActiveFsuCycle *ActiveCycleDetails `json:"activeFsuCycle"` + TargetCount *int `json:"targetCount"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleDetails *string `json:"lifecycleDetails"` + LastCompletedFsuCycleId *string `json:"lastCompletedFsuCycleId"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + ServiceType CollectionServiceTypesEnum `json:"serviceType"` + CompartmentId *string `json:"compartmentId"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState CollectionLifecycleStatesEnum `json:"lifecycleState"` + Components []softwarecomponentsummary `json:"components"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.ActiveFsuCycle = model.ActiveFsuCycle + + m.TargetCount = model.TargetCount + + m.TimeUpdated = model.TimeUpdated + + m.LifecycleDetails = model.LifecycleDetails + + m.LastCompletedFsuCycleId = model.LastCompletedFsuCycleId + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.ServiceType = model.ServiceType + + m.CompartmentId = model.CompartmentId + + m.TimeCreated = model.TimeCreated + + m.LifecycleState = model.LifecycleState + + m.Components = make([]SoftwareComponentSummary, len(model.Components)) + for i, n := range model.Components { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Components[i] = nn.(SoftwareComponentSummary) + } else { + m.Components[i] = nil + } + } + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_fsu_goal_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_fsu_goal_version_details.go new file mode 100644 index 00000000000..17d38518900 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/exadb_stack_fsu_goal_version_details.go @@ -0,0 +1,115 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExadbStackFsuGoalVersionDetails Details of goal version for an 'EXADB_STACK' type Exadata Fleet Update Collection. +// Currently, components allowed in an Exadata software stack are 'GUEST_OS' and 'GI'. +// At least two distinct component types are required for an Exadata software stack. +type ExadbStackFsuGoalVersionDetails struct { + + // Details of goal versions for components in an Exadata software stack. + Components []GoalSoftwareComponentDetails `mandatory:"true" json:"components"` + + // Prefix name used for new DB home resources created as part of the Stage Action. + // Format: _ + // If not specified, a default OCI DB home resource will be generated for the new DB home resources created. + NewHomePrefix *string `mandatory:"false" json:"newHomePrefix"` + + // Goal home policy to use when Staging the Goal Version during patching. + // CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. + // USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. + // If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. + // If more than one existing home for the selected image is found, then the home with the least number of databases will be used. + // If multiple homes have the least number of databases, then a home will be selected at random. + HomePolicy FsuGoalVersionDetailsHomePolicyEnum `mandatory:"false" json:"homePolicy,omitempty"` +} + +// GetHomePolicy returns HomePolicy +func (m ExadbStackFsuGoalVersionDetails) GetHomePolicy() FsuGoalVersionDetailsHomePolicyEnum { + return m.HomePolicy +} + +// GetNewHomePrefix returns NewHomePrefix +func (m ExadbStackFsuGoalVersionDetails) GetNewHomePrefix() *string { + return m.NewHomePrefix +} + +func (m ExadbStackFsuGoalVersionDetails) 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 ExadbStackFsuGoalVersionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingFsuGoalVersionDetailsHomePolicyEnum(string(m.HomePolicy)); !ok && m.HomePolicy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for HomePolicy: %s. Supported values are: %s.", m.HomePolicy, strings.Join(GetFsuGoalVersionDetailsHomePolicyEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ExadbStackFsuGoalVersionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeExadbStackFsuGoalVersionDetails ExadbStackFsuGoalVersionDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeExadbStackFsuGoalVersionDetails + }{ + "EXADB_STACK", + (MarshalTypeExadbStackFsuGoalVersionDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *ExadbStackFsuGoalVersionDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + HomePolicy FsuGoalVersionDetailsHomePolicyEnum `json:"homePolicy"` + NewHomePrefix *string `json:"newHomePrefix"` + Components []goalsoftwarecomponentdetails `json:"components"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.HomePolicy = model.HomePolicy + + m.NewHomePrefix = model.NewHomePrefix + + m.Components = make([]GoalSoftwareComponentDetails, len(model.Components)) + for i, n := range model.Components { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Components[i] = nn.(GoalSoftwareComponentDetails) + } else { + m.Components[i] = nil + } + } + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection.go index b49b02b849c..260247ef1d8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection.go @@ -20,16 +20,16 @@ import ( // FsuCollection Exadata Fleet Update Collection Resource. type FsuCollection interface { - // OCID identifier for the Exadata Fleet Update Collection. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. GetId() *string - // Exadata Fleet Update Collection resource display name. + // The user-friendly name for the Exadata Fleet Update Collection. GetDisplayName() *string // Exadata service type for the target resource members. GetServiceType() CollectionServiceTypesEnum - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. GetCompartmentId() *string // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. @@ -124,6 +124,14 @@ func (m *fsucollection) UnmarshalPolymorphicJSON(data []byte) (interface{}, erro var err error switch m.Type { + case "GUEST_OS": + mm := GuestOsCollection{} + err = json.Unmarshal(data, &mm) + return mm, err + case "EXADB_STACK": + mm := ExadbStackCollection{} + err = json.Unmarshal(data, &mm) + return mm, err case "GI": mm := GiCollection{} err = json.Unmarshal(data, &mm) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection_summary.go index 3925e67d5c7..225513dd569 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_collection_summary.go @@ -20,16 +20,16 @@ import ( // FsuCollectionSummary Exadata Fleet Update Collection Resource. type FsuCollectionSummary interface { - // OCID identifier for the Exadata Fleet Update Collection. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. GetId() *string - // Exadata Fleet Update Collection resource display name. + // The user-friendly name for the Exadata Fleet Update Collection. GetDisplayName() *string // Exadata service type for the target resource members. GetServiceType() CollectionServiceTypesEnum - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. GetCompartmentId() *string // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. @@ -128,10 +128,18 @@ func (m *fsucollectionsummary) UnmarshalPolymorphicJSON(data []byte) (interface{ mm := GiFsuCollectionSummary{} err = json.Unmarshal(data, &mm) return mm, err + case "EXADB_STACK": + mm := ExadbStackFsuCollectionSummary{} + err = json.Unmarshal(data, &mm) + return mm, err case "DB": mm := DbFsuCollectionSummary{} err = json.Unmarshal(data, &mm) return mm, err + case "GUEST_OS": + mm := GuestOsFsuCollectionSummary{} + err = json.Unmarshal(data, &mm) + return mm, err default: common.Logf("Received unsupported enum value for FsuCollectionSummary: %s.", m.Type) return *m, nil diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle.go index 8025683eb41..3404ac8169e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle.go @@ -20,13 +20,13 @@ import ( // FsuCycle Exadata Fleet Update Cycle resource details. type FsuCycle interface { - // OCID identifier for the Exadata Fleet Update Cycle. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Cycle. GetId() *string - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. GetCompartmentId() *string - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle is assigned to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. GetFsuCollectionId() *string // The date and time the Exadata Fleet Update Cycle was created, as described in @@ -36,16 +36,16 @@ type FsuCycle interface { // The current state of the Exadata Fleet Update Cycle. GetLifecycleState() CycleLifecycleStatesEnum - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. GetDisplayName() *string - // Type of Collection this Exadata Fleet Update Cycle belongs to. + // Type of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. GetCollectionType() CollectionTypesEnum - // OCID identifier for the Action that is currently in execution, if applicable. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Action that is currently in progress, if applicable. GetExecutingFsuActionId() *string - // In this array all the possible actions will be listed. The first element is the suggested Action. + // All possible Exadata Fleet Update Actions will be listed. The first element is the suggested Exadata Fleet Update Action. GetNextActionToExecute() []NextActionToExecuteDetails // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle_summary.go index ed992d7d3c1..ae5bc8801e7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_cycle_summary.go @@ -20,19 +20,19 @@ import ( // FsuCycleSummary Exadata Fleet Update Cycle Summary. type FsuCycleSummary struct { - // OCID identifier for the Exadata Fleet Update Cycle. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Cycle. Id *string `mandatory:"true" json:"id"` - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // Type of Exadata Fleet Update Cycle. Type CycleTypesEnum `mandatory:"true" json:"type"` - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle is assigned to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. FsuCollectionId *string `mandatory:"true" json:"fsuCollectionId"` - // Type of Collection this Exadata Fleet Update Cycle belongs to. + // Type of Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. CollectionType CollectionTypesEnum `mandatory:"true" json:"collectionType"` GoalVersionDetails FsuGoalVersionDetails `mandatory:"true" json:"goalVersionDetails"` @@ -44,10 +44,10 @@ type FsuCycleSummary struct { // The current state of the Exadata Fleet Update Cycle. LifecycleState CycleLifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. DisplayName *string `mandatory:"false" json:"displayName"` - // OCID identifier for the Action that is currently in execution, if applicable. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Action that is currently in progress, if applicable. ExecutingFsuActionId *string `mandatory:"false" json:"executingFsuActionId"` // In this array all the possible actions will be listed. The first element is the suggested Action. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_goal_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_goal_version_details.go index 6269b5578b4..4a2d54d1495 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_goal_version_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/fsu_goal_version_details.go @@ -68,6 +68,10 @@ func (m *fsugoalversiondetails) UnmarshalPolymorphicJSON(data []byte) (interface var err error switch m.Type { + case "EXADB_STACK": + mm := ExadbStackFsuGoalVersionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "VERSION": mm := VersionFsuTargetDetails{} err = json.Unmarshal(data, &mm) @@ -158,18 +162,21 @@ type FsuGoalVersionDetailsTypeEnum string // Set of constants representing the allowable values for FsuGoalVersionDetailsTypeEnum const ( - FsuGoalVersionDetailsTypeVersion FsuGoalVersionDetailsTypeEnum = "VERSION" - FsuGoalVersionDetailsTypeImageId FsuGoalVersionDetailsTypeEnum = "IMAGE_ID" + FsuGoalVersionDetailsTypeVersion FsuGoalVersionDetailsTypeEnum = "VERSION" + FsuGoalVersionDetailsTypeImageId FsuGoalVersionDetailsTypeEnum = "IMAGE_ID" + FsuGoalVersionDetailsTypeExadbStack FsuGoalVersionDetailsTypeEnum = "EXADB_STACK" ) var mappingFsuGoalVersionDetailsTypeEnum = map[string]FsuGoalVersionDetailsTypeEnum{ - "VERSION": FsuGoalVersionDetailsTypeVersion, - "IMAGE_ID": FsuGoalVersionDetailsTypeImageId, + "VERSION": FsuGoalVersionDetailsTypeVersion, + "IMAGE_ID": FsuGoalVersionDetailsTypeImageId, + "EXADB_STACK": FsuGoalVersionDetailsTypeExadbStack, } var mappingFsuGoalVersionDetailsTypeEnumLowerCase = map[string]FsuGoalVersionDetailsTypeEnum{ - "version": FsuGoalVersionDetailsTypeVersion, - "image_id": FsuGoalVersionDetailsTypeImageId, + "version": FsuGoalVersionDetailsTypeVersion, + "image_id": FsuGoalVersionDetailsTypeImageId, + "exadb_stack": FsuGoalVersionDetailsTypeExadbStack, } // GetFsuGoalVersionDetailsTypeEnumValues Enumerates the set of values for FsuGoalVersionDetailsTypeEnum @@ -186,6 +193,7 @@ func GetFsuGoalVersionDetailsTypeEnumStringValues() []string { return []string{ "VERSION", "IMAGE_ID", + "EXADB_STACK", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_collection.go index e9db497d805..6db18a5718d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_collection.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_collection.go @@ -20,13 +20,13 @@ import ( // GiCollection Details to create a 'GI' type Exadata Fleet Update Collection. type GiCollection struct { - // OCID identifier for the Exadata Fleet Update Collection. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. Id *string `mandatory:"true" json:"id"` - // Exadata Fleet Update Collection resource display name. + // The user-friendly name for the Exadata Fleet Update Collection. DisplayName *string `mandatory:"true" json:"displayName"` - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_fsu_collection_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_fsu_collection_summary.go index 0d8dbf382a5..170d35d5fc1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_fsu_collection_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_fsu_collection_summary.go @@ -20,13 +20,13 @@ import ( // GiFsuCollectionSummary 'GI' type Exadata Fleet Update Collection summary. type GiFsuCollectionSummary struct { - // OCID identifier for the Exadata Fleet Update Collection. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. Id *string `mandatory:"true" json:"id"` - // Exadata Fleet Update Collection resource display name. + // The user-friendly name for the Exadata Fleet Update Collection. DisplayName *string `mandatory:"true" json:"displayName"` - // Compartment Identifier + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_goal_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_goal_software_component_details.go new file mode 100644 index 00000000000..3d3bb3ac5be --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_goal_software_component_details.go @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GiGoalSoftwareComponentDetails Details of goal version for 'GI' component in an 'EXADB_STACK' type Exadata Fleet Update Collection. +type GiGoalSoftwareComponentDetails struct { + GoalVersionDetails GiGoalVersionDetails `mandatory:"true" json:"goalVersionDetails"` + + // Prefix name used for new DB home resources created as part of the Stage Action. + // Format: _ + // If not specified, a default OCI DB home resource will be generated for the new DB home resources created. + NewHomePrefix *string `mandatory:"false" json:"newHomePrefix"` + + // Goal home policy to use when Staging the Goal Version during patching. + // CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. + // USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. + // If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. + // If more than one existing home for the selected image is found, then the home with the least number of databases will be used. + // If multiple homes have the least number of databases, then a home will be selected at random. + HomePolicy GiGoalSoftwareComponentDetailsHomePolicyEnum `mandatory:"false" json:"homePolicy,omitempty"` +} + +func (m GiGoalSoftwareComponentDetails) 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 GiGoalSoftwareComponentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGiGoalSoftwareComponentDetailsHomePolicyEnum(string(m.HomePolicy)); !ok && m.HomePolicy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for HomePolicy: %s. Supported values are: %s.", m.HomePolicy, strings.Join(GetGiGoalSoftwareComponentDetailsHomePolicyEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GiGoalSoftwareComponentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGiGoalSoftwareComponentDetails GiGoalSoftwareComponentDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGiGoalSoftwareComponentDetails + }{ + "GI", + (MarshalTypeGiGoalSoftwareComponentDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GiGoalSoftwareComponentDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + HomePolicy GiGoalSoftwareComponentDetailsHomePolicyEnum `json:"homePolicy"` + NewHomePrefix *string `json:"newHomePrefix"` + GoalVersionDetails gigoalversiondetails `json:"goalVersionDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.HomePolicy = model.HomePolicy + + m.NewHomePrefix = model.NewHomePrefix + + nn, e = model.GoalVersionDetails.UnmarshalPolymorphicJSON(model.GoalVersionDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.GoalVersionDetails = nn.(GiGoalVersionDetails) + } else { + m.GoalVersionDetails = nil + } + + return +} + +// GiGoalSoftwareComponentDetailsHomePolicyEnum Enum with underlying type: string +type GiGoalSoftwareComponentDetailsHomePolicyEnum string + +// Set of constants representing the allowable values for GiGoalSoftwareComponentDetailsHomePolicyEnum +const ( + GiGoalSoftwareComponentDetailsHomePolicyCreateNew GiGoalSoftwareComponentDetailsHomePolicyEnum = "CREATE_NEW" + GiGoalSoftwareComponentDetailsHomePolicyUseExisting GiGoalSoftwareComponentDetailsHomePolicyEnum = "USE_EXISTING" +) + +var mappingGiGoalSoftwareComponentDetailsHomePolicyEnum = map[string]GiGoalSoftwareComponentDetailsHomePolicyEnum{ + "CREATE_NEW": GiGoalSoftwareComponentDetailsHomePolicyCreateNew, + "USE_EXISTING": GiGoalSoftwareComponentDetailsHomePolicyUseExisting, +} + +var mappingGiGoalSoftwareComponentDetailsHomePolicyEnumLowerCase = map[string]GiGoalSoftwareComponentDetailsHomePolicyEnum{ + "create_new": GiGoalSoftwareComponentDetailsHomePolicyCreateNew, + "use_existing": GiGoalSoftwareComponentDetailsHomePolicyUseExisting, +} + +// GetGiGoalSoftwareComponentDetailsHomePolicyEnumValues Enumerates the set of values for GiGoalSoftwareComponentDetailsHomePolicyEnum +func GetGiGoalSoftwareComponentDetailsHomePolicyEnumValues() []GiGoalSoftwareComponentDetailsHomePolicyEnum { + values := make([]GiGoalSoftwareComponentDetailsHomePolicyEnum, 0) + for _, v := range mappingGiGoalSoftwareComponentDetailsHomePolicyEnum { + values = append(values, v) + } + return values +} + +// GetGiGoalSoftwareComponentDetailsHomePolicyEnumStringValues Enumerates the set of values in String for GiGoalSoftwareComponentDetailsHomePolicyEnum +func GetGiGoalSoftwareComponentDetailsHomePolicyEnumStringValues() []string { + return []string{ + "CREATE_NEW", + "USE_EXISTING", + } +} + +// GetMappingGiGoalSoftwareComponentDetailsHomePolicyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGiGoalSoftwareComponentDetailsHomePolicyEnum(val string) (GiGoalSoftwareComponentDetailsHomePolicyEnum, bool) { + enum, ok := mappingGiGoalSoftwareComponentDetailsHomePolicyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_goal_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_goal_version_details.go new file mode 100644 index 00000000000..48163d2e7f0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_goal_version_details.go @@ -0,0 +1,124 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GiGoalVersionDetails Details of goal 'GI' software version. +type GiGoalVersionDetails interface { +} + +type gigoalversiondetails struct { + JsonData []byte + GoalType string `json:"goalType"` +} + +// UnmarshalJSON unmarshals json +func (m *gigoalversiondetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalergigoalversiondetails gigoalversiondetails + s := struct { + Model Unmarshalergigoalversiondetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.GoalType = s.Model.GoalType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *gigoalversiondetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.GoalType { + case "GI_ORACLE_IMAGE": + mm := OracleGiGoalVersionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GI_CUSTOM_IMAGE": + mm := CustomGiGoalVersionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for GiGoalVersionDetails: %s.", m.GoalType) + return *m, nil + } +} + +func (m gigoalversiondetails) 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 gigoalversiondetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GiGoalVersionDetailsGoalTypeEnum Enum with underlying type: string +type GiGoalVersionDetailsGoalTypeEnum string + +// Set of constants representing the allowable values for GiGoalVersionDetailsGoalTypeEnum +const ( + GiGoalVersionDetailsGoalTypeOracleImage GiGoalVersionDetailsGoalTypeEnum = "GI_ORACLE_IMAGE" + GiGoalVersionDetailsGoalTypeCustomImage GiGoalVersionDetailsGoalTypeEnum = "GI_CUSTOM_IMAGE" +) + +var mappingGiGoalVersionDetailsGoalTypeEnum = map[string]GiGoalVersionDetailsGoalTypeEnum{ + "GI_ORACLE_IMAGE": GiGoalVersionDetailsGoalTypeOracleImage, + "GI_CUSTOM_IMAGE": GiGoalVersionDetailsGoalTypeCustomImage, +} + +var mappingGiGoalVersionDetailsGoalTypeEnumLowerCase = map[string]GiGoalVersionDetailsGoalTypeEnum{ + "gi_oracle_image": GiGoalVersionDetailsGoalTypeOracleImage, + "gi_custom_image": GiGoalVersionDetailsGoalTypeCustomImage, +} + +// GetGiGoalVersionDetailsGoalTypeEnumValues Enumerates the set of values for GiGoalVersionDetailsGoalTypeEnum +func GetGiGoalVersionDetailsGoalTypeEnumValues() []GiGoalVersionDetailsGoalTypeEnum { + values := make([]GiGoalVersionDetailsGoalTypeEnum, 0) + for _, v := range mappingGiGoalVersionDetailsGoalTypeEnum { + values = append(values, v) + } + return values +} + +// GetGiGoalVersionDetailsGoalTypeEnumStringValues Enumerates the set of values in String for GiGoalVersionDetailsGoalTypeEnum +func GetGiGoalVersionDetailsGoalTypeEnumStringValues() []string { + return []string{ + "GI_ORACLE_IMAGE", + "GI_CUSTOM_IMAGE", + } +} + +// GetMappingGiGoalVersionDetailsGoalTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGiGoalVersionDetailsGoalTypeEnum(val string) (GiGoalVersionDetailsGoalTypeEnum, bool) { + enum, ok := mappingGiGoalVersionDetailsGoalTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_details.go new file mode 100644 index 00000000000..e01dca899ec --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_details.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GiSoftwareComponentDetails Details of 'GI' component in an Exadata software stack. +type GiSoftwareComponentDetails struct { + FleetDiscovery GiFleetDiscoveryDetails `mandatory:"true" json:"fleetDiscovery"` + + // Grid Infrastructure Major Version of targets to be included in the Exadata Fleet Update Collection. + // Only GI targets that match the version specified in this value would be added to the Exadata Fleet Update Collection. + SourceMajorVersion GiSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m GiSoftwareComponentDetails) 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 GiSoftwareComponentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGiSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGiSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GiSoftwareComponentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGiSoftwareComponentDetails GiSoftwareComponentDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGiSoftwareComponentDetails + }{ + "GI", + (MarshalTypeGiSoftwareComponentDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GiSoftwareComponentDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + SourceMajorVersion GiSourceMajorVersionsEnum `json:"sourceMajorVersion"` + FleetDiscovery gifleetdiscoverydetails `json:"fleetDiscovery"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.SourceMajorVersion = model.SourceMajorVersion + + nn, e = model.FleetDiscovery.UnmarshalPolymorphicJSON(model.FleetDiscovery.JsonData) + if e != nil { + return + } + if nn != nil { + m.FleetDiscovery = nn.(GiFleetDiscoveryDetails) + } else { + m.FleetDiscovery = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_discovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_discovery_details.go new file mode 100644 index 00000000000..1a26e48c065 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_discovery_details.go @@ -0,0 +1,87 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GiSoftwareComponentDiscoveryDetails Discovery filter details of 'GI' component in an Exadata software stack. +type GiSoftwareComponentDiscoveryDetails struct { + Criteria GiFleetDiscoveryDetails `mandatory:"true" json:"criteria"` + + // Grid Infrastructure Major Version of targets to be included in the Exadata Fleet Update Discovery results. + // Only GI targets that match the version specified in this value would be added to the Exadata Fleet Update Discovery results. + SourceMajorVersion GiSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m GiSoftwareComponentDiscoveryDetails) 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 GiSoftwareComponentDiscoveryDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGiSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGiSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GiSoftwareComponentDiscoveryDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGiSoftwareComponentDiscoveryDetails GiSoftwareComponentDiscoveryDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGiSoftwareComponentDiscoveryDetails + }{ + "GI", + (MarshalTypeGiSoftwareComponentDiscoveryDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GiSoftwareComponentDiscoveryDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + SourceMajorVersion GiSourceMajorVersionsEnum `json:"sourceMajorVersion"` + Criteria gifleetdiscoverydetails `json:"criteria"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.SourceMajorVersion = model.SourceMajorVersion + + nn, e = model.Criteria.UnmarshalPolymorphicJSON(model.Criteria.JsonData) + if e != nil { + return + } + if nn != nil { + m.Criteria = nn.(GiFleetDiscoveryDetails) + } else { + m.Criteria = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_summary.go new file mode 100644 index 00000000000..02299b9b433 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/gi_software_component_summary.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GiSoftwareComponentSummary Summary of 'GI' component in an Exadata software stack. +type GiSoftwareComponentSummary struct { + + // Grid Infrastructure Major Version of targets to be included in the Exadata Fleet Update Collection. + // Only GI targets that match the version specified in this value would be added to the Exadata Fleet Update Collection. + SourceMajorVersion GiSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m GiSoftwareComponentSummary) 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 GiSoftwareComponentSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGiSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGiSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GiSoftwareComponentSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGiSoftwareComponentSummary GiSoftwareComponentSummary + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGiSoftwareComponentSummary + }{ + "GI", + (MarshalTypeGiSoftwareComponentSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/goal_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/goal_software_component_details.go new file mode 100644 index 00000000000..f835939e8b2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/goal_software_component_details.go @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GoalSoftwareComponentDetails Details of goal version for a component in an 'EXADB_STACK' type Exadata Fleet Update Collection. +type GoalSoftwareComponentDetails interface { +} + +type goalsoftwarecomponentdetails struct { + JsonData []byte + ComponentType string `json:"componentType"` +} + +// UnmarshalJSON unmarshals json +func (m *goalsoftwarecomponentdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalergoalsoftwarecomponentdetails goalsoftwarecomponentdetails + s := struct { + Model Unmarshalergoalsoftwarecomponentdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ComponentType = s.Model.ComponentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *goalsoftwarecomponentdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ComponentType { + case "GUEST_OS": + mm := GuestOsGoalSoftwareComponentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GI": + mm := GiGoalSoftwareComponentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for GoalSoftwareComponentDetails: %s.", m.ComponentType) + return *m, nil + } +} + +func (m goalsoftwarecomponentdetails) 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 goalsoftwarecomponentdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_collection.go new file mode 100644 index 00000000000..e62bb6e43a0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_collection.go @@ -0,0 +1,252 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsCollection Details of a 'GUEST_OS' type Exadata Fleet Update Collection. +type GuestOsCollection struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. + Id *string `mandatory:"true" json:"id"` + + // The user-friendly name for the Exadata Fleet Update Collection. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + FleetDiscovery GuestOsFleetDiscoveryDetails `mandatory:"true" json:"fleetDiscovery"` + + ActiveFsuCycle *ActiveCycleDetails `mandatory:"false" json:"activeFsuCycle"` + + // Number of targets that are members of this Collection. + TargetCount *int `mandatory:"false" json:"targetCount"` + + // The time the Exadata Fleet Update Collection was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle. + LastCompletedFsuCycleId *string `mandatory:"false" json:"lastCompletedFsuCycleId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Exadata service type for the target resource members. + ServiceType CollectionServiceTypesEnum `mandatory:"true" json:"serviceType"` + + // The current state of the Exadata Fleet Update Collection. + LifecycleState CollectionLifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the Exadata Fleet Update Collection. + // Only Exadata VM Clusters whose 'systemVersion' is related to the major version will be added to the Exadata Fleet Update Collection. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +// GetId returns Id +func (m GuestOsCollection) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m GuestOsCollection) GetDisplayName() *string { + return m.DisplayName +} + +// GetServiceType returns ServiceType +func (m GuestOsCollection) GetServiceType() CollectionServiceTypesEnum { + return m.ServiceType +} + +// GetCompartmentId returns CompartmentId +func (m GuestOsCollection) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetActiveFsuCycle returns ActiveFsuCycle +func (m GuestOsCollection) GetActiveFsuCycle() *ActiveCycleDetails { + return m.ActiveFsuCycle +} + +// GetTargetCount returns TargetCount +func (m GuestOsCollection) GetTargetCount() *int { + return m.TargetCount +} + +// GetTimeCreated returns TimeCreated +func (m GuestOsCollection) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m GuestOsCollection) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m GuestOsCollection) GetLifecycleState() CollectionLifecycleStatesEnum { + return m.LifecycleState +} + +// GetLifecycleDetails returns LifecycleDetails +func (m GuestOsCollection) GetLifecycleDetails() *string { + return m.LifecycleDetails +} + +// GetLastCompletedFsuCycleId returns LastCompletedFsuCycleId +func (m GuestOsCollection) GetLastCompletedFsuCycleId() *string { + return m.LastCompletedFsuCycleId +} + +// GetFreeformTags returns FreeformTags +func (m GuestOsCollection) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m GuestOsCollection) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m GuestOsCollection) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m GuestOsCollection) 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 GuestOsCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCollectionServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetCollectionServiceTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingCollectionLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCollectionLifecycleStatesEnumStringValues(), ","))) + } + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsCollection) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsCollection GuestOsCollection + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsCollection + }{ + "GUEST_OS", + (MarshalTypeGuestOsCollection)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GuestOsCollection) UnmarshalJSON(data []byte) (e error) { + model := struct { + ActiveFsuCycle *ActiveCycleDetails `json:"activeFsuCycle"` + TargetCount *int `json:"targetCount"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleDetails *string `json:"lifecycleDetails"` + LastCompletedFsuCycleId *string `json:"lastCompletedFsuCycleId"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + ServiceType CollectionServiceTypesEnum `json:"serviceType"` + CompartmentId *string `json:"compartmentId"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState CollectionLifecycleStatesEnum `json:"lifecycleState"` + SourceMajorVersion GuestOsSourceMajorVersionsEnum `json:"sourceMajorVersion"` + FleetDiscovery guestosfleetdiscoverydetails `json:"fleetDiscovery"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.ActiveFsuCycle = model.ActiveFsuCycle + + m.TargetCount = model.TargetCount + + m.TimeUpdated = model.TimeUpdated + + m.LifecycleDetails = model.LifecycleDetails + + m.LastCompletedFsuCycleId = model.LastCompletedFsuCycleId + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.ServiceType = model.ServiceType + + m.CompartmentId = model.CompartmentId + + m.TimeCreated = model.TimeCreated + + m.LifecycleState = model.LifecycleState + + m.SourceMajorVersion = model.SourceMajorVersion + + nn, e = model.FleetDiscovery.UnmarshalPolymorphicJSON(model.FleetDiscovery.JsonData) + if e != nil { + return + } + if nn != nil { + m.FleetDiscovery = nn.(GuestOsFleetDiscoveryDetails) + } else { + m.FleetDiscovery = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_compartment_id_filter.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_compartment_id_filter.go new file mode 100644 index 00000000000..f93b83aca7d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_compartment_id_filter.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsCompartmentIdFilter List of OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of compartments to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. +type GuestOsCompartmentIdFilter struct { + + // List of OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Compartments to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + Identifiers []string `mandatory:"true" json:"identifiers"` + + // INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Supported only for RESOURCE_ID filter. + Mode GuestOsFleetDiscoveryFilterModeEnum `mandatory:"false" json:"mode,omitempty"` +} + +// GetMode returns Mode +func (m GuestOsCompartmentIdFilter) GetMode() GuestOsFleetDiscoveryFilterModeEnum { + return m.Mode +} + +func (m GuestOsCompartmentIdFilter) 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 GuestOsCompartmentIdFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsFleetDiscoveryFilterModeEnum(string(m.Mode)); !ok && m.Mode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Mode: %s. Supported values are: %s.", m.Mode, strings.Join(GetGuestOsFleetDiscoveryFilterModeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsCompartmentIdFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsCompartmentIdFilter GuestOsCompartmentIdFilter + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsCompartmentIdFilter + }{ + "COMPARTMENT_ID", + (MarshalTypeGuestOsCompartmentIdFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_defined_tags_filter.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_defined_tags_filter.go new file mode 100644 index 00000000000..ea4fdaa9fde --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_defined_tags_filter.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsDefinedTagsFilter Defined tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. +type GuestOsDefinedTagsFilter struct { + + // Defined tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + Tags []DefinedTagFilterEntry `mandatory:"true" json:"tags"` + + // INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Supported only for RESOURCE_ID filter. + Mode GuestOsFleetDiscoveryFilterModeEnum `mandatory:"false" json:"mode,omitempty"` + + // Type of join for each element in this filter. + Operator FleetDiscoveryOperatorsEnum `mandatory:"false" json:"operator,omitempty"` +} + +// GetMode returns Mode +func (m GuestOsDefinedTagsFilter) GetMode() GuestOsFleetDiscoveryFilterModeEnum { + return m.Mode +} + +func (m GuestOsDefinedTagsFilter) 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 GuestOsDefinedTagsFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsFleetDiscoveryFilterModeEnum(string(m.Mode)); !ok && m.Mode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Mode: %s. Supported values are: %s.", m.Mode, strings.Join(GetGuestOsFleetDiscoveryFilterModeEnumStringValues(), ","))) + } + if _, ok := GetMappingFleetDiscoveryOperatorsEnum(string(m.Operator)); !ok && m.Operator != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Operator: %s. Supported values are: %s.", m.Operator, strings.Join(GetFleetDiscoveryOperatorsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsDefinedTagsFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsDefinedTagsFilter GuestOsDefinedTagsFilter + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsDefinedTagsFilter + }{ + "DEFINED_TAG", + (MarshalTypeGuestOsDefinedTagsFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_discovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_discovery_details.go new file mode 100644 index 00000000000..d135ce18ef3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_discovery_details.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsDiscoveryDetails Details to create a 'GUEST_OS' type Exadata Fleet Update Discovery. +type GuestOsDiscoveryDetails struct { + Criteria GuestOsFleetDiscoveryDetails `mandatory:"true" json:"criteria"` + + // Exadata service type for the target resource members. + ServiceType DiscoveryServiceTypesEnum `mandatory:"true" json:"serviceType"` + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the results for an Exadata Fleet Update Discovery. + // Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +// GetServiceType returns ServiceType +func (m GuestOsDiscoveryDetails) GetServiceType() DiscoveryServiceTypesEnum { + return m.ServiceType +} + +func (m GuestOsDiscoveryDetails) 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 GuestOsDiscoveryDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingDiscoveryServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetDiscoveryServiceTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsDiscoveryDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsDiscoveryDetails GuestOsDiscoveryDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsDiscoveryDetails + }{ + "GUEST_OS", + (MarshalTypeGuestOsDiscoveryDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GuestOsDiscoveryDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + ServiceType DiscoveryServiceTypesEnum `json:"serviceType"` + SourceMajorVersion GuestOsSourceMajorVersionsEnum `json:"sourceMajorVersion"` + Criteria guestosfleetdiscoverydetails `json:"criteria"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.ServiceType = model.ServiceType + + m.SourceMajorVersion = model.SourceMajorVersion + + nn, e = model.Criteria.UnmarshalPolymorphicJSON(model.Criteria.JsonData) + if e != nil { + return + } + if nn != nil { + m.Criteria = nn.(GuestOsFleetDiscoveryDetails) + } else { + m.Criteria = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_discovery_results.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_discovery_results.go new file mode 100644 index 00000000000..6729d199164 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_discovery_results.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsDiscoveryResults Discover Exadata VM Cluster targets for a 'GUEST_OS' collection by cloning the results of a 'Succeeded' Exadata Fleet Update Discovery resource. +// The type of the source Exadata Fleet Update Discovery resource can be 'GI' or 'GUEST_OS'. +type GuestOsDiscoveryResults struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + FsuDiscoveryId *string `mandatory:"true" json:"fsuDiscoveryId"` +} + +func (m GuestOsDiscoveryResults) 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 GuestOsDiscoveryResults) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsDiscoveryResults) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsDiscoveryResults GuestOsDiscoveryResults + s := struct { + DiscriminatorParam string `json:"strategy"` + MarshalTypeGuestOsDiscoveryResults + }{ + "DISCOVERY_RESULTS", + (MarshalTypeGuestOsDiscoveryResults)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_exadata_release_version_filter.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_exadata_release_version_filter.go new file mode 100644 index 00000000000..5ad4fdef113 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_exadata_release_version_filter.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsExadataReleaseVersionFilter Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. +// Only release versions related to the specified sourceMajorVersion are allowed. +type GuestOsExadataReleaseVersionFilter struct { + + // INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Supported only for RESOURCE_ID filter. + Mode GuestOsFleetDiscoveryFilterModeEnum `mandatory:"false" json:"mode,omitempty"` + + // List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + ExadataReleases []ExadataReleaseVersionsEnum `mandatory:"true" json:"exadataReleases"` +} + +// GetMode returns Mode +func (m GuestOsExadataReleaseVersionFilter) GetMode() GuestOsFleetDiscoveryFilterModeEnum { + return m.Mode +} + +func (m GuestOsExadataReleaseVersionFilter) 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 GuestOsExadataReleaseVersionFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsFleetDiscoveryFilterModeEnum(string(m.Mode)); !ok && m.Mode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Mode: %s. Supported values are: %s.", m.Mode, strings.Join(GetGuestOsFleetDiscoveryFilterModeEnumStringValues(), ","))) + } + for _, val := range m.ExadataReleases { + if _, ok := GetMappingExadataReleaseVersionsEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ExadataReleases: %s. Supported values are: %s.", val, strings.Join(GetExadataReleaseVersionsEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsExadataReleaseVersionFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsExadataReleaseVersionFilter GuestOsExadataReleaseVersionFilter + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsExadataReleaseVersionFilter + }{ + "EXADATA_RELEASE_VERSION", + (MarshalTypeGuestOsExadataReleaseVersionFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_filters_discovery.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_filters_discovery.go new file mode 100644 index 00000000000..cc048976cb0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_filters_discovery.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsFiltersDiscovery Discover Exadata VM Cluster targets for a 'GUEST_OS' collection by querying OCI Search Service (https://docs.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) using specified filters. +type GuestOsFiltersDiscovery struct { + + // Filters to use for search. + Filters []GuestOsFleetDiscoveryFilter `mandatory:"true" json:"filters"` +} + +func (m GuestOsFiltersDiscovery) 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 GuestOsFiltersDiscovery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsFiltersDiscovery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsFiltersDiscovery GuestOsFiltersDiscovery + s := struct { + DiscriminatorParam string `json:"strategy"` + MarshalTypeGuestOsFiltersDiscovery + }{ + "FILTERS", + (MarshalTypeGuestOsFiltersDiscovery)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GuestOsFiltersDiscovery) UnmarshalJSON(data []byte) (e error) { + model := struct { + Filters []guestosfleetdiscoveryfilter `json:"filters"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Filters = make([]GuestOsFleetDiscoveryFilter, len(model.Filters)) + for i, n := range model.Filters { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Filters[i] = nn.(GuestOsFleetDiscoveryFilter) + } else { + m.Filters[i] = nil + } + } + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fleet_discovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fleet_discovery_details.go new file mode 100644 index 00000000000..e050087bfb2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fleet_discovery_details.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsFleetDiscoveryDetails Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. +// If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. +type GuestOsFleetDiscoveryDetails interface { +} + +type guestosfleetdiscoverydetails struct { + JsonData []byte + Strategy string `json:"strategy"` +} + +// UnmarshalJSON unmarshals json +func (m *guestosfleetdiscoverydetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerguestosfleetdiscoverydetails guestosfleetdiscoverydetails + s := struct { + Model Unmarshalerguestosfleetdiscoverydetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Strategy = s.Model.Strategy + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *guestosfleetdiscoverydetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Strategy { + case "TARGET_LIST": + mm := GuestOsTargetListDiscovery{} + err = json.Unmarshal(data, &mm) + return mm, err + case "SEARCH_QUERY": + mm := GuestOsSearchQueryDiscovery{} + err = json.Unmarshal(data, &mm) + return mm, err + case "DISCOVERY_RESULTS": + mm := GuestOsDiscoveryResults{} + err = json.Unmarshal(data, &mm) + return mm, err + case "FILTERS": + mm := GuestOsFiltersDiscovery{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for GuestOsFleetDiscoveryDetails: %s.", m.Strategy) + return *m, nil + } +} + +func (m guestosfleetdiscoverydetails) 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 guestosfleetdiscoverydetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fleet_discovery_filter.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fleet_discovery_filter.go new file mode 100644 index 00000000000..5cc395e30a5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fleet_discovery_filter.go @@ -0,0 +1,212 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsFleetDiscoveryFilter Discover Exadata VM Cluster targets for a 'GUEST_OS' collection by querying OCI Search Service (https://docs.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) using specified filters. +type GuestOsFleetDiscoveryFilter interface { + + // INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Supported only for RESOURCE_ID filter. + GetMode() GuestOsFleetDiscoveryFilterModeEnum +} + +type guestosfleetdiscoveryfilter struct { + JsonData []byte + Mode GuestOsFleetDiscoveryFilterModeEnum `mandatory:"false" json:"mode,omitempty"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *guestosfleetdiscoveryfilter) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerguestosfleetdiscoveryfilter guestosfleetdiscoveryfilter + s := struct { + Model Unmarshalerguestosfleetdiscoveryfilter + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Mode = s.Model.Mode + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *guestosfleetdiscoveryfilter) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "VERSION": + mm := GuestOsVersionFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "EXADATA_RELEASE_VERSION": + mm := GuestOsExadataReleaseVersionFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "FREEFORM_TAG": + mm := GuestOsFreeformTagsFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "DEFINED_TAG": + mm := GuestOsDefinedTagsFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "COMPARTMENT_ID": + mm := GuestOsCompartmentIdFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + case "RESOURCE_ID": + mm := GuestOsResourceIdFilter{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for GuestOsFleetDiscoveryFilter: %s.", m.Type) + return *m, nil + } +} + +// GetMode returns Mode +func (m guestosfleetdiscoveryfilter) GetMode() GuestOsFleetDiscoveryFilterModeEnum { + return m.Mode +} + +func (m guestosfleetdiscoveryfilter) 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 guestosfleetdiscoveryfilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsFleetDiscoveryFilterModeEnum(string(m.Mode)); !ok && m.Mode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Mode: %s. Supported values are: %s.", m.Mode, strings.Join(GetGuestOsFleetDiscoveryFilterModeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GuestOsFleetDiscoveryFilterModeEnum Enum with underlying type: string +type GuestOsFleetDiscoveryFilterModeEnum string + +// Set of constants representing the allowable values for GuestOsFleetDiscoveryFilterModeEnum +const ( + GuestOsFleetDiscoveryFilterModeInclude GuestOsFleetDiscoveryFilterModeEnum = "INCLUDE" + GuestOsFleetDiscoveryFilterModeExclude GuestOsFleetDiscoveryFilterModeEnum = "EXCLUDE" +) + +var mappingGuestOsFleetDiscoveryFilterModeEnum = map[string]GuestOsFleetDiscoveryFilterModeEnum{ + "INCLUDE": GuestOsFleetDiscoveryFilterModeInclude, + "EXCLUDE": GuestOsFleetDiscoveryFilterModeExclude, +} + +var mappingGuestOsFleetDiscoveryFilterModeEnumLowerCase = map[string]GuestOsFleetDiscoveryFilterModeEnum{ + "include": GuestOsFleetDiscoveryFilterModeInclude, + "exclude": GuestOsFleetDiscoveryFilterModeExclude, +} + +// GetGuestOsFleetDiscoveryFilterModeEnumValues Enumerates the set of values for GuestOsFleetDiscoveryFilterModeEnum +func GetGuestOsFleetDiscoveryFilterModeEnumValues() []GuestOsFleetDiscoveryFilterModeEnum { + values := make([]GuestOsFleetDiscoveryFilterModeEnum, 0) + for _, v := range mappingGuestOsFleetDiscoveryFilterModeEnum { + values = append(values, v) + } + return values +} + +// GetGuestOsFleetDiscoveryFilterModeEnumStringValues Enumerates the set of values in String for GuestOsFleetDiscoveryFilterModeEnum +func GetGuestOsFleetDiscoveryFilterModeEnumStringValues() []string { + return []string{ + "INCLUDE", + "EXCLUDE", + } +} + +// GetMappingGuestOsFleetDiscoveryFilterModeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGuestOsFleetDiscoveryFilterModeEnum(val string) (GuestOsFleetDiscoveryFilterModeEnum, bool) { + enum, ok := mappingGuestOsFleetDiscoveryFilterModeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// GuestOsFleetDiscoveryFilterTypeEnum Enum with underlying type: string +type GuestOsFleetDiscoveryFilterTypeEnum string + +// Set of constants representing the allowable values for GuestOsFleetDiscoveryFilterTypeEnum +const ( + GuestOsFleetDiscoveryFilterTypeCompartmentId GuestOsFleetDiscoveryFilterTypeEnum = "COMPARTMENT_ID" + GuestOsFleetDiscoveryFilterTypeVersion GuestOsFleetDiscoveryFilterTypeEnum = "VERSION" + GuestOsFleetDiscoveryFilterTypeExadataReleaseVersion GuestOsFleetDiscoveryFilterTypeEnum = "EXADATA_RELEASE_VERSION" + GuestOsFleetDiscoveryFilterTypeFreeformTag GuestOsFleetDiscoveryFilterTypeEnum = "FREEFORM_TAG" + GuestOsFleetDiscoveryFilterTypeDefinedTag GuestOsFleetDiscoveryFilterTypeEnum = "DEFINED_TAG" + GuestOsFleetDiscoveryFilterTypeResourceId GuestOsFleetDiscoveryFilterTypeEnum = "RESOURCE_ID" +) + +var mappingGuestOsFleetDiscoveryFilterTypeEnum = map[string]GuestOsFleetDiscoveryFilterTypeEnum{ + "COMPARTMENT_ID": GuestOsFleetDiscoveryFilterTypeCompartmentId, + "VERSION": GuestOsFleetDiscoveryFilterTypeVersion, + "EXADATA_RELEASE_VERSION": GuestOsFleetDiscoveryFilterTypeExadataReleaseVersion, + "FREEFORM_TAG": GuestOsFleetDiscoveryFilterTypeFreeformTag, + "DEFINED_TAG": GuestOsFleetDiscoveryFilterTypeDefinedTag, + "RESOURCE_ID": GuestOsFleetDiscoveryFilterTypeResourceId, +} + +var mappingGuestOsFleetDiscoveryFilterTypeEnumLowerCase = map[string]GuestOsFleetDiscoveryFilterTypeEnum{ + "compartment_id": GuestOsFleetDiscoveryFilterTypeCompartmentId, + "version": GuestOsFleetDiscoveryFilterTypeVersion, + "exadata_release_version": GuestOsFleetDiscoveryFilterTypeExadataReleaseVersion, + "freeform_tag": GuestOsFleetDiscoveryFilterTypeFreeformTag, + "defined_tag": GuestOsFleetDiscoveryFilterTypeDefinedTag, + "resource_id": GuestOsFleetDiscoveryFilterTypeResourceId, +} + +// GetGuestOsFleetDiscoveryFilterTypeEnumValues Enumerates the set of values for GuestOsFleetDiscoveryFilterTypeEnum +func GetGuestOsFleetDiscoveryFilterTypeEnumValues() []GuestOsFleetDiscoveryFilterTypeEnum { + values := make([]GuestOsFleetDiscoveryFilterTypeEnum, 0) + for _, v := range mappingGuestOsFleetDiscoveryFilterTypeEnum { + values = append(values, v) + } + return values +} + +// GetGuestOsFleetDiscoveryFilterTypeEnumStringValues Enumerates the set of values in String for GuestOsFleetDiscoveryFilterTypeEnum +func GetGuestOsFleetDiscoveryFilterTypeEnumStringValues() []string { + return []string{ + "COMPARTMENT_ID", + "VERSION", + "EXADATA_RELEASE_VERSION", + "FREEFORM_TAG", + "DEFINED_TAG", + "RESOURCE_ID", + } +} + +// GetMappingGuestOsFleetDiscoveryFilterTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGuestOsFleetDiscoveryFilterTypeEnum(val string) (GuestOsFleetDiscoveryFilterTypeEnum, bool) { + enum, ok := mappingGuestOsFleetDiscoveryFilterTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_freeform_tags_filter.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_freeform_tags_filter.go new file mode 100644 index 00000000000..25ec7af20f3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_freeform_tags_filter.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsFreeformTagsFilter Free-form tags (https://docs.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. +type GuestOsFreeformTagsFilter struct { + + // Free-form tags (https://docs.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + Tags []FreeformTagFilterEntry `mandatory:"true" json:"tags"` + + // INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Supported only for RESOURCE_ID filter. + Mode GuestOsFleetDiscoveryFilterModeEnum `mandatory:"false" json:"mode,omitempty"` + + // Type of join for each element in this filter. + Operator FleetDiscoveryOperatorsEnum `mandatory:"false" json:"operator,omitempty"` +} + +// GetMode returns Mode +func (m GuestOsFreeformTagsFilter) GetMode() GuestOsFleetDiscoveryFilterModeEnum { + return m.Mode +} + +func (m GuestOsFreeformTagsFilter) 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 GuestOsFreeformTagsFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsFleetDiscoveryFilterModeEnum(string(m.Mode)); !ok && m.Mode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Mode: %s. Supported values are: %s.", m.Mode, strings.Join(GetGuestOsFleetDiscoveryFilterModeEnumStringValues(), ","))) + } + if _, ok := GetMappingFleetDiscoveryOperatorsEnum(string(m.Operator)); !ok && m.Operator != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Operator: %s. Supported values are: %s.", m.Operator, strings.Join(GetFleetDiscoveryOperatorsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsFreeformTagsFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsFreeformTagsFilter GuestOsFreeformTagsFilter + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsFreeformTagsFilter + }{ + "FREEFORM_TAG", + (MarshalTypeGuestOsFreeformTagsFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fsu_collection_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fsu_collection_summary.go new file mode 100644 index 00000000000..208c6a773d7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_fsu_collection_summary.go @@ -0,0 +1,181 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsFsuCollectionSummary Summary of 'GUEST_OS' type Exadata Fleet Update Collection. +type GuestOsFsuCollectionSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. + Id *string `mandatory:"true" json:"id"` + + // The user-friendly name for the Exadata Fleet Update Collection. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the Exadata Fleet Update Collection was created. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + ActiveFsuCycle *ActiveCycleDetails `mandatory:"false" json:"activeFsuCycle"` + + // Number of targets that are members of this Collection. + TargetCount *int `mandatory:"false" json:"targetCount"` + + // The time the Exadata Fleet Update Collection was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // 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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle. + LastCompletedFsuCycleId *string `mandatory:"false" json:"lastCompletedFsuCycleId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Exadata service type for the target resource members. + ServiceType CollectionServiceTypesEnum `mandatory:"true" json:"serviceType"` + + // The current state of the Exadata Fleet Update Collection. + LifecycleState CollectionLifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the Exadata Fleet Update Collection. + // Only Exadata VM Clusters whose 'systemVersion' is related to the major version will be added to the Exadata Fleet Update Collection. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +// GetId returns Id +func (m GuestOsFsuCollectionSummary) GetId() *string { + return m.Id +} + +// GetDisplayName returns DisplayName +func (m GuestOsFsuCollectionSummary) GetDisplayName() *string { + return m.DisplayName +} + +// GetServiceType returns ServiceType +func (m GuestOsFsuCollectionSummary) GetServiceType() CollectionServiceTypesEnum { + return m.ServiceType +} + +// GetCompartmentId returns CompartmentId +func (m GuestOsFsuCollectionSummary) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetActiveFsuCycle returns ActiveFsuCycle +func (m GuestOsFsuCollectionSummary) GetActiveFsuCycle() *ActiveCycleDetails { + return m.ActiveFsuCycle +} + +// GetTargetCount returns TargetCount +func (m GuestOsFsuCollectionSummary) GetTargetCount() *int { + return m.TargetCount +} + +// GetTimeCreated returns TimeCreated +func (m GuestOsFsuCollectionSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m GuestOsFsuCollectionSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetLifecycleState returns LifecycleState +func (m GuestOsFsuCollectionSummary) GetLifecycleState() CollectionLifecycleStatesEnum { + return m.LifecycleState +} + +// GetLifecycleDetails returns LifecycleDetails +func (m GuestOsFsuCollectionSummary) GetLifecycleDetails() *string { + return m.LifecycleDetails +} + +// GetLastCompletedFsuCycleId returns LastCompletedFsuCycleId +func (m GuestOsFsuCollectionSummary) GetLastCompletedFsuCycleId() *string { + return m.LastCompletedFsuCycleId +} + +// GetFreeformTags returns FreeformTags +func (m GuestOsFsuCollectionSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m GuestOsFsuCollectionSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m GuestOsFsuCollectionSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m GuestOsFsuCollectionSummary) 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 GuestOsFsuCollectionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCollectionServiceTypesEnum(string(m.ServiceType)); !ok && m.ServiceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceType: %s. Supported values are: %s.", m.ServiceType, strings.Join(GetCollectionServiceTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingCollectionLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetCollectionLifecycleStatesEnumStringValues(), ","))) + } + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsFsuCollectionSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsFsuCollectionSummary GuestOsFsuCollectionSummary + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsFsuCollectionSummary + }{ + "GUEST_OS", + (MarshalTypeGuestOsFsuCollectionSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_goal_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_goal_software_component_details.go new file mode 100644 index 00000000000..18a698d1657 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_goal_software_component_details.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsGoalSoftwareComponentDetails Details of goal version for 'GUEST_OS' component in an 'EXADB_STACK' type Exadata Fleet Update Collection. +type GuestOsGoalSoftwareComponentDetails struct { + GoalVersionDetails GuestOsGoalVersionDetails `mandatory:"true" json:"goalVersionDetails"` +} + +func (m GuestOsGoalSoftwareComponentDetails) 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 GuestOsGoalSoftwareComponentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsGoalSoftwareComponentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsGoalSoftwareComponentDetails GuestOsGoalSoftwareComponentDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGuestOsGoalSoftwareComponentDetails + }{ + "GUEST_OS", + (MarshalTypeGuestOsGoalSoftwareComponentDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GuestOsGoalSoftwareComponentDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + GoalVersionDetails guestosgoalversiondetails `json:"goalVersionDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.GoalVersionDetails.UnmarshalPolymorphicJSON(model.GoalVersionDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.GoalVersionDetails = nn.(GuestOsGoalVersionDetails) + } else { + m.GoalVersionDetails = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_goal_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_goal_version_details.go new file mode 100644 index 00000000000..d24112b13eb --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_goal_version_details.go @@ -0,0 +1,116 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsGoalVersionDetails Details of goal 'GUEST_OS' software version. +type GuestOsGoalVersionDetails interface { +} + +type guestosgoalversiondetails struct { + JsonData []byte + GoalType string `json:"goalType"` +} + +// UnmarshalJSON unmarshals json +func (m *guestosgoalversiondetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerguestosgoalversiondetails guestosgoalversiondetails + s := struct { + Model Unmarshalerguestosgoalversiondetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.GoalType = s.Model.GoalType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *guestosgoalversiondetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.GoalType { + case "GUEST_OS_ORACLE_IMAGE": + mm := OracleGuestOsGoalVersionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for GuestOsGoalVersionDetails: %s.", m.GoalType) + return *m, nil + } +} + +func (m guestosgoalversiondetails) 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 guestosgoalversiondetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GuestOsGoalVersionDetailsGoalTypeEnum Enum with underlying type: string +type GuestOsGoalVersionDetailsGoalTypeEnum string + +// Set of constants representing the allowable values for GuestOsGoalVersionDetailsGoalTypeEnum +const ( + GuestOsGoalVersionDetailsGoalTypeGuestOsOracleImage GuestOsGoalVersionDetailsGoalTypeEnum = "GUEST_OS_ORACLE_IMAGE" +) + +var mappingGuestOsGoalVersionDetailsGoalTypeEnum = map[string]GuestOsGoalVersionDetailsGoalTypeEnum{ + "GUEST_OS_ORACLE_IMAGE": GuestOsGoalVersionDetailsGoalTypeGuestOsOracleImage, +} + +var mappingGuestOsGoalVersionDetailsGoalTypeEnumLowerCase = map[string]GuestOsGoalVersionDetailsGoalTypeEnum{ + "guest_os_oracle_image": GuestOsGoalVersionDetailsGoalTypeGuestOsOracleImage, +} + +// GetGuestOsGoalVersionDetailsGoalTypeEnumValues Enumerates the set of values for GuestOsGoalVersionDetailsGoalTypeEnum +func GetGuestOsGoalVersionDetailsGoalTypeEnumValues() []GuestOsGoalVersionDetailsGoalTypeEnum { + values := make([]GuestOsGoalVersionDetailsGoalTypeEnum, 0) + for _, v := range mappingGuestOsGoalVersionDetailsGoalTypeEnum { + values = append(values, v) + } + return values +} + +// GetGuestOsGoalVersionDetailsGoalTypeEnumStringValues Enumerates the set of values in String for GuestOsGoalVersionDetailsGoalTypeEnum +func GetGuestOsGoalVersionDetailsGoalTypeEnumStringValues() []string { + return []string{ + "GUEST_OS_ORACLE_IMAGE", + } +} + +// GetMappingGuestOsGoalVersionDetailsGoalTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGuestOsGoalVersionDetailsGoalTypeEnum(val string) (GuestOsGoalVersionDetailsGoalTypeEnum, bool) { + enum, ok := mappingGuestOsGoalVersionDetailsGoalTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_resource_id_filter.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_resource_id_filter.go new file mode 100644 index 00000000000..785d3a0ea19 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_resource_id_filter.go @@ -0,0 +1,135 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsResourceIdFilter The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. +type GuestOsResourceIdFilter struct { + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Specified resources must match the specified 'entityType'. + // FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + Identifiers []string `mandatory:"true" json:"identifiers"` + + // Type of associated resource. + EntityType GuestOsResourceIdFilterEntityTypeEnum `mandatory:"true" json:"entityType"` + + // INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Supported only for RESOURCE_ID filter. + Mode GuestOsFleetDiscoveryFilterModeEnum `mandatory:"false" json:"mode,omitempty"` + + // Type of join for each element in this filter. + Operator FleetDiscoveryOperatorsEnum `mandatory:"false" json:"operator,omitempty"` +} + +// GetMode returns Mode +func (m GuestOsResourceIdFilter) GetMode() GuestOsFleetDiscoveryFilterModeEnum { + return m.Mode +} + +func (m GuestOsResourceIdFilter) 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 GuestOsResourceIdFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGuestOsResourceIdFilterEntityTypeEnum(string(m.EntityType)); !ok && m.EntityType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EntityType: %s. Supported values are: %s.", m.EntityType, strings.Join(GetGuestOsResourceIdFilterEntityTypeEnumStringValues(), ","))) + } + + if _, ok := GetMappingGuestOsFleetDiscoveryFilterModeEnum(string(m.Mode)); !ok && m.Mode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Mode: %s. Supported values are: %s.", m.Mode, strings.Join(GetGuestOsFleetDiscoveryFilterModeEnumStringValues(), ","))) + } + if _, ok := GetMappingFleetDiscoveryOperatorsEnum(string(m.Operator)); !ok && m.Operator != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Operator: %s. Supported values are: %s.", m.Operator, strings.Join(GetFleetDiscoveryOperatorsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsResourceIdFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsResourceIdFilter GuestOsResourceIdFilter + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsResourceIdFilter + }{ + "RESOURCE_ID", + (MarshalTypeGuestOsResourceIdFilter)(m), + } + + return json.Marshal(&s) +} + +// GuestOsResourceIdFilterEntityTypeEnum Enum with underlying type: string +type GuestOsResourceIdFilterEntityTypeEnum string + +// Set of constants representing the allowable values for GuestOsResourceIdFilterEntityTypeEnum +const ( + GuestOsResourceIdFilterEntityTypeExadatainfrastructure GuestOsResourceIdFilterEntityTypeEnum = "EXADATAINFRASTRUCTURE" + GuestOsResourceIdFilterEntityTypeCloudexadatainfrastructure GuestOsResourceIdFilterEntityTypeEnum = "CLOUDEXADATAINFRASTRUCTURE" + GuestOsResourceIdFilterEntityTypeVmcluster GuestOsResourceIdFilterEntityTypeEnum = "VMCLUSTER" + GuestOsResourceIdFilterEntityTypeCloudvmcluster GuestOsResourceIdFilterEntityTypeEnum = "CLOUDVMCLUSTER" + GuestOsResourceIdFilterEntityTypeFsucollection GuestOsResourceIdFilterEntityTypeEnum = "FSUCOLLECTION" +) + +var mappingGuestOsResourceIdFilterEntityTypeEnum = map[string]GuestOsResourceIdFilterEntityTypeEnum{ + "EXADATAINFRASTRUCTURE": GuestOsResourceIdFilterEntityTypeExadatainfrastructure, + "CLOUDEXADATAINFRASTRUCTURE": GuestOsResourceIdFilterEntityTypeCloudexadatainfrastructure, + "VMCLUSTER": GuestOsResourceIdFilterEntityTypeVmcluster, + "CLOUDVMCLUSTER": GuestOsResourceIdFilterEntityTypeCloudvmcluster, + "FSUCOLLECTION": GuestOsResourceIdFilterEntityTypeFsucollection, +} + +var mappingGuestOsResourceIdFilterEntityTypeEnumLowerCase = map[string]GuestOsResourceIdFilterEntityTypeEnum{ + "exadatainfrastructure": GuestOsResourceIdFilterEntityTypeExadatainfrastructure, + "cloudexadatainfrastructure": GuestOsResourceIdFilterEntityTypeCloudexadatainfrastructure, + "vmcluster": GuestOsResourceIdFilterEntityTypeVmcluster, + "cloudvmcluster": GuestOsResourceIdFilterEntityTypeCloudvmcluster, + "fsucollection": GuestOsResourceIdFilterEntityTypeFsucollection, +} + +// GetGuestOsResourceIdFilterEntityTypeEnumValues Enumerates the set of values for GuestOsResourceIdFilterEntityTypeEnum +func GetGuestOsResourceIdFilterEntityTypeEnumValues() []GuestOsResourceIdFilterEntityTypeEnum { + values := make([]GuestOsResourceIdFilterEntityTypeEnum, 0) + for _, v := range mappingGuestOsResourceIdFilterEntityTypeEnum { + values = append(values, v) + } + return values +} + +// GetGuestOsResourceIdFilterEntityTypeEnumStringValues Enumerates the set of values in String for GuestOsResourceIdFilterEntityTypeEnum +func GetGuestOsResourceIdFilterEntityTypeEnumStringValues() []string { + return []string{ + "EXADATAINFRASTRUCTURE", + "CLOUDEXADATAINFRASTRUCTURE", + "VMCLUSTER", + "CLOUDVMCLUSTER", + "FSUCOLLECTION", + } +} + +// GetMappingGuestOsResourceIdFilterEntityTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGuestOsResourceIdFilterEntityTypeEnum(val string) (GuestOsResourceIdFilterEntityTypeEnum, bool) { + enum, ok := mappingGuestOsResourceIdFilterEntityTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_search_query_discovery.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_search_query_discovery.go new file mode 100644 index 00000000000..37aa3a090f9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_search_query_discovery.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsSearchQueryDiscovery Discover Exadata VM Cluster targets for a 'GUEST_OS' collection by querying OCI Search Service (https://docs.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) using specified query string. +type GuestOsSearchQueryDiscovery struct { + + // OCI Search Service (https://docs.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + Query *string `mandatory:"true" json:"query"` +} + +func (m GuestOsSearchQueryDiscovery) 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 GuestOsSearchQueryDiscovery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsSearchQueryDiscovery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsSearchQueryDiscovery GuestOsSearchQueryDiscovery + s := struct { + DiscriminatorParam string `json:"strategy"` + MarshalTypeGuestOsSearchQueryDiscovery + }{ + "SEARCH_QUERY", + (MarshalTypeGuestOsSearchQueryDiscovery)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_details.go new file mode 100644 index 00000000000..8fa96cb7f7b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_details.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsSoftwareComponentDetails Details of 'GUEST_OS' component in an Exadata software stack. +type GuestOsSoftwareComponentDetails struct { + FleetDiscovery GuestOsFleetDiscoveryDetails `mandatory:"true" json:"fleetDiscovery"` + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in an Exadata Fleet Update Collection. + // Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m GuestOsSoftwareComponentDetails) 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 GuestOsSoftwareComponentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsSoftwareComponentDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsSoftwareComponentDetails GuestOsSoftwareComponentDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGuestOsSoftwareComponentDetails + }{ + "GUEST_OS", + (MarshalTypeGuestOsSoftwareComponentDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GuestOsSoftwareComponentDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + SourceMajorVersion GuestOsSourceMajorVersionsEnum `json:"sourceMajorVersion"` + FleetDiscovery guestosfleetdiscoverydetails `json:"fleetDiscovery"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.SourceMajorVersion = model.SourceMajorVersion + + nn, e = model.FleetDiscovery.UnmarshalPolymorphicJSON(model.FleetDiscovery.JsonData) + if e != nil { + return + } + if nn != nil { + m.FleetDiscovery = nn.(GuestOsFleetDiscoveryDetails) + } else { + m.FleetDiscovery = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_discovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_discovery_details.go new file mode 100644 index 00000000000..360f6a50f25 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_discovery_details.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsSoftwareComponentDiscoveryDetails Discovery filter details of 'GUEST_OS' component in an Exadata software stack. +type GuestOsSoftwareComponentDiscoveryDetails struct { + Criteria GuestOsFleetDiscoveryDetails `mandatory:"true" json:"criteria"` + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the results for an Exadata Fleet Update Discovery. + // Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m GuestOsSoftwareComponentDiscoveryDetails) 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 GuestOsSoftwareComponentDiscoveryDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsSoftwareComponentDiscoveryDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsSoftwareComponentDiscoveryDetails GuestOsSoftwareComponentDiscoveryDetails + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGuestOsSoftwareComponentDiscoveryDetails + }{ + "GUEST_OS", + (MarshalTypeGuestOsSoftwareComponentDiscoveryDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *GuestOsSoftwareComponentDiscoveryDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + SourceMajorVersion GuestOsSourceMajorVersionsEnum `json:"sourceMajorVersion"` + Criteria guestosfleetdiscoverydetails `json:"criteria"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.SourceMajorVersion = model.SourceMajorVersion + + nn, e = model.Criteria.UnmarshalPolymorphicJSON(model.Criteria.JsonData) + if e != nil { + return + } + if nn != nil { + m.Criteria = nn.(GuestOsFleetDiscoveryDetails) + } else { + m.Criteria = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_summary.go new file mode 100644 index 00000000000..f20d7219264 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_software_component_summary.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsSoftwareComponentSummary Summary of 'GUEST_OS' component in Exadata software stack. +type GuestOsSoftwareComponentSummary struct { + + // Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in an Exadata Fleet Update Collection. + // Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. + // For more details, refer to Oracle document 2075007.1 (https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) + SourceMajorVersion GuestOsSourceMajorVersionsEnum `mandatory:"true" json:"sourceMajorVersion"` +} + +func (m GuestOsSoftwareComponentSummary) 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 GuestOsSoftwareComponentSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsSourceMajorVersionsEnum(string(m.SourceMajorVersion)); !ok && m.SourceMajorVersion != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SourceMajorVersion: %s. Supported values are: %s.", m.SourceMajorVersion, strings.Join(GetGuestOsSourceMajorVersionsEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsSoftwareComponentSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsSoftwareComponentSummary GuestOsSoftwareComponentSummary + s := struct { + DiscriminatorParam string `json:"componentType"` + MarshalTypeGuestOsSoftwareComponentSummary + }{ + "GUEST_OS", + (MarshalTypeGuestOsSoftwareComponentSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_source_major_versions.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_source_major_versions.go new file mode 100644 index 00000000000..c427bce8852 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_source_major_versions.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "strings" +) + +// GuestOsSourceMajorVersionsEnum Enum with underlying type: string +type GuestOsSourceMajorVersionsEnum string + +// Set of constants representing the allowable values for GuestOsSourceMajorVersionsEnum +const ( + GuestOsSourceMajorVersionsExaOl5 GuestOsSourceMajorVersionsEnum = "EXA_OL_5" + GuestOsSourceMajorVersionsExaOl6 GuestOsSourceMajorVersionsEnum = "EXA_OL_6" + GuestOsSourceMajorVersionsExaOl7 GuestOsSourceMajorVersionsEnum = "EXA_OL_7" + GuestOsSourceMajorVersionsExaOl8 GuestOsSourceMajorVersionsEnum = "EXA_OL_8" +) + +var mappingGuestOsSourceMajorVersionsEnum = map[string]GuestOsSourceMajorVersionsEnum{ + "EXA_OL_5": GuestOsSourceMajorVersionsExaOl5, + "EXA_OL_6": GuestOsSourceMajorVersionsExaOl6, + "EXA_OL_7": GuestOsSourceMajorVersionsExaOl7, + "EXA_OL_8": GuestOsSourceMajorVersionsExaOl8, +} + +var mappingGuestOsSourceMajorVersionsEnumLowerCase = map[string]GuestOsSourceMajorVersionsEnum{ + "exa_ol_5": GuestOsSourceMajorVersionsExaOl5, + "exa_ol_6": GuestOsSourceMajorVersionsExaOl6, + "exa_ol_7": GuestOsSourceMajorVersionsExaOl7, + "exa_ol_8": GuestOsSourceMajorVersionsExaOl8, +} + +// GetGuestOsSourceMajorVersionsEnumValues Enumerates the set of values for GuestOsSourceMajorVersionsEnum +func GetGuestOsSourceMajorVersionsEnumValues() []GuestOsSourceMajorVersionsEnum { + values := make([]GuestOsSourceMajorVersionsEnum, 0) + for _, v := range mappingGuestOsSourceMajorVersionsEnum { + values = append(values, v) + } + return values +} + +// GetGuestOsSourceMajorVersionsEnumStringValues Enumerates the set of values in String for GuestOsSourceMajorVersionsEnum +func GetGuestOsSourceMajorVersionsEnumStringValues() []string { + return []string{ + "EXA_OL_5", + "EXA_OL_6", + "EXA_OL_7", + "EXA_OL_8", + } +} + +// GetMappingGuestOsSourceMajorVersionsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGuestOsSourceMajorVersionsEnum(val string) (GuestOsSourceMajorVersionsEnum, bool) { + enum, ok := mappingGuestOsSourceMajorVersionsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_target_list_discovery.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_target_list_discovery.go new file mode 100644 index 00000000000..ee4a708bb35 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_target_list_discovery.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsTargetListDiscovery Discover specified list of Exadata VM Cluster targets for a 'GUEST_OS' collection. +type GuestOsTargetListDiscovery struct { + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. + // Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. + Targets []string `mandatory:"true" json:"targets"` +} + +func (m GuestOsTargetListDiscovery) 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 GuestOsTargetListDiscovery) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsTargetListDiscovery) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsTargetListDiscovery GuestOsTargetListDiscovery + s := struct { + DiscriminatorParam string `json:"strategy"` + MarshalTypeGuestOsTargetListDiscovery + }{ + "TARGET_LIST", + (MarshalTypeGuestOsTargetListDiscovery)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_version_filter.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_version_filter.go new file mode 100644 index 00000000000..2db75de3a99 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/guest_os_version_filter.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GuestOsVersionFilter Exadata Image (Guest OS) versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. +// Only versions related to the specified sourceMajorVersion are allowed. +// For example, version "22.1.26.0.0.240801" can be specified for sourceMajorVersion "EXA_OL_7" (Oracle Linux 7). +type GuestOsVersionFilter struct { + + // List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + Versions []string `mandatory:"true" json:"versions"` + + // INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + // Supported only for RESOURCE_ID filter. + Mode GuestOsFleetDiscoveryFilterModeEnum `mandatory:"false" json:"mode,omitempty"` +} + +// GetMode returns Mode +func (m GuestOsVersionFilter) GetMode() GuestOsFleetDiscoveryFilterModeEnum { + return m.Mode +} + +func (m GuestOsVersionFilter) 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 GuestOsVersionFilter) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingGuestOsFleetDiscoveryFilterModeEnum(string(m.Mode)); !ok && m.Mode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Mode: %s. Supported values are: %s.", m.Mode, strings.Join(GetGuestOsFleetDiscoveryFilterModeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GuestOsVersionFilter) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGuestOsVersionFilter GuestOsVersionFilter + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeGuestOsVersionFilter + }{ + "VERSION", + (MarshalTypeGuestOsVersionFilter)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/image_id_fsu_target_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/image_id_fsu_target_details.go index 302cab0a92e..c1a86285177 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/image_id_fsu_target_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/image_id_fsu_target_details.go @@ -23,7 +23,7 @@ import ( // Specify a Database Software Image of type GRID_IMAGE for a GI Collection. type ImageIdFsuTargetDetails struct { - // Target database software image OCID. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the goal database software image. SoftwareImageId *string `mandatory:"true" json:"softwareImageId"` // Prefix name used for new DB home resources created as part of the Stage Action. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_collections_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_collections_request_response.go index 07a46e1b481..75dbf1de46a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_collections_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_collections_request_response.go @@ -195,18 +195,24 @@ type ListFsuCollectionsTypeEnum string // Set of constants representing the allowable values for ListFsuCollectionsTypeEnum const ( - ListFsuCollectionsTypeDb ListFsuCollectionsTypeEnum = "DB" - ListFsuCollectionsTypeGi ListFsuCollectionsTypeEnum = "GI" + ListFsuCollectionsTypeDb ListFsuCollectionsTypeEnum = "DB" + ListFsuCollectionsTypeGi ListFsuCollectionsTypeEnum = "GI" + ListFsuCollectionsTypeGuestOs ListFsuCollectionsTypeEnum = "GUEST_OS" + ListFsuCollectionsTypeExadbStack ListFsuCollectionsTypeEnum = "EXADB_STACK" ) var mappingListFsuCollectionsTypeEnum = map[string]ListFsuCollectionsTypeEnum{ - "DB": ListFsuCollectionsTypeDb, - "GI": ListFsuCollectionsTypeGi, + "DB": ListFsuCollectionsTypeDb, + "GI": ListFsuCollectionsTypeGi, + "GUEST_OS": ListFsuCollectionsTypeGuestOs, + "EXADB_STACK": ListFsuCollectionsTypeExadbStack, } var mappingListFsuCollectionsTypeEnumLowerCase = map[string]ListFsuCollectionsTypeEnum{ - "db": ListFsuCollectionsTypeDb, - "gi": ListFsuCollectionsTypeGi, + "db": ListFsuCollectionsTypeDb, + "gi": ListFsuCollectionsTypeGi, + "guest_os": ListFsuCollectionsTypeGuestOs, + "exadb_stack": ListFsuCollectionsTypeExadbStack, } // GetListFsuCollectionsTypeEnumValues Enumerates the set of values for ListFsuCollectionsTypeEnum @@ -223,6 +229,8 @@ func GetListFsuCollectionsTypeEnumStringValues() []string { return []string{ "DB", "GI", + "GUEST_OS", + "EXADB_STACK", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_cycles_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_cycles_request_response.go index 0e621d83b2d..402d772e3e3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_cycles_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/list_fsu_cycles_request_response.go @@ -209,18 +209,24 @@ type ListFsuCyclesCollectionTypeEnum string // Set of constants representing the allowable values for ListFsuCyclesCollectionTypeEnum const ( - ListFsuCyclesCollectionTypeDb ListFsuCyclesCollectionTypeEnum = "DB" - ListFsuCyclesCollectionTypeGi ListFsuCyclesCollectionTypeEnum = "GI" + ListFsuCyclesCollectionTypeDb ListFsuCyclesCollectionTypeEnum = "DB" + ListFsuCyclesCollectionTypeGi ListFsuCyclesCollectionTypeEnum = "GI" + ListFsuCyclesCollectionTypeGuestOs ListFsuCyclesCollectionTypeEnum = "GUEST_OS" + ListFsuCyclesCollectionTypeExadbStack ListFsuCyclesCollectionTypeEnum = "EXADB_STACK" ) var mappingListFsuCyclesCollectionTypeEnum = map[string]ListFsuCyclesCollectionTypeEnum{ - "DB": ListFsuCyclesCollectionTypeDb, - "GI": ListFsuCyclesCollectionTypeGi, + "DB": ListFsuCyclesCollectionTypeDb, + "GI": ListFsuCyclesCollectionTypeGi, + "GUEST_OS": ListFsuCyclesCollectionTypeGuestOs, + "EXADB_STACK": ListFsuCyclesCollectionTypeExadbStack, } var mappingListFsuCyclesCollectionTypeEnumLowerCase = map[string]ListFsuCyclesCollectionTypeEnum{ - "db": ListFsuCyclesCollectionTypeDb, - "gi": ListFsuCyclesCollectionTypeGi, + "db": ListFsuCyclesCollectionTypeDb, + "gi": ListFsuCyclesCollectionTypeGi, + "guest_os": ListFsuCyclesCollectionTypeGuestOs, + "exadb_stack": ListFsuCyclesCollectionTypeExadbStack, } // GetListFsuCyclesCollectionTypeEnumValues Enumerates the set of values for ListFsuCyclesCollectionTypeEnum @@ -237,6 +243,8 @@ func GetListFsuCyclesCollectionTypeEnumStringValues() []string { return []string{ "DB", "GI", + "GUEST_OS", + "EXADB_STACK", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/membership_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/membership_summary.go new file mode 100644 index 00000000000..b85b329c4d2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/membership_summary.go @@ -0,0 +1,49 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MembershipSummary Summary of an Exadata Fleet Update Collection containing a target. +type MembershipSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. + FsuCollectionId *string `mandatory:"true" json:"fsuCollectionId"` + + // Type of Exadata Fleet Update Collection. + FsuCollectionType CollectionTypesEnum `mandatory:"true" json:"fsuCollectionType"` + + // The user-friendly name for the Exadata Fleet Update Collection. + FsuCollectionName *string `mandatory:"true" json:"fsuCollectionName"` +} + +func (m MembershipSummary) 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 MembershipSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCollectionTypesEnum(string(m.FsuCollectionType)); !ok && m.FsuCollectionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FsuCollectionType: %s. Supported values are: %s.", m.FsuCollectionType, strings.Join(GetCollectionTypesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/oracle_gi_goal_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/oracle_gi_goal_version_details.go new file mode 100644 index 00000000000..750da55c9bd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/oracle_gi_goal_version_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OracleGiGoalVersionDetails Details of a goal Oracle released 'GI' software image. +type OracleGiGoalVersionDetails struct { + + // Goal version string matching an Oracle released 'GI' software image. + GoalVersion *string `mandatory:"true" json:"goalVersion"` +} + +func (m OracleGiGoalVersionDetails) 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 OracleGiGoalVersionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m OracleGiGoalVersionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeOracleGiGoalVersionDetails OracleGiGoalVersionDetails + s := struct { + DiscriminatorParam string `json:"goalType"` + MarshalTypeOracleGiGoalVersionDetails + }{ + "GI_ORACLE_IMAGE", + (MarshalTypeOracleGiGoalVersionDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/oracle_guest_os_goal_version_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/oracle_guest_os_goal_version_details.go new file mode 100644 index 00000000000..2ef369789a9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/oracle_guest_os_goal_version_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OracleGuestOsGoalVersionDetails Details of a goal Oracle released 'GI' software image. +type OracleGuestOsGoalVersionDetails struct { + + // Goal version string matching an Oracle released 'GUEST_OS' software image. + GoalVersion *string `mandatory:"true" json:"goalVersion"` +} + +func (m OracleGuestOsGoalVersionDetails) 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 OracleGuestOsGoalVersionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m OracleGuestOsGoalVersionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeOracleGuestOsGoalVersionDetails OracleGuestOsGoalVersionDetails + s := struct { + DiscriminatorParam string `json:"goalType"` + MarshalTypeOracleGuestOsGoalVersionDetails + }{ + "GUEST_OS_ORACLE_IMAGE", + (MarshalTypeOracleGuestOsGoalVersionDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/patch_fsu_cycle.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/patch_fsu_cycle.go index 7535fb3e2f2..6080b7922e9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/patch_fsu_cycle.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/patch_fsu_cycle.go @@ -20,26 +20,26 @@ import ( // PatchFsuCycle Patch Exadata Fleet Update Cycle resource details. type PatchFsuCycle struct { - // OCID identifier for the Exadata Fleet Update Cycle. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Cycle. Id *string `mandatory:"true" json:"id"` - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle is assigned to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. FsuCollectionId *string `mandatory:"true" json:"fsuCollectionId"` // The date and time the Exadata Fleet Update Cycle was created, as described in // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. DisplayName *string `mandatory:"false" json:"displayName"` - // OCID identifier for the Action that is currently in execution, if applicable. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Action that is currently in progress, if applicable. ExecutingFsuActionId *string `mandatory:"false" json:"executingFsuActionId"` - // In this array all the possible actions will be listed. The first element is the suggested Action. + // All possible Exadata Fleet Update Actions will be listed. The first element is the suggested Exadata Fleet Update Action. NextActionToExecute []NextActionToExecuteDetails `mandatory:"false" json:"nextActionToExecute"` // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action @@ -81,20 +81,21 @@ type PatchFsuCycle struct { // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` - // Ignore all patches between the source and target homes during patching. + // Ignore patch conflicts or missing patches between the source and goal homes. + // This attribute will be ignored for Exadata Image (Guest OS) maintenance update. IsIgnorePatches *bool `mandatory:"false" json:"isIgnorePatches"` - // List of bug numbers to ignore. + // List of identifiers of patches to ignore. + // This attribute will be ignored for Exadata Image (Guest OS) maintenance update. IsIgnoreMissingPatches []string `mandatory:"false" json:"isIgnoreMissingPatches"` - // Service drain timeout specified in seconds. + // Timeout for session draining for database services specified in seconds. MaxDrainTimeoutInSeconds *int `mandatory:"false" json:"maxDrainTimeoutInSeconds"` - // Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same - // instances before and after the move operation. + // Ensure that database services are online on the same VMs before and after the maintenance update. IsKeepPlacement *bool `mandatory:"false" json:"isKeepPlacement"` - // Type of Collection this Exadata Fleet Update Cycle belongs to. + // Type of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. CollectionType CollectionTypesEnum `mandatory:"false" json:"collectionType,omitempty"` // Current rollback cycle state if rollback maintenance cycle action has been attempted. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/remove_fsu_collection_targets_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/remove_fsu_collection_targets_details.go index 8892b90a7f5..a572c72b4de 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/remove_fsu_collection_targets_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/remove_fsu_collection_targets_details.go @@ -17,7 +17,7 @@ import ( "strings" ) -// RemoveFsuCollectionTargetsDetails Remove targets from a Exadata Fleet Update Collection. +// RemoveFsuCollectionTargetsDetails Remove targets from an Exadata Fleet Update Collection. type RemoveFsuCollectionTargetsDetails interface { } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_details.go new file mode 100644 index 00000000000..5fcfff201b6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_details.go @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareComponentDetails Details of a component in an Exadata software stack. +type SoftwareComponentDetails interface { +} + +type softwarecomponentdetails struct { + JsonData []byte + ComponentType string `json:"componentType"` +} + +// UnmarshalJSON unmarshals json +func (m *softwarecomponentdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersoftwarecomponentdetails softwarecomponentdetails + s := struct { + Model Unmarshalersoftwarecomponentdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ComponentType = s.Model.ComponentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *softwarecomponentdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ComponentType { + case "GI": + mm := GiSoftwareComponentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GUEST_OS": + mm := GuestOsSoftwareComponentDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for SoftwareComponentDetails: %s.", m.ComponentType) + return *m, nil + } +} + +func (m softwarecomponentdetails) 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 softwarecomponentdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_discovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_discovery_details.go new file mode 100644 index 00000000000..8c96401dbd0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_discovery_details.go @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareComponentDiscoveryDetails Discovery filter details of a component in an Exadata software stack. +type SoftwareComponentDiscoveryDetails interface { +} + +type softwarecomponentdiscoverydetails struct { + JsonData []byte + ComponentType string `json:"componentType"` +} + +// UnmarshalJSON unmarshals json +func (m *softwarecomponentdiscoverydetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersoftwarecomponentdiscoverydetails softwarecomponentdiscoverydetails + s := struct { + Model Unmarshalersoftwarecomponentdiscoverydetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ComponentType = s.Model.ComponentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *softwarecomponentdiscoverydetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ComponentType { + case "GUEST_OS": + mm := GuestOsSoftwareComponentDiscoveryDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GI": + mm := GiSoftwareComponentDiscoveryDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for SoftwareComponentDiscoveryDetails: %s.", m.ComponentType) + return *m, nil + } +} + +func (m softwarecomponentdiscoverydetails) 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 softwarecomponentdiscoverydetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_summary.go new file mode 100644 index 00000000000..60ceda82033 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/software_component_summary.go @@ -0,0 +1,82 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Exadata Fleet Update service API +// +// Use the Exadata Fleet Update service to patch large collections of components directly, +// as a single entity, orchestrating the maintenance actions to update all chosen components in the stack in a single cycle. +// + +package fleetsoftwareupdate + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SoftwareComponentSummary Summary of a component in an Exadata software stack. +type SoftwareComponentSummary interface { +} + +type softwarecomponentsummary struct { + JsonData []byte + ComponentType string `json:"componentType"` +} + +// UnmarshalJSON unmarshals json +func (m *softwarecomponentsummary) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersoftwarecomponentsummary softwarecomponentsummary + s := struct { + Model Unmarshalersoftwarecomponentsummary + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ComponentType = s.Model.ComponentType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *softwarecomponentsummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ComponentType { + case "GUEST_OS": + mm := GuestOsSoftwareComponentSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + case "GI": + mm := GiSoftwareComponentSummary{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for SoftwareComponentSummary: %s.", m.ComponentType) + return *m, nil + } +} + +func (m softwarecomponentsummary) 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 softwarecomponentsummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_entry.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_entry.go index a63a44f5752..b0a1e85a5ff 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_entry.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_entry.go @@ -16,7 +16,7 @@ import ( "strings" ) -// TargetEntry Details to specify a target to add or remove from a Exadata Fleet Update Collection. +// TargetEntry Details to specify a target to add or remove from an Exadata Fleet Update Collection. type TargetEntry struct { // Resource entity type diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_ids_remove_targets_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_ids_remove_targets_details.go index ca5545f974a..5c97374ef49 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_ids_remove_targets_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_ids_remove_targets_details.go @@ -17,7 +17,7 @@ import ( "strings" ) -// TargetIdsRemoveTargetsDetails Remove a list of targets from a Exadata Fleet Update Collection. +// TargetIdsRemoveTargetsDetails Remove a list of targets from an Exadata Fleet Update Collection. type TargetIdsRemoveTargetsDetails struct { // List of target entries to remove from the Exadata Fleet Update Collection. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_progress_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_progress_summary.go index 52ff83c5505..0195f375325 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_progress_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_progress_summary.go @@ -16,7 +16,7 @@ import ( "strings" ) -// TargetProgressSummary Progress details of the executing job for a Database target. +// TargetProgressSummary Progress details of the executing job for a target. type TargetProgressSummary struct { // Type of operations being executed. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_summary.go index 2055caf4d95..0fc14e7589f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/target_summary.go @@ -34,6 +34,9 @@ type TargetSummary struct { ActiveFsuCycleId *string `mandatory:"false" json:"activeFsuCycleId"` Progress *TargetProgressSummary `mandatory:"false" json:"progress"` + + // List of Exadata Fleet Update Collections containing this target. + Memberships []MembershipSummary `mandatory:"false" json:"memberships"` } func (m TargetSummary) String() string { @@ -64,6 +67,7 @@ func (m *TargetSummary) UnmarshalJSON(data []byte) (e error) { ExecutingFsuJobId *string `json:"executingFsuJobId"` ActiveFsuCycleId *string `json:"activeFsuCycleId"` Progress *TargetProgressSummary `json:"progress"` + Memberships []MembershipSummary `json:"memberships"` }{} e = json.Unmarshal(data, &model) @@ -91,6 +95,8 @@ func (m *TargetSummary) UnmarshalJSON(data []byte) (e error) { m.Progress = model.Progress + m.Memberships = make([]MembershipSummary, len(model.Memberships)) + copy(m.Memberships, model.Memberships) return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_collection_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_collection_details.go index 481e9fd8d83..5a04dc33abb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_collection_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_collection_details.go @@ -16,10 +16,11 @@ import ( "strings" ) -// UpdateFsuCollectionDetails The information to Update Exadata Fleet Update Collection. +// UpdateFsuCollectionDetails Updates specified fields for the specified Exadata Fleet Update Collection. +// Fields that are not specified in the request will not be updated. type UpdateFsuCollectionDetails struct { - // Exadata Fleet Update Collection display name. + // The user-friendly name for the Exadata Fleet Update Collection. DisplayName *string `mandatory:"false" json:"displayName"` // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_cycle_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_cycle_details.go index 99919f796c7..78a691ece0c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_cycle_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_fsu_cycle_details.go @@ -18,6 +18,7 @@ import ( ) // UpdateFsuCycleDetails Update Exadata Fleet Update Cycle resource details. +// If automated maintenance is enabled for the associated Exadata Fleet Update Collection, updating Exadata Fleet Update Cycle will not affect the Exadata Fleet Update Collection. type UpdateFsuCycleDetails interface { // Exadata Fleet Update Cycle display name. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_patch_fsu_cycle.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_patch_fsu_cycle.go index 8bd63afd8f6..9288bd937ca 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_patch_fsu_cycle.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/update_patch_fsu_cycle.go @@ -18,6 +18,7 @@ import ( ) // UpdatePatchFsuCycle Update Patch Exadata Fleet Update Cycle resource details. +// If automated maintenance is enabled for the associated Exadata Fleet Update Collection, updating Exadata Fleet Update Cycle will not affect the Exadata Fleet Update Collection. type UpdatePatchFsuCycle struct { // Exadata Fleet Update Cycle display name. @@ -37,18 +38,19 @@ type UpdatePatchFsuCycle struct { // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` - // Ignore all patches between the source and target homes during patching. + // Ignore patch conflicts or missing patches between the source and goal homes. + // This attribute will be ignored for Exadata Image (Guest OS) maintenance update. IsIgnorePatches *bool `mandatory:"false" json:"isIgnorePatches"` - // List of patch IDs to ignore. - // An empty array removes the previously stored patch IDs in the Maintenance Cycle properties. + // List of identifiers of patches to ignore. + // Specify an empty array to unset the field. + // This attribute will be ignored for Exadata Image (Guest OS) maintenance update. IsIgnoreMissingPatches []string `mandatory:"false" json:"isIgnoreMissingPatches"` - // Service drain timeout specified in seconds. + // Timeout for session draining for database services specified in seconds. MaxDrainTimeoutInSeconds *int `mandatory:"false" json:"maxDrainTimeoutInSeconds"` - // Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same - // instances before and after the move operation. + // Ensure that database services are online on the same VMs before and after the maintenance update. IsKeepPlacement *bool `mandatory:"false" json:"isKeepPlacement"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/upgrade_fsu_cycle.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/upgrade_fsu_cycle.go index de6b5aab82b..e89b43c9694 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/upgrade_fsu_cycle.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/upgrade_fsu_cycle.go @@ -20,26 +20,26 @@ import ( // UpgradeFsuCycle Upgrade Exadata Fleet Update Cycle resource details. type UpgradeFsuCycle struct { - // OCID identifier for the Exadata Fleet Update Cycle. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Cycle. Id *string `mandatory:"true" json:"id"` - // Compartment Identifier. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. CompartmentId *string `mandatory:"true" json:"compartmentId"` - // OCID identifier for the Collection ID the Exadata Fleet Update Cycle is assigned to. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. FsuCollectionId *string `mandatory:"true" json:"fsuCollectionId"` // The date and time the Exadata Fleet Update Cycle was created, as described in // RFC 3339 (https://tools.ietf.org/rfc/rfc3339), section 14.29. TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // Exadata Fleet Update Cycle display name. + // The user-friendly name for the Exadata Fleet Update Cycle. DisplayName *string `mandatory:"false" json:"displayName"` - // OCID identifier for the Action that is currently in execution, if applicable. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Action that is currently in progress, if applicable. ExecutingFsuActionId *string `mandatory:"false" json:"executingFsuActionId"` - // In this array all the possible actions will be listed. The first element is the suggested Action. + // All possible Exadata Fleet Update Actions will be listed. The first element is the suggested Exadata Fleet Update Action. NextActionToExecute []NextActionToExecuteDetails `mandatory:"false" json:"nextActionToExecute"` // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action @@ -83,7 +83,7 @@ type UpgradeFsuCycle struct { UpgradeDetails UpgradeDetails `mandatory:"false" json:"upgradeDetails"` - // Type of Collection this Exadata Fleet Update Cycle belongs to. + // Type of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. CollectionType CollectionTypesEnum `mandatory:"false" json:"collectionType,omitempty"` // Current rollback cycle state if rollback maintenance cycle action has been attempted. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/version_fsu_target_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/version_fsu_target_details.go index 832881d3d84..79317c21990 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/version_fsu_target_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/version_fsu_target_details.go @@ -17,10 +17,11 @@ import ( "strings" ) -// VersionFsuTargetDetails Exadata Fleet Update Cycle Target version string details. +// VersionFsuTargetDetails Exadata Fleet Update Cycle goal version string details. type VersionFsuTargetDetails struct { - // Target DB or GI version string for the Exadata Fleet Update Cycle. + // Goal version string for the Exadata Fleet Update Cycle. + // Applicable to Database, Grid Infrastructure, or Exadata Image software updates. Version *string `mandatory:"true" json:"version"` // Prefix name used for new DB home resources created as part of the Stage Action. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/vm_cluster_target_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/vm_cluster_target_summary.go index 5d7a126f62f..e9d1c39bd4d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/vm_cluster_target_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fleetsoftwareupdate/vm_cluster_target_summary.go @@ -34,6 +34,9 @@ type VmClusterTargetSummary struct { // OCID of the Grid Infrastructure software image. SoftwareImageId *string `mandatory:"false" json:"softwareImageId"` + + // Exadata Image (Guest OS) version. + SystemVersion *string `mandatory:"false" json:"systemVersion"` } // GetId returns Id diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go index c7c145db21f..be7d34f18c6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/create_function_details.go @@ -51,6 +51,13 @@ type CreateFunctionDetails struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. @@ -88,6 +95,9 @@ func (m *CreateFunctionDetails) UnmarshalJSON(data []byte) (e error) { Config map[string]string `json:"config"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` @@ -129,6 +139,28 @@ func (m *CreateFunctionDetails) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/failure_destination_details.go new file mode 100644 index 00000000000..d433e022d05 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/failure_destination_details.go @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FailureDestinationDetails An object that represents the destination to which Oracle Functions will send an invocation record with the details of the error of the failed detached function invocation. +// A notification is an example of a failure destination. +// Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` +type FailureDestinationDetails interface { +} + +type failuredestinationdetails struct { + JsonData []byte + Kind string `json:"kind"` +} + +// UnmarshalJSON unmarshals json +func (m *failuredestinationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerfailuredestinationdetails failuredestinationdetails + s := struct { + Model Unmarshalerfailuredestinationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Kind = s.Model.Kind + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *failuredestinationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Kind { + case "STREAM": + mm := StreamFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "QUEUE": + mm := QueueFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NOTIFICATION": + mm := NotificationFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NONE": + mm := NoneFailureDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for FailureDestinationDetails: %s.", m.Kind) + return *m, nil + } +} + +func (m failuredestinationdetails) 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 failuredestinationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// FailureDestinationDetailsKindEnum Enum with underlying type: string +type FailureDestinationDetailsKindEnum string + +// Set of constants representing the allowable values for FailureDestinationDetailsKindEnum +const ( + FailureDestinationDetailsKindNotification FailureDestinationDetailsKindEnum = "NOTIFICATION" + FailureDestinationDetailsKindQueue FailureDestinationDetailsKindEnum = "QUEUE" + FailureDestinationDetailsKindStream FailureDestinationDetailsKindEnum = "STREAM" + FailureDestinationDetailsKindNone FailureDestinationDetailsKindEnum = "NONE" +) + +var mappingFailureDestinationDetailsKindEnum = map[string]FailureDestinationDetailsKindEnum{ + "NOTIFICATION": FailureDestinationDetailsKindNotification, + "QUEUE": FailureDestinationDetailsKindQueue, + "STREAM": FailureDestinationDetailsKindStream, + "NONE": FailureDestinationDetailsKindNone, +} + +var mappingFailureDestinationDetailsKindEnumLowerCase = map[string]FailureDestinationDetailsKindEnum{ + "notification": FailureDestinationDetailsKindNotification, + "queue": FailureDestinationDetailsKindQueue, + "stream": FailureDestinationDetailsKindStream, + "none": FailureDestinationDetailsKindNone, +} + +// GetFailureDestinationDetailsKindEnumValues Enumerates the set of values for FailureDestinationDetailsKindEnum +func GetFailureDestinationDetailsKindEnumValues() []FailureDestinationDetailsKindEnum { + values := make([]FailureDestinationDetailsKindEnum, 0) + for _, v := range mappingFailureDestinationDetailsKindEnum { + values = append(values, v) + } + return values +} + +// GetFailureDestinationDetailsKindEnumStringValues Enumerates the set of values in String for FailureDestinationDetailsKindEnum +func GetFailureDestinationDetailsKindEnumStringValues() []string { + return []string{ + "NOTIFICATION", + "QUEUE", + "STREAM", + "NONE", + } +} + +// GetMappingFailureDestinationDetailsKindEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingFailureDestinationDetailsKindEnum(val string) (FailureDestinationDetailsKindEnum, bool) { + enum, ok := mappingFailureDestinationDetailsKindEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go index c410d78134a..8f42e194949 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function.go @@ -63,6 +63,14 @@ type Function struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + // Example: `{"detachedModeTimeoutInSeconds": 900}` + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. @@ -125,6 +133,9 @@ func (m *Function) UnmarshalJSON(data []byte) (e error) { Config map[string]string `json:"config"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` InvokeEndpoint *string `json:"invokeEndpoint"` @@ -179,6 +190,28 @@ func (m *Function) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go index 3988936451d..52ab6aefe07 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/function_summary.go @@ -57,6 +57,13 @@ type FunctionSummary struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. @@ -118,6 +125,9 @@ func (m *FunctionSummary) UnmarshalJSON(data []byte) (e error) { MemoryInMBs *int64 `json:"memoryInMBs"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` InvokeEndpoint *string `json:"invokeEndpoint"` @@ -170,6 +180,28 @@ func (m *FunctionSummary) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_failure_destination_details.go new file mode 100644 index 00000000000..5fcffa0c813 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_failure_destination_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NoneFailureDestinationDetails Specifies no failure destination +// Example: `{"kind": "NONE"}` +type NoneFailureDestinationDetails struct { +} + +func (m NoneFailureDestinationDetails) 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 NoneFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NoneFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNoneFailureDestinationDetails NoneFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNoneFailureDestinationDetails + }{ + "NONE", + (MarshalTypeNoneFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_success_destination_details.go new file mode 100644 index 00000000000..d1d7f6eb765 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/none_success_destination_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NoneSuccessDestinationDetails Specifies no success destination +// Example: `{"kind": "NONE"}` +type NoneSuccessDestinationDetails struct { +} + +func (m NoneSuccessDestinationDetails) 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 NoneSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NoneSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNoneSuccessDestinationDetails NoneSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNoneSuccessDestinationDetails + }{ + "NONE", + (MarshalTypeNoneSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_failure_destination_details.go new file mode 100644 index 00000000000..ccfee1f4af8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_failure_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NotificationFailureDestinationDetails The destination topic in the Notifications service to which to send the response of the failed detached function invocation. +// Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` +type NotificationFailureDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. + TopicId *string `mandatory:"true" json:"topicId"` +} + +func (m NotificationFailureDestinationDetails) 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 NotificationFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NotificationFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNotificationFailureDestinationDetails NotificationFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNotificationFailureDestinationDetails + }{ + "NOTIFICATION", + (MarshalTypeNotificationFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_success_destination_details.go new file mode 100644 index 00000000000..e42eebe8ecb --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/notification_success_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NotificationSuccessDestinationDetails The destination topic in the Notifications service to which to send the response of the successful detached function invocation. +// Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` +type NotificationSuccessDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. + TopicId *string `mandatory:"true" json:"topicId"` +} + +func (m NotificationSuccessDestinationDetails) 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 NotificationSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NotificationSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNotificationSuccessDestinationDetails NotificationSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeNotificationSuccessDestinationDetails + }{ + "NOTIFICATION", + (MarshalTypeNotificationSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_failure_destination_details.go new file mode 100644 index 00000000000..acb4e0ef10d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_failure_destination_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueueFailureDestinationDetails The destination queue or channel in the Queue service to which to send the response of the failed detached function invocation. +// Example: `{"kind": "QUEUE", "queueId": "queue_OCID", "channelId": "channel_Id"}` +type QueueFailureDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + QueueId *string `mandatory:"true" json:"queueId"` + + // The ID of the channel in the queue. + ChannelId *string `mandatory:"false" json:"channelId"` +} + +func (m QueueFailureDestinationDetails) 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 QueueFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m QueueFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeQueueFailureDestinationDetails QueueFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeQueueFailureDestinationDetails + }{ + "QUEUE", + (MarshalTypeQueueFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_success_destination_details.go new file mode 100644 index 00000000000..e25fe867e44 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/queue_success_destination_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// QueueSuccessDestinationDetails The destination queue or channel in the Queue service to which to send the response of the successful detached function invocation. +// Example: `{"kind": "QUEUE", "queueId": "queue_OCID", "channelId": "channel_Id"}` +type QueueSuccessDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + QueueId *string `mandatory:"true" json:"queueId"` + + // The ID of the channel in the queue. + ChannelId *string `mandatory:"false" json:"channelId"` +} + +func (m QueueSuccessDestinationDetails) 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 QueueSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m QueueSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeQueueSuccessDestinationDetails QueueSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeQueueSuccessDestinationDetails + }{ + "QUEUE", + (MarshalTypeQueueSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_failure_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_failure_destination_details.go new file mode 100644 index 00000000000..85ef2f140f7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_failure_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StreamFailureDestinationDetails The destination stream in the Streaming service to which to send the response of the failed detached function invocation. +// Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` +type StreamFailureDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + StreamId *string `mandatory:"true" json:"streamId"` +} + +func (m StreamFailureDestinationDetails) 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 StreamFailureDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m StreamFailureDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeStreamFailureDestinationDetails StreamFailureDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeStreamFailureDestinationDetails + }{ + "STREAM", + (MarshalTypeStreamFailureDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_success_destination_details.go new file mode 100644 index 00000000000..3ec7df062de --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/stream_success_destination_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StreamSuccessDestinationDetails The destination stream in the Streaming service to which to send the response of the successful detached function invocation. +// Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` +type StreamSuccessDestinationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + StreamId *string `mandatory:"true" json:"streamId"` +} + +func (m StreamSuccessDestinationDetails) 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 StreamSuccessDestinationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m StreamSuccessDestinationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeStreamSuccessDestinationDetails StreamSuccessDestinationDetails + s := struct { + DiscriminatorParam string `json:"kind"` + MarshalTypeStreamSuccessDestinationDetails + }{ + "STREAM", + (MarshalTypeStreamSuccessDestinationDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/success_destination_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/success_destination_details.go new file mode 100644 index 00000000000..a606fa429ec --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/success_destination_details.go @@ -0,0 +1,141 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Functions Service API +// +// API for the Functions service. +// + +package functions + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SuccessDestinationDetails An object that represents the destination to which Oracle Functions will send an invocation record with the details of the successful detached function invocation. +// A stream is an example of a success destination. +// Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` +type SuccessDestinationDetails interface { +} + +type successdestinationdetails struct { + JsonData []byte + Kind string `json:"kind"` +} + +// UnmarshalJSON unmarshals json +func (m *successdestinationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalersuccessdestinationdetails successdestinationdetails + s := struct { + Model Unmarshalersuccessdestinationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Kind = s.Model.Kind + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *successdestinationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Kind { + case "STREAM": + mm := StreamSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NOTIFICATION": + mm := NotificationSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "QUEUE": + mm := QueueSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "NONE": + mm := NoneSuccessDestinationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for SuccessDestinationDetails: %s.", m.Kind) + return *m, nil + } +} + +func (m successdestinationdetails) 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 successdestinationdetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// SuccessDestinationDetailsKindEnum Enum with underlying type: string +type SuccessDestinationDetailsKindEnum string + +// Set of constants representing the allowable values for SuccessDestinationDetailsKindEnum +const ( + SuccessDestinationDetailsKindNotification SuccessDestinationDetailsKindEnum = "NOTIFICATION" + SuccessDestinationDetailsKindQueue SuccessDestinationDetailsKindEnum = "QUEUE" + SuccessDestinationDetailsKindStream SuccessDestinationDetailsKindEnum = "STREAM" + SuccessDestinationDetailsKindNone SuccessDestinationDetailsKindEnum = "NONE" +) + +var mappingSuccessDestinationDetailsKindEnum = map[string]SuccessDestinationDetailsKindEnum{ + "NOTIFICATION": SuccessDestinationDetailsKindNotification, + "QUEUE": SuccessDestinationDetailsKindQueue, + "STREAM": SuccessDestinationDetailsKindStream, + "NONE": SuccessDestinationDetailsKindNone, +} + +var mappingSuccessDestinationDetailsKindEnumLowerCase = map[string]SuccessDestinationDetailsKindEnum{ + "notification": SuccessDestinationDetailsKindNotification, + "queue": SuccessDestinationDetailsKindQueue, + "stream": SuccessDestinationDetailsKindStream, + "none": SuccessDestinationDetailsKindNone, +} + +// GetSuccessDestinationDetailsKindEnumValues Enumerates the set of values for SuccessDestinationDetailsKindEnum +func GetSuccessDestinationDetailsKindEnumValues() []SuccessDestinationDetailsKindEnum { + values := make([]SuccessDestinationDetailsKindEnum, 0) + for _, v := range mappingSuccessDestinationDetailsKindEnum { + values = append(values, v) + } + return values +} + +// GetSuccessDestinationDetailsKindEnumStringValues Enumerates the set of values in String for SuccessDestinationDetailsKindEnum +func GetSuccessDestinationDetailsKindEnumStringValues() []string { + return []string{ + "NOTIFICATION", + "QUEUE", + "STREAM", + "NONE", + } +} + +// GetMappingSuccessDestinationDetailsKindEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSuccessDestinationDetailsKindEnum(val string) (SuccessDestinationDetailsKindEnum, bool) { + enum, ok := mappingSuccessDestinationDetailsKindEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go index dad5d79f211..3a196fe8104 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/functions/update_function_details.go @@ -43,6 +43,13 @@ type UpdateFunctionDetails struct { ProvisionedConcurrencyConfig FunctionProvisionedConcurrencyConfig `mandatory:"false" json:"provisionedConcurrencyConfig"` + // Timeout for detached function invocations. Value in seconds. + DetachedModeTimeoutInSeconds *int `mandatory:"false" json:"detachedModeTimeoutInSeconds"` + + FailureDestination FailureDestinationDetails `mandatory:"false" json:"failureDestination"` + + SuccessDestination SuccessDestinationDetails `mandatory:"false" json:"successDestination"` + TraceConfig *FunctionTraceConfig `mandatory:"false" json:"traceConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. @@ -80,6 +87,9 @@ func (m *UpdateFunctionDetails) UnmarshalJSON(data []byte) (e error) { Config map[string]string `json:"config"` TimeoutInSeconds *int `json:"timeoutInSeconds"` ProvisionedConcurrencyConfig functionprovisionedconcurrencyconfig `json:"provisionedConcurrencyConfig"` + DetachedModeTimeoutInSeconds *int `json:"detachedModeTimeoutInSeconds"` + FailureDestination failuredestinationdetails `json:"failureDestination"` + SuccessDestination successdestinationdetails `json:"successDestination"` TraceConfig *FunctionTraceConfig `json:"traceConfig"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` @@ -110,6 +120,28 @@ func (m *UpdateFunctionDetails) UnmarshalJSON(data []byte) (e error) { m.ProvisionedConcurrencyConfig = nil } + m.DetachedModeTimeoutInSeconds = model.DetachedModeTimeoutInSeconds + + nn, e = model.FailureDestination.UnmarshalPolymorphicJSON(model.FailureDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.FailureDestination = nn.(FailureDestinationDetails) + } else { + m.FailureDestination = nil + } + + nn, e = model.SuccessDestination.UnmarshalPolymorphicJSON(model.SuccessDestination.JsonData) + if e != nil { + return + } + if nn != nil { + m.SuccessDestination = nn.(SuccessDestinationDetails) + } else { + m.SuccessDestination = nil + } + m.TraceConfig = model.TraceConfig m.FreeformTags = model.FreeformTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/create_fusion_environment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/create_fusion_environment_details.go index 563b5c96cfd..fbeea9b412d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/create_fusion_environment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/create_fusion_environment_details.go @@ -44,6 +44,9 @@ type CreateFusionEnvironmentDetails struct { // Language packs. AdditionalLanguagePacks []string `mandatory:"false" json:"additionalLanguagePacks"` + // Enable IPv4/IPv6 dual stack support for the environment. Setting to true will assign an IPv6 address to the environment in addition to an IPv4 address. Default value will be false if not set + IsIPv6DualStackEnabled *bool `mandatory:"false" json:"isIPv6DualStackEnabled"` + // Rules. Rules []Rule `mandatory:"false" json:"rules"` @@ -82,6 +85,7 @@ func (m *CreateFusionEnvironmentDetails) UnmarshalJSON(data []byte) (e error) { KmsKeyId *string `json:"kmsKeyId"` DnsPrefix *string `json:"dnsPrefix"` AdditionalLanguagePacks []string `json:"additionalLanguagePacks"` + IsIPv6DualStackEnabled *bool `json:"isIPv6DualStackEnabled"` Rules []rule `json:"rules"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` @@ -105,6 +109,8 @@ func (m *CreateFusionEnvironmentDetails) UnmarshalJSON(data []byte) (e error) { m.AdditionalLanguagePacks = make([]string, len(model.AdditionalLanguagePacks)) copy(m.AdditionalLanguagePacks, model.AdditionalLanguagePacks) + m.IsIPv6DualStackEnabled = model.IsIPv6DualStackEnabled + m.Rules = make([]Rule, len(model.Rules)) for i, n := range model.Rules { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment.go index 8598cc84b86..3ae6b92c725 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment.go @@ -72,6 +72,9 @@ type FusionEnvironment struct { // Language packs AdditionalLanguagePacks []string `mandatory:"false" json:"additionalLanguagePacks"` + // Enable IPv4/IPv6 dual stack support for the environment. Setting to true will assign an IPv6 address to the environment in addition to an IPv4 address. + IsIPv6DualStackEnabled *bool `mandatory:"false" json:"isIPv6DualStackEnabled"` + // The lockbox Id of this fusion environment. If there's no lockbox id, this field will be null LockboxId *string `mandatory:"false" json:"lockboxId"` @@ -147,6 +150,7 @@ func (m *FusionEnvironment) UnmarshalJSON(data []byte) (e error) { PublicUrl *string `json:"publicUrl"` DnsPrefix *string `json:"dnsPrefix"` AdditionalLanguagePacks []string `json:"additionalLanguagePacks"` + IsIPv6DualStackEnabled *bool `json:"isIPv6DualStackEnabled"` LockboxId *string `json:"lockboxId"` IsBreakGlassEnabled *bool `json:"isBreakGlassEnabled"` Refresh *RefreshDetails `json:"refresh"` @@ -197,6 +201,8 @@ func (m *FusionEnvironment) UnmarshalJSON(data []byte) (e error) { m.AdditionalLanguagePacks = make([]string, len(model.AdditionalLanguagePacks)) copy(m.AdditionalLanguagePacks, model.AdditionalLanguagePacks) + m.IsIPv6DualStackEnabled = model.IsIPv6DualStackEnabled + m.LockboxId = model.LockboxId m.IsBreakGlassEnabled = model.IsBreakGlassEnabled diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment_summary.go index e175c426511..96ca9fcce6e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/fusion_environment_summary.go @@ -59,6 +59,9 @@ type FusionEnvironmentSummary struct { // Language packs AdditionalLanguagePacks []string `mandatory:"false" json:"additionalLanguagePacks"` + // Enable IPv4/IPv6 dual stack support for the environment. Setting to true will assign an IPv6 address to the environment in addition to an IPv4 address. + IsIPv6DualStackEnabled *bool `mandatory:"false" json:"isIPv6DualStackEnabled"` + // The lockbox Id of this fusion environment. If there's no lockbox id, this field will be null LockboxId *string `mandatory:"false" json:"lockboxId"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/patch_action.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/patch_action.go index ee78f90aa44..5c76b9694b8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/patch_action.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/patch_action.go @@ -28,7 +28,7 @@ type PatchAction struct { // patch bundle name Artifact *string `mandatory:"false" json:"artifact"` - // A string that describeds whether the change is applied hot or cold + // A string that describes whether the change is applied hot or cold Mode PatchActionModeEnum `mandatory:"false" json:"mode,omitempty"` // patch artifact category diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/update_fusion_environment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/update_fusion_environment_details.go index bb83f5faf8f..2a1e7b88b35 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/update_fusion_environment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/update_fusion_environment_details.go @@ -30,6 +30,9 @@ type UpdateFusionEnvironmentDetails struct { // Language packs AdditionalLanguagePacks []string `mandatory:"false" json:"additionalLanguagePacks"` + // Enable IPv4/IPv6 dual stack support for the environment. Setting to true will assign an IPv6 address to the environment in addition to an IPv4 address. + IsIPv6DualStackEnabled *bool `mandatory:"false" json:"isIPv6DualStackEnabled"` + // Network access control rules to limit internet traffic that can access the environment. For more information, see AllowRule. Rules []Rule `mandatory:"false" json:"rules"` @@ -65,6 +68,7 @@ func (m *UpdateFusionEnvironmentDetails) UnmarshalJSON(data []byte) (e error) { KmsKeyId *string `json:"kmsKeyId"` MaintenancePolicy *MaintenancePolicy `json:"maintenancePolicy"` AdditionalLanguagePacks []string `json:"additionalLanguagePacks"` + IsIPv6DualStackEnabled *bool `json:"isIPv6DualStackEnabled"` Rules []rule `json:"rules"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` @@ -83,6 +87,8 @@ func (m *UpdateFusionEnvironmentDetails) UnmarshalJSON(data []byte) (e error) { m.AdditionalLanguagePacks = make([]string, len(model.AdditionalLanguagePacks)) copy(m.AdditionalLanguagePacks, model.AdditionalLanguagePacks) + m.IsIPv6DualStackEnabled = model.IsIPv6DualStackEnabled + m.Rules = make([]Rule, len(model.Rules)) for i, n := range model.Rules { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/change_generative_ai_private_endpoint_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/change_generative_ai_private_endpoint_compartment_details.go new file mode 100644 index 00000000000..c99ede0c3d9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/change_generative_ai_private_endpoint_compartment_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Generative AI Service Management API +// +// OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings. +// Use the Generative AI service management API to create and manage DedicatedAiCluster, Endpoint, Model, and WorkRequest in the Generative AI service. For example, create a custom model by fine-tuning an out-of-the-box model using your own data, on a fine-tuning dedicated AI cluster. Then, create a hosting dedicated AI cluster with an endpoint to host your custom model. +// To access your custom model endpoints, or to try the out-of-the-box models to generate text, summarize, and create text embeddings see the Generative AI Inference API (https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/latest/). +// To learn more about the service, see the Generative AI documentation (https://docs.oracle.com/iaas/Content/generative-ai/home.htm). +// + +package generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeGenerativeAiPrivateEndpointCompartmentDetails The details required to change a private endpoint compartment. +type ChangeGenerativeAiPrivateEndpointCompartmentDetails struct { + + // The OCID of the target compartment where the private endpoint is moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeGenerativeAiPrivateEndpointCompartmentDetails) 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 ChangeGenerativeAiPrivateEndpointCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/change_generative_ai_private_endpoint_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/change_generative_ai_private_endpoint_compartment_request_response.go new file mode 100644 index 00000000000..70d44474e6f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/change_generative_ai_private_endpoint_compartment_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2025, 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 generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeGenerativeAiPrivateEndpointCompartmentRequest wrapper for the ChangeGenerativeAiPrivateEndpointCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/ChangeGenerativeAiPrivateEndpointCompartment.go.html to see an example of how to use ChangeGenerativeAiPrivateEndpointCompartmentRequest. +type ChangeGenerativeAiPrivateEndpointCompartmentRequest struct { + + // The unique id for a Generative AI private endpoint. + GenerativeAiPrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"generativeAiPrivateEndpointId"` + + // Details for changing a Generative AI private endpoint's compartment. + ChangeGenerativeAiPrivateEndpointCompartmentDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 ChangeGenerativeAiPrivateEndpointCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeGenerativeAiPrivateEndpointCompartmentRequest) 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 ChangeGenerativeAiPrivateEndpointCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeGenerativeAiPrivateEndpointCompartmentRequest) 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 ChangeGenerativeAiPrivateEndpointCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeGenerativeAiPrivateEndpointCompartmentResponse wrapper for the ChangeGenerativeAiPrivateEndpointCompartment operation +type ChangeGenerativeAiPrivateEndpointCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response ChangeGenerativeAiPrivateEndpointCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeGenerativeAiPrivateEndpointCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_endpoint_details.go index 426d6514acc..6cf6df99ee0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_endpoint_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_endpoint_details.go @@ -36,6 +36,9 @@ type CreateEndpointDetails struct { // An optional description of the endpoint. Description *string `mandatory:"false" json:"description"` + // The OCID of the Generative AI private endpoint to which this endpoint is attached to. + GenerativeAiPrivateEndpointId *string `mandatory:"false" json:"generativeAiPrivateEndpointId"` + ContentModerationConfig *ContentModerationConfig `mandatory:"false" json:"contentModerationConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_generative_ai_private_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_generative_ai_private_endpoint_details.go new file mode 100644 index 00000000000..db5ff4a418c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_generative_ai_private_endpoint_details.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Generative AI Service Management API +// +// OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings. +// Use the Generative AI service management API to create and manage DedicatedAiCluster, Endpoint, Model, and WorkRequest in the Generative AI service. For example, create a custom model by fine-tuning an out-of-the-box model using your own data, on a fine-tuning dedicated AI cluster. Then, create a hosting dedicated AI cluster with an endpoint to host your custom model. +// To access your custom model endpoints, or to try the out-of-the-box models to generate text, summarize, and create text embeddings see the Generative AI Inference API (https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/latest/). +// To learn more about the service, see the Generative AI documentation (https://docs.oracle.com/iaas/Content/generative-ai/home.htm). +// + +package generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateGenerativeAiPrivateEndpointDetails The details required to create a Generative AI private endpoint. +type CreateGenerativeAiPrivateEndpointDetails struct { + + // The OCID of the compartment where the private endpoint is created. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the customer's subnet where the private endpoint VNIC will reside. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // dnsPrefix of the private endpoint FQDN. + DnsPrefix *string `mandatory:"true" json:"dnsPrefix"` + + // A description of this private endpoint. + Description *string `mandatory:"false" json:"description"` + + // A user friendly name. It doesn't have to be unique. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateGenerativeAiPrivateEndpointDetails) 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 CreateGenerativeAiPrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_generative_ai_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_generative_ai_private_endpoint_request_response.go new file mode 100644 index 00000000000..11d8f1d98bb --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/create_generative_ai_private_endpoint_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2025, 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 generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateGenerativeAiPrivateEndpointRequest wrapper for the CreateGenerativeAiPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/CreateGenerativeAiPrivateEndpoint.go.html to see an example of how to use CreateGenerativeAiPrivateEndpointRequest. +type CreateGenerativeAiPrivateEndpointRequest struct { + + // The parameters required to create a private endpoint. + CreateGenerativeAiPrivateEndpointDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 CreateGenerativeAiPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateGenerativeAiPrivateEndpointRequest) 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 CreateGenerativeAiPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateGenerativeAiPrivateEndpointRequest) 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 CreateGenerativeAiPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateGenerativeAiPrivateEndpointResponse wrapper for the CreateGenerativeAiPrivateEndpoint operation +type CreateGenerativeAiPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The GenerativeAiPrivateEndpoint instance + GenerativeAiPrivateEndpoint `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response CreateGenerativeAiPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateGenerativeAiPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/delete_generative_ai_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/delete_generative_ai_private_endpoint_request_response.go new file mode 100644 index 00000000000..24f553d16b4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/delete_generative_ai_private_endpoint_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, 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 generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteGenerativeAiPrivateEndpointRequest wrapper for the DeleteGenerativeAiPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/DeleteGenerativeAiPrivateEndpoint.go.html to see an example of how to use DeleteGenerativeAiPrivateEndpointRequest. +type DeleteGenerativeAiPrivateEndpointRequest struct { + + // The unique id for a Generative AI private endpoint. + GenerativeAiPrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"generativeAiPrivateEndpointId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // 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 DeleteGenerativeAiPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteGenerativeAiPrivateEndpointRequest) 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 DeleteGenerativeAiPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteGenerativeAiPrivateEndpointRequest) 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 DeleteGenerativeAiPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteGenerativeAiPrivateEndpointResponse wrapper for the DeleteGenerativeAiPrivateEndpoint operation +type DeleteGenerativeAiPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteGenerativeAiPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteGenerativeAiPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint.go index e940fa9376f..b4ee8c4247c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint.go @@ -47,6 +47,9 @@ type Endpoint struct { // An optional description of the endpoint. Description *string `mandatory:"false" json:"description"` + // The OCID of the Generative AI private endpoint to which this endpoint is attached to. + GenerativeAiPrivateEndpointId *string `mandatory:"false" json:"generativeAiPrivateEndpointId"` + // The date and time that the endpoint was updated in the format of an RFC3339 datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint_summary.go index 57ce25a4f1f..066e805def1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/endpoint_summary.go @@ -52,6 +52,9 @@ type EndpointSummary struct { // An optional description of the endpoint. Description *string `mandatory:"false" json:"description"` + // The OCID of the Generative AI private endpoint to which this endpoint is attached to. + GenerativeAiPrivateEndpointId *string `mandatory:"false" json:"generativeAiPrivateEndpointId"` + // The date and time the endpoint was updated in the format of n RFC3339 datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint.go new file mode 100644 index 00000000000..9c814a1f6bf --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Generative AI Service Management API +// +// OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings. +// Use the Generative AI service management API to create and manage DedicatedAiCluster, Endpoint, Model, and WorkRequest in the Generative AI service. For example, create a custom model by fine-tuning an out-of-the-box model using your own data, on a fine-tuning dedicated AI cluster. Then, create a hosting dedicated AI cluster with an endpoint to host your custom model. +// To access your custom model endpoints, or to try the out-of-the-box models to generate text, summarize, and create text embeddings see the Generative AI Inference API (https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/latest/). +// To learn more about the service, see the Generative AI documentation (https://docs.oracle.com/iaas/Content/generative-ai/home.htm). +// + +package generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GenerativeAiPrivateEndpoint Generative AI private endpoint. +type GenerativeAiPrivateEndpoint struct { + + // The OCID of a private endpoint. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains the private endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the subnet that the private endpoint belongs to. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The current state of the Generative AI Private Endpoint. + LifecycleState GenerativeAiPrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Fully qualified domain name the customer will use for access (for eg: xyz.oraclecloud.com) + Fqdn *string `mandatory:"true" json:"fqdn"` + + // The date and time that the Generative AI private endpoint was created expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time that the Generative AI private endpoint was updated expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // A user friendly name. It doesn't have to be unique. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A description of this private endpoint. + Description *string `mandatory:"false" json:"description"` + + // The detailed messages about the lifecycle state + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // A list of the OCIDs of the network security groups that the private endpoint's VNIC belongs to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // The private IP address (in the customer's VCN) that represents the access point for the associated endpoint service. + PrivateEndpointIp *string `mandatory:"false" json:"privateEndpointIp"` + + PreviousState *GenerativeAiPrivateEndpoint `mandatory:"false" json:"previousState"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m GenerativeAiPrivateEndpoint) 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 GenerativeAiPrivateEndpoint) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGenerativeAiPrivateEndpointLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetGenerativeAiPrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GenerativeAiPrivateEndpointLifecycleStateEnum Enum with underlying type: string +type GenerativeAiPrivateEndpointLifecycleStateEnum string + +// Set of constants representing the allowable values for GenerativeAiPrivateEndpointLifecycleStateEnum +const ( + GenerativeAiPrivateEndpointLifecycleStateCreating GenerativeAiPrivateEndpointLifecycleStateEnum = "CREATING" + GenerativeAiPrivateEndpointLifecycleStateActive GenerativeAiPrivateEndpointLifecycleStateEnum = "ACTIVE" + GenerativeAiPrivateEndpointLifecycleStateUpdating GenerativeAiPrivateEndpointLifecycleStateEnum = "UPDATING" + GenerativeAiPrivateEndpointLifecycleStateDeleting GenerativeAiPrivateEndpointLifecycleStateEnum = "DELETING" + GenerativeAiPrivateEndpointLifecycleStateDeleted GenerativeAiPrivateEndpointLifecycleStateEnum = "DELETED" + GenerativeAiPrivateEndpointLifecycleStateFailed GenerativeAiPrivateEndpointLifecycleStateEnum = "FAILED" +) + +var mappingGenerativeAiPrivateEndpointLifecycleStateEnum = map[string]GenerativeAiPrivateEndpointLifecycleStateEnum{ + "CREATING": GenerativeAiPrivateEndpointLifecycleStateCreating, + "ACTIVE": GenerativeAiPrivateEndpointLifecycleStateActive, + "UPDATING": GenerativeAiPrivateEndpointLifecycleStateUpdating, + "DELETING": GenerativeAiPrivateEndpointLifecycleStateDeleting, + "DELETED": GenerativeAiPrivateEndpointLifecycleStateDeleted, + "FAILED": GenerativeAiPrivateEndpointLifecycleStateFailed, +} + +var mappingGenerativeAiPrivateEndpointLifecycleStateEnumLowerCase = map[string]GenerativeAiPrivateEndpointLifecycleStateEnum{ + "creating": GenerativeAiPrivateEndpointLifecycleStateCreating, + "active": GenerativeAiPrivateEndpointLifecycleStateActive, + "updating": GenerativeAiPrivateEndpointLifecycleStateUpdating, + "deleting": GenerativeAiPrivateEndpointLifecycleStateDeleting, + "deleted": GenerativeAiPrivateEndpointLifecycleStateDeleted, + "failed": GenerativeAiPrivateEndpointLifecycleStateFailed, +} + +// GetGenerativeAiPrivateEndpointLifecycleStateEnumValues Enumerates the set of values for GenerativeAiPrivateEndpointLifecycleStateEnum +func GetGenerativeAiPrivateEndpointLifecycleStateEnumValues() []GenerativeAiPrivateEndpointLifecycleStateEnum { + values := make([]GenerativeAiPrivateEndpointLifecycleStateEnum, 0) + for _, v := range mappingGenerativeAiPrivateEndpointLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetGenerativeAiPrivateEndpointLifecycleStateEnumStringValues Enumerates the set of values in String for GenerativeAiPrivateEndpointLifecycleStateEnum +func GetGenerativeAiPrivateEndpointLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingGenerativeAiPrivateEndpointLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGenerativeAiPrivateEndpointLifecycleStateEnum(val string) (GenerativeAiPrivateEndpointLifecycleStateEnum, bool) { + enum, ok := mappingGenerativeAiPrivateEndpointLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint_collection.go new file mode 100644 index 00000000000..3f470c9e847 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint_collection.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Generative AI Service Management API +// +// OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings. +// Use the Generative AI service management API to create and manage DedicatedAiCluster, Endpoint, Model, and WorkRequest in the Generative AI service. For example, create a custom model by fine-tuning an out-of-the-box model using your own data, on a fine-tuning dedicated AI cluster. Then, create a hosting dedicated AI cluster with an endpoint to host your custom model. +// To access your custom model endpoints, or to try the out-of-the-box models to generate text, summarize, and create text embeddings see the Generative AI Inference API (https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/latest/). +// To learn more about the service, see the Generative AI documentation (https://docs.oracle.com/iaas/Content/generative-ai/home.htm). +// + +package generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GenerativeAiPrivateEndpointCollection Collection of GenerativeAiPrivateEndpointSummary +type GenerativeAiPrivateEndpointCollection struct { + + // The results of a GenerativeAiPrivateEndpoint list. + Items []GenerativeAiPrivateEndpointSummary `mandatory:"true" json:"items"` +} + +func (m GenerativeAiPrivateEndpointCollection) 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 GenerativeAiPrivateEndpointCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint_summary.go new file mode 100644 index 00000000000..fe77b213dbc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generative_ai_private_endpoint_summary.go @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Generative AI Service Management API +// +// OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings. +// Use the Generative AI service management API to create and manage DedicatedAiCluster, Endpoint, Model, and WorkRequest in the Generative AI service. For example, create a custom model by fine-tuning an out-of-the-box model using your own data, on a fine-tuning dedicated AI cluster. Then, create a hosting dedicated AI cluster with an endpoint to host your custom model. +// To access your custom model endpoints, or to try the out-of-the-box models to generate text, summarize, and create text embeddings see the Generative AI Inference API (https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/latest/). +// To learn more about the service, see the Generative AI documentation (https://docs.oracle.com/iaas/Content/generative-ai/home.htm). +// + +package generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GenerativeAiPrivateEndpointSummary List of Generative AI private endpoints. +type GenerativeAiPrivateEndpointSummary struct { + + // The OCID of a private endpoint. + Id *string `mandatory:"true" json:"id"` + + // The OCID of the compartment that contains the private endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of a subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The current state of the Generative AI Private Endpoint. + LifecycleState GenerativeAiPrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Fully qualified domain name the customer will use for access + Fqdn *string `mandatory:"true" json:"fqdn"` + + // The date and time that the Generative AI private endpoint was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time that the Generative AI private endpoint was updated expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // A user-friendly name. It doesn't have to be unique. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A description of this private endpoint. + Description *string `mandatory:"false" json:"description"` + + // Details of the state of a private endpoint. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The private IP address (in the customer's VCN) that represents the access point for the associated endpoint service. + PrivateEndpointIp *string `mandatory:"false" json:"privateEndpointIp"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m GenerativeAiPrivateEndpointSummary) 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 GenerativeAiPrivateEndpointSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGenerativeAiPrivateEndpointLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetGenerativeAiPrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generativeai_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generativeai_client.go index 38776cd6588..176ec3f1d13 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generativeai_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/generativeai_client.go @@ -220,6 +220,69 @@ func (client GenerativeAiClient) changeEndpointCompartment(ctx context.Context, return response, err } +// ChangeGenerativeAiPrivateEndpointCompartment Moves a Generative AI private endpoint into a different compartment. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/ChangeGenerativeAiPrivateEndpointCompartment.go.html to see an example of how to use ChangeGenerativeAiPrivateEndpointCompartment API. +// A default retry strategy applies to this operation ChangeGenerativeAiPrivateEndpointCompartment() +func (client GenerativeAiClient) ChangeGenerativeAiPrivateEndpointCompartment(ctx context.Context, request ChangeGenerativeAiPrivateEndpointCompartmentRequest) (response ChangeGenerativeAiPrivateEndpointCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.changeGenerativeAiPrivateEndpointCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeGenerativeAiPrivateEndpointCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeGenerativeAiPrivateEndpointCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeGenerativeAiPrivateEndpointCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeGenerativeAiPrivateEndpointCompartmentResponse") + } + return +} + +// changeGenerativeAiPrivateEndpointCompartment implements the OCIOperation interface (enables retrying operations) +func (client GenerativeAiClient) changeGenerativeAiPrivateEndpointCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/generativeAiPrivateEndpoints/{generativeAiPrivateEndpointId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeGenerativeAiPrivateEndpointCompartmentResponse + 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/generative-ai/20231130/GenerativeAiPrivateEndpoint/ChangeGenerativeAiPrivateEndpointCompartment" + err = common.PostProcessServiceError(err, "GenerativeAi", "ChangeGenerativeAiPrivateEndpointCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeModelCompartment Moves a custom model into a different compartment. For information about moving resources between compartments, see Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). // // # See also @@ -410,6 +473,69 @@ func (client GenerativeAiClient) createEndpoint(ctx context.Context, request com return response, err } +// CreateGenerativeAiPrivateEndpoint Creates a Generative AI private endpoint. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/CreateGenerativeAiPrivateEndpoint.go.html to see an example of how to use CreateGenerativeAiPrivateEndpoint API. +// A default retry strategy applies to this operation CreateGenerativeAiPrivateEndpoint() +func (client GenerativeAiClient) CreateGenerativeAiPrivateEndpoint(ctx context.Context, request CreateGenerativeAiPrivateEndpointRequest) (response CreateGenerativeAiPrivateEndpointResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createGenerativeAiPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateGenerativeAiPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateGenerativeAiPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateGenerativeAiPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateGenerativeAiPrivateEndpointResponse") + } + return +} + +// createGenerativeAiPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client GenerativeAiClient) createGenerativeAiPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/generativeAiPrivateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateGenerativeAiPrivateEndpointResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "GenerativeAi", "CreateGenerativeAiPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateModel Creates a custom model by fine-tuning a base model with your own dataset. You can create a new custom models or create a new version of existing custom model.. // The header contains an opc-work-request-id, which is the id for the WorkRequest that tracks the model creation progress. // @@ -591,6 +717,64 @@ func (client GenerativeAiClient) deleteEndpoint(ctx context.Context, request com return response, err } +// DeleteGenerativeAiPrivateEndpoint Deletes a Generative AI private endpoint using `privateEndpointId`. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/DeleteGenerativeAiPrivateEndpoint.go.html to see an example of how to use DeleteGenerativeAiPrivateEndpoint API. +// A default retry strategy applies to this operation DeleteGenerativeAiPrivateEndpoint() +func (client GenerativeAiClient) DeleteGenerativeAiPrivateEndpoint(ctx context.Context, request DeleteGenerativeAiPrivateEndpointRequest) (response DeleteGenerativeAiPrivateEndpointResponse, 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.deleteGenerativeAiPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteGenerativeAiPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteGenerativeAiPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteGenerativeAiPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteGenerativeAiPrivateEndpointResponse") + } + return +} + +// deleteGenerativeAiPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client GenerativeAiClient) deleteGenerativeAiPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/generativeAiPrivateEndpoints/{generativeAiPrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteGenerativeAiPrivateEndpointResponse + 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/generative-ai/20231130/GenerativeAiPrivateEndpoint/DeleteGenerativeAiPrivateEndpoint" + err = common.PostProcessServiceError(err, "GenerativeAi", "DeleteGenerativeAiPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteModel Deletes a custom model. A model shouldn't be deleted if there's one or more active endpoints associated with that model. // // # See also @@ -765,6 +949,64 @@ func (client GenerativeAiClient) getEndpoint(ctx context.Context, request common return response, err } +// GetGenerativeAiPrivateEndpoint Retrieves an Generative AI private endpoint using a `privateEndpointId`. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/GetGenerativeAiPrivateEndpoint.go.html to see an example of how to use GetGenerativeAiPrivateEndpoint API. +// A default retry strategy applies to this operation GetGenerativeAiPrivateEndpoint() +func (client GenerativeAiClient) GetGenerativeAiPrivateEndpoint(ctx context.Context, request GetGenerativeAiPrivateEndpointRequest) (response GetGenerativeAiPrivateEndpointResponse, 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.getGenerativeAiPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetGenerativeAiPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetGenerativeAiPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetGenerativeAiPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetGenerativeAiPrivateEndpointResponse") + } + return +} + +// getGenerativeAiPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client GenerativeAiClient) getGenerativeAiPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/generativeAiPrivateEndpoints/{generativeAiPrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetGenerativeAiPrivateEndpointResponse + 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/generative-ai/20231130/GenerativeAiPrivateEndpoint/GetGenerativeAiPrivateEndpoint" + err = common.PostProcessServiceError(err, "GenerativeAi", "GetGenerativeAiPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetModel Gets information about a custom model. // // # See also @@ -997,6 +1239,64 @@ func (client GenerativeAiClient) listEndpoints(ctx context.Context, request comm return response, err } +// ListGenerativeAiPrivateEndpoints Lists all Generative AI private endpoints in the specified compartment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/ListGenerativeAiPrivateEndpoints.go.html to see an example of how to use ListGenerativeAiPrivateEndpoints API. +// A default retry strategy applies to this operation ListGenerativeAiPrivateEndpoints() +func (client GenerativeAiClient) ListGenerativeAiPrivateEndpoints(ctx context.Context, request ListGenerativeAiPrivateEndpointsRequest) (response ListGenerativeAiPrivateEndpointsResponse, 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.listGenerativeAiPrivateEndpoints, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListGenerativeAiPrivateEndpointsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListGenerativeAiPrivateEndpointsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListGenerativeAiPrivateEndpointsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListGenerativeAiPrivateEndpointsResponse") + } + return +} + +// listGenerativeAiPrivateEndpoints implements the OCIOperation interface (enables retrying operations) +func (client GenerativeAiClient) listGenerativeAiPrivateEndpoints(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/generativeAiPrivateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListGenerativeAiPrivateEndpointsResponse + 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/generative-ai/20231130/GenerativeAiPrivateEndpointCollection/ListGenerativeAiPrivateEndpoints" + err = common.PostProcessServiceError(err, "GenerativeAi", "ListGenerativeAiPrivateEndpoints", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListModels Lists the models in a specific compartment. Includes pretrained base models and fine-tuned custom models. // // # See also @@ -1345,6 +1645,64 @@ func (client GenerativeAiClient) updateEndpoint(ctx context.Context, request com return response, err } +// UpdateGenerativeAiPrivateEndpoint Updates a Generative AI private endpoint using a `privateEndpointId`. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/UpdateGenerativeAiPrivateEndpoint.go.html to see an example of how to use UpdateGenerativeAiPrivateEndpoint API. +// A default retry strategy applies to this operation UpdateGenerativeAiPrivateEndpoint() +func (client GenerativeAiClient) UpdateGenerativeAiPrivateEndpoint(ctx context.Context, request UpdateGenerativeAiPrivateEndpointRequest) (response UpdateGenerativeAiPrivateEndpointResponse, 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.updateGenerativeAiPrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateGenerativeAiPrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateGenerativeAiPrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateGenerativeAiPrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateGenerativeAiPrivateEndpointResponse") + } + return +} + +// updateGenerativeAiPrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client GenerativeAiClient) updateGenerativeAiPrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/generativeAiPrivateEndpoints/{generativeAiPrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateGenerativeAiPrivateEndpointResponse + 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/generative-ai/20231130/GenerativeAiPrivateEndpoint/UpdateGenerativeAiPrivateEndpoint" + err = common.PostProcessServiceError(err, "GenerativeAi", "UpdateGenerativeAiPrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateModel Updates the properties of a custom model such as name, description, version, freeform tags, and defined tags. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/get_generative_ai_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/get_generative_ai_private_endpoint_request_response.go new file mode 100644 index 00000000000..bac569f3760 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/get_generative_ai_private_endpoint_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, 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 generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetGenerativeAiPrivateEndpointRequest wrapper for the GetGenerativeAiPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/GetGenerativeAiPrivateEndpoint.go.html to see an example of how to use GetGenerativeAiPrivateEndpointRequest. +type GetGenerativeAiPrivateEndpointRequest struct { + + // The unique id for a Generative AI private endpoint. + GenerativeAiPrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"generativeAiPrivateEndpointId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 GetGenerativeAiPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetGenerativeAiPrivateEndpointRequest) 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 GetGenerativeAiPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetGenerativeAiPrivateEndpointRequest) 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 GetGenerativeAiPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetGenerativeAiPrivateEndpointResponse wrapper for the GetGenerativeAiPrivateEndpoint operation +type GetGenerativeAiPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The GenerativeAiPrivateEndpoint instance + GenerativeAiPrivateEndpoint `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetGenerativeAiPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetGenerativeAiPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/list_generative_ai_private_endpoints_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/list_generative_ai_private_endpoints_request_response.go new file mode 100644 index 00000000000..405a29cd547 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/list_generative_ai_private_endpoints_request_response.go @@ -0,0 +1,211 @@ +// Copyright (c) 2016, 2018, 2025, 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 generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListGenerativeAiPrivateEndpointsRequest wrapper for the ListGenerativeAiPrivateEndpoints operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/ListGenerativeAiPrivateEndpoints.go.html to see an example of how to use ListGenerativeAiPrivateEndpointsRequest. +type ListGenerativeAiPrivateEndpointsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the private endpoint. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // The lifecycle state of Generative AI private endpoints. + LifecycleState GenerativeAiPrivateEndpointLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The field used to sort the results. Multiple fields aren't supported. + SortBy ListGenerativeAiPrivateEndpointsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListGenerativeAiPrivateEndpointsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListGenerativeAiPrivateEndpointsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListGenerativeAiPrivateEndpointsRequest) 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 ListGenerativeAiPrivateEndpointsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListGenerativeAiPrivateEndpointsRequest) 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 ListGenerativeAiPrivateEndpointsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGenerativeAiPrivateEndpointLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetGenerativeAiPrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListGenerativeAiPrivateEndpointsSortByEnum(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(GetListGenerativeAiPrivateEndpointsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListGenerativeAiPrivateEndpointsSortOrderEnum(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(GetListGenerativeAiPrivateEndpointsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListGenerativeAiPrivateEndpointsResponse wrapper for the ListGenerativeAiPrivateEndpoints operation +type ListGenerativeAiPrivateEndpointsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of GenerativeAiPrivateEndpointCollection instances + GenerativeAiPrivateEndpointCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListGenerativeAiPrivateEndpointsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListGenerativeAiPrivateEndpointsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListGenerativeAiPrivateEndpointsSortByEnum Enum with underlying type: string +type ListGenerativeAiPrivateEndpointsSortByEnum string + +// Set of constants representing the allowable values for ListGenerativeAiPrivateEndpointsSortByEnum +const ( + ListGenerativeAiPrivateEndpointsSortByTimecreated ListGenerativeAiPrivateEndpointsSortByEnum = "timeCreated" +) + +var mappingListGenerativeAiPrivateEndpointsSortByEnum = map[string]ListGenerativeAiPrivateEndpointsSortByEnum{ + "timeCreated": ListGenerativeAiPrivateEndpointsSortByTimecreated, +} + +var mappingListGenerativeAiPrivateEndpointsSortByEnumLowerCase = map[string]ListGenerativeAiPrivateEndpointsSortByEnum{ + "timecreated": ListGenerativeAiPrivateEndpointsSortByTimecreated, +} + +// GetListGenerativeAiPrivateEndpointsSortByEnumValues Enumerates the set of values for ListGenerativeAiPrivateEndpointsSortByEnum +func GetListGenerativeAiPrivateEndpointsSortByEnumValues() []ListGenerativeAiPrivateEndpointsSortByEnum { + values := make([]ListGenerativeAiPrivateEndpointsSortByEnum, 0) + for _, v := range mappingListGenerativeAiPrivateEndpointsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListGenerativeAiPrivateEndpointsSortByEnumStringValues Enumerates the set of values in String for ListGenerativeAiPrivateEndpointsSortByEnum +func GetListGenerativeAiPrivateEndpointsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + } +} + +// GetMappingListGenerativeAiPrivateEndpointsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListGenerativeAiPrivateEndpointsSortByEnum(val string) (ListGenerativeAiPrivateEndpointsSortByEnum, bool) { + enum, ok := mappingListGenerativeAiPrivateEndpointsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListGenerativeAiPrivateEndpointsSortOrderEnum Enum with underlying type: string +type ListGenerativeAiPrivateEndpointsSortOrderEnum string + +// Set of constants representing the allowable values for ListGenerativeAiPrivateEndpointsSortOrderEnum +const ( + ListGenerativeAiPrivateEndpointsSortOrderAsc ListGenerativeAiPrivateEndpointsSortOrderEnum = "ASC" + ListGenerativeAiPrivateEndpointsSortOrderDesc ListGenerativeAiPrivateEndpointsSortOrderEnum = "DESC" +) + +var mappingListGenerativeAiPrivateEndpointsSortOrderEnum = map[string]ListGenerativeAiPrivateEndpointsSortOrderEnum{ + "ASC": ListGenerativeAiPrivateEndpointsSortOrderAsc, + "DESC": ListGenerativeAiPrivateEndpointsSortOrderDesc, +} + +var mappingListGenerativeAiPrivateEndpointsSortOrderEnumLowerCase = map[string]ListGenerativeAiPrivateEndpointsSortOrderEnum{ + "asc": ListGenerativeAiPrivateEndpointsSortOrderAsc, + "desc": ListGenerativeAiPrivateEndpointsSortOrderDesc, +} + +// GetListGenerativeAiPrivateEndpointsSortOrderEnumValues Enumerates the set of values for ListGenerativeAiPrivateEndpointsSortOrderEnum +func GetListGenerativeAiPrivateEndpointsSortOrderEnumValues() []ListGenerativeAiPrivateEndpointsSortOrderEnum { + values := make([]ListGenerativeAiPrivateEndpointsSortOrderEnum, 0) + for _, v := range mappingListGenerativeAiPrivateEndpointsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListGenerativeAiPrivateEndpointsSortOrderEnumStringValues Enumerates the set of values in String for ListGenerativeAiPrivateEndpointsSortOrderEnum +func GetListGenerativeAiPrivateEndpointsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListGenerativeAiPrivateEndpointsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListGenerativeAiPrivateEndpointsSortOrderEnum(val string) (ListGenerativeAiPrivateEndpointsSortOrderEnum, bool) { + enum, ok := mappingListGenerativeAiPrivateEndpointsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/operation_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/operation_type.go index 630456bba7e..b042afa94db 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/operation_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/operation_type.go @@ -32,6 +32,10 @@ const ( OperationTypeDeleteEndpoint OperationTypeEnum = "DELETE_ENDPOINT" OperationTypeUpdateEndpoint OperationTypeEnum = "UPDATE_ENDPOINT" OperationTypeMoveEndpoint OperationTypeEnum = "MOVE_ENDPOINT" + OperationTypeCreatePrivateEndpoint OperationTypeEnum = "CREATE_PRIVATE_ENDPOINT" + OperationTypeDeletePrivateEndpoint OperationTypeEnum = "DELETE_PRIVATE_ENDPOINT" + OperationTypeUpdatePrivateEndpoint OperationTypeEnum = "UPDATE_PRIVATE_ENDPOINT" + OperationTypeMovePrivateEndpoint OperationTypeEnum = "MOVE_PRIVATE_ENDPOINT" ) var mappingOperationTypeEnum = map[string]OperationTypeEnum{ @@ -46,6 +50,10 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "DELETE_ENDPOINT": OperationTypeDeleteEndpoint, "UPDATE_ENDPOINT": OperationTypeUpdateEndpoint, "MOVE_ENDPOINT": OperationTypeMoveEndpoint, + "CREATE_PRIVATE_ENDPOINT": OperationTypeCreatePrivateEndpoint, + "DELETE_PRIVATE_ENDPOINT": OperationTypeDeletePrivateEndpoint, + "UPDATE_PRIVATE_ENDPOINT": OperationTypeUpdatePrivateEndpoint, + "MOVE_PRIVATE_ENDPOINT": OperationTypeMovePrivateEndpoint, } var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ @@ -60,6 +68,10 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "delete_endpoint": OperationTypeDeleteEndpoint, "update_endpoint": OperationTypeUpdateEndpoint, "move_endpoint": OperationTypeMoveEndpoint, + "create_private_endpoint": OperationTypeCreatePrivateEndpoint, + "delete_private_endpoint": OperationTypeDeletePrivateEndpoint, + "update_private_endpoint": OperationTypeUpdatePrivateEndpoint, + "move_private_endpoint": OperationTypeMovePrivateEndpoint, } // GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum @@ -85,6 +97,10 @@ func GetOperationTypeEnumStringValues() []string { "DELETE_ENDPOINT", "UPDATE_ENDPOINT", "MOVE_ENDPOINT", + "CREATE_PRIVATE_ENDPOINT", + "DELETE_PRIVATE_ENDPOINT", + "UPDATE_PRIVATE_ENDPOINT", + "MOVE_PRIVATE_ENDPOINT", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_endpoint_details.go index f37da06dea0..13442719541 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_endpoint_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_endpoint_details.go @@ -27,6 +27,9 @@ type UpdateEndpointDetails struct { // An optional description of the endpoint. Description *string `mandatory:"false" json:"description"` + // The OCID of the Generative AI private endpoint to which this endpoint will be attached. + GenerativeAiPrivateEndpointId *string `mandatory:"false" json:"generativeAiPrivateEndpointId"` + ContentModerationConfig *ContentModerationConfig `mandatory:"false" json:"contentModerationConfig"` // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_generative_ai_private_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_generative_ai_private_endpoint_details.go new file mode 100644 index 00000000000..1b5e18dde85 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_generative_ai_private_endpoint_details.go @@ -0,0 +1,61 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Generative AI Service Management API +// +// OCI Generative AI is a fully managed service that provides a set of state-of-the-art, customizable large language models (LLMs) that cover a wide range of use cases for text generation, summarization, and text embeddings. +// Use the Generative AI service management API to create and manage DedicatedAiCluster, Endpoint, Model, and WorkRequest in the Generative AI service. For example, create a custom model by fine-tuning an out-of-the-box model using your own data, on a fine-tuning dedicated AI cluster. Then, create a hosting dedicated AI cluster with an endpoint to host your custom model. +// To access your custom model endpoints, or to try the out-of-the-box models to generate text, summarize, and create text embeddings see the Generative AI Inference API (https://docs.oracle.com/iaas/api/#/en/generative-ai-inference/latest/). +// To learn more about the service, see the Generative AI documentation (https://docs.oracle.com/iaas/Content/generative-ai/home.htm). +// + +package generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateGenerativeAiPrivateEndpointDetails The details required to update a Generative AI private endpoint. +type UpdateGenerativeAiPrivateEndpointDetails struct { + + // A user friendly description. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // A user friendly name. It doesn't have to be unique. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // dnsPrefix of the private endpoint FQDN. + DnsPrefix *string `mandatory:"false" json:"dnsPrefix"` + + // A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateGenerativeAiPrivateEndpointDetails) 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 UpdateGenerativeAiPrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_generative_ai_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_generative_ai_private_endpoint_request_response.go new file mode 100644 index 00000000000..c6b0e0790b4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/generativeai/update_generative_ai_private_endpoint_request_response.go @@ -0,0 +1,109 @@ +// Copyright (c) 2016, 2018, 2025, 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 generativeai + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateGenerativeAiPrivateEndpointRequest wrapper for the UpdateGenerativeAiPrivateEndpoint operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/generativeai/UpdateGenerativeAiPrivateEndpoint.go.html to see an example of how to use UpdateGenerativeAiPrivateEndpointRequest. +type UpdateGenerativeAiPrivateEndpointRequest struct { + + // The unique id for a Generative AI private endpoint. + GenerativeAiPrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"generativeAiPrivateEndpointId"` + + // Details for updating a Generative AI private endpoint. + UpdateGenerativeAiPrivateEndpointDetails `contributesTo:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // 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 UpdateGenerativeAiPrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateGenerativeAiPrivateEndpointRequest) 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 UpdateGenerativeAiPrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateGenerativeAiPrivateEndpointRequest) 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 UpdateGenerativeAiPrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateGenerativeAiPrivateEndpointResponse wrapper for the UpdateGenerativeAiPrivateEndpoint operation +type UpdateGenerativeAiPrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The GenerativeAiPrivateEndpoint instance + GenerativeAiPrivateEndpoint `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"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response UpdateGenerativeAiPrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateGenerativeAiPrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/jmsutils/jmsutils_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/jmsutils/jmsutils_client.go index c30852d6242..81c99fc3abf 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/jmsutils/jmsutils_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/jmsutils/jmsutils_client.go @@ -140,7 +140,7 @@ func (client JmsUtilsClient) cancelWorkRequest(ctx context.Context, request comm defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/WorkRequest/CancelWorkRequest" err = common.PostProcessServiceError(err, "JmsUtils", "CancelWorkRequest", apiReferenceLink) return response, err } @@ -198,7 +198,7 @@ func (client JmsUtilsClient) deleteJavaMigrationAnalysis(ctx context.Context, re defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/JavaMigrationAnalysis/DeleteJavaMigrationAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "DeleteJavaMigrationAnalysis", apiReferenceLink) return response, err } @@ -256,7 +256,7 @@ func (client JmsUtilsClient) deletePerformanceTuningAnalysis(ctx context.Context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/PerformanceTuningAnalysis/DeletePerformanceTuningAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "DeletePerformanceTuningAnalysis", apiReferenceLink) return response, err } @@ -314,7 +314,7 @@ func (client JmsUtilsClient) getAnalyzeApplicationsConfiguration(ctx context.Con defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/AnalyzeApplicationsConfiguration/GetAnalyzeApplicationsConfiguration" err = common.PostProcessServiceError(err, "JmsUtils", "GetAnalyzeApplicationsConfiguration", apiReferenceLink) return response, err } @@ -372,7 +372,7 @@ func (client JmsUtilsClient) getJavaMigrationAnalysis(ctx context.Context, reque defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/JavaMigrationAnalysis/GetJavaMigrationAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "GetJavaMigrationAnalysis", apiReferenceLink) return response, err } @@ -430,7 +430,7 @@ func (client JmsUtilsClient) getPerformanceTuningAnalysis(ctx context.Context, r defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/PerformanceTuningAnalysis/GetPerformanceTuningAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "GetPerformanceTuningAnalysis", apiReferenceLink) return response, err } @@ -488,7 +488,7 @@ func (client JmsUtilsClient) getSubscriptionAcknowledgmentConfiguration(ctx cont defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/SubscriptionAcknowledgmentConfiguration/GetSubscriptionAcknowledgmentConfiguration" err = common.PostProcessServiceError(err, "JmsUtils", "GetSubscriptionAcknowledgmentConfiguration", apiReferenceLink) return response, err } @@ -546,7 +546,7 @@ func (client JmsUtilsClient) getWorkRequest(ctx context.Context, request common. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/WorkRequest/GetWorkRequest" err = common.PostProcessServiceError(err, "JmsUtils", "GetWorkRequest", apiReferenceLink) return response, err } @@ -604,7 +604,7 @@ func (client JmsUtilsClient) listJavaMigrationAnalysis(ctx context.Context, requ defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/JavaMigrationAnalysis/ListJavaMigrationAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "ListJavaMigrationAnalysis", apiReferenceLink) return response, err } @@ -662,7 +662,7 @@ func (client JmsUtilsClient) listPerformanceTuningAnalysis(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/PerformanceTuningAnalysis/ListPerformanceTuningAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "ListPerformanceTuningAnalysis", apiReferenceLink) return response, err } @@ -720,7 +720,7 @@ func (client JmsUtilsClient) listWorkItems(ctx context.Context, request common.O defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/WorkItemSummary/ListWorkItems" err = common.PostProcessServiceError(err, "JmsUtils", "ListWorkItems", apiReferenceLink) return response, err } @@ -778,7 +778,7 @@ func (client JmsUtilsClient) listWorkRequestErrors(ctx context.Context, request defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/WorkRequestError/ListWorkRequestErrors" err = common.PostProcessServiceError(err, "JmsUtils", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -836,7 +836,7 @@ func (client JmsUtilsClient) listWorkRequestLogs(ctx context.Context, request co defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/WorkRequestLogEntry/ListWorkRequestLogs" err = common.PostProcessServiceError(err, "JmsUtils", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -894,7 +894,7 @@ func (client JmsUtilsClient) listWorkRequests(ctx context.Context, request commo defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/WorkRequest/ListWorkRequests" err = common.PostProcessServiceError(err, "JmsUtils", "ListWorkRequests", apiReferenceLink) return response, err } @@ -957,7 +957,7 @@ func (client JmsUtilsClient) requestJavaMigrationAnalysis(ctx context.Context, r defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/JavaMigrationAnalysis/RequestJavaMigrationAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "RequestJavaMigrationAnalysis", apiReferenceLink) return response, err } @@ -1020,7 +1020,7 @@ func (client JmsUtilsClient) requestPerformanceTuningAnalysis(ctx context.Contex defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/PerformanceTuningAnalysis/RequestPerformanceTuningAnalysis" err = common.PostProcessServiceError(err, "JmsUtils", "RequestPerformanceTuningAnalysis", apiReferenceLink) return response, err } @@ -1078,7 +1078,7 @@ func (client JmsUtilsClient) updateAnalyzeApplicationsConfiguration(ctx context. defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/AnalyzeApplicationsConfiguration/UpdateAnalyzeApplicationsConfiguration" err = common.PostProcessServiceError(err, "JmsUtils", "UpdateAnalyzeApplicationsConfiguration", apiReferenceLink) return response, err } @@ -1136,7 +1136,7 @@ func (client JmsUtilsClient) updateSubscriptionAcknowledgmentConfiguration(ctx c defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "" + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/jms-utils/20250521/SubscriptionAcknowledgmentConfiguration/UpdateSubscriptionAcknowledgmentConfiguration" err = common.PostProcessServiceError(err, "JmsUtils", "UpdateSubscriptionAcknowledgmentConfiguration", apiReferenceLink) return response, err } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/action_kind_header.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/action_kind_header.go new file mode 100644 index 00000000000..66769d6752c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/action_kind_header.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "strings" +) + +// ActionKindHeaderEnum Enum with underlying type: string +type ActionKindHeaderEnum string + +// Set of constants representing the allowable values for ActionKindHeaderEnum +const ( + ActionKindHeaderCreate ActionKindHeaderEnum = "create" + ActionKindHeaderUpdate ActionKindHeaderEnum = "update" +) + +var mappingActionKindHeaderEnum = map[string]ActionKindHeaderEnum{ + "create": ActionKindHeaderCreate, + "update": ActionKindHeaderUpdate, +} + +var mappingActionKindHeaderEnumLowerCase = map[string]ActionKindHeaderEnum{ + "create": ActionKindHeaderCreate, + "update": ActionKindHeaderUpdate, +} + +// GetActionKindHeaderEnumValues Enumerates the set of values for ActionKindHeaderEnum +func GetActionKindHeaderEnumValues() []ActionKindHeaderEnum { + values := make([]ActionKindHeaderEnum, 0) + for _, v := range mappingActionKindHeaderEnum { + values = append(values, v) + } + return values +} + +// GetActionKindHeaderEnumStringValues Enumerates the set of values in String for ActionKindHeaderEnum +func GetActionKindHeaderEnumStringValues() []string { + return []string{ + "create", + "update", + } +} + +// GetMappingActionKindHeaderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionKindHeaderEnum(val string) (ActionKindHeaderEnum, bool) { + enum, ok := mappingActionKindHeaderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/aws_cloud_service_provider_metadata_item.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/aws_cloud_service_provider_metadata_item.go new file mode 100644 index 00000000000..4ab2f64ded9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/aws_cloud_service_provider_metadata_item.go @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AwsCloudServiceProviderMetadataItem Aws Cloud Service Provider metadata item. +type AwsCloudServiceProviderMetadataItem struct { + + // CSP resource anchor ID or name. + ResourceAnchorName *string `mandatory:"true" json:"resourceAnchorName"` + + // AWS accountId that was used for creating this resource anchor resource. + AccountId *string `mandatory:"true" json:"accountId"` + + // The Azure, AWS or GCP region. + Region *string `mandatory:"false" json:"region"` + + // CSP resource anchor Uri. + ResourceAnchorUri *string `mandatory:"false" json:"resourceAnchorUri"` +} + +// GetRegion returns Region +func (m AwsCloudServiceProviderMetadataItem) GetRegion() *string { + return m.Region +} + +// GetResourceAnchorName returns ResourceAnchorName +func (m AwsCloudServiceProviderMetadataItem) GetResourceAnchorName() *string { + return m.ResourceAnchorName +} + +// GetResourceAnchorUri returns ResourceAnchorUri +func (m AwsCloudServiceProviderMetadataItem) GetResourceAnchorUri() *string { + return m.ResourceAnchorUri +} + +func (m AwsCloudServiceProviderMetadataItem) 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 AwsCloudServiceProviderMetadataItem) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m AwsCloudServiceProviderMetadataItem) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAwsCloudServiceProviderMetadataItem AwsCloudServiceProviderMetadataItem + s := struct { + DiscriminatorParam string `json:"subscriptionType"` + MarshalTypeAwsCloudServiceProviderMetadataItem + }{ + "ORACLEDBATAWS", + (MarshalTypeAwsCloudServiceProviderMetadataItem)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/azure_cloud_service_provider_metadata_item.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/azure_cloud_service_provider_metadata_item.go new file mode 100644 index 00000000000..23a0196bfb3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/azure_cloud_service_provider_metadata_item.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AzureCloudServiceProviderMetadataItem Azure Cloud Service Provider metadata item. +type AzureCloudServiceProviderMetadataItem struct { + + // CSP resource anchor ID or name. + ResourceAnchorName *string `mandatory:"true" json:"resourceAnchorName"` + + // Azure resource group that was used for creating this resource. + ResourceGroup *string `mandatory:"true" json:"resourceGroup"` + + // Azure subscription that was used for creating this resource. + Subscription *string `mandatory:"true" json:"subscription"` + + // The Azure, AWS or GCP region. + Region *string `mandatory:"false" json:"region"` + + // CSP resource anchor Uri. + ResourceAnchorUri *string `mandatory:"false" json:"resourceAnchorUri"` +} + +// GetRegion returns Region +func (m AzureCloudServiceProviderMetadataItem) GetRegion() *string { + return m.Region +} + +// GetResourceAnchorName returns ResourceAnchorName +func (m AzureCloudServiceProviderMetadataItem) GetResourceAnchorName() *string { + return m.ResourceAnchorName +} + +// GetResourceAnchorUri returns ResourceAnchorUri +func (m AzureCloudServiceProviderMetadataItem) GetResourceAnchorUri() *string { + return m.ResourceAnchorUri +} + +func (m AzureCloudServiceProviderMetadataItem) 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 AzureCloudServiceProviderMetadataItem) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m AzureCloudServiceProviderMetadataItem) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAzureCloudServiceProviderMetadataItem AzureCloudServiceProviderMetadataItem + s := struct { + DiscriminatorParam string `json:"subscriptionType"` + MarshalTypeAzureCloudServiceProviderMetadataItem + }{ + "ORACLEDBATAZURE", + (MarshalTypeAzureCloudServiceProviderMetadataItem)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/cloud_service_provider_metadata_item.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/cloud_service_provider_metadata_item.go new file mode 100644 index 00000000000..922f498504a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/cloud_service_provider_metadata_item.go @@ -0,0 +1,117 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CloudServiceProviderMetadataItem Cloud Service Provider metadata item. +// Warning - In future this object can change to generic object with future Cloud Service Provider based on +// CloudServiceProvider field. This can be one of CSP provider type Azure, GCP and AWS. +type CloudServiceProviderMetadataItem interface { + + // CSP resource anchor ID or name. + GetResourceAnchorName() *string + + // The Azure, AWS or GCP region. + GetRegion() *string + + // CSP resource anchor Uri. + GetResourceAnchorUri() *string +} + +type cloudserviceprovidermetadataitem struct { + JsonData []byte + Region *string `mandatory:"false" json:"region"` + ResourceAnchorUri *string `mandatory:"false" json:"resourceAnchorUri"` + ResourceAnchorName *string `mandatory:"true" json:"resourceAnchorName"` + SubscriptionType string `json:"subscriptionType"` +} + +// UnmarshalJSON unmarshals json +func (m *cloudserviceprovidermetadataitem) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercloudserviceprovidermetadataitem cloudserviceprovidermetadataitem + s := struct { + Model Unmarshalercloudserviceprovidermetadataitem + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ResourceAnchorName = s.Model.ResourceAnchorName + m.Region = s.Model.Region + m.ResourceAnchorUri = s.Model.ResourceAnchorUri + m.SubscriptionType = s.Model.SubscriptionType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *cloudserviceprovidermetadataitem) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.SubscriptionType { + case "ORACLEDBATAZURE": + mm := AzureCloudServiceProviderMetadataItem{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ORACLEDBATGOOGLE": + mm := GcpCloudServiceProviderMetadataItem{} + err = json.Unmarshal(data, &mm) + return mm, err + case "ORACLEDBATAWS": + mm := AwsCloudServiceProviderMetadataItem{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for CloudServiceProviderMetadataItem: %s.", m.SubscriptionType) + return *m, nil + } +} + +// GetRegion returns Region +func (m cloudserviceprovidermetadataitem) GetRegion() *string { + return m.Region +} + +// GetResourceAnchorUri returns ResourceAnchorUri +func (m cloudserviceprovidermetadataitem) GetResourceAnchorUri() *string { + return m.ResourceAnchorUri +} + +// GetResourceAnchorName returns ResourceAnchorName +func (m cloudserviceprovidermetadataitem) GetResourceAnchorName() *string { + return m.ResourceAnchorName +} + +func (m cloudserviceprovidermetadataitem) 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 cloudserviceprovidermetadataitem) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/cloud_service_provider_network_metadata_item.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/cloud_service_provider_network_metadata_item.go new file mode 100644 index 00000000000..21d3a47571d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/cloud_service_provider_network_metadata_item.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CloudServiceProviderNetworkMetadataItem Cloud Service Provider metadata item. +// Warning - In future this object can change to generic object with future Cloud Service Provider based on +// CloudServiceProvider field. This can be one of CSP provider type Azure, GCP and AWS +type CloudServiceProviderNetworkMetadataItem struct { + + // Azure/GCP/AWS region + Region *string `mandatory:"true" json:"region"` + + // CSP oracle database network anchor unique ID/name + OdbNetworkId *string `mandatory:"true" json:"odbNetworkId"` + + // An Azure/GCP/AWS cidrBlocks + CidrBlocks []string `mandatory:"false" json:"cidrBlocks"` + + // CSP network anchor Uri + NetworkAnchorUri *string `mandatory:"false" json:"networkAnchorUri"` + + // DNS domain ip mapping forwarding configuration + DnsForwardingConfig []map[string]string `mandatory:"false" json:"dnsForwardingConfig"` +} + +func (m CloudServiceProviderNetworkMetadataItem) 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 CloudServiceProviderNetworkMetadataItem) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/csp_zone_key_reference_id.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/csp_zone_key_reference_id.go new file mode 100644 index 00000000000..fe4ffc4f06d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/csp_zone_key_reference_id.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CspZoneKeyReferenceId This is CSP zone key reference +type CspZoneKeyReferenceId struct { + + // Value of keyName + // GcpProjectName: A human-readable name for your project. The project name isn't used by any Google APIs. You can edit the project name at any time during or after project creation. Project names do not need to be unique. + // AzureSubscriptionId: A unique alphanumeric string that identifies your Azure subscription. + // AwsAccountId: a unique 12-digit number that identifies an Amazon Web Services (AWS) account + KeyValue *string `mandatory:"true" json:"keyValue"` + + // KeyName for Azure=AzureSubscriptionId Aws=AwsAccountId GCP=GcpProjectName + KeyName *string `mandatory:"true" json:"keyName"` +} + +func (m CspZoneKeyReferenceId) 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 CspZoneKeyReferenceId) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location.go new file mode 100644 index 00000000000..504b1989a90 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocation External location for CSP Region, CSP-Physical-AZ +type ExternalLocation struct { + + // CSP region corresponding to the given OCI region + CspRegion *string `mandatory:"true" json:"cspRegion"` + + // CSP region display Name corresponding to the given OCI region + CspRegionDisplayName *string `mandatory:"true" json:"cspRegionDisplayName"` + + // A mapping of OCI site group name to CSP physical availability zone name + CspPhysicalAz *string `mandatory:"true" json:"cspPhysicalAz"` + + // User friendly display name for cspPhysicalAZ + CspPhysicalAzDisplayName *string `mandatory:"true" json:"cspPhysicalAzDisplayName"` + + // The serviceName that externalLocation map object belongs to + ServiceName SubscriptionTypeEnum `mandatory:"false" json:"serviceName,omitempty"` +} + +func (m ExternalLocation) 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 ExternalLocation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSubscriptionTypeEnum(string(m.ServiceName)); !ok && m.ServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceName: %s. Supported values are: %s.", m.ServiceName, strings.Join(GetSubscriptionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_detail.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_detail.go new file mode 100644 index 00000000000..041ca71045b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_detail.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationDetail External location for CSP Region, CSP-Physical-AZ, CSP-Logical-AZ +type ExternalLocationDetail struct { + + // CSP region corresponding to the given OCI region + CspRegion *string `mandatory:"true" json:"cspRegion"` + + // CSP region display Name corresponding to the given OCI region + CspRegionDisplayName *string `mandatory:"true" json:"cspRegionDisplayName"` + + // A mapping of OCI site group name to CSP physical availability zone name + CspPhysicalAz *string `mandatory:"true" json:"cspPhysicalAz"` + + // User friendly display name for cspPhysicalAZ + CspPhysicalAzDisplayName *string `mandatory:"true" json:"cspPhysicalAzDisplayName"` + + CspZoneKeyReferenceId *CspZoneKeyReferenceId `mandatory:"false" json:"cspZoneKeyReferenceId"` + + // A mapping of CSP physical availability zone to CSP logical availability zone. + CspLogicalAz *string `mandatory:"false" json:"cspLogicalAz"` + + // The serviceName that externalLocation map object belongs to. + ServiceName SubscriptionTypeEnum `mandatory:"false" json:"serviceName,omitempty"` +} + +func (m ExternalLocationDetail) 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 ExternalLocationDetail) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSubscriptionTypeEnum(string(m.ServiceName)); !ok && m.ServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceName: %s. Supported values are: %s.", m.ServiceName, strings.Join(GetSubscriptionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_mapping_metadatum_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_mapping_metadatum_summary.go new file mode 100644 index 00000000000..8a46f85ef6c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_mapping_metadatum_summary.go @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationMappingMetadatumSummary Flat Map of CSP Region -> CSP-Physical-AZ -> OCI Site Group +// All fields in this object has immutable mappings. Please don't add any field that case change +// for any customer as this is only for Oracle Cloud Infrastructure internal service use. +type ExternalLocationMappingMetadatumSummary struct { + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + ExternalLocation *ExternalLocation `mandatory:"true" json:"externalLocation"` + + // OCI physical ad name + OciPhysicalAd *string `mandatory:"true" json:"ociPhysicalAd"` + + // OCI logical ad name + OciLogicalAd *string `mandatory:"true" json:"ociLogicalAd"` + + // OCI region identifier https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm + OciRegion *string `mandatory:"true" json:"ociRegion"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ExternalLocationMappingMetadatumSummary) 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 ExternalLocationMappingMetadatumSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_mapping_metadatum_summary_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_mapping_metadatum_summary_collection.go new file mode 100644 index 00000000000..f469c74524a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_mapping_metadatum_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationMappingMetadatumSummaryCollection External location information from OCI primitives to a CSP +type ExternalLocationMappingMetadatumSummaryCollection struct { + + // List of ExternalLocationMappingMetadatumSummary + Items []ExternalLocationMappingMetadatumSummary `mandatory:"true" json:"items"` +} + +func (m ExternalLocationMappingMetadatumSummaryCollection) 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 ExternalLocationMappingMetadatumSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summaries_metadatum_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summaries_metadatum_summary.go new file mode 100644 index 00000000000..71aa6d1fa18 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summaries_metadatum_summary.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationSummariesMetadatumSummary Flat Map of CSP Region to OCI Region +type ExternalLocationSummariesMetadatumSummary struct { + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // OCI region identifier https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm + OciRegion *string `mandatory:"true" json:"ociRegion"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + ExternalLocation *ExternalLocationSummary `mandatory:"false" json:"externalLocation"` +} + +func (m ExternalLocationSummariesMetadatumSummary) 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 ExternalLocationSummariesMetadatumSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summaries_metadatum_summary_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summaries_metadatum_summary_collection.go new file mode 100644 index 00000000000..c938fc7a55c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summaries_metadatum_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationSummariesMetadatumSummaryCollection External location summary information from OCI primitives to any CSP across all regions +type ExternalLocationSummariesMetadatumSummaryCollection struct { + + // List of ExternalLocationSummariesMetadatumSummary + Items []ExternalLocationSummariesMetadatumSummary `mandatory:"true" json:"items"` +} + +func (m ExternalLocationSummariesMetadatumSummaryCollection) 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 ExternalLocationSummariesMetadatumSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summary.go new file mode 100644 index 00000000000..b98c5f7ef86 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_location_summary.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationSummary External location for CSP Region +type ExternalLocationSummary struct { + + // CSP region corresponding to the given OCI region + CspRegion *string `mandatory:"true" json:"cspRegion"` + + // CSP region display Name corresponding to the given OCI region + CspRegionDisplayName *string `mandatory:"true" json:"cspRegionDisplayName"` +} + +func (m ExternalLocationSummary) 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 ExternalLocationSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_locations_metadatum_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_locations_metadatum_collection.go new file mode 100644 index 00000000000..adf1fdfb971 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_locations_metadatum_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationsMetadatumCollection External location information from OCI primitives to any CSP +type ExternalLocationsMetadatumCollection struct { + + // List of ExternalLocationsMetadatumSummary + Items []ExternalLocationsMetadatumSummary `mandatory:"true" json:"items"` +} + +func (m ExternalLocationsMetadatumCollection) 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 ExternalLocationsMetadatumCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_locations_metadatum_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_locations_metadatum_summary.go new file mode 100644 index 00000000000..21e3bdfbdbe --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/external_locations_metadatum_summary.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ExternalLocationsMetadatumSummary Flat Map of CSP Region -> CSP-Physical-AZ -> CSP-Logical-AZ -> OCI Site Group -> CPG-ID +type ExternalLocationsMetadatumSummary struct { + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + ExternalLocation *ExternalLocationDetail `mandatory:"true" json:"externalLocation"` + + // OCI physical ad name + OciPhysicalAd *string `mandatory:"true" json:"ociPhysicalAd"` + + // OCI region identifier https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm + OciRegion *string `mandatory:"true" json:"ociRegion"` + + // Cluster Placement Group OCID + CpgId *string `mandatory:"true" json:"cpgId"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // OCI logical ad name + OciLogicalAd *string `mandatory:"false" json:"ociLogicalAd"` +} + +func (m ExternalLocationsMetadatumSummary) 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 ExternalLocationsMetadatumSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/gcp_cloud_service_provider_metadata_item.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/gcp_cloud_service_provider_metadata_item.go new file mode 100644 index 00000000000..2d8f34e7671 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/gcp_cloud_service_provider_metadata_item.go @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// GcpCloudServiceProviderMetadataItem GCP Cloud Service Provider metadata item. +type GcpCloudServiceProviderMetadataItem struct { + + // CSP resource anchor ID or name. + ResourceAnchorName *string `mandatory:"true" json:"resourceAnchorName"` + + // GCP project number that was used for creating this resource anchor resource. + ProjectNumber *string `mandatory:"true" json:"projectNumber"` + + // The Azure, AWS or GCP region. + Region *string `mandatory:"false" json:"region"` + + // CSP resource anchor Uri. + ResourceAnchorUri *string `mandatory:"false" json:"resourceAnchorUri"` +} + +// GetRegion returns Region +func (m GcpCloudServiceProviderMetadataItem) GetRegion() *string { + return m.Region +} + +// GetResourceAnchorName returns ResourceAnchorName +func (m GcpCloudServiceProviderMetadataItem) GetResourceAnchorName() *string { + return m.ResourceAnchorName +} + +// GetResourceAnchorUri returns ResourceAnchorUri +func (m GcpCloudServiceProviderMetadataItem) GetResourceAnchorUri() *string { + return m.ResourceAnchorUri +} + +func (m GcpCloudServiceProviderMetadataItem) 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 GcpCloudServiceProviderMetadataItem) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m GcpCloudServiceProviderMetadataItem) MarshalJSON() (buff []byte, e error) { + type MarshalTypeGcpCloudServiceProviderMetadataItem GcpCloudServiceProviderMetadataItem + s := struct { + DiscriminatorParam string `json:"subscriptionType"` + MarshalTypeGcpCloudServiceProviderMetadataItem + }{ + "ORACLEDBATGOOGLE", + (MarshalTypeGcpCloudServiceProviderMetadataItem)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_multi_cloud_metadata_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_multi_cloud_metadata_request_response.go new file mode 100644 index 00000000000..4e95c22b333 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_multi_cloud_metadata_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetMultiCloudMetadataRequest wrapper for the GetMultiCloudMetadata operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/GetMultiCloudMetadata.go.html to see an example of how to use GetMultiCloudMetadataRequest. +type GetMultiCloudMetadataRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OCI subscription. + SubscriptionId *string `mandatory:"true" contributesTo:"path" name:"subscriptionId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 GetMultiCloudMetadataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetMultiCloudMetadataRequest) 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 GetMultiCloudMetadataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMultiCloudMetadataRequest) 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 GetMultiCloudMetadataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetMultiCloudMetadataResponse wrapper for the GetMultiCloudMetadata operation +type GetMultiCloudMetadataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MultiCloudMetadata instance + MultiCloudMetadata `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetMultiCloudMetadataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetMultiCloudMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_network_anchor_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_network_anchor_request_response.go new file mode 100644 index 00000000000..97d97242c57 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_network_anchor_request_response.go @@ -0,0 +1,154 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetNetworkAnchorRequest wrapper for the GetNetworkAnchor operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/GetNetworkAnchor.go.html to see an example of how to use GetNetworkAnchorRequest. +type GetNetworkAnchorRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. + NetworkAnchorId *string `mandatory:"true" contributesTo:"path" name:"networkAnchorId"` + + // The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + SubscriptionServiceName GetNetworkAnchorSubscriptionServiceNameEnum `mandatory:"true" contributesTo:"query" name:"subscriptionServiceName" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + SubscriptionId *string `mandatory:"true" contributesTo:"query" name:"subscriptionId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // OMHub Control Plane must know underlying CSP CP Region External Location Name. + ExternalLocation *string `mandatory:"false" contributesTo:"query" name:"externalLocation"` + + // 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 GetNetworkAnchorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNetworkAnchorRequest) 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 GetNetworkAnchorRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNetworkAnchorRequest) 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 GetNetworkAnchorRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGetNetworkAnchorSubscriptionServiceNameEnum(string(request.SubscriptionServiceName)); !ok && request.SubscriptionServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionServiceName: %s. Supported values are: %s.", request.SubscriptionServiceName, strings.Join(GetGetNetworkAnchorSubscriptionServiceNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetNetworkAnchorResponse wrapper for the GetNetworkAnchor operation +type GetNetworkAnchorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NetworkAnchor instance + NetworkAnchor `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetNetworkAnchorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNetworkAnchorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetNetworkAnchorSubscriptionServiceNameEnum Enum with underlying type: string +type GetNetworkAnchorSubscriptionServiceNameEnum string + +// Set of constants representing the allowable values for GetNetworkAnchorSubscriptionServiceNameEnum +const ( + GetNetworkAnchorSubscriptionServiceNameOracledbatazure GetNetworkAnchorSubscriptionServiceNameEnum = "ORACLEDBATAZURE" + GetNetworkAnchorSubscriptionServiceNameOracledbatgoogle GetNetworkAnchorSubscriptionServiceNameEnum = "ORACLEDBATGOOGLE" + GetNetworkAnchorSubscriptionServiceNameOracledbataws GetNetworkAnchorSubscriptionServiceNameEnum = "ORACLEDBATAWS" +) + +var mappingGetNetworkAnchorSubscriptionServiceNameEnum = map[string]GetNetworkAnchorSubscriptionServiceNameEnum{ + "ORACLEDBATAZURE": GetNetworkAnchorSubscriptionServiceNameOracledbatazure, + "ORACLEDBATGOOGLE": GetNetworkAnchorSubscriptionServiceNameOracledbatgoogle, + "ORACLEDBATAWS": GetNetworkAnchorSubscriptionServiceNameOracledbataws, +} + +var mappingGetNetworkAnchorSubscriptionServiceNameEnumLowerCase = map[string]GetNetworkAnchorSubscriptionServiceNameEnum{ + "oracledbatazure": GetNetworkAnchorSubscriptionServiceNameOracledbatazure, + "oracledbatgoogle": GetNetworkAnchorSubscriptionServiceNameOracledbatgoogle, + "oracledbataws": GetNetworkAnchorSubscriptionServiceNameOracledbataws, +} + +// GetGetNetworkAnchorSubscriptionServiceNameEnumValues Enumerates the set of values for GetNetworkAnchorSubscriptionServiceNameEnum +func GetGetNetworkAnchorSubscriptionServiceNameEnumValues() []GetNetworkAnchorSubscriptionServiceNameEnum { + values := make([]GetNetworkAnchorSubscriptionServiceNameEnum, 0) + for _, v := range mappingGetNetworkAnchorSubscriptionServiceNameEnum { + values = append(values, v) + } + return values +} + +// GetGetNetworkAnchorSubscriptionServiceNameEnumStringValues Enumerates the set of values in String for GetNetworkAnchorSubscriptionServiceNameEnum +func GetGetNetworkAnchorSubscriptionServiceNameEnumStringValues() []string { + return []string{ + "ORACLEDBATAZURE", + "ORACLEDBATGOOGLE", + "ORACLEDBATAWS", + } +} + +// GetMappingGetNetworkAnchorSubscriptionServiceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetNetworkAnchorSubscriptionServiceNameEnum(val string) (GetNetworkAnchorSubscriptionServiceNameEnum, bool) { + enum, ok := mappingGetNetworkAnchorSubscriptionServiceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_resource_anchor_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_resource_anchor_request_response.go new file mode 100644 index 00000000000..deba5845bc3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/get_resource_anchor_request_response.go @@ -0,0 +1,151 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetResourceAnchorRequest wrapper for the GetResourceAnchor operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/GetResourceAnchor.go.html to see an example of how to use GetResourceAnchorRequest. +type GetResourceAnchorRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnchor. + ResourceAnchorId *string `mandatory:"true" contributesTo:"path" name:"resourceAnchorId"` + + // The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + SubscriptionServiceName GetResourceAnchorSubscriptionServiceNameEnum `mandatory:"true" contributesTo:"query" name:"subscriptionServiceName" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + SubscriptionId *string `mandatory:"true" contributesTo:"query" name:"subscriptionId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 GetResourceAnchorRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetResourceAnchorRequest) 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 GetResourceAnchorRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetResourceAnchorRequest) 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 GetResourceAnchorRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGetResourceAnchorSubscriptionServiceNameEnum(string(request.SubscriptionServiceName)); !ok && request.SubscriptionServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionServiceName: %s. Supported values are: %s.", request.SubscriptionServiceName, strings.Join(GetGetResourceAnchorSubscriptionServiceNameEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetResourceAnchorResponse wrapper for the GetResourceAnchor operation +type GetResourceAnchorResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ResourceAnchor instance + ResourceAnchor `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetResourceAnchorResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetResourceAnchorResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetResourceAnchorSubscriptionServiceNameEnum Enum with underlying type: string +type GetResourceAnchorSubscriptionServiceNameEnum string + +// Set of constants representing the allowable values for GetResourceAnchorSubscriptionServiceNameEnum +const ( + GetResourceAnchorSubscriptionServiceNameOracledbatazure GetResourceAnchorSubscriptionServiceNameEnum = "ORACLEDBATAZURE" + GetResourceAnchorSubscriptionServiceNameOracledbatgoogle GetResourceAnchorSubscriptionServiceNameEnum = "ORACLEDBATGOOGLE" + GetResourceAnchorSubscriptionServiceNameOracledbataws GetResourceAnchorSubscriptionServiceNameEnum = "ORACLEDBATAWS" +) + +var mappingGetResourceAnchorSubscriptionServiceNameEnum = map[string]GetResourceAnchorSubscriptionServiceNameEnum{ + "ORACLEDBATAZURE": GetResourceAnchorSubscriptionServiceNameOracledbatazure, + "ORACLEDBATGOOGLE": GetResourceAnchorSubscriptionServiceNameOracledbatgoogle, + "ORACLEDBATAWS": GetResourceAnchorSubscriptionServiceNameOracledbataws, +} + +var mappingGetResourceAnchorSubscriptionServiceNameEnumLowerCase = map[string]GetResourceAnchorSubscriptionServiceNameEnum{ + "oracledbatazure": GetResourceAnchorSubscriptionServiceNameOracledbatazure, + "oracledbatgoogle": GetResourceAnchorSubscriptionServiceNameOracledbatgoogle, + "oracledbataws": GetResourceAnchorSubscriptionServiceNameOracledbataws, +} + +// GetGetResourceAnchorSubscriptionServiceNameEnumValues Enumerates the set of values for GetResourceAnchorSubscriptionServiceNameEnum +func GetGetResourceAnchorSubscriptionServiceNameEnumValues() []GetResourceAnchorSubscriptionServiceNameEnum { + values := make([]GetResourceAnchorSubscriptionServiceNameEnum, 0) + for _, v := range mappingGetResourceAnchorSubscriptionServiceNameEnum { + values = append(values, v) + } + return values +} + +// GetGetResourceAnchorSubscriptionServiceNameEnumStringValues Enumerates the set of values in String for GetResourceAnchorSubscriptionServiceNameEnum +func GetGetResourceAnchorSubscriptionServiceNameEnumStringValues() []string { + return []string{ + "ORACLEDBATAZURE", + "ORACLEDBATGOOGLE", + "ORACLEDBATAWS", + } +} + +// GetMappingGetResourceAnchorSubscriptionServiceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetResourceAnchorSubscriptionServiceNameEnum(val string) (GetResourceAnchorSubscriptionServiceNameEnum, bool) { + enum, ok := mappingGetResourceAnchorSubscriptionServiceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_details_metadata_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_details_metadata_request_response.go new file mode 100644 index 00000000000..ee402df7d9a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_details_metadata_request_response.go @@ -0,0 +1,306 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListExternalLocationDetailsMetadataRequest wrapper for the ListExternalLocationDetailsMetadata operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListExternalLocationDetailsMetadata.go.html to see an example of how to use ListExternalLocationDetailsMetadataRequest. +type ListExternalLocationDetailsMetadataRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + SubscriptionId *string `mandatory:"true" contributesTo:"query" name:"subscriptionId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + SubscriptionServiceName ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum `mandatory:"true" contributesTo:"query" name:"subscriptionServiceName" omitEmpty:"true"` + + // The resource type query (i.e. dbsystem, instance etc.) + EntityType ListExternalLocationDetailsMetadataEntityTypeEnum `mandatory:"false" contributesTo:"query" name:"entityType" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which linked to Resource. + LinkedCompartmentId *string `mandatory:"false" contributesTo:"query" name:"linkedCompartmentId"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListExternalLocationDetailsMetadataSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `displayName` is ascending. + SortBy ListExternalLocationDetailsMetadataSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListExternalLocationDetailsMetadataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListExternalLocationDetailsMetadataRequest) 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 ListExternalLocationDetailsMetadataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListExternalLocationDetailsMetadataRequest) 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 ListExternalLocationDetailsMetadataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListExternalLocationDetailsMetadataSubscriptionServiceNameEnum(string(request.SubscriptionServiceName)); !ok && request.SubscriptionServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionServiceName: %s. Supported values are: %s.", request.SubscriptionServiceName, strings.Join(GetListExternalLocationDetailsMetadataSubscriptionServiceNameEnumStringValues(), ","))) + } + if _, ok := GetMappingListExternalLocationDetailsMetadataEntityTypeEnum(string(request.EntityType)); !ok && request.EntityType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EntityType: %s. Supported values are: %s.", request.EntityType, strings.Join(GetListExternalLocationDetailsMetadataEntityTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListExternalLocationDetailsMetadataSortOrderEnum(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(GetListExternalLocationDetailsMetadataSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListExternalLocationDetailsMetadataSortByEnum(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(GetListExternalLocationDetailsMetadataSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListExternalLocationDetailsMetadataResponse wrapper for the ListExternalLocationDetailsMetadata operation +type ListExternalLocationDetailsMetadataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ExternalLocationsMetadatumCollection instances + ExternalLocationsMetadatumCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListExternalLocationDetailsMetadataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListExternalLocationDetailsMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum Enum with underlying type: string +type ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum string + +// Set of constants representing the allowable values for ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum +const ( + ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbatazure ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum = "ORACLEDBATAZURE" + ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbatgoogle ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum = "ORACLEDBATGOOGLE" + ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbataws ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum = "ORACLEDBATAWS" +) + +var mappingListExternalLocationDetailsMetadataSubscriptionServiceNameEnum = map[string]ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum{ + "ORACLEDBATAZURE": ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbatazure, + "ORACLEDBATGOOGLE": ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbatgoogle, + "ORACLEDBATAWS": ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbataws, +} + +var mappingListExternalLocationDetailsMetadataSubscriptionServiceNameEnumLowerCase = map[string]ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum{ + "oracledbatazure": ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbatazure, + "oracledbatgoogle": ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbatgoogle, + "oracledbataws": ListExternalLocationDetailsMetadataSubscriptionServiceNameOracledbataws, +} + +// GetListExternalLocationDetailsMetadataSubscriptionServiceNameEnumValues Enumerates the set of values for ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum +func GetListExternalLocationDetailsMetadataSubscriptionServiceNameEnumValues() []ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum { + values := make([]ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum, 0) + for _, v := range mappingListExternalLocationDetailsMetadataSubscriptionServiceNameEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationDetailsMetadataSubscriptionServiceNameEnumStringValues Enumerates the set of values in String for ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum +func GetListExternalLocationDetailsMetadataSubscriptionServiceNameEnumStringValues() []string { + return []string{ + "ORACLEDBATAZURE", + "ORACLEDBATGOOGLE", + "ORACLEDBATAWS", + } +} + +// GetMappingListExternalLocationDetailsMetadataSubscriptionServiceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationDetailsMetadataSubscriptionServiceNameEnum(val string) (ListExternalLocationDetailsMetadataSubscriptionServiceNameEnum, bool) { + enum, ok := mappingListExternalLocationDetailsMetadataSubscriptionServiceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExternalLocationDetailsMetadataEntityTypeEnum Enum with underlying type: string +type ListExternalLocationDetailsMetadataEntityTypeEnum string + +// Set of constants representing the allowable values for ListExternalLocationDetailsMetadataEntityTypeEnum +const ( + ListExternalLocationDetailsMetadataEntityTypeDbsystem ListExternalLocationDetailsMetadataEntityTypeEnum = "dbsystem" +) + +var mappingListExternalLocationDetailsMetadataEntityTypeEnum = map[string]ListExternalLocationDetailsMetadataEntityTypeEnum{ + "dbsystem": ListExternalLocationDetailsMetadataEntityTypeDbsystem, +} + +var mappingListExternalLocationDetailsMetadataEntityTypeEnumLowerCase = map[string]ListExternalLocationDetailsMetadataEntityTypeEnum{ + "dbsystem": ListExternalLocationDetailsMetadataEntityTypeDbsystem, +} + +// GetListExternalLocationDetailsMetadataEntityTypeEnumValues Enumerates the set of values for ListExternalLocationDetailsMetadataEntityTypeEnum +func GetListExternalLocationDetailsMetadataEntityTypeEnumValues() []ListExternalLocationDetailsMetadataEntityTypeEnum { + values := make([]ListExternalLocationDetailsMetadataEntityTypeEnum, 0) + for _, v := range mappingListExternalLocationDetailsMetadataEntityTypeEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationDetailsMetadataEntityTypeEnumStringValues Enumerates the set of values in String for ListExternalLocationDetailsMetadataEntityTypeEnum +func GetListExternalLocationDetailsMetadataEntityTypeEnumStringValues() []string { + return []string{ + "dbsystem", + } +} + +// GetMappingListExternalLocationDetailsMetadataEntityTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationDetailsMetadataEntityTypeEnum(val string) (ListExternalLocationDetailsMetadataEntityTypeEnum, bool) { + enum, ok := mappingListExternalLocationDetailsMetadataEntityTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExternalLocationDetailsMetadataSortOrderEnum Enum with underlying type: string +type ListExternalLocationDetailsMetadataSortOrderEnum string + +// Set of constants representing the allowable values for ListExternalLocationDetailsMetadataSortOrderEnum +const ( + ListExternalLocationDetailsMetadataSortOrderAsc ListExternalLocationDetailsMetadataSortOrderEnum = "ASC" + ListExternalLocationDetailsMetadataSortOrderDesc ListExternalLocationDetailsMetadataSortOrderEnum = "DESC" +) + +var mappingListExternalLocationDetailsMetadataSortOrderEnum = map[string]ListExternalLocationDetailsMetadataSortOrderEnum{ + "ASC": ListExternalLocationDetailsMetadataSortOrderAsc, + "DESC": ListExternalLocationDetailsMetadataSortOrderDesc, +} + +var mappingListExternalLocationDetailsMetadataSortOrderEnumLowerCase = map[string]ListExternalLocationDetailsMetadataSortOrderEnum{ + "asc": ListExternalLocationDetailsMetadataSortOrderAsc, + "desc": ListExternalLocationDetailsMetadataSortOrderDesc, +} + +// GetListExternalLocationDetailsMetadataSortOrderEnumValues Enumerates the set of values for ListExternalLocationDetailsMetadataSortOrderEnum +func GetListExternalLocationDetailsMetadataSortOrderEnumValues() []ListExternalLocationDetailsMetadataSortOrderEnum { + values := make([]ListExternalLocationDetailsMetadataSortOrderEnum, 0) + for _, v := range mappingListExternalLocationDetailsMetadataSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationDetailsMetadataSortOrderEnumStringValues Enumerates the set of values in String for ListExternalLocationDetailsMetadataSortOrderEnum +func GetListExternalLocationDetailsMetadataSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListExternalLocationDetailsMetadataSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationDetailsMetadataSortOrderEnum(val string) (ListExternalLocationDetailsMetadataSortOrderEnum, bool) { + enum, ok := mappingListExternalLocationDetailsMetadataSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExternalLocationDetailsMetadataSortByEnum Enum with underlying type: string +type ListExternalLocationDetailsMetadataSortByEnum string + +// Set of constants representing the allowable values for ListExternalLocationDetailsMetadataSortByEnum +const ( + ListExternalLocationDetailsMetadataSortByTimecreated ListExternalLocationDetailsMetadataSortByEnum = "timeCreated" + ListExternalLocationDetailsMetadataSortByDisplayname ListExternalLocationDetailsMetadataSortByEnum = "displayName" +) + +var mappingListExternalLocationDetailsMetadataSortByEnum = map[string]ListExternalLocationDetailsMetadataSortByEnum{ + "timeCreated": ListExternalLocationDetailsMetadataSortByTimecreated, + "displayName": ListExternalLocationDetailsMetadataSortByDisplayname, +} + +var mappingListExternalLocationDetailsMetadataSortByEnumLowerCase = map[string]ListExternalLocationDetailsMetadataSortByEnum{ + "timecreated": ListExternalLocationDetailsMetadataSortByTimecreated, + "displayname": ListExternalLocationDetailsMetadataSortByDisplayname, +} + +// GetListExternalLocationDetailsMetadataSortByEnumValues Enumerates the set of values for ListExternalLocationDetailsMetadataSortByEnum +func GetListExternalLocationDetailsMetadataSortByEnumValues() []ListExternalLocationDetailsMetadataSortByEnum { + values := make([]ListExternalLocationDetailsMetadataSortByEnum, 0) + for _, v := range mappingListExternalLocationDetailsMetadataSortByEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationDetailsMetadataSortByEnumStringValues Enumerates the set of values in String for ListExternalLocationDetailsMetadataSortByEnum +func GetListExternalLocationDetailsMetadataSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListExternalLocationDetailsMetadataSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationDetailsMetadataSortByEnum(val string) (ListExternalLocationDetailsMetadataSortByEnum, bool) { + enum, ok := mappingListExternalLocationDetailsMetadataSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_mapping_metadata_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_mapping_metadata_request_response.go new file mode 100644 index 00000000000..611ac00aaf1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_mapping_metadata_request_response.go @@ -0,0 +1,216 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListExternalLocationMappingMetadataRequest wrapper for the ListExternalLocationMappingMetadata operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListExternalLocationMappingMetadata.go.html to see an example of how to use ListExternalLocationMappingMetadataRequest. +type ListExternalLocationMappingMetadataRequest struct { + + // The subscription type values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + SubscriptionServiceName []SubscriptionTypeEnum `contributesTo:"query" name:"subscriptionServiceName" omitEmpty:"true" collectionFormat:"multi"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + SubscriptionId *string `mandatory:"false" contributesTo:"query" name:"subscriptionId"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListExternalLocationMappingMetadataSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `displayName` is ascending. + SortBy ListExternalLocationMappingMetadataSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListExternalLocationMappingMetadataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListExternalLocationMappingMetadataRequest) 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 ListExternalLocationMappingMetadataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListExternalLocationMappingMetadataRequest) 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 ListExternalLocationMappingMetadataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.SubscriptionServiceName { + if _, ok := GetMappingSubscriptionTypeEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionServiceName: %s. Supported values are: %s.", val, strings.Join(GetSubscriptionTypeEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListExternalLocationMappingMetadataSortOrderEnum(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(GetListExternalLocationMappingMetadataSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListExternalLocationMappingMetadataSortByEnum(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(GetListExternalLocationMappingMetadataSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListExternalLocationMappingMetadataResponse wrapper for the ListExternalLocationMappingMetadata operation +type ListExternalLocationMappingMetadataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ExternalLocationMappingMetadatumSummaryCollection instances + ExternalLocationMappingMetadatumSummaryCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListExternalLocationMappingMetadataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListExternalLocationMappingMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListExternalLocationMappingMetadataSortOrderEnum Enum with underlying type: string +type ListExternalLocationMappingMetadataSortOrderEnum string + +// Set of constants representing the allowable values for ListExternalLocationMappingMetadataSortOrderEnum +const ( + ListExternalLocationMappingMetadataSortOrderAsc ListExternalLocationMappingMetadataSortOrderEnum = "ASC" + ListExternalLocationMappingMetadataSortOrderDesc ListExternalLocationMappingMetadataSortOrderEnum = "DESC" +) + +var mappingListExternalLocationMappingMetadataSortOrderEnum = map[string]ListExternalLocationMappingMetadataSortOrderEnum{ + "ASC": ListExternalLocationMappingMetadataSortOrderAsc, + "DESC": ListExternalLocationMappingMetadataSortOrderDesc, +} + +var mappingListExternalLocationMappingMetadataSortOrderEnumLowerCase = map[string]ListExternalLocationMappingMetadataSortOrderEnum{ + "asc": ListExternalLocationMappingMetadataSortOrderAsc, + "desc": ListExternalLocationMappingMetadataSortOrderDesc, +} + +// GetListExternalLocationMappingMetadataSortOrderEnumValues Enumerates the set of values for ListExternalLocationMappingMetadataSortOrderEnum +func GetListExternalLocationMappingMetadataSortOrderEnumValues() []ListExternalLocationMappingMetadataSortOrderEnum { + values := make([]ListExternalLocationMappingMetadataSortOrderEnum, 0) + for _, v := range mappingListExternalLocationMappingMetadataSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationMappingMetadataSortOrderEnumStringValues Enumerates the set of values in String for ListExternalLocationMappingMetadataSortOrderEnum +func GetListExternalLocationMappingMetadataSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListExternalLocationMappingMetadataSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationMappingMetadataSortOrderEnum(val string) (ListExternalLocationMappingMetadataSortOrderEnum, bool) { + enum, ok := mappingListExternalLocationMappingMetadataSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExternalLocationMappingMetadataSortByEnum Enum with underlying type: string +type ListExternalLocationMappingMetadataSortByEnum string + +// Set of constants representing the allowable values for ListExternalLocationMappingMetadataSortByEnum +const ( + ListExternalLocationMappingMetadataSortByTimecreated ListExternalLocationMappingMetadataSortByEnum = "timeCreated" + ListExternalLocationMappingMetadataSortByDisplayname ListExternalLocationMappingMetadataSortByEnum = "displayName" +) + +var mappingListExternalLocationMappingMetadataSortByEnum = map[string]ListExternalLocationMappingMetadataSortByEnum{ + "timeCreated": ListExternalLocationMappingMetadataSortByTimecreated, + "displayName": ListExternalLocationMappingMetadataSortByDisplayname, +} + +var mappingListExternalLocationMappingMetadataSortByEnumLowerCase = map[string]ListExternalLocationMappingMetadataSortByEnum{ + "timecreated": ListExternalLocationMappingMetadataSortByTimecreated, + "displayname": ListExternalLocationMappingMetadataSortByDisplayname, +} + +// GetListExternalLocationMappingMetadataSortByEnumValues Enumerates the set of values for ListExternalLocationMappingMetadataSortByEnum +func GetListExternalLocationMappingMetadataSortByEnumValues() []ListExternalLocationMappingMetadataSortByEnum { + values := make([]ListExternalLocationMappingMetadataSortByEnum, 0) + for _, v := range mappingListExternalLocationMappingMetadataSortByEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationMappingMetadataSortByEnumStringValues Enumerates the set of values in String for ListExternalLocationMappingMetadataSortByEnum +func GetListExternalLocationMappingMetadataSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListExternalLocationMappingMetadataSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationMappingMetadataSortByEnum(val string) (ListExternalLocationMappingMetadataSortByEnum, bool) { + enum, ok := mappingListExternalLocationMappingMetadataSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_summaries_metadata_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_summaries_metadata_request_response.go new file mode 100644 index 00000000000..cc4454914fa --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_external_location_summaries_metadata_request_response.go @@ -0,0 +1,303 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListExternalLocationSummariesMetadataRequest wrapper for the ListExternalLocationSummariesMetadata operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListExternalLocationSummariesMetadata.go.html to see an example of how to use ListExternalLocationSummariesMetadataRequest. +type ListExternalLocationSummariesMetadataRequest struct { + + // The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + SubscriptionServiceName ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum `mandatory:"true" contributesTo:"query" name:"subscriptionServiceName" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + SubscriptionId *string `mandatory:"false" contributesTo:"query" name:"subscriptionId"` + + // The resource type query (i.e. dbsystem, instance etc.) + EntityType ListExternalLocationSummariesMetadataEntityTypeEnum `mandatory:"false" contributesTo:"query" name:"entityType" omitEmpty:"true"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListExternalLocationSummariesMetadataSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `displayName` is ascending. + SortBy ListExternalLocationSummariesMetadataSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListExternalLocationSummariesMetadataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListExternalLocationSummariesMetadataRequest) 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 ListExternalLocationSummariesMetadataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListExternalLocationSummariesMetadataRequest) 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 ListExternalLocationSummariesMetadataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListExternalLocationSummariesMetadataSubscriptionServiceNameEnum(string(request.SubscriptionServiceName)); !ok && request.SubscriptionServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionServiceName: %s. Supported values are: %s.", request.SubscriptionServiceName, strings.Join(GetListExternalLocationSummariesMetadataSubscriptionServiceNameEnumStringValues(), ","))) + } + if _, ok := GetMappingListExternalLocationSummariesMetadataEntityTypeEnum(string(request.EntityType)); !ok && request.EntityType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for EntityType: %s. Supported values are: %s.", request.EntityType, strings.Join(GetListExternalLocationSummariesMetadataEntityTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingListExternalLocationSummariesMetadataSortOrderEnum(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(GetListExternalLocationSummariesMetadataSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListExternalLocationSummariesMetadataSortByEnum(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(GetListExternalLocationSummariesMetadataSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListExternalLocationSummariesMetadataResponse wrapper for the ListExternalLocationSummariesMetadata operation +type ListExternalLocationSummariesMetadataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ExternalLocationSummariesMetadatumSummaryCollection instances + ExternalLocationSummariesMetadatumSummaryCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListExternalLocationSummariesMetadataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListExternalLocationSummariesMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum Enum with underlying type: string +type ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum string + +// Set of constants representing the allowable values for ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum +const ( + ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbatazure ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum = "ORACLEDBATAZURE" + ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbatgoogle ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum = "ORACLEDBATGOOGLE" + ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbataws ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum = "ORACLEDBATAWS" +) + +var mappingListExternalLocationSummariesMetadataSubscriptionServiceNameEnum = map[string]ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum{ + "ORACLEDBATAZURE": ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbatazure, + "ORACLEDBATGOOGLE": ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbatgoogle, + "ORACLEDBATAWS": ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbataws, +} + +var mappingListExternalLocationSummariesMetadataSubscriptionServiceNameEnumLowerCase = map[string]ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum{ + "oracledbatazure": ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbatazure, + "oracledbatgoogle": ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbatgoogle, + "oracledbataws": ListExternalLocationSummariesMetadataSubscriptionServiceNameOracledbataws, +} + +// GetListExternalLocationSummariesMetadataSubscriptionServiceNameEnumValues Enumerates the set of values for ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum +func GetListExternalLocationSummariesMetadataSubscriptionServiceNameEnumValues() []ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum { + values := make([]ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum, 0) + for _, v := range mappingListExternalLocationSummariesMetadataSubscriptionServiceNameEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationSummariesMetadataSubscriptionServiceNameEnumStringValues Enumerates the set of values in String for ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum +func GetListExternalLocationSummariesMetadataSubscriptionServiceNameEnumStringValues() []string { + return []string{ + "ORACLEDBATAZURE", + "ORACLEDBATGOOGLE", + "ORACLEDBATAWS", + } +} + +// GetMappingListExternalLocationSummariesMetadataSubscriptionServiceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationSummariesMetadataSubscriptionServiceNameEnum(val string) (ListExternalLocationSummariesMetadataSubscriptionServiceNameEnum, bool) { + enum, ok := mappingListExternalLocationSummariesMetadataSubscriptionServiceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExternalLocationSummariesMetadataEntityTypeEnum Enum with underlying type: string +type ListExternalLocationSummariesMetadataEntityTypeEnum string + +// Set of constants representing the allowable values for ListExternalLocationSummariesMetadataEntityTypeEnum +const ( + ListExternalLocationSummariesMetadataEntityTypeDbsystem ListExternalLocationSummariesMetadataEntityTypeEnum = "dbsystem" +) + +var mappingListExternalLocationSummariesMetadataEntityTypeEnum = map[string]ListExternalLocationSummariesMetadataEntityTypeEnum{ + "dbsystem": ListExternalLocationSummariesMetadataEntityTypeDbsystem, +} + +var mappingListExternalLocationSummariesMetadataEntityTypeEnumLowerCase = map[string]ListExternalLocationSummariesMetadataEntityTypeEnum{ + "dbsystem": ListExternalLocationSummariesMetadataEntityTypeDbsystem, +} + +// GetListExternalLocationSummariesMetadataEntityTypeEnumValues Enumerates the set of values for ListExternalLocationSummariesMetadataEntityTypeEnum +func GetListExternalLocationSummariesMetadataEntityTypeEnumValues() []ListExternalLocationSummariesMetadataEntityTypeEnum { + values := make([]ListExternalLocationSummariesMetadataEntityTypeEnum, 0) + for _, v := range mappingListExternalLocationSummariesMetadataEntityTypeEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationSummariesMetadataEntityTypeEnumStringValues Enumerates the set of values in String for ListExternalLocationSummariesMetadataEntityTypeEnum +func GetListExternalLocationSummariesMetadataEntityTypeEnumStringValues() []string { + return []string{ + "dbsystem", + } +} + +// GetMappingListExternalLocationSummariesMetadataEntityTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationSummariesMetadataEntityTypeEnum(val string) (ListExternalLocationSummariesMetadataEntityTypeEnum, bool) { + enum, ok := mappingListExternalLocationSummariesMetadataEntityTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExternalLocationSummariesMetadataSortOrderEnum Enum with underlying type: string +type ListExternalLocationSummariesMetadataSortOrderEnum string + +// Set of constants representing the allowable values for ListExternalLocationSummariesMetadataSortOrderEnum +const ( + ListExternalLocationSummariesMetadataSortOrderAsc ListExternalLocationSummariesMetadataSortOrderEnum = "ASC" + ListExternalLocationSummariesMetadataSortOrderDesc ListExternalLocationSummariesMetadataSortOrderEnum = "DESC" +) + +var mappingListExternalLocationSummariesMetadataSortOrderEnum = map[string]ListExternalLocationSummariesMetadataSortOrderEnum{ + "ASC": ListExternalLocationSummariesMetadataSortOrderAsc, + "DESC": ListExternalLocationSummariesMetadataSortOrderDesc, +} + +var mappingListExternalLocationSummariesMetadataSortOrderEnumLowerCase = map[string]ListExternalLocationSummariesMetadataSortOrderEnum{ + "asc": ListExternalLocationSummariesMetadataSortOrderAsc, + "desc": ListExternalLocationSummariesMetadataSortOrderDesc, +} + +// GetListExternalLocationSummariesMetadataSortOrderEnumValues Enumerates the set of values for ListExternalLocationSummariesMetadataSortOrderEnum +func GetListExternalLocationSummariesMetadataSortOrderEnumValues() []ListExternalLocationSummariesMetadataSortOrderEnum { + values := make([]ListExternalLocationSummariesMetadataSortOrderEnum, 0) + for _, v := range mappingListExternalLocationSummariesMetadataSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationSummariesMetadataSortOrderEnumStringValues Enumerates the set of values in String for ListExternalLocationSummariesMetadataSortOrderEnum +func GetListExternalLocationSummariesMetadataSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListExternalLocationSummariesMetadataSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationSummariesMetadataSortOrderEnum(val string) (ListExternalLocationSummariesMetadataSortOrderEnum, bool) { + enum, ok := mappingListExternalLocationSummariesMetadataSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListExternalLocationSummariesMetadataSortByEnum Enum with underlying type: string +type ListExternalLocationSummariesMetadataSortByEnum string + +// Set of constants representing the allowable values for ListExternalLocationSummariesMetadataSortByEnum +const ( + ListExternalLocationSummariesMetadataSortByTimecreated ListExternalLocationSummariesMetadataSortByEnum = "timeCreated" + ListExternalLocationSummariesMetadataSortByDisplayname ListExternalLocationSummariesMetadataSortByEnum = "displayName" +) + +var mappingListExternalLocationSummariesMetadataSortByEnum = map[string]ListExternalLocationSummariesMetadataSortByEnum{ + "timeCreated": ListExternalLocationSummariesMetadataSortByTimecreated, + "displayName": ListExternalLocationSummariesMetadataSortByDisplayname, +} + +var mappingListExternalLocationSummariesMetadataSortByEnumLowerCase = map[string]ListExternalLocationSummariesMetadataSortByEnum{ + "timecreated": ListExternalLocationSummariesMetadataSortByTimecreated, + "displayname": ListExternalLocationSummariesMetadataSortByDisplayname, +} + +// GetListExternalLocationSummariesMetadataSortByEnumValues Enumerates the set of values for ListExternalLocationSummariesMetadataSortByEnum +func GetListExternalLocationSummariesMetadataSortByEnumValues() []ListExternalLocationSummariesMetadataSortByEnum { + values := make([]ListExternalLocationSummariesMetadataSortByEnum, 0) + for _, v := range mappingListExternalLocationSummariesMetadataSortByEnum { + values = append(values, v) + } + return values +} + +// GetListExternalLocationSummariesMetadataSortByEnumStringValues Enumerates the set of values in String for ListExternalLocationSummariesMetadataSortByEnum +func GetListExternalLocationSummariesMetadataSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListExternalLocationSummariesMetadataSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListExternalLocationSummariesMetadataSortByEnum(val string) (ListExternalLocationSummariesMetadataSortByEnum, bool) { + enum, ok := mappingListExternalLocationSummariesMetadataSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_multi_cloud_metadata_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_multi_cloud_metadata_request_response.go new file mode 100644 index 00000000000..5a8e282b4fb --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_multi_cloud_metadata_request_response.go @@ -0,0 +1,204 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListMultiCloudMetadataRequest wrapper for the ListMultiCloudMetadata operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListMultiCloudMetadata.go.html to see an example of how to use ListMultiCloudMetadataRequest. +type ListMultiCloudMetadataRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListMultiCloudMetadataSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `displayName` is ascending. + SortBy ListMultiCloudMetadataSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListMultiCloudMetadataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListMultiCloudMetadataRequest) 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 ListMultiCloudMetadataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMultiCloudMetadataRequest) 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 ListMultiCloudMetadataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListMultiCloudMetadataSortOrderEnum(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(GetListMultiCloudMetadataSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListMultiCloudMetadataSortByEnum(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(GetListMultiCloudMetadataSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListMultiCloudMetadataResponse wrapper for the ListMultiCloudMetadata operation +type ListMultiCloudMetadataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of MultiCloudMetadataCollection instances + MultiCloudMetadataCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListMultiCloudMetadataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListMultiCloudMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListMultiCloudMetadataSortOrderEnum Enum with underlying type: string +type ListMultiCloudMetadataSortOrderEnum string + +// Set of constants representing the allowable values for ListMultiCloudMetadataSortOrderEnum +const ( + ListMultiCloudMetadataSortOrderAsc ListMultiCloudMetadataSortOrderEnum = "ASC" + ListMultiCloudMetadataSortOrderDesc ListMultiCloudMetadataSortOrderEnum = "DESC" +) + +var mappingListMultiCloudMetadataSortOrderEnum = map[string]ListMultiCloudMetadataSortOrderEnum{ + "ASC": ListMultiCloudMetadataSortOrderAsc, + "DESC": ListMultiCloudMetadataSortOrderDesc, +} + +var mappingListMultiCloudMetadataSortOrderEnumLowerCase = map[string]ListMultiCloudMetadataSortOrderEnum{ + "asc": ListMultiCloudMetadataSortOrderAsc, + "desc": ListMultiCloudMetadataSortOrderDesc, +} + +// GetListMultiCloudMetadataSortOrderEnumValues Enumerates the set of values for ListMultiCloudMetadataSortOrderEnum +func GetListMultiCloudMetadataSortOrderEnumValues() []ListMultiCloudMetadataSortOrderEnum { + values := make([]ListMultiCloudMetadataSortOrderEnum, 0) + for _, v := range mappingListMultiCloudMetadataSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListMultiCloudMetadataSortOrderEnumStringValues Enumerates the set of values in String for ListMultiCloudMetadataSortOrderEnum +func GetListMultiCloudMetadataSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListMultiCloudMetadataSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMultiCloudMetadataSortOrderEnum(val string) (ListMultiCloudMetadataSortOrderEnum, bool) { + enum, ok := mappingListMultiCloudMetadataSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListMultiCloudMetadataSortByEnum Enum with underlying type: string +type ListMultiCloudMetadataSortByEnum string + +// Set of constants representing the allowable values for ListMultiCloudMetadataSortByEnum +const ( + ListMultiCloudMetadataSortByTimecreated ListMultiCloudMetadataSortByEnum = "timeCreated" + ListMultiCloudMetadataSortByDisplayname ListMultiCloudMetadataSortByEnum = "displayName" +) + +var mappingListMultiCloudMetadataSortByEnum = map[string]ListMultiCloudMetadataSortByEnum{ + "timeCreated": ListMultiCloudMetadataSortByTimecreated, + "displayName": ListMultiCloudMetadataSortByDisplayname, +} + +var mappingListMultiCloudMetadataSortByEnumLowerCase = map[string]ListMultiCloudMetadataSortByEnum{ + "timecreated": ListMultiCloudMetadataSortByTimecreated, + "displayname": ListMultiCloudMetadataSortByDisplayname, +} + +// GetListMultiCloudMetadataSortByEnumValues Enumerates the set of values for ListMultiCloudMetadataSortByEnum +func GetListMultiCloudMetadataSortByEnumValues() []ListMultiCloudMetadataSortByEnum { + values := make([]ListMultiCloudMetadataSortByEnum, 0) + for _, v := range mappingListMultiCloudMetadataSortByEnum { + values = append(values, v) + } + return values +} + +// GetListMultiCloudMetadataSortByEnumStringValues Enumerates the set of values in String for ListMultiCloudMetadataSortByEnum +func GetListMultiCloudMetadataSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListMultiCloudMetadataSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMultiCloudMetadataSortByEnum(val string) (ListMultiCloudMetadataSortByEnum, bool) { + enum, ok := mappingListMultiCloudMetadataSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_network_anchors_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_network_anchors_request_response.go new file mode 100644 index 00000000000..eb676177b71 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_network_anchors_request_response.go @@ -0,0 +1,281 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListNetworkAnchorsRequest wrapper for the ListNetworkAnchors operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListNetworkAnchors.go.html to see an example of how to use ListNetworkAnchorsRequest. +type ListNetworkAnchorsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + SubscriptionId *string `mandatory:"true" contributesTo:"query" name:"subscriptionId"` + + // The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + SubscriptionServiceName ListNetworkAnchorsSubscriptionServiceNameEnum `mandatory:"true" contributesTo:"query" name:"subscriptionServiceName" omitEmpty:"true"` + + // OMHub Control Plane must know underlying CSP CP Region External Location Name. + ExternalLocation *string `mandatory:"true" contributesTo:"query" name:"externalLocation"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState NetworkAnchorLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only NetworkAnchor resources that match the given OCI subnet Id. + NetworkAnchorOciSubnetId *string `mandatory:"false" contributesTo:"query" name:"networkAnchorOciSubnetId"` + + // A filter to return only NetworkAnchor resources that match the given OCI Vcn Id. + NetworkAnchorOciVcnId *string `mandatory:"false" contributesTo:"query" name:"networkAnchorOciVcnId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListNetworkAnchorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `displayName` is ascending. + SortBy ListNetworkAnchorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListNetworkAnchorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListNetworkAnchorsRequest) 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 ListNetworkAnchorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListNetworkAnchorsRequest) 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 ListNetworkAnchorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListNetworkAnchorsSubscriptionServiceNameEnum(string(request.SubscriptionServiceName)); !ok && request.SubscriptionServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionServiceName: %s. Supported values are: %s.", request.SubscriptionServiceName, strings.Join(GetListNetworkAnchorsSubscriptionServiceNameEnumStringValues(), ","))) + } + if _, ok := GetMappingNetworkAnchorLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetNetworkAnchorLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListNetworkAnchorsSortOrderEnum(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(GetListNetworkAnchorsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListNetworkAnchorsSortByEnum(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(GetListNetworkAnchorsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListNetworkAnchorsResponse wrapper for the ListNetworkAnchors operation +type ListNetworkAnchorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of NetworkAnchorCollection instances + NetworkAnchorCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListNetworkAnchorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListNetworkAnchorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListNetworkAnchorsSubscriptionServiceNameEnum Enum with underlying type: string +type ListNetworkAnchorsSubscriptionServiceNameEnum string + +// Set of constants representing the allowable values for ListNetworkAnchorsSubscriptionServiceNameEnum +const ( + ListNetworkAnchorsSubscriptionServiceNameOracledbatazure ListNetworkAnchorsSubscriptionServiceNameEnum = "ORACLEDBATAZURE" + ListNetworkAnchorsSubscriptionServiceNameOracledbatgoogle ListNetworkAnchorsSubscriptionServiceNameEnum = "ORACLEDBATGOOGLE" + ListNetworkAnchorsSubscriptionServiceNameOracledbataws ListNetworkAnchorsSubscriptionServiceNameEnum = "ORACLEDBATAWS" +) + +var mappingListNetworkAnchorsSubscriptionServiceNameEnum = map[string]ListNetworkAnchorsSubscriptionServiceNameEnum{ + "ORACLEDBATAZURE": ListNetworkAnchorsSubscriptionServiceNameOracledbatazure, + "ORACLEDBATGOOGLE": ListNetworkAnchorsSubscriptionServiceNameOracledbatgoogle, + "ORACLEDBATAWS": ListNetworkAnchorsSubscriptionServiceNameOracledbataws, +} + +var mappingListNetworkAnchorsSubscriptionServiceNameEnumLowerCase = map[string]ListNetworkAnchorsSubscriptionServiceNameEnum{ + "oracledbatazure": ListNetworkAnchorsSubscriptionServiceNameOracledbatazure, + "oracledbatgoogle": ListNetworkAnchorsSubscriptionServiceNameOracledbatgoogle, + "oracledbataws": ListNetworkAnchorsSubscriptionServiceNameOracledbataws, +} + +// GetListNetworkAnchorsSubscriptionServiceNameEnumValues Enumerates the set of values for ListNetworkAnchorsSubscriptionServiceNameEnum +func GetListNetworkAnchorsSubscriptionServiceNameEnumValues() []ListNetworkAnchorsSubscriptionServiceNameEnum { + values := make([]ListNetworkAnchorsSubscriptionServiceNameEnum, 0) + for _, v := range mappingListNetworkAnchorsSubscriptionServiceNameEnum { + values = append(values, v) + } + return values +} + +// GetListNetworkAnchorsSubscriptionServiceNameEnumStringValues Enumerates the set of values in String for ListNetworkAnchorsSubscriptionServiceNameEnum +func GetListNetworkAnchorsSubscriptionServiceNameEnumStringValues() []string { + return []string{ + "ORACLEDBATAZURE", + "ORACLEDBATGOOGLE", + "ORACLEDBATAWS", + } +} + +// GetMappingListNetworkAnchorsSubscriptionServiceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNetworkAnchorsSubscriptionServiceNameEnum(val string) (ListNetworkAnchorsSubscriptionServiceNameEnum, bool) { + enum, ok := mappingListNetworkAnchorsSubscriptionServiceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListNetworkAnchorsSortOrderEnum Enum with underlying type: string +type ListNetworkAnchorsSortOrderEnum string + +// Set of constants representing the allowable values for ListNetworkAnchorsSortOrderEnum +const ( + ListNetworkAnchorsSortOrderAsc ListNetworkAnchorsSortOrderEnum = "ASC" + ListNetworkAnchorsSortOrderDesc ListNetworkAnchorsSortOrderEnum = "DESC" +) + +var mappingListNetworkAnchorsSortOrderEnum = map[string]ListNetworkAnchorsSortOrderEnum{ + "ASC": ListNetworkAnchorsSortOrderAsc, + "DESC": ListNetworkAnchorsSortOrderDesc, +} + +var mappingListNetworkAnchorsSortOrderEnumLowerCase = map[string]ListNetworkAnchorsSortOrderEnum{ + "asc": ListNetworkAnchorsSortOrderAsc, + "desc": ListNetworkAnchorsSortOrderDesc, +} + +// GetListNetworkAnchorsSortOrderEnumValues Enumerates the set of values for ListNetworkAnchorsSortOrderEnum +func GetListNetworkAnchorsSortOrderEnumValues() []ListNetworkAnchorsSortOrderEnum { + values := make([]ListNetworkAnchorsSortOrderEnum, 0) + for _, v := range mappingListNetworkAnchorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListNetworkAnchorsSortOrderEnumStringValues Enumerates the set of values in String for ListNetworkAnchorsSortOrderEnum +func GetListNetworkAnchorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListNetworkAnchorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNetworkAnchorsSortOrderEnum(val string) (ListNetworkAnchorsSortOrderEnum, bool) { + enum, ok := mappingListNetworkAnchorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListNetworkAnchorsSortByEnum Enum with underlying type: string +type ListNetworkAnchorsSortByEnum string + +// Set of constants representing the allowable values for ListNetworkAnchorsSortByEnum +const ( + ListNetworkAnchorsSortByTimecreated ListNetworkAnchorsSortByEnum = "timeCreated" + ListNetworkAnchorsSortByDisplayname ListNetworkAnchorsSortByEnum = "displayName" +) + +var mappingListNetworkAnchorsSortByEnum = map[string]ListNetworkAnchorsSortByEnum{ + "timeCreated": ListNetworkAnchorsSortByTimecreated, + "displayName": ListNetworkAnchorsSortByDisplayname, +} + +var mappingListNetworkAnchorsSortByEnumLowerCase = map[string]ListNetworkAnchorsSortByEnum{ + "timecreated": ListNetworkAnchorsSortByTimecreated, + "displayname": ListNetworkAnchorsSortByDisplayname, +} + +// GetListNetworkAnchorsSortByEnumValues Enumerates the set of values for ListNetworkAnchorsSortByEnum +func GetListNetworkAnchorsSortByEnumValues() []ListNetworkAnchorsSortByEnum { + values := make([]ListNetworkAnchorsSortByEnum, 0) + for _, v := range mappingListNetworkAnchorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListNetworkAnchorsSortByEnumStringValues Enumerates the set of values in String for ListNetworkAnchorsSortByEnum +func GetListNetworkAnchorsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListNetworkAnchorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNetworkAnchorsSortByEnum(val string) (ListNetworkAnchorsSortByEnum, bool) { + enum, ok := mappingListNetworkAnchorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_resource_anchors_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_resource_anchors_request_response.go new file mode 100644 index 00000000000..ec513f09e37 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/list_resource_anchors_request_response.go @@ -0,0 +1,278 @@ +// Copyright (c) 2016, 2018, 2025, 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 multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListResourceAnchorsRequest wrapper for the ListResourceAnchors operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListResourceAnchors.go.html to see an example of how to use ListResourceAnchorsRequest. +type ListResourceAnchorsRequest struct { + + // The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + SubscriptionServiceName ListResourceAnchorsSubscriptionServiceNameEnum `mandatory:"true" contributesTo:"query" name:"subscriptionServiceName" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + SubscriptionId *string `mandatory:"true" contributesTo:"query" name:"subscriptionId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which linked to Resource. + LinkedCompartmentId *string `mandatory:"false" contributesTo:"query" name:"linkedCompartmentId"` + + // A filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState ResourceAnchorLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnchor. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListResourceAnchorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `displayName` is ascending. + SortBy ListResourceAnchorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Check the sub-compartments of a given compartmentId + IsCompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"isCompartmentIdInSubtree"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListResourceAnchorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListResourceAnchorsRequest) 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 ListResourceAnchorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListResourceAnchorsRequest) 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 ListResourceAnchorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListResourceAnchorsSubscriptionServiceNameEnum(string(request.SubscriptionServiceName)); !ok && request.SubscriptionServiceName != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionServiceName: %s. Supported values are: %s.", request.SubscriptionServiceName, strings.Join(GetListResourceAnchorsSubscriptionServiceNameEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceAnchorLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetResourceAnchorLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListResourceAnchorsSortOrderEnum(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(GetListResourceAnchorsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListResourceAnchorsSortByEnum(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(GetListResourceAnchorsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListResourceAnchorsResponse wrapper for the ListResourceAnchors operation +type ListResourceAnchorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ResourceAnchorCollection instances + ResourceAnchorCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListResourceAnchorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListResourceAnchorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListResourceAnchorsSubscriptionServiceNameEnum Enum with underlying type: string +type ListResourceAnchorsSubscriptionServiceNameEnum string + +// Set of constants representing the allowable values for ListResourceAnchorsSubscriptionServiceNameEnum +const ( + ListResourceAnchorsSubscriptionServiceNameOracledbatazure ListResourceAnchorsSubscriptionServiceNameEnum = "ORACLEDBATAZURE" + ListResourceAnchorsSubscriptionServiceNameOracledbatgoogle ListResourceAnchorsSubscriptionServiceNameEnum = "ORACLEDBATGOOGLE" + ListResourceAnchorsSubscriptionServiceNameOracledbataws ListResourceAnchorsSubscriptionServiceNameEnum = "ORACLEDBATAWS" +) + +var mappingListResourceAnchorsSubscriptionServiceNameEnum = map[string]ListResourceAnchorsSubscriptionServiceNameEnum{ + "ORACLEDBATAZURE": ListResourceAnchorsSubscriptionServiceNameOracledbatazure, + "ORACLEDBATGOOGLE": ListResourceAnchorsSubscriptionServiceNameOracledbatgoogle, + "ORACLEDBATAWS": ListResourceAnchorsSubscriptionServiceNameOracledbataws, +} + +var mappingListResourceAnchorsSubscriptionServiceNameEnumLowerCase = map[string]ListResourceAnchorsSubscriptionServiceNameEnum{ + "oracledbatazure": ListResourceAnchorsSubscriptionServiceNameOracledbatazure, + "oracledbatgoogle": ListResourceAnchorsSubscriptionServiceNameOracledbatgoogle, + "oracledbataws": ListResourceAnchorsSubscriptionServiceNameOracledbataws, +} + +// GetListResourceAnchorsSubscriptionServiceNameEnumValues Enumerates the set of values for ListResourceAnchorsSubscriptionServiceNameEnum +func GetListResourceAnchorsSubscriptionServiceNameEnumValues() []ListResourceAnchorsSubscriptionServiceNameEnum { + values := make([]ListResourceAnchorsSubscriptionServiceNameEnum, 0) + for _, v := range mappingListResourceAnchorsSubscriptionServiceNameEnum { + values = append(values, v) + } + return values +} + +// GetListResourceAnchorsSubscriptionServiceNameEnumStringValues Enumerates the set of values in String for ListResourceAnchorsSubscriptionServiceNameEnum +func GetListResourceAnchorsSubscriptionServiceNameEnumStringValues() []string { + return []string{ + "ORACLEDBATAZURE", + "ORACLEDBATGOOGLE", + "ORACLEDBATAWS", + } +} + +// GetMappingListResourceAnchorsSubscriptionServiceNameEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListResourceAnchorsSubscriptionServiceNameEnum(val string) (ListResourceAnchorsSubscriptionServiceNameEnum, bool) { + enum, ok := mappingListResourceAnchorsSubscriptionServiceNameEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListResourceAnchorsSortOrderEnum Enum with underlying type: string +type ListResourceAnchorsSortOrderEnum string + +// Set of constants representing the allowable values for ListResourceAnchorsSortOrderEnum +const ( + ListResourceAnchorsSortOrderAsc ListResourceAnchorsSortOrderEnum = "ASC" + ListResourceAnchorsSortOrderDesc ListResourceAnchorsSortOrderEnum = "DESC" +) + +var mappingListResourceAnchorsSortOrderEnum = map[string]ListResourceAnchorsSortOrderEnum{ + "ASC": ListResourceAnchorsSortOrderAsc, + "DESC": ListResourceAnchorsSortOrderDesc, +} + +var mappingListResourceAnchorsSortOrderEnumLowerCase = map[string]ListResourceAnchorsSortOrderEnum{ + "asc": ListResourceAnchorsSortOrderAsc, + "desc": ListResourceAnchorsSortOrderDesc, +} + +// GetListResourceAnchorsSortOrderEnumValues Enumerates the set of values for ListResourceAnchorsSortOrderEnum +func GetListResourceAnchorsSortOrderEnumValues() []ListResourceAnchorsSortOrderEnum { + values := make([]ListResourceAnchorsSortOrderEnum, 0) + for _, v := range mappingListResourceAnchorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListResourceAnchorsSortOrderEnumStringValues Enumerates the set of values in String for ListResourceAnchorsSortOrderEnum +func GetListResourceAnchorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListResourceAnchorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListResourceAnchorsSortOrderEnum(val string) (ListResourceAnchorsSortOrderEnum, bool) { + enum, ok := mappingListResourceAnchorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListResourceAnchorsSortByEnum Enum with underlying type: string +type ListResourceAnchorsSortByEnum string + +// Set of constants representing the allowable values for ListResourceAnchorsSortByEnum +const ( + ListResourceAnchorsSortByTimecreated ListResourceAnchorsSortByEnum = "timeCreated" + ListResourceAnchorsSortByDisplayname ListResourceAnchorsSortByEnum = "displayName" +) + +var mappingListResourceAnchorsSortByEnum = map[string]ListResourceAnchorsSortByEnum{ + "timeCreated": ListResourceAnchorsSortByTimecreated, + "displayName": ListResourceAnchorsSortByDisplayname, +} + +var mappingListResourceAnchorsSortByEnumLowerCase = map[string]ListResourceAnchorsSortByEnum{ + "timecreated": ListResourceAnchorsSortByTimecreated, + "displayname": ListResourceAnchorsSortByDisplayname, +} + +// GetListResourceAnchorsSortByEnumValues Enumerates the set of values for ListResourceAnchorsSortByEnum +func GetListResourceAnchorsSortByEnumValues() []ListResourceAnchorsSortByEnum { + values := make([]ListResourceAnchorsSortByEnum, 0) + for _, v := range mappingListResourceAnchorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListResourceAnchorsSortByEnumStringValues Enumerates the set of values in String for ListResourceAnchorsSortByEnum +func GetListResourceAnchorsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListResourceAnchorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListResourceAnchorsSortByEnum(val string) (ListResourceAnchorsSortByEnum, bool) { + enum, ok := mappingListResourceAnchorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata.go new file mode 100644 index 00000000000..e45f454a34f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MultiCloudMetadata Multicloud metadata information including base multicloud compartments information. +type MultiCloudMetadata struct { + + // MultiCloud base compartment OCID associated with subscriptionId. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Oracle Cloud Infrastructure subscriptionId. + SubscriptionId *string `mandatory:"true" json:"subscriptionId"` + + // The date and time the multicloud compartment was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m MultiCloudMetadata) 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 MultiCloudMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata_collection.go new file mode 100644 index 00000000000..9a0c784cc9d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MultiCloudMetadataCollection Multicloud metadata information across clouds. +type MultiCloudMetadataCollection struct { + + // List of MultiCloudMetadata. + Items []MultiCloudMetadataSummary `mandatory:"true" json:"items"` +} + +func (m MultiCloudMetadataCollection) 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 MultiCloudMetadataCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata_summary.go new file mode 100644 index 00000000000..83ee583f435 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multi_cloud_metadata_summary.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MultiCloudMetadataSummary Multicloud metadata information including base multicloud compartments information. +type MultiCloudMetadataSummary struct { + + // MultiCloud base compartment OCID associated with subscriptionId. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the multicloud compartment was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Oracle Cloud Infrastructure subscriptionId. + SubscriptionId *string `mandatory:"true" json:"subscriptionId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m MultiCloudMetadataSummary) 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 MultiCloudMetadataSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_metadata_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_metadata_client.go new file mode 100644 index 00000000000..57f1611a1c7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_metadata_client.go @@ -0,0 +1,445 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// MetadataClient a client for Metadata +type MetadataClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewMetadataClientWithConfigurationProvider Creates a new default Metadata client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewMetadataClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client MetadataClient, err error) { + if enabled := common.CheckForEnabledServices("multicloud"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newMetadataClientFromBaseClient(baseClient, provider) +} + +// NewMetadataClientWithOboToken Creates a new default Metadata client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewMetadataClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client MetadataClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newMetadataClientFromBaseClient(baseClient, configProvider) +} + +func newMetadataClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client MetadataClient, err error) { + // Metadata service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Metadata")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = MetadataClient{BaseClient: baseClient} + client.BasePath = "20180828" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *MetadataClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("multicloud", "https://multicloud.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *MetadataClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *MetadataClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ListExternalLocationDetailsMetadata List externalLocationDetail metadata from OCI to Cloud Service Provider for regions, Availability Zones, and Cluster Placement Group ID. +// examples: +// +// application-json: | +// [ +// { +// "externalLocation": { +// "cspRegion": "East US", +// "cspPhysicalAz": "az1-xyz", +// "cspPhysicalAzDisplayName": "(US) East US 2", +// "cspLogicalAz": "az1", +// "serviceName": "ORACLEDBATAZURE", +// "cspZoneKeyReferenceId": { +// "keyName": "AzureSubscriptionId or AwsAccountId, GcpProjectName", +// "keyValue": "azure-subscriptionId-1 or aws-account-id-1, gcp-project-id-1" +// } +// }, +// "ociPhysicalAd": "ad1-xyb", +// "ociLogicalAd": "ad2", +// "ociRegion": "us-ashburn-1", +// "cpgId": "cpg-1" +// }, +// { +// "externalLocation": { +// "cspRegion": "East US", +// "cspPhysicalAz": "az2-abc", +// "cspPhysicalAzDisplayName": "(US) East US 2", +// "cspLogicalAz": "az2", +// "serviceName": "ORACLEDBATAZURE", +// "cspZoneKeyReferenceId": { +// "keyName": "AzureSubscriptionId or AwsAccountId, GcpProjectName", +// "keyValue": "azure-subscriptionId-2 or aws-account-id-2, gcp-project-id-2" +// } +// }, +// "ociPhysicalAd": "ad2-xby", +// "ociLogicalAd": "ad1", +// "ociRegion": "us-ashburn-1", +// "cpgId": "cpg-2" +// }, +// { +// "externalLocation": { +// "cspRegion": "East US", +// "cspPhysicalAz": "az3-abz", +// "cspPhysicalAzDisplayName": "(US) East US 2", +// "cspLogicalAz": "az3", +// "serviceName": "ORACLEDBATAZURE", +// "cspZoneKeyReferenceId": { +// "keyName": "AzureSubscriptionId or AwsAccountId, GcpProjectName", +// "keyValue": "azure-subscriptionId-3 or aws-account-id-3, gcp-project-id-3" +// } +// }, +// "ociPhysicalAd": "ad3-cde", +// "ociLogicalAd": "ad3", +// "ociRegion": "us-ashburn-1", +// "cpgId": "cpg-3" +// }, +// { +// "externalLocation": { +// "cspRegion": "East US 2", +// "cspPhysicalAz": "az1-def", +// "cspPhysicalAzDisplayName": "(US) East US 2", +// "cspLogicalAz": "az1", +// "serviceName": "ORACLEDBATAZURE", +// "cspZoneKeyReferenceId": { +// "keyName": "AzureSubscriptionId or AwsAccountId, GcpProjectName", +// "keyValue": "azure-subscriptionId-4 or aws-account-id-4, gcp-project-id-4" +// } +// }, +// "ociPhysicalAd": "ad1-bce", +// "ociLogicalAd": "ad2", +// "ociRegion": "us-ashburn-1", +// "cpgId": "cpg-4" +// }, +// { +// "externalLocation": { +// "cspRegion": "East US 2", +// "cspPhysicalAz": "az2-uvw", +// "cspPhysicalAzDisplayName": "(US) East US 2", +// "cspLogicalAz": "az2", +// "serviceName": "ORACLEDBATAZURE", +// "cspZoneKeyReferenceId": { +// "keyName": "AzureSubscriptionId or AwsAccountId, GcpProjectName", +// "keyValue": "azure-subscriptionId-3 or aws-account-id-3, gcp-project-id-3" +// } +// }, +// "ociPhysicalAd": "ad2-ftc", +// "ociLogicalAd": "ad1", +// "ociRegion": "us-ashburn-1", +// "cpgId": "cpg-5" +// }, +// { +// "externalLocation": { +// "cspRegion": "East US 2", +// "cspPhysicalAz": "az3-uvw", +// "cspPhysicalAzDisplayName": "(US) East US 2", +// "cspLogicalAz": "az3", +// "serviceName": "ORACLEDBATAZURE", +// "cspZoneKeyReferenceId": { +// "keyName": "AzureSubscriptionId or AwsAccountId, GcpProjectName", +// "keyValue": "azure-subscriptionId-3 or aws-account-id-3, gcp-project-id-3" +// } +// }, +// "ociPhysicalAd": "ad3-stc", +// "ociLogicalAd": "ad3", +// "ociRegion": "us-ashburn-1", +// "cpgId": "cpg-6" +// } +// ] +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListExternalLocationDetailsMetadata.go.html to see an example of how to use ListExternalLocationDetailsMetadata API. +// A default retry strategy applies to this operation ListExternalLocationDetailsMetadata() +func (client MetadataClient) ListExternalLocationDetailsMetadata(ctx context.Context, request ListExternalLocationDetailsMetadataRequest) (response ListExternalLocationDetailsMetadataResponse, 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.listExternalLocationDetailsMetadata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListExternalLocationDetailsMetadataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListExternalLocationDetailsMetadataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListExternalLocationDetailsMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListExternalLocationDetailsMetadataResponse") + } + return +} + +// listExternalLocationDetailsMetadata implements the OCIOperation interface (enables retrying operations) +func (client MetadataClient) listExternalLocationDetailsMetadata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalLocationsMetadata", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListExternalLocationDetailsMetadataResponse + 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/multicloud-omhub-cp/20180828/ExternalLocationsMetadatumCollection/ListExternalLocationDetailsMetadata" + err = common.PostProcessServiceError(err, "Metadata", "ListExternalLocationDetailsMetadata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListExternalLocationMappingMetadata List externalLocation metadata from OCI to the Cloud Service Provider for regions, Physical Availability Zones. +// examples: +// +// application-json: | +// [ +// { +// "externalLocation": { +// "cspRegion": "eastus", +// "cspPhysicalAz": "eastus-az1", +// "cspPhysicalAzDisplayName": "(US) East US 1", +// "serviceName": "ORACLEDBATAZURE" +// }, +// "ociPhysicalAd": "iad-ad-1", +// "ociLogicalAd": "ad1", +// "ociRegion": "us-ashburn-1" +// }, +// { +// "externalLocation": { +// "cspRegion": "eastus", +// "cspPhysicalAz": "eastus-az1", +// "cspPhysicalAzDisplayName": "(US) East US 1", +// "serviceName": "ORACLEDBATAZURE" +// }, +// "ociPhysicalAd": "iad-ad-1", +// "ociLogicalAd": "ad1", +// "ociRegion": "us-ashburn-1" +// }, +// { +// "externalLocation": { +// "cspRegion": "eastus2", +// "cspPhysicalAz": "eastus2-az3", +// "cspPhysicalAzDisplayName": "(US) East US 1", +// "serviceName": "ORACLEDBATAZURE" +// }, +// "ociPhysicalAd": "iad-ad-2", +// "ociLogicalAd": "ad1", +// "ociRegion": "us-ashburn-1" +// }, +// { +// "externalLocation": { +// "cspRegion": "eastus", +// "cspPhysicalAz": "eastus-az3" +// "cspPhysicalAzDisplayName": "(US) East US 1", +// "serviceName": "ORACLEDBATAZURE" +// }, +// "ociPhysicalAd": "iad-ad-333", +// "ociLogicalAd": "ad1", +// "ociRegion": "us-ashburn-1" +// } +// ] +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListExternalLocationMappingMetadata.go.html to see an example of how to use ListExternalLocationMappingMetadata API. +// A default retry strategy applies to this operation ListExternalLocationMappingMetadata() +func (client MetadataClient) ListExternalLocationMappingMetadata(ctx context.Context, request ListExternalLocationMappingMetadataRequest) (response ListExternalLocationMappingMetadataResponse, 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.listExternalLocationMappingMetadata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListExternalLocationMappingMetadataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListExternalLocationMappingMetadataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListExternalLocationMappingMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListExternalLocationMappingMetadataResponse") + } + return +} + +// listExternalLocationMappingMetadata implements the OCIOperation interface (enables retrying operations) +func (client MetadataClient) listExternalLocationMappingMetadata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalLocationMappingMetadata", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListExternalLocationMappingMetadataResponse + 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/multicloud-omhub-cp/20180828/ExternalLocationMappingMetadatumSummaryCollection/ListExternalLocationMappingMetadata" + err = common.PostProcessServiceError(err, "Metadata", "ListExternalLocationMappingMetadata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListExternalLocationSummariesMetadata List externalLocationSummary metadata from OCI Region to the Cloud Service Provider region across all regions. +// examples: +// +// application-json: | +// [ +// { +// "externalLocation": { +// "cspRegion": "East US" +// }, +// "ociRegion": "us-ashburn-1" +// }, +// { +// "externalLocation": { +// "cspRegion": "East US 2" +// }, +// "ociRegion": "us-ashburn-1" +// }, +// { +// "externalLocation": { +// "cspRegion": "Germany West Central" +// }, +// "ociRegion": "eu-frankfurt-1", +// } +// ] +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListExternalLocationSummariesMetadata.go.html to see an example of how to use ListExternalLocationSummariesMetadata API. +// A default retry strategy applies to this operation ListExternalLocationSummariesMetadata() +func (client MetadataClient) ListExternalLocationSummariesMetadata(ctx context.Context, request ListExternalLocationSummariesMetadataRequest) (response ListExternalLocationSummariesMetadataResponse, 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.listExternalLocationSummariesMetadata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListExternalLocationSummariesMetadataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListExternalLocationSummariesMetadataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListExternalLocationSummariesMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListExternalLocationSummariesMetadataResponse") + } + return +} + +// listExternalLocationSummariesMetadata implements the OCIOperation interface (enables retrying operations) +func (client MetadataClient) listExternalLocationSummariesMetadata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/externalLocationSummariesMetadata", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListExternalLocationSummariesMetadataResponse + 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/multicloud-omhub-cp/20180828/ExternalLocationSummariesMetadatumSummaryCollection/ListExternalLocationSummariesMetadata" + err = common.PostProcessServiceError(err, "Metadata", "ListExternalLocationSummariesMetadata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_multicloudsmetadata_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_multicloudsmetadata_client.go new file mode 100644 index 00000000000..f4f47fa4711 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_multicloudsmetadata_client.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// MultiCloudsMetadataClient a client for MultiCloudsMetadata +type MultiCloudsMetadataClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewMultiCloudsMetadataClientWithConfigurationProvider Creates a new default MultiCloudsMetadata client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewMultiCloudsMetadataClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client MultiCloudsMetadataClient, err error) { + if enabled := common.CheckForEnabledServices("multicloud"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newMultiCloudsMetadataClientFromBaseClient(baseClient, provider) +} + +// NewMultiCloudsMetadataClientWithOboToken Creates a new default MultiCloudsMetadata client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewMultiCloudsMetadataClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client MultiCloudsMetadataClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newMultiCloudsMetadataClientFromBaseClient(baseClient, configProvider) +} + +func newMultiCloudsMetadataClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client MultiCloudsMetadataClient, err error) { + // MultiCloudsMetadata service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("MultiCloudsMetadata")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = MultiCloudsMetadataClient{BaseClient: baseClient} + client.BasePath = "20180828" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *MultiCloudsMetadataClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("multicloud", "https://multicloud.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *MultiCloudsMetadataClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *MultiCloudsMetadataClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetMultiCloudMetadata Gets information about multicloud base compartment +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/GetMultiCloudMetadata.go.html to see an example of how to use GetMultiCloudMetadata API. +// A default retry strategy applies to this operation GetMultiCloudMetadata() +func (client MultiCloudsMetadataClient) GetMultiCloudMetadata(ctx context.Context, request GetMultiCloudMetadataRequest) (response GetMultiCloudMetadataResponse, 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.getMultiCloudMetadata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetMultiCloudMetadataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetMultiCloudMetadataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetMultiCloudMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMultiCloudMetadataResponse") + } + return +} + +// getMultiCloudMetadata implements the OCIOperation interface (enables retrying operations) +func (client MultiCloudsMetadataClient) getMultiCloudMetadata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/omHub/multiCloudsMetadata/{subscriptionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetMultiCloudMetadataResponse + 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/multicloud-omhub-cp/20180828/MultiCloudMetadata/GetMultiCloudMetadata" + err = common.PostProcessServiceError(err, "MultiCloudsMetadata", "GetMultiCloudMetadata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMultiCloudMetadata Gets a list of multicloud metadata with multicloud base compartment and subscription across Cloud Service Providers. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListMultiCloudMetadata.go.html to see an example of how to use ListMultiCloudMetadata API. +// A default retry strategy applies to this operation ListMultiCloudMetadata() +func (client MultiCloudsMetadataClient) ListMultiCloudMetadata(ctx context.Context, request ListMultiCloudMetadataRequest) (response ListMultiCloudMetadataResponse, 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.listMultiCloudMetadata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMultiCloudMetadataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMultiCloudMetadataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMultiCloudMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMultiCloudMetadataResponse") + } + return +} + +// listMultiCloudMetadata implements the OCIOperation interface (enables retrying operations) +func (client MultiCloudsMetadataClient) listMultiCloudMetadata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/omHub/multiCloudsMetadata", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMultiCloudMetadataResponse + 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/multicloud-omhub-cp/20180828/MultiCloudMetadataCollection/ListMultiCloudMetadata" + err = common.PostProcessServiceError(err, "MultiCloudsMetadata", "ListMultiCloudMetadata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_omhubnetworkanchor_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_omhubnetworkanchor_client.go new file mode 100644 index 00000000000..b18065acbce --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_omhubnetworkanchor_client.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// OmhubNetworkAnchorClient a client for OmhubNetworkAnchor +type OmhubNetworkAnchorClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewOmhubNetworkAnchorClientWithConfigurationProvider Creates a new default OmhubNetworkAnchor client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewOmhubNetworkAnchorClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client OmhubNetworkAnchorClient, err error) { + if enabled := common.CheckForEnabledServices("multicloud"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newOmhubNetworkAnchorClientFromBaseClient(baseClient, provider) +} + +// NewOmhubNetworkAnchorClientWithOboToken Creates a new default OmhubNetworkAnchor client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewOmhubNetworkAnchorClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client OmhubNetworkAnchorClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newOmhubNetworkAnchorClientFromBaseClient(baseClient, configProvider) +} + +func newOmhubNetworkAnchorClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client OmhubNetworkAnchorClient, err error) { + // OmhubNetworkAnchor service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("OmhubNetworkAnchor")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = OmhubNetworkAnchorClient{BaseClient: baseClient} + client.BasePath = "20180828" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *OmhubNetworkAnchorClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("multicloud", "https://multicloud.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *OmhubNetworkAnchorClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *OmhubNetworkAnchorClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetNetworkAnchor Gets information about a NetworkAnchor. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/GetNetworkAnchor.go.html to see an example of how to use GetNetworkAnchor API. +// A default retry strategy applies to this operation GetNetworkAnchor() +func (client OmhubNetworkAnchorClient) GetNetworkAnchor(ctx context.Context, request GetNetworkAnchorRequest) (response GetNetworkAnchorResponse, 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.getNetworkAnchor, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetNetworkAnchorResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetNetworkAnchorResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetNetworkAnchorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNetworkAnchorResponse") + } + return +} + +// getNetworkAnchor implements the OCIOperation interface (enables retrying operations) +func (client OmhubNetworkAnchorClient) getNetworkAnchor(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkAnchors/{networkAnchorId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetNetworkAnchorResponse + 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/multicloud-omhub-cp/20180828/NetworkAnchor/GetNetworkAnchor" + err = common.PostProcessServiceError(err, "OmhubNetworkAnchor", "GetNetworkAnchor", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListNetworkAnchors Gets a list of NetworkAnchors. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListNetworkAnchors.go.html to see an example of how to use ListNetworkAnchors API. +// A default retry strategy applies to this operation ListNetworkAnchors() +func (client OmhubNetworkAnchorClient) ListNetworkAnchors(ctx context.Context, request ListNetworkAnchorsRequest) (response ListNetworkAnchorsResponse, 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.listNetworkAnchors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListNetworkAnchorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListNetworkAnchorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListNetworkAnchorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListNetworkAnchorsResponse") + } + return +} + +// listNetworkAnchors implements the OCIOperation interface (enables retrying operations) +func (client OmhubNetworkAnchorClient) listNetworkAnchors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/networkAnchors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListNetworkAnchorsResponse + 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/multicloud-omhub-cp/20180828/NetworkAnchorCollection/ListNetworkAnchors" + err = common.PostProcessServiceError(err, "OmhubNetworkAnchor", "ListNetworkAnchors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_omhubresourceanchor_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_omhubresourceanchor_client.go new file mode 100644 index 00000000000..a84fe4142f4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/multicloud_omhubresourceanchor_client.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// OmhubResourceAnchorClient a client for OmhubResourceAnchor +type OmhubResourceAnchorClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewOmhubResourceAnchorClientWithConfigurationProvider Creates a new default OmhubResourceAnchor client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewOmhubResourceAnchorClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client OmhubResourceAnchorClient, err error) { + if enabled := common.CheckForEnabledServices("multicloud"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newOmhubResourceAnchorClientFromBaseClient(baseClient, provider) +} + +// NewOmhubResourceAnchorClientWithOboToken Creates a new default OmhubResourceAnchor client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewOmhubResourceAnchorClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client OmhubResourceAnchorClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newOmhubResourceAnchorClientFromBaseClient(baseClient, configProvider) +} + +func newOmhubResourceAnchorClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client OmhubResourceAnchorClient, err error) { + // OmhubResourceAnchor service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("OmhubResourceAnchor")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = OmhubResourceAnchorClient{BaseClient: baseClient} + client.BasePath = "20180828" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *OmhubResourceAnchorClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("multicloud", "https://multicloud.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *OmhubResourceAnchorClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *OmhubResourceAnchorClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetResourceAnchor Gets information about a ResourceAnchor. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/GetResourceAnchor.go.html to see an example of how to use GetResourceAnchor API. +// A default retry strategy applies to this operation GetResourceAnchor() +func (client OmhubResourceAnchorClient) GetResourceAnchor(ctx context.Context, request GetResourceAnchorRequest) (response GetResourceAnchorResponse, 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.getResourceAnchor, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetResourceAnchorResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetResourceAnchorResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetResourceAnchorResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetResourceAnchorResponse") + } + return +} + +// getResourceAnchor implements the OCIOperation interface (enables retrying operations) +func (client OmhubResourceAnchorClient) getResourceAnchor(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/resourceAnchors/{resourceAnchorId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetResourceAnchorResponse + 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/multicloud-omhub-cp/20180828/ResourceAnchor/GetResourceAnchor" + err = common.PostProcessServiceError(err, "OmhubResourceAnchor", "GetResourceAnchor", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListResourceAnchors Gets a list of ResourceAnchors. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/multicloud/ListResourceAnchors.go.html to see an example of how to use ListResourceAnchors API. +// A default retry strategy applies to this operation ListResourceAnchors() +func (client OmhubResourceAnchorClient) ListResourceAnchors(ctx context.Context, request ListResourceAnchorsRequest) (response ListResourceAnchorsResponse, 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.listResourceAnchors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListResourceAnchorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListResourceAnchorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListResourceAnchorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListResourceAnchorsResponse") + } + return +} + +// listResourceAnchors implements the OCIOperation interface (enables retrying operations) +func (client OmhubResourceAnchorClient) listResourceAnchors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/resourceAnchors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListResourceAnchorsResponse + 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/multicloud-omhub-cp/20180828/ResourceAnchorCollection/ListResourceAnchors" + err = common.PostProcessServiceError(err, "OmhubResourceAnchor", "ListResourceAnchors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor.go new file mode 100644 index 00000000000..5f8497afdba --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor.go @@ -0,0 +1,198 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NetworkAnchor A NetworkAnchor is a description of a NetworkAnchor. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to +// an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.oracle.com/iaas/Content/Identity/policiesgs/get-started-with-policies.htm). +type NetworkAnchor struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // OCI resource anchor Id (OCID). + ResourceAnchorId *string `mandatory:"true" json:"resourceAnchorId"` + + // The date and time the NetworkAnchor was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the NetworkAnchor. + LifecycleState NetworkAnchorLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // The date and time the NetworkAnchor was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the NetworkAnchor in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // AUTO_BIND - when passed compartment will be created on-behalf of customer and bind to this resource anchor + // NO_AUTO_BIND - compartment will not be created and later customer can bind existing compartment. + // to this resource anchor. This is for future use only + SetupMode NetworkAnchorSetupModeEnum `mandatory:"false" json:"setupMode,omitempty"` + + // The CPG ID in which Network Anchor will be created. + ClusterPlacementGroupId *string `mandatory:"false" json:"clusterPlacementGroupId"` + + OciMetadataItem *OciNetworkMetadata `mandatory:"false" json:"ociMetadataItem"` + + CloudServiceProviderMetadataItem *CloudServiceProviderNetworkMetadataItem `mandatory:"false" json:"cloudServiceProviderMetadataItem"` +} + +func (m NetworkAnchor) 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 NetworkAnchor) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNetworkAnchorLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetNetworkAnchorLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingNetworkAnchorSetupModeEnum(string(m.SetupMode)); !ok && m.SetupMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SetupMode: %s. Supported values are: %s.", m.SetupMode, strings.Join(GetNetworkAnchorSetupModeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// NetworkAnchorLifecycleStateEnum Enum with underlying type: string +type NetworkAnchorLifecycleStateEnum string + +// Set of constants representing the allowable values for NetworkAnchorLifecycleStateEnum +const ( + NetworkAnchorLifecycleStateCreating NetworkAnchorLifecycleStateEnum = "CREATING" + NetworkAnchorLifecycleStateUpdating NetworkAnchorLifecycleStateEnum = "UPDATING" + NetworkAnchorLifecycleStateActive NetworkAnchorLifecycleStateEnum = "ACTIVE" + NetworkAnchorLifecycleStateDeleting NetworkAnchorLifecycleStateEnum = "DELETING" + NetworkAnchorLifecycleStateDeleted NetworkAnchorLifecycleStateEnum = "DELETED" + NetworkAnchorLifecycleStateFailed NetworkAnchorLifecycleStateEnum = "FAILED" +) + +var mappingNetworkAnchorLifecycleStateEnum = map[string]NetworkAnchorLifecycleStateEnum{ + "CREATING": NetworkAnchorLifecycleStateCreating, + "UPDATING": NetworkAnchorLifecycleStateUpdating, + "ACTIVE": NetworkAnchorLifecycleStateActive, + "DELETING": NetworkAnchorLifecycleStateDeleting, + "DELETED": NetworkAnchorLifecycleStateDeleted, + "FAILED": NetworkAnchorLifecycleStateFailed, +} + +var mappingNetworkAnchorLifecycleStateEnumLowerCase = map[string]NetworkAnchorLifecycleStateEnum{ + "creating": NetworkAnchorLifecycleStateCreating, + "updating": NetworkAnchorLifecycleStateUpdating, + "active": NetworkAnchorLifecycleStateActive, + "deleting": NetworkAnchorLifecycleStateDeleting, + "deleted": NetworkAnchorLifecycleStateDeleted, + "failed": NetworkAnchorLifecycleStateFailed, +} + +// GetNetworkAnchorLifecycleStateEnumValues Enumerates the set of values for NetworkAnchorLifecycleStateEnum +func GetNetworkAnchorLifecycleStateEnumValues() []NetworkAnchorLifecycleStateEnum { + values := make([]NetworkAnchorLifecycleStateEnum, 0) + for _, v := range mappingNetworkAnchorLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetNetworkAnchorLifecycleStateEnumStringValues Enumerates the set of values in String for NetworkAnchorLifecycleStateEnum +func GetNetworkAnchorLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingNetworkAnchorLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNetworkAnchorLifecycleStateEnum(val string) (NetworkAnchorLifecycleStateEnum, bool) { + enum, ok := mappingNetworkAnchorLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// NetworkAnchorSetupModeEnum Enum with underlying type: string +type NetworkAnchorSetupModeEnum string + +// Set of constants representing the allowable values for NetworkAnchorSetupModeEnum +const ( + NetworkAnchorSetupModeAutoBind NetworkAnchorSetupModeEnum = "AUTO_BIND" + NetworkAnchorSetupModeNoAutoBind NetworkAnchorSetupModeEnum = "NO_AUTO_BIND" +) + +var mappingNetworkAnchorSetupModeEnum = map[string]NetworkAnchorSetupModeEnum{ + "AUTO_BIND": NetworkAnchorSetupModeAutoBind, + "NO_AUTO_BIND": NetworkAnchorSetupModeNoAutoBind, +} + +var mappingNetworkAnchorSetupModeEnumLowerCase = map[string]NetworkAnchorSetupModeEnum{ + "auto_bind": NetworkAnchorSetupModeAutoBind, + "no_auto_bind": NetworkAnchorSetupModeNoAutoBind, +} + +// GetNetworkAnchorSetupModeEnumValues Enumerates the set of values for NetworkAnchorSetupModeEnum +func GetNetworkAnchorSetupModeEnumValues() []NetworkAnchorSetupModeEnum { + values := make([]NetworkAnchorSetupModeEnum, 0) + for _, v := range mappingNetworkAnchorSetupModeEnum { + values = append(values, v) + } + return values +} + +// GetNetworkAnchorSetupModeEnumStringValues Enumerates the set of values in String for NetworkAnchorSetupModeEnum +func GetNetworkAnchorSetupModeEnumStringValues() []string { + return []string{ + "AUTO_BIND", + "NO_AUTO_BIND", + } +} + +// GetMappingNetworkAnchorSetupModeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNetworkAnchorSetupModeEnum(val string) (NetworkAnchorSetupModeEnum, bool) { + enum, ok := mappingNetworkAnchorSetupModeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor_collection.go new file mode 100644 index 00000000000..3a87db5bb43 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NetworkAnchorCollection Results of a networkAnchor search. Contains both NetworkAnchorSummary items and other information, such as metadata. +type NetworkAnchorCollection struct { + + // List of networkAnchors. + Items []NetworkAnchorSummary `mandatory:"true" json:"items"` +} + +func (m NetworkAnchorCollection) 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 NetworkAnchorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor_summary.go new file mode 100644 index 00000000000..4bbc36b9c8e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/network_anchor_summary.go @@ -0,0 +1,86 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NetworkAnchorSummary Summary information about a NetworkAnchor. +type NetworkAnchorSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // OCI resource anchor Id (OCID). + ResourceAnchorId *string `mandatory:"true" json:"resourceAnchorId"` + + // The date and time the NetworkAnchor was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the NetworkAnchor. + LifecycleState NetworkAnchorLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // OCI resource Id of VCN. + VcnId *string `mandatory:"false" json:"vcnId"` + + // The CPG ID in which Network Anchor will be created. + ClusterPlacementGroupId *string `mandatory:"false" json:"clusterPlacementGroupId"` + + // The date and time the NetworkAnchor was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the NetworkAnchor in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m NetworkAnchorSummary) 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 NetworkAnchorSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNetworkAnchorLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetNetworkAnchorLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_dns.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_dns.go new file mode 100644 index 00000000000..e1d39e7104d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_dns.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciDns Oracle Cloud Infrastructure network anchor related meta data items +type OciDns struct { + + // Full custom domain name. If this field is passed dnsLabel will be ignored + CustomDomainName *string `mandatory:"false" json:"customDomainName"` +} + +func (m OciDns) 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 OciDns) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_network_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_network_metadata.go new file mode 100644 index 00000000000..81745efb7cc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_network_metadata.go @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciNetworkMetadata Oracle Cloud Infrastructure network anchor related meta data items +type OciNetworkMetadata struct { + + // This can be merge to lifecycleState + // CONNECTED - Partner and CSI information is assigned and MulticloudLink provisioned. + // DISCONNECTED - Only partner cloud information is assigned. + // CONNECTING - Oracle Cloud Infrastructure information is assigned and the control plane is provisioning resources. + // ACTIVE - Network anchor is connected and resources (VNICs) exist within a subnet. + // ERROR - DRG attach fails during connection. + // FAILED - Network anchor creation failed + // NEEDS_ATTENTION - Network anchor is in temporary bad state + // UPDATING - Network anchor is getting updated. + // DELETING - Network anchor is getting deleted + // DELETED - A connected network anchor is deleted. + NetworkAnchorConnectionStatus OciNetworkMetadataNetworkAnchorConnectionStatusEnum `mandatory:"true" json:"networkAnchorConnectionStatus"` + + Vcn *OciVcn `mandatory:"false" json:"vcn"` + + Dns *OciDns `mandatory:"false" json:"dns"` + + // Network subnets + Subnets []OciNetworkSubnet `mandatory:"false" json:"subnets"` + + // The DNS Listener Endpoint Address. + DnsListeningEndpointIpAddress *string `mandatory:"false" json:"dnsListeningEndpointIpAddress"` + + // The DNS Listener Forwarding Address. + DnsForwardingEndpointIpAddress *string `mandatory:"false" json:"dnsForwardingEndpointIpAddress"` + + // DNS forward configuration + DnsForwardingConfig []map[string]string `mandatory:"false" json:"dnsForwardingConfig"` +} + +func (m OciNetworkMetadata) 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 OciNetworkMetadata) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOciNetworkMetadataNetworkAnchorConnectionStatusEnum(string(m.NetworkAnchorConnectionStatus)); !ok && m.NetworkAnchorConnectionStatus != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NetworkAnchorConnectionStatus: %s. Supported values are: %s.", m.NetworkAnchorConnectionStatus, strings.Join(GetOciNetworkMetadataNetworkAnchorConnectionStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OciNetworkMetadataNetworkAnchorConnectionStatusEnum Enum with underlying type: string +type OciNetworkMetadataNetworkAnchorConnectionStatusEnum string + +// Set of constants representing the allowable values for OciNetworkMetadataNetworkAnchorConnectionStatusEnum +const ( + OciNetworkMetadataNetworkAnchorConnectionStatusConnected OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "CONNECTED" + OciNetworkMetadataNetworkAnchorConnectionStatusDisconnected OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "DISCONNECTED" + OciNetworkMetadataNetworkAnchorConnectionStatusConnecting OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "CONNECTING" + OciNetworkMetadataNetworkAnchorConnectionStatusActive OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "ACTIVE" + OciNetworkMetadataNetworkAnchorConnectionStatusError OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "ERROR" + OciNetworkMetadataNetworkAnchorConnectionStatusUpdating OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "UPDATING" + OciNetworkMetadataNetworkAnchorConnectionStatusNeedsAttention OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "NEEDS_ATTENTION" + OciNetworkMetadataNetworkAnchorConnectionStatusFailed OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "FAILED" + OciNetworkMetadataNetworkAnchorConnectionStatusDeleting OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "DELETING" + OciNetworkMetadataNetworkAnchorConnectionStatusDeleted OciNetworkMetadataNetworkAnchorConnectionStatusEnum = "DELETED" +) + +var mappingOciNetworkMetadataNetworkAnchorConnectionStatusEnum = map[string]OciNetworkMetadataNetworkAnchorConnectionStatusEnum{ + "CONNECTED": OciNetworkMetadataNetworkAnchorConnectionStatusConnected, + "DISCONNECTED": OciNetworkMetadataNetworkAnchorConnectionStatusDisconnected, + "CONNECTING": OciNetworkMetadataNetworkAnchorConnectionStatusConnecting, + "ACTIVE": OciNetworkMetadataNetworkAnchorConnectionStatusActive, + "ERROR": OciNetworkMetadataNetworkAnchorConnectionStatusError, + "UPDATING": OciNetworkMetadataNetworkAnchorConnectionStatusUpdating, + "NEEDS_ATTENTION": OciNetworkMetadataNetworkAnchorConnectionStatusNeedsAttention, + "FAILED": OciNetworkMetadataNetworkAnchorConnectionStatusFailed, + "DELETING": OciNetworkMetadataNetworkAnchorConnectionStatusDeleting, + "DELETED": OciNetworkMetadataNetworkAnchorConnectionStatusDeleted, +} + +var mappingOciNetworkMetadataNetworkAnchorConnectionStatusEnumLowerCase = map[string]OciNetworkMetadataNetworkAnchorConnectionStatusEnum{ + "connected": OciNetworkMetadataNetworkAnchorConnectionStatusConnected, + "disconnected": OciNetworkMetadataNetworkAnchorConnectionStatusDisconnected, + "connecting": OciNetworkMetadataNetworkAnchorConnectionStatusConnecting, + "active": OciNetworkMetadataNetworkAnchorConnectionStatusActive, + "error": OciNetworkMetadataNetworkAnchorConnectionStatusError, + "updating": OciNetworkMetadataNetworkAnchorConnectionStatusUpdating, + "needs_attention": OciNetworkMetadataNetworkAnchorConnectionStatusNeedsAttention, + "failed": OciNetworkMetadataNetworkAnchorConnectionStatusFailed, + "deleting": OciNetworkMetadataNetworkAnchorConnectionStatusDeleting, + "deleted": OciNetworkMetadataNetworkAnchorConnectionStatusDeleted, +} + +// GetOciNetworkMetadataNetworkAnchorConnectionStatusEnumValues Enumerates the set of values for OciNetworkMetadataNetworkAnchorConnectionStatusEnum +func GetOciNetworkMetadataNetworkAnchorConnectionStatusEnumValues() []OciNetworkMetadataNetworkAnchorConnectionStatusEnum { + values := make([]OciNetworkMetadataNetworkAnchorConnectionStatusEnum, 0) + for _, v := range mappingOciNetworkMetadataNetworkAnchorConnectionStatusEnum { + values = append(values, v) + } + return values +} + +// GetOciNetworkMetadataNetworkAnchorConnectionStatusEnumStringValues Enumerates the set of values in String for OciNetworkMetadataNetworkAnchorConnectionStatusEnum +func GetOciNetworkMetadataNetworkAnchorConnectionStatusEnumStringValues() []string { + return []string{ + "CONNECTED", + "DISCONNECTED", + "CONNECTING", + "ACTIVE", + "ERROR", + "UPDATING", + "NEEDS_ATTENTION", + "FAILED", + "DELETING", + "DELETED", + } +} + +// GetMappingOciNetworkMetadataNetworkAnchorConnectionStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOciNetworkMetadataNetworkAnchorConnectionStatusEnum(val string) (OciNetworkMetadataNetworkAnchorConnectionStatusEnum, bool) { + enum, ok := mappingOciNetworkMetadataNetworkAnchorConnectionStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_network_subnet.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_network_subnet.go new file mode 100644 index 00000000000..0dcac830c2b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_network_subnet.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciNetworkSubnet Oracle Cloud Infrastructure network subnet object. +type OciNetworkSubnet struct { + + // Defines if the subnet is the primary or backup for the network + Type OciNetworkSubnetTypeEnum `mandatory:"true" json:"type"` + + // OCID for existing the subnet. CSP can not set this property. + SubnetId *string `mandatory:"false" json:"subnetId"` + + // Subnet label. CSP can set this property + Label *string `mandatory:"false" json:"label"` +} + +func (m OciNetworkSubnet) 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 OciNetworkSubnet) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOciNetworkSubnetTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetOciNetworkSubnetTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// OciNetworkSubnetTypeEnum Enum with underlying type: string +type OciNetworkSubnetTypeEnum string + +// Set of constants representing the allowable values for OciNetworkSubnetTypeEnum +const ( + OciNetworkSubnetTypeClient OciNetworkSubnetTypeEnum = "CLIENT" + OciNetworkSubnetTypeBackup OciNetworkSubnetTypeEnum = "BACKUP" +) + +var mappingOciNetworkSubnetTypeEnum = map[string]OciNetworkSubnetTypeEnum{ + "CLIENT": OciNetworkSubnetTypeClient, + "BACKUP": OciNetworkSubnetTypeBackup, +} + +var mappingOciNetworkSubnetTypeEnumLowerCase = map[string]OciNetworkSubnetTypeEnum{ + "client": OciNetworkSubnetTypeClient, + "backup": OciNetworkSubnetTypeBackup, +} + +// GetOciNetworkSubnetTypeEnumValues Enumerates the set of values for OciNetworkSubnetTypeEnum +func GetOciNetworkSubnetTypeEnumValues() []OciNetworkSubnetTypeEnum { + values := make([]OciNetworkSubnetTypeEnum, 0) + for _, v := range mappingOciNetworkSubnetTypeEnum { + values = append(values, v) + } + return values +} + +// GetOciNetworkSubnetTypeEnumStringValues Enumerates the set of values in String for OciNetworkSubnetTypeEnum +func GetOciNetworkSubnetTypeEnumStringValues() []string { + return []string{ + "CLIENT", + "BACKUP", + } +} + +// GetMappingOciNetworkSubnetTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOciNetworkSubnetTypeEnum(val string) (OciNetworkSubnetTypeEnum, bool) { + enum, ok := mappingOciNetworkSubnetTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_vcn.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_vcn.go new file mode 100644 index 00000000000..cc00475fa5f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/oci_vcn.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OciVcn Oracle Cloud Infrastructure VCN basic information object. It is optional and planned to used for future for network anchor +type OciVcn struct { + + // Oracle Cloud Infrastructure VCN OCID. CSP can not set this property. + VcnId *string `mandatory:"false" json:"vcnId"` + + // Oracle Cloud Infrastructure primary cidr block. CSP can set this property + // It's optional only if disconnect anchor is allowed + // IPv4 CIDR blocks for the VCN that meet the following criteria + // Type: [string (length: 1–32), ...] + // The CIDR blocks must be valid. + // They must not overlap with each other or with the on-premises network CIDR block. + CidrBlocks []string `mandatory:"false" json:"cidrBlocks"` + + // Oracle Cloud Infrastructure backup cidr block. CSP can set this property + // It's optional only if disconnect anchor is allowed. + // IPv4 CIDR blocks for the VCN that meet the following criteria + // Type: [string (length: 1–32), ...] + // The CIDR blocks must be valid. + // They must not overlap with each other or with the on-premises network CIDR block. + BackupCidrBlocks []string `mandatory:"false" json:"backupCidrBlocks"` + + // Oracle Cloud Infrastructure DNS label. This is optional if DNS config is provided. + DnsLabel *string `mandatory:"false" json:"dnsLabel"` +} + +func (m OciVcn) 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 OciVcn) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/om_hub_cp.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/om_hub_cp.go new file mode 100644 index 00000000000..dc959a7de88 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/om_hub_cp.go @@ -0,0 +1,37 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OmHubCp OmHubCp service resource. +type OmHubCp struct { + Properties *Properties `mandatory:"true" json:"properties"` +} + +func (m OmHubCp) 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 OmHubCp) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/properties.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/properties.go new file mode 100644 index 00000000000..bb4c15b8d64 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/properties.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Properties Object containing the message to send. +type Properties struct { + + // Message to send + Message *string `mandatory:"true" json:"message"` +} + +func (m Properties) 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 Properties) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor.go new file mode 100644 index 00000000000..76c6789654b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor.go @@ -0,0 +1,276 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnchor A ResourceAnchor is a description of a ResourceAnchor. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to +// an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.oracle.com/iaas/Content/Identity/policiesgs/get-started-with-policies.htm). +type ResourceAnchor struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnchor. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the ResourceAnchor was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the ResourceAnchor. + LifecycleState ResourceAnchorLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"true" json:"systemTags"` + + // Oracle Cloud Infrastructure Subscription Id + SubscriptionId *string `mandatory:"true" json:"subscriptionId"` + + // OCI Region that resource is created. + Region *string `mandatory:"false" json:"region"` + + // The date and time the ResourceAnchor was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the ResourceAnchor in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // AUTO_BIND - when passed compartment will be created on-behalf of customer and bind to this resource anchor + // NO_AUTO_BIND - compartment will not be created and later customer can bind existing compartment. + // to this resource anchor. This is for future use only + SetupMode ResourceAnchorSetupModeEnum `mandatory:"false" json:"setupMode,omitempty"` + + // Optional - Oracle Cloud Infrastructure compartment Id (OCID) which was created or linked by customer with resource anchor. + // This compartmentId is different from where resource Anchor live. + LinkedCompartmentId *string `mandatory:"false" json:"linkedCompartmentId"` + + // subscription type + SubscriptionType SubscriptionTypeEnum `mandatory:"false" json:"subscriptionType,omitempty"` + + CloudServiceProviderMetadataItem CloudServiceProviderMetadataItem `mandatory:"false" json:"cloudServiceProviderMetadataItem"` +} + +func (m ResourceAnchor) 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 ResourceAnchor) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceAnchorLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResourceAnchorLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingResourceAnchorSetupModeEnum(string(m.SetupMode)); !ok && m.SetupMode != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SetupMode: %s. Supported values are: %s.", m.SetupMode, strings.Join(GetResourceAnchorSetupModeEnumStringValues(), ","))) + } + if _, ok := GetMappingSubscriptionTypeEnum(string(m.SubscriptionType)); !ok && m.SubscriptionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubscriptionType: %s. Supported values are: %s.", m.SubscriptionType, strings.Join(GetSubscriptionTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ResourceAnchor) UnmarshalJSON(data []byte) (e error) { + model := struct { + Region *string `json:"region"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleDetails *string `json:"lifecycleDetails"` + SetupMode ResourceAnchorSetupModeEnum `json:"setupMode"` + LinkedCompartmentId *string `json:"linkedCompartmentId"` + SubscriptionType SubscriptionTypeEnum `json:"subscriptionType"` + CloudServiceProviderMetadataItem cloudserviceprovidermetadataitem `json:"cloudServiceProviderMetadataItem"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + CompartmentId *string `json:"compartmentId"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState ResourceAnchorLifecycleStateEnum `json:"lifecycleState"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + SubscriptionId *string `json:"subscriptionId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Region = model.Region + + m.TimeUpdated = model.TimeUpdated + + m.LifecycleDetails = model.LifecycleDetails + + m.SetupMode = model.SetupMode + + m.LinkedCompartmentId = model.LinkedCompartmentId + + m.SubscriptionType = model.SubscriptionType + + nn, e = model.CloudServiceProviderMetadataItem.UnmarshalPolymorphicJSON(model.CloudServiceProviderMetadataItem.JsonData) + if e != nil { + return + } + if nn != nil { + m.CloudServiceProviderMetadataItem = nn.(CloudServiceProviderMetadataItem) + } else { + m.CloudServiceProviderMetadataItem = nil + } + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.CompartmentId = model.CompartmentId + + m.TimeCreated = model.TimeCreated + + m.LifecycleState = model.LifecycleState + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.SubscriptionId = model.SubscriptionId + + return +} + +// ResourceAnchorLifecycleStateEnum Enum with underlying type: string +type ResourceAnchorLifecycleStateEnum string + +// Set of constants representing the allowable values for ResourceAnchorLifecycleStateEnum +const ( + ResourceAnchorLifecycleStateCreating ResourceAnchorLifecycleStateEnum = "CREATING" + ResourceAnchorLifecycleStateUpdating ResourceAnchorLifecycleStateEnum = "UPDATING" + ResourceAnchorLifecycleStateActive ResourceAnchorLifecycleStateEnum = "ACTIVE" + ResourceAnchorLifecycleStateDeleting ResourceAnchorLifecycleStateEnum = "DELETING" + ResourceAnchorLifecycleStateDeleted ResourceAnchorLifecycleStateEnum = "DELETED" + ResourceAnchorLifecycleStateFailed ResourceAnchorLifecycleStateEnum = "FAILED" +) + +var mappingResourceAnchorLifecycleStateEnum = map[string]ResourceAnchorLifecycleStateEnum{ + "CREATING": ResourceAnchorLifecycleStateCreating, + "UPDATING": ResourceAnchorLifecycleStateUpdating, + "ACTIVE": ResourceAnchorLifecycleStateActive, + "DELETING": ResourceAnchorLifecycleStateDeleting, + "DELETED": ResourceAnchorLifecycleStateDeleted, + "FAILED": ResourceAnchorLifecycleStateFailed, +} + +var mappingResourceAnchorLifecycleStateEnumLowerCase = map[string]ResourceAnchorLifecycleStateEnum{ + "creating": ResourceAnchorLifecycleStateCreating, + "updating": ResourceAnchorLifecycleStateUpdating, + "active": ResourceAnchorLifecycleStateActive, + "deleting": ResourceAnchorLifecycleStateDeleting, + "deleted": ResourceAnchorLifecycleStateDeleted, + "failed": ResourceAnchorLifecycleStateFailed, +} + +// GetResourceAnchorLifecycleStateEnumValues Enumerates the set of values for ResourceAnchorLifecycleStateEnum +func GetResourceAnchorLifecycleStateEnumValues() []ResourceAnchorLifecycleStateEnum { + values := make([]ResourceAnchorLifecycleStateEnum, 0) + for _, v := range mappingResourceAnchorLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetResourceAnchorLifecycleStateEnumStringValues Enumerates the set of values in String for ResourceAnchorLifecycleStateEnum +func GetResourceAnchorLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingResourceAnchorLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceAnchorLifecycleStateEnum(val string) (ResourceAnchorLifecycleStateEnum, bool) { + enum, ok := mappingResourceAnchorLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ResourceAnchorSetupModeEnum Enum with underlying type: string +type ResourceAnchorSetupModeEnum string + +// Set of constants representing the allowable values for ResourceAnchorSetupModeEnum +const ( + ResourceAnchorSetupModeAutoBind ResourceAnchorSetupModeEnum = "AUTO_BIND" + ResourceAnchorSetupModeNoAutoBind ResourceAnchorSetupModeEnum = "NO_AUTO_BIND" +) + +var mappingResourceAnchorSetupModeEnum = map[string]ResourceAnchorSetupModeEnum{ + "AUTO_BIND": ResourceAnchorSetupModeAutoBind, + "NO_AUTO_BIND": ResourceAnchorSetupModeNoAutoBind, +} + +var mappingResourceAnchorSetupModeEnumLowerCase = map[string]ResourceAnchorSetupModeEnum{ + "auto_bind": ResourceAnchorSetupModeAutoBind, + "no_auto_bind": ResourceAnchorSetupModeNoAutoBind, +} + +// GetResourceAnchorSetupModeEnumValues Enumerates the set of values for ResourceAnchorSetupModeEnum +func GetResourceAnchorSetupModeEnumValues() []ResourceAnchorSetupModeEnum { + values := make([]ResourceAnchorSetupModeEnum, 0) + for _, v := range mappingResourceAnchorSetupModeEnum { + values = append(values, v) + } + return values +} + +// GetResourceAnchorSetupModeEnumStringValues Enumerates the set of values in String for ResourceAnchorSetupModeEnum +func GetResourceAnchorSetupModeEnumStringValues() []string { + return []string{ + "AUTO_BIND", + "NO_AUTO_BIND", + } +} + +// GetMappingResourceAnchorSetupModeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceAnchorSetupModeEnum(val string) (ResourceAnchorSetupModeEnum, bool) { + enum, ok := mappingResourceAnchorSetupModeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor_collection.go new file mode 100644 index 00000000000..b396025bacd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnchorCollection Results of a resourceAnchor search. Contains both ResourceAnchorSummary items and other information, such as metadata. +type ResourceAnchorCollection struct { + + // List of resourceAnchors. + Items []ResourceAnchorSummary `mandatory:"true" json:"items"` +} + +func (m ResourceAnchorCollection) 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 ResourceAnchorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor_summary.go new file mode 100644 index 00000000000..ad8ccc0d3d0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/resource_anchor_summary.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnchorSummary Summary information about a ResourceAnchor. +type ResourceAnchorSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnchor. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the ResourceAnchor was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the ResourceAnchor. + LifecycleState ResourceAnchorLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // Oracle Cloud Infrastructure Subscription Id + SubscriptionId *string `mandatory:"true" json:"subscriptionId"` + + // The date and time the ResourceAnchor was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the ResourceAnchor in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ResourceAnchorSummary) 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 ResourceAnchorSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceAnchorLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResourceAnchorLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/sort_order.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/sort_order.go new file mode 100644 index 00000000000..79848187d34 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/sort_order.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "strings" +) + +// SortOrderEnum Enum with underlying type: string +type SortOrderEnum string + +// Set of constants representing the allowable values for SortOrderEnum +const ( + SortOrderAsc SortOrderEnum = "ASC" + SortOrderDesc SortOrderEnum = "DESC" +) + +var mappingSortOrderEnum = map[string]SortOrderEnum{ + "ASC": SortOrderAsc, + "DESC": SortOrderDesc, +} + +var mappingSortOrderEnumLowerCase = map[string]SortOrderEnum{ + "asc": SortOrderAsc, + "desc": SortOrderDesc, +} + +// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum +func GetSortOrderEnumValues() []SortOrderEnum { + values := make([]SortOrderEnum, 0) + for _, v := range mappingSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSortOrderEnumStringValues Enumerates the set of values in String for SortOrderEnum +func GetSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrderEnum(val string) (SortOrderEnum, bool) { + enum, ok := mappingSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/subscription_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/subscription_type.go new file mode 100644 index 00000000000..81718936ba5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/multicloud/subscription_type.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Multicloud API +// +// Use the Oracle Multicloud API to retrieve resource anchors and network anchors, and the metadata mappings related a Cloud Service Provider. For more information, see . +// + +package multicloud + +import ( + "strings" +) + +// SubscriptionTypeEnum Enum with underlying type: string +type SubscriptionTypeEnum string + +// Set of constants representing the allowable values for SubscriptionTypeEnum +const ( + SubscriptionTypeOracledbatazure SubscriptionTypeEnum = "ORACLEDBATAZURE" + SubscriptionTypeOracledbatgoogle SubscriptionTypeEnum = "ORACLEDBATGOOGLE" + SubscriptionTypeOracledbataws SubscriptionTypeEnum = "ORACLEDBATAWS" +) + +var mappingSubscriptionTypeEnum = map[string]SubscriptionTypeEnum{ + "ORACLEDBATAZURE": SubscriptionTypeOracledbatazure, + "ORACLEDBATGOOGLE": SubscriptionTypeOracledbatgoogle, + "ORACLEDBATAWS": SubscriptionTypeOracledbataws, +} + +var mappingSubscriptionTypeEnumLowerCase = map[string]SubscriptionTypeEnum{ + "oracledbatazure": SubscriptionTypeOracledbatazure, + "oracledbatgoogle": SubscriptionTypeOracledbatgoogle, + "oracledbataws": SubscriptionTypeOracledbataws, +} + +// GetSubscriptionTypeEnumValues Enumerates the set of values for SubscriptionTypeEnum +func GetSubscriptionTypeEnumValues() []SubscriptionTypeEnum { + values := make([]SubscriptionTypeEnum, 0) + for _, v := range mappingSubscriptionTypeEnum { + values = append(values, v) + } + return values +} + +// GetSubscriptionTypeEnumStringValues Enumerates the set of values in String for SubscriptionTypeEnum +func GetSubscriptionTypeEnumStringValues() []string { + return []string{ + "ORACLEDBATAZURE", + "ORACLEDBATGOOGLE", + "ORACLEDBATAWS", + } +} + +// GetMappingSubscriptionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSubscriptionTypeEnum(val string) (SubscriptionTypeEnum, bool) { + enum, ok := mappingSubscriptionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_block_volume_to_datastore_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_block_volume_to_datastore_details.go new file mode 100644 index 00000000000..d3ea1e4dc80 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_block_volume_to_datastore_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddBlockVolumeToDatastoreDetails Details for the Block Volume addition to the datastore +type AddBlockVolumeToDatastoreDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Block Volume to be added to the Datastore. + BlockVolumeId *string `mandatory:"true" json:"blockVolumeId"` +} + +func (m AddBlockVolumeToDatastoreDetails) 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 AddBlockVolumeToDatastoreDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_block_volume_to_datastore_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_block_volume_to_datastore_request_response.go new file mode 100644 index 00000000000..1fe7c046dfa --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_block_volume_to_datastore_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddBlockVolumeToDatastoreRequest wrapper for the AddBlockVolumeToDatastore operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AddBlockVolumeToDatastore.go.html to see an example of how to use AddBlockVolumeToDatastoreRequest. +type AddBlockVolumeToDatastoreRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + DatastoreId *string `mandatory:"true" contributesTo:"path" name:"datastoreId"` + + // The information about Block Volume addition to datastore. + AddBlockVolumeToDatastoreDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 AddBlockVolumeToDatastoreRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddBlockVolumeToDatastoreRequest) 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 AddBlockVolumeToDatastoreRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddBlockVolumeToDatastoreRequest) 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 AddBlockVolumeToDatastoreRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddBlockVolumeToDatastoreResponse wrapper for the AddBlockVolumeToDatastore operation +type AddBlockVolumeToDatastoreResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response AddBlockVolumeToDatastoreResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddBlockVolumeToDatastoreResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_datastore_to_datastore_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_datastore_to_datastore_cluster_details.go new file mode 100644 index 00000000000..a2029c4281e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_datastore_to_datastore_cluster_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddDatastoreToDatastoreClusterDetails Details for the datastore attachment to Datastore Cluster. +type AddDatastoreToDatastoreClusterDetails struct { + + // A list of datastores to be added. + DatastoreIds []string `mandatory:"true" json:"datastoreIds"` +} + +func (m AddDatastoreToDatastoreClusterDetails) 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 AddDatastoreToDatastoreClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_datastore_to_datastore_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_datastore_to_datastore_cluster_request_response.go new file mode 100644 index 00000000000..9cafaaa9f15 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/add_datastore_to_datastore_cluster_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddDatastoreToDatastoreClusterRequest wrapper for the AddDatastoreToDatastoreCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AddDatastoreToDatastoreCluster.go.html to see an example of how to use AddDatastoreToDatastoreClusterRequest. +type AddDatastoreToDatastoreClusterRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // The information about datastore addition to the Datastore Cluster. + AddDatastoreToDatastoreClusterDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 AddDatastoreToDatastoreClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddDatastoreToDatastoreClusterRequest) 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 AddDatastoreToDatastoreClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddDatastoreToDatastoreClusterRequest) 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 AddDatastoreToDatastoreClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddDatastoreToDatastoreClusterResponse wrapper for the AddDatastoreToDatastoreCluster operation +type AddDatastoreToDatastoreClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response AddDatastoreToDatastoreClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddDatastoreToDatastoreClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_cluster_details.go new file mode 100644 index 00000000000..5870d91f7dd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_cluster_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttachDatastoreClusterToClusterDetails Details for the datastore cluster attachment to Vmware Cluster. +type AttachDatastoreClusterToClusterDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware cluster to attach the + // datastore cluster to. + ClusterId *string `mandatory:"true" json:"clusterId"` +} + +func (m AttachDatastoreClusterToClusterDetails) 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 AttachDatastoreClusterToClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_cluster_request_response.go new file mode 100644 index 00000000000..598b60bdc8b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_cluster_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AttachDatastoreClusterToClusterRequest wrapper for the AttachDatastoreClusterToCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AttachDatastoreClusterToCluster.go.html to see an example of how to use AttachDatastoreClusterToClusterRequest. +type AttachDatastoreClusterToClusterRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // The information about Datastore Cluster attachment. + AttachDatastoreClusterToClusterDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 AttachDatastoreClusterToClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachDatastoreClusterToClusterRequest) 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 AttachDatastoreClusterToClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachDatastoreClusterToClusterRequest) 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 AttachDatastoreClusterToClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttachDatastoreClusterToClusterResponse wrapper for the AttachDatastoreClusterToCluster operation +type AttachDatastoreClusterToClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response AttachDatastoreClusterToClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachDatastoreClusterToClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_esxi_host_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_esxi_host_details.go new file mode 100644 index 00000000000..fe031dacf6b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_esxi_host_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AttachDatastoreClusterToEsxiHostDetails Details for the datastore cluster attachment to ESXi hosts. +type AttachDatastoreClusterToEsxiHostDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi host to attach the + // datastore cluster to. + EsxiHostId *string `mandatory:"true" json:"esxiHostId"` +} + +func (m AttachDatastoreClusterToEsxiHostDetails) 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 AttachDatastoreClusterToEsxiHostDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_esxi_host_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_esxi_host_request_response.go new file mode 100644 index 00000000000..837e96cb18b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/attach_datastore_cluster_to_esxi_host_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AttachDatastoreClusterToEsxiHostRequest wrapper for the AttachDatastoreClusterToEsxiHost operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AttachDatastoreClusterToEsxiHost.go.html to see an example of how to use AttachDatastoreClusterToEsxiHostRequest. +type AttachDatastoreClusterToEsxiHostRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // The information about Datastore Cluster attachment. + AttachDatastoreClusterToEsxiHostDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 AttachDatastoreClusterToEsxiHostRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AttachDatastoreClusterToEsxiHostRequest) 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 AttachDatastoreClusterToEsxiHostRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AttachDatastoreClusterToEsxiHostRequest) 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 AttachDatastoreClusterToEsxiHostRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AttachDatastoreClusterToEsxiHostResponse wrapper for the AttachDatastoreClusterToEsxiHost operation +type AttachDatastoreClusterToEsxiHostResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response AttachDatastoreClusterToEsxiHostResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AttachDatastoreClusterToEsxiHostResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/block_volume_attachment.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/block_volume_attachment.go new file mode 100644 index 00000000000..ad24d183008 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/block_volume_attachment.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BlockVolumeAttachment The details about the attachment of block volume. +type BlockVolumeAttachment struct { + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi host that block volume is attached to. + EsxiHostId *string `mandatory:"true" json:"esxiHostId"` + + // The IP address of block volume attachment. + IpAddress *string `mandatory:"true" json:"ipAddress"` + + // The port of block volume attachment. + Port *int `mandatory:"true" json:"port"` +} + +func (m BlockVolumeAttachment) 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 BlockVolumeAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/block_volume_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/block_volume_details.go new file mode 100644 index 00000000000..2e573525160 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/block_volume_details.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// BlockVolumeDetails Block volume that is part of the Datastore. +type BlockVolumeDetails struct { + + // An OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Block Storage Volume. + Id *string `mandatory:"true" json:"id"` + + // An IQN of the Block Storage Volume. + Iqn *string `mandatory:"false" json:"iqn"` + + // List of BlockVolumeAttachment objects containing information about attachment details + Attachments []BlockVolumeAttachment `mandatory:"false" json:"attachments"` +} + +func (m BlockVolumeDetails) 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 BlockVolumeDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_cluster_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_cluster_compartment_details.go new file mode 100644 index 00000000000..4a8cf3865c9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_cluster_compartment_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeDatastoreClusterCompartmentDetails The configuration details for the move operation. +type ChangeDatastoreClusterCompartmentDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move + // the Datastore Cluster to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeDatastoreClusterCompartmentDetails) 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 ChangeDatastoreClusterCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_cluster_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_cluster_compartment_request_response.go new file mode 100644 index 00000000000..cf27294b675 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_cluster_compartment_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeDatastoreClusterCompartmentRequest wrapper for the ChangeDatastoreClusterCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ChangeDatastoreClusterCompartment.go.html to see an example of how to use ChangeDatastoreClusterCompartmentRequest. +type ChangeDatastoreClusterCompartmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // Request to change the compartment of the specified Datastore Cluster. + ChangeDatastoreClusterCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 ChangeDatastoreClusterCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeDatastoreClusterCompartmentRequest) 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 ChangeDatastoreClusterCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeDatastoreClusterCompartmentRequest) 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 ChangeDatastoreClusterCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeDatastoreClusterCompartmentResponse wrapper for the ChangeDatastoreClusterCompartment operation +type ChangeDatastoreClusterCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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"` +} + +func (response ChangeDatastoreClusterCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeDatastoreClusterCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_compartment_details.go new file mode 100644 index 00000000000..6ebbac4fb3d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_compartment_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeDatastoreCompartmentDetails The configuration details for the move operation. +type ChangeDatastoreCompartmentDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move + // the Datastore to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeDatastoreCompartmentDetails) 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 ChangeDatastoreCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_compartment_request_response.go new file mode 100644 index 00000000000..b4c28d4b9d7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/change_datastore_compartment_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeDatastoreCompartmentRequest wrapper for the ChangeDatastoreCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ChangeDatastoreCompartment.go.html to see an example of how to use ChangeDatastoreCompartmentRequest. +type ChangeDatastoreCompartmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + DatastoreId *string `mandatory:"true" contributesTo:"path" name:"datastoreId"` + + // Request to change the compartment of the specified Datastore + ChangeDatastoreCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique 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"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // 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 ChangeDatastoreCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeDatastoreCompartmentRequest) 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 ChangeDatastoreCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeDatastoreCompartmentRequest) 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 ChangeDatastoreCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeDatastoreCompartmentResponse wrapper for the ChangeDatastoreCompartment operation +type ChangeDatastoreCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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"` +} + +func (response ChangeDatastoreCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeDatastoreCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/cluster.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/cluster.go index 3a16dc6904d..ff759a01953 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/cluster.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/cluster.go @@ -141,6 +141,9 @@ type Cluster struct { // Datastores used for the Cluster. Datastores []DatastoreDetails `mandatory:"false" json:"datastores"` + // A list of datastore clusters. + DatastoreClusterIds []string `mandatory:"false" json:"datastoreClusterIds"` + // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{orcl-cloud: {free-tier-retain: true}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_cluster_details.go index 42cd6defee7..4829cc3c095 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_cluster_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_cluster_details.go @@ -37,7 +37,7 @@ type CreateClusterDetails struct { NetworkConfiguration *NetworkConfiguration `mandatory:"true" json:"networkConfiguration"` // A descriptive name for the Cluster. - // Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. + // Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` @@ -72,6 +72,9 @@ type CreateClusterDetails struct { // This value is required only when `initialHostShapeName` is a standard shape. Datastores []DatastoreInfo `mandatory:"false" json:"datastores"` + // A list of datastore clusters. + DatastoreClusterIds []string `mandatory:"false" json:"datastoreClusterIds"` + // The VMware software bundle to install on the ESXi hosts in the Cluster. To get a list of the available versions, use // ListSupportedVmwareSoftwareVersions. VmwareSoftwareVersion *string `mandatory:"false" json:"vmwareSoftwareVersion"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_cluster_details.go new file mode 100644 index 00000000000..ab0b4389163 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_cluster_details.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDatastoreClusterDetails Details of the Datastore Cluster. +type CreateDatastoreClusterDetails struct { + + // A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to contain the Datastore Cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Type of the datastore. + DatastoreClusterType DatastoreClusterTypesEnum `mandatory:"true" json:"datastoreClusterType"` + + // The availability domain to create the Datastore Cluster in. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastores that belong to the Datastore Cluster. + DatastoreIds []string `mandatory:"false" json:"datastoreIds"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateDatastoreClusterDetails) 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 CreateDatastoreClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDatastoreClusterTypesEnum(string(m.DatastoreClusterType)); !ok && m.DatastoreClusterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DatastoreClusterType: %s. Supported values are: %s.", m.DatastoreClusterType, strings.Join(GetDatastoreClusterTypesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_cluster_request_response.go new file mode 100644 index 00000000000..7539246b8f3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_cluster_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDatastoreClusterRequest wrapper for the CreateDatastoreCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/CreateDatastoreCluster.go.html to see an example of how to use CreateDatastoreClusterRequest. +type CreateDatastoreClusterRequest struct { + + // Details for the Datastore Cluster. + CreateDatastoreClusterDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 CreateDatastoreClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDatastoreClusterRequest) 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 CreateDatastoreClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDatastoreClusterRequest) 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 CreateDatastoreClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDatastoreClusterResponse wrapper for the CreateDatastoreCluster operation +type CreateDatastoreClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response CreateDatastoreClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDatastoreClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_details.go new file mode 100644 index 00000000000..72f645b4ff5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_details.go @@ -0,0 +1,65 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDatastoreDetails Details of the Datastore +type CreateDatastoreDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to contain the Datastore. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The List of Block volume OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s that belong to the Datastore. + BlockVolumeIds []string `mandatory:"true" json:"blockVolumeIds"` + + // A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The availability domain to create the Datastore in. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the datastore cluster that + // Datastore belongs to. + DatastoreClusterId *string `mandatory:"false" json:"datastoreClusterId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateDatastoreDetails) 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 CreateDatastoreDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_request_response.go new file mode 100644 index 00000000000..9fab3ec6715 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_datastore_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDatastoreRequest wrapper for the CreateDatastore operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/CreateDatastore.go.html to see an example of how to use CreateDatastoreRequest. +type CreateDatastoreRequest struct { + + // Details for the Datastore. + CreateDatastoreDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 CreateDatastoreRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDatastoreRequest) 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 CreateDatastoreRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDatastoreRequest) 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 CreateDatastoreRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDatastoreResponse wrapper for the CreateDatastore operation +type CreateDatastoreResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response CreateDatastoreResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDatastoreResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_esxi_host_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_esxi_host_details.go index 8c74e4064e5..c91a22fe6e6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_esxi_host_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/create_esxi_host_details.go @@ -23,7 +23,7 @@ type CreateEsxiHostDetails struct { ClusterId *string `mandatory:"true" json:"clusterId"` // A descriptive name for the ESXi host. It's changeable. - // Esxi Host name requirements are 1-16 character length limit, Must start with a letter, + // Esxi Host name requirements are 1-25 character length limit, Must start with a letter, // Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the Cluster. // If this attribute is not specified, the Cluster's `instanceDisplayNamePrefix` attribute is used // to name and incrementally number the ESXi host. For example, if you're creating the fourth diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore.go new file mode 100644 index 00000000000..ca0b5b69b73 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Datastore An Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm) Datastore for software-defined data center. +type Datastore struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + Id *string `mandatory:"true" json:"id"` + + // The List of Block volume OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s that belong to the Datastore. + BlockVolumeIds []string `mandatory:"true" json:"blockVolumeIds"` + + // The list of Block Volume details that belong to the datastore. + BlockVolumeDetails []BlockVolumeDetails `mandatory:"true" json:"blockVolumeDetails"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that + // contains the Datastore. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time the Datastore was created, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the Datastore was updated, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The current state of the Datastore. + LifecycleState LifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` + + // The availability domain of the Datastore. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the datastore cluster that + // Datastore belongs to. + DatastoreClusterId *string `mandatory:"false" json:"datastoreClusterId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore is attached to. + ClusterId *string `mandatory:"false" json:"clusterId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore is associated with. + SddcId *string `mandatory:"false" json:"sddcId"` + + // Total size of the datastore in GB. + CapacityInGBs *float64 `mandatory:"false" json:"capacityInGBs"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m Datastore) 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 Datastore) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_attachment.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_attachment.go new file mode 100644 index 00000000000..f8434203b10 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_attachment.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DatastoreAttachment The details about attachment of datastore +type DatastoreAttachment struct { + + // An IQN of the Block Storage Volume. + VolumeIqn *string `mandatory:"true" json:"volumeIqn"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Block Volume that belongs to the datastore. + BlockVolumeId *string `mandatory:"true" json:"blockVolumeId"` + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore that ESXi host is attached to. + DatastoreId *string `mandatory:"true" json:"datastoreId"` + + // The IP address of datastore attachment. + IpAddress *string `mandatory:"true" json:"ipAddress"` + + // The port of datastore attachment. + Port *int `mandatory:"true" json:"port"` +} + +func (m DatastoreAttachment) 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 DatastoreAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster.go new file mode 100644 index 00000000000..5606d5519f8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DatastoreCluster An Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm) Datastore Cluster for software-defined data center. +// The Datastore Cluster combines multiple datastores into a single datastore cluster. +type DatastoreCluster struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore cluster. + Id *string `mandatory:"true" json:"id"` + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastores that belong to the Datastore Cluster + DatastoreIds []string `mandatory:"true" json:"datastoreIds"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that + // contains the Datastore. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Type of the datastore cluster. + DatastoreClusterType DatastoreClusterTypesEnum `mandatory:"true" json:"datastoreClusterType"` + + // The date and time the Datastore Cluster was created, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the Datastore Cluster was updated, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The current state of the Datastore Cluster. + LifecycleState LifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` + + // The availability domain of the Datastore Cluster. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore cluster is attached to. + ClusterId *string `mandatory:"false" json:"clusterId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore cluster is associated with. + SddcId *string `mandatory:"false" json:"sddcId"` + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi hosts to attach the + // datastore to. All ESXi hosts must belong to the same VMware cluster. + EsxiHostIds []string `mandatory:"false" json:"esxiHostIds"` + + // Total size of all datastores associated with the datastore cluster in GB. + CapacityInGBs *float64 `mandatory:"false" json:"capacityInGBs"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m DatastoreCluster) 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 DatastoreCluster) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDatastoreClusterTypesEnum(string(m.DatastoreClusterType)); !ok && m.DatastoreClusterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DatastoreClusterType: %s. Supported values are: %s.", m.DatastoreClusterType, strings.Join(GetDatastoreClusterTypesEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster_collection.go new file mode 100644 index 00000000000..3dff2a2495a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DatastoreClusterCollection A list of Datastore Clusters. +type DatastoreClusterCollection struct { + + // A list of Datastore Clusters. + Items []DatastoreClusterSummary `mandatory:"true" json:"items"` +} + +func (m DatastoreClusterCollection) 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 DatastoreClusterCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster_summary.go new file mode 100644 index 00000000000..ae5f83f2463 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_cluster_summary.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DatastoreClusterSummary An Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm) Datastore Cluster for software-defined data center. +// The Datastore Cluster combines multiple datastores into a single datastore cluster. +type DatastoreClusterSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + Id *string `mandatory:"true" json:"id"` + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastores that belong to the Datastore Cluster + DatastoreIds []string `mandatory:"true" json:"datastoreIds"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that + // contains the Datastore Cluster. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The date and time the Datastore Cluster was created, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the Datastore Cluster. + LifecycleState LifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` + + // The availability domain of the Datastore Cluster. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore Cluster is attached to. + ClusterId *string `mandatory:"false" json:"clusterId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore Cluster is associated with. + SddcId *string `mandatory:"false" json:"sddcId"` + + // The OCIDs (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi hosts attached to Datastore Cluster. + EsxiHostIds []string `mandatory:"false" json:"esxiHostIds"` + + // Type of the datastore cluster. + DatastoreClusterType DatastoreClusterTypesEnum `mandatory:"false" json:"datastoreClusterType,omitempty"` + + // Total size of all datastores associated with the datastore cluster in GB. + CapacityInGBs *float64 `mandatory:"false" json:"capacityInGBs"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m DatastoreClusterSummary) 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 DatastoreClusterSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + + if _, ok := GetMappingDatastoreClusterTypesEnum(string(m.DatastoreClusterType)); !ok && m.DatastoreClusterType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DatastoreClusterType: %s. Supported values are: %s.", m.DatastoreClusterType, strings.Join(GetDatastoreClusterTypesEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_collection.go new file mode 100644 index 00000000000..4a2b92ea319 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_collection.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DatastoreCollection A list of Datastores. +type DatastoreCollection struct { + + // A list of Datastores. + Items []DatastoreSummary `mandatory:"true" json:"items"` +} + +func (m DatastoreCollection) 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 DatastoreCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_summary.go new file mode 100644 index 00000000000..e56aed74c48 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/datastore_summary.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DatastoreSummary An Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm) Datastore for software-defined data center. +// The Datastore can be attached to multiple ESXi hosts. +type DatastoreSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + Id *string `mandatory:"true" json:"id"` + + // The List of Block volume OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s that belong to the Datastore. + BlockVolumeIds []string `mandatory:"true" json:"blockVolumeIds"` + + // The list of Block Volume details that belong to the datastore. + BlockVolumeDetails []BlockVolumeDetails `mandatory:"true" json:"blockVolumeDetails"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that + // contains the Datastore. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The current state of the Datastore. + LifecycleState LifecycleStatesEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the SDDC was created, in the format defined by + // RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The availability domain of the Datastore. + AvailabilityDomain *string `mandatory:"true" json:"availabilityDomain"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore is attached to. + ClusterId *string `mandatory:"false" json:"clusterId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore is associated with. + SddcId *string `mandatory:"false" json:"sddcId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the datastore cluster that + // Datastore belongs to. + DatastoreClusterId *string `mandatory:"false" json:"datastoreClusterId"` + + // Total size of the datastore in GB. + CapacityInGBs *float64 `mandatory:"false" json:"capacityInGBs"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{orcl-cloud: {free-tier-retain: true}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m DatastoreSummary) 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 DatastoreSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingLifecycleStatesEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetLifecycleStatesEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/delete_datastore_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/delete_datastore_cluster_request_response.go new file mode 100644 index 00000000000..28485dbe7c3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/delete_datastore_cluster_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDatastoreClusterRequest wrapper for the DeleteDatastoreCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DeleteDatastoreCluster.go.html to see an example of how to use DeleteDatastoreClusterRequest. +type DeleteDatastoreClusterRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique 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 DeleteDatastoreClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDatastoreClusterRequest) 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 DeleteDatastoreClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDatastoreClusterRequest) 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 DeleteDatastoreClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDatastoreClusterResponse wrapper for the DeleteDatastoreCluster operation +type DeleteDatastoreClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response DeleteDatastoreClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDatastoreClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/delete_datastore_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/delete_datastore_request_response.go new file mode 100644 index 00000000000..2ab1502358c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/delete_datastore_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDatastoreRequest wrapper for the DeleteDatastore operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DeleteDatastore.go.html to see an example of how to use DeleteDatastoreRequest. +type DeleteDatastoreRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + DatastoreId *string `mandatory:"true" contributesTo:"path" name:"datastoreId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique 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 DeleteDatastoreRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDatastoreRequest) 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 DeleteDatastoreRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDatastoreRequest) 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 DeleteDatastoreRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDatastoreResponse wrapper for the DeleteDatastore operation +type DeleteDatastoreResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response DeleteDatastoreResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDatastoreResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_cluster_request_response.go new file mode 100644 index 00000000000..5192a0986b5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_cluster_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DetachDatastoreClusterFromClusterRequest wrapper for the DetachDatastoreClusterFromCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DetachDatastoreClusterFromCluster.go.html to see an example of how to use DetachDatastoreClusterFromClusterRequest. +type DetachDatastoreClusterFromClusterRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 DetachDatastoreClusterFromClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachDatastoreClusterFromClusterRequest) 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 DetachDatastoreClusterFromClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachDatastoreClusterFromClusterRequest) 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 DetachDatastoreClusterFromClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DetachDatastoreClusterFromClusterResponse wrapper for the DetachDatastoreClusterFromCluster operation +type DetachDatastoreClusterFromClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response DetachDatastoreClusterFromClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachDatastoreClusterFromClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_esxi_host_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_esxi_host_details.go new file mode 100644 index 00000000000..85714555209 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_esxi_host_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DetachDatastoreClusterFromEsxiHostDetails Details for the datastore cluster detachment from ESXi hosts. +type DetachDatastoreClusterFromEsxiHostDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi host to detach the + // datastore cluster from. + EsxiHostId *string `mandatory:"true" json:"esxiHostId"` +} + +func (m DetachDatastoreClusterFromEsxiHostDetails) 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 DetachDatastoreClusterFromEsxiHostDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_esxi_host_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_esxi_host_request_response.go new file mode 100644 index 00000000000..2cd89e2b8fd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/detach_datastore_cluster_from_esxi_host_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DetachDatastoreClusterFromEsxiHostRequest wrapper for the DetachDatastoreClusterFromEsxiHost operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DetachDatastoreClusterFromEsxiHost.go.html to see an example of how to use DetachDatastoreClusterFromEsxiHostRequest. +type DetachDatastoreClusterFromEsxiHostRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // The information about Datastore Cluster detachment. + DetachDatastoreClusterFromEsxiHostDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 DetachDatastoreClusterFromEsxiHostRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DetachDatastoreClusterFromEsxiHostRequest) 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 DetachDatastoreClusterFromEsxiHostRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DetachDatastoreClusterFromEsxiHostRequest) 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 DetachDatastoreClusterFromEsxiHostRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DetachDatastoreClusterFromEsxiHostResponse wrapper for the DetachDatastoreClusterFromEsxiHost operation +type DetachDatastoreClusterFromEsxiHostResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response DetachDatastoreClusterFromEsxiHostResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DetachDatastoreClusterFromEsxiHostResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host.go index 0de26add923..8fa23c94af7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host.go @@ -138,6 +138,12 @@ type EsxiHost struct { // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{orcl-cloud: {free-tier-retain: true}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // A list of datastore clusters. + DatastoreClusterIds []string `mandatory:"false" json:"datastoreClusterIds"` + + // List of DatastoreAttachment objects containing information about attachment details + DatastoreAttachments []DatastoreAttachment `mandatory:"false" json:"datastoreAttachments"` } func (m EsxiHost) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host_summary.go index 3c8ac0467bb..73e441e7b53 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/esxi_host_summary.go @@ -124,6 +124,9 @@ type EsxiHostSummary struct { // Indicates whether this host is in the progress of swapping billing. IsBillingSwappingInProgress *bool `mandatory:"false" json:"isBillingSwappingInProgress"` + // A list of datastore clusters. + DatastoreClusterIds []string `mandatory:"false" json:"datastoreClusterIds"` + // Usage of system tag keys. These predefined keys are scoped to namespaces. // Example: `{orcl-cloud: {free-tier-retain: true}}` SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/get_datastore_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/get_datastore_cluster_request_response.go new file mode 100644 index 00000000000..015d35157c3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/get_datastore_cluster_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDatastoreClusterRequest wrapper for the GetDatastoreCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/GetDatastoreCluster.go.html to see an example of how to use GetDatastoreClusterRequest. +type GetDatastoreClusterRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // Unique 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 GetDatastoreClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDatastoreClusterRequest) 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 GetDatastoreClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDatastoreClusterRequest) 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 GetDatastoreClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDatastoreClusterResponse wrapper for the GetDatastoreCluster operation +type GetDatastoreClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DatastoreCluster instance + DatastoreCluster `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetDatastoreClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDatastoreClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/get_datastore_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/get_datastore_request_response.go new file mode 100644 index 00000000000..ad442027baf --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/get_datastore_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDatastoreRequest wrapper for the GetDatastore operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/GetDatastore.go.html to see an example of how to use GetDatastoreRequest. +type GetDatastoreRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + DatastoreId *string `mandatory:"true" contributesTo:"path" name:"datastoreId"` + + // Unique 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 GetDatastoreRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDatastoreRequest) 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 GetDatastoreRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDatastoreRequest) 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 GetDatastoreRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDatastoreResponse wrapper for the GetDatastore operation +type GetDatastoreResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Datastore instance + Datastore `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetDatastoreResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDatastoreResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/initial_cluster_configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/initial_cluster_configuration.go index e3ef2381b60..582a06a3133 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/initial_cluster_configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/initial_cluster_configuration.go @@ -37,7 +37,7 @@ type InitialClusterConfiguration struct { NetworkConfiguration *NetworkConfiguration `mandatory:"true" json:"networkConfiguration"` // A descriptive name for the Cluster. - // Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. + // Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` @@ -71,6 +71,9 @@ type InitialClusterConfiguration struct { // A list of datastore info for the Cluster. // This value is required only when `initialHostShapeName` is a standard shape. Datastores []DatastoreInfo `mandatory:"false" json:"datastores"` + + // A list of datastore clusters. + DatastoreClusterIds []string `mandatory:"false" json:"datastoreClusterIds"` } func (m InitialClusterConfiguration) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/list_datastore_clusters_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/list_datastore_clusters_request_response.go new file mode 100644 index 00000000000..6c71d5965aa --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/list_datastore_clusters_request_response.go @@ -0,0 +1,282 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDatastoreClustersRequest wrapper for the ListDatastoreClusters operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListDatastoreClusters.go.html to see an example of how to use ListDatastoreClustersRequest. +type ListDatastoreClustersRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"false" contributesTo:"query" name:"datastoreClusterId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. + ClusterId *string `mandatory:"false" contributesTo:"query" name:"clusterId"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListDatastoreClustersSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListDatastoreClustersSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique 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"` + + // The lifecycle state of the resource. + LifecycleState ListDatastoreClustersLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // 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 ListDatastoreClustersRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDatastoreClustersRequest) 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 ListDatastoreClustersRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDatastoreClustersRequest) 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 ListDatastoreClustersRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListDatastoreClustersSortOrderEnum(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(GetListDatastoreClustersSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDatastoreClustersSortByEnum(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(GetListDatastoreClustersSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListDatastoreClustersLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetListDatastoreClustersLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDatastoreClustersResponse wrapper for the ListDatastoreClusters operation +type ListDatastoreClustersResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DatastoreClusterCollection instances + DatastoreClusterCollection `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 list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListDatastoreClustersResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDatastoreClustersResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDatastoreClustersSortOrderEnum Enum with underlying type: string +type ListDatastoreClustersSortOrderEnum string + +// Set of constants representing the allowable values for ListDatastoreClustersSortOrderEnum +const ( + ListDatastoreClustersSortOrderAsc ListDatastoreClustersSortOrderEnum = "ASC" + ListDatastoreClustersSortOrderDesc ListDatastoreClustersSortOrderEnum = "DESC" +) + +var mappingListDatastoreClustersSortOrderEnum = map[string]ListDatastoreClustersSortOrderEnum{ + "ASC": ListDatastoreClustersSortOrderAsc, + "DESC": ListDatastoreClustersSortOrderDesc, +} + +var mappingListDatastoreClustersSortOrderEnumLowerCase = map[string]ListDatastoreClustersSortOrderEnum{ + "asc": ListDatastoreClustersSortOrderAsc, + "desc": ListDatastoreClustersSortOrderDesc, +} + +// GetListDatastoreClustersSortOrderEnumValues Enumerates the set of values for ListDatastoreClustersSortOrderEnum +func GetListDatastoreClustersSortOrderEnumValues() []ListDatastoreClustersSortOrderEnum { + values := make([]ListDatastoreClustersSortOrderEnum, 0) + for _, v := range mappingListDatastoreClustersSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDatastoreClustersSortOrderEnumStringValues Enumerates the set of values in String for ListDatastoreClustersSortOrderEnum +func GetListDatastoreClustersSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDatastoreClustersSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDatastoreClustersSortOrderEnum(val string) (ListDatastoreClustersSortOrderEnum, bool) { + enum, ok := mappingListDatastoreClustersSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDatastoreClustersSortByEnum Enum with underlying type: string +type ListDatastoreClustersSortByEnum string + +// Set of constants representing the allowable values for ListDatastoreClustersSortByEnum +const ( + ListDatastoreClustersSortByTimecreated ListDatastoreClustersSortByEnum = "timeCreated" + ListDatastoreClustersSortByDisplayname ListDatastoreClustersSortByEnum = "displayName" +) + +var mappingListDatastoreClustersSortByEnum = map[string]ListDatastoreClustersSortByEnum{ + "timeCreated": ListDatastoreClustersSortByTimecreated, + "displayName": ListDatastoreClustersSortByDisplayname, +} + +var mappingListDatastoreClustersSortByEnumLowerCase = map[string]ListDatastoreClustersSortByEnum{ + "timecreated": ListDatastoreClustersSortByTimecreated, + "displayname": ListDatastoreClustersSortByDisplayname, +} + +// GetListDatastoreClustersSortByEnumValues Enumerates the set of values for ListDatastoreClustersSortByEnum +func GetListDatastoreClustersSortByEnumValues() []ListDatastoreClustersSortByEnum { + values := make([]ListDatastoreClustersSortByEnum, 0) + for _, v := range mappingListDatastoreClustersSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDatastoreClustersSortByEnumStringValues Enumerates the set of values in String for ListDatastoreClustersSortByEnum +func GetListDatastoreClustersSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListDatastoreClustersSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDatastoreClustersSortByEnum(val string) (ListDatastoreClustersSortByEnum, bool) { + enum, ok := mappingListDatastoreClustersSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDatastoreClustersLifecycleStateEnum Enum with underlying type: string +type ListDatastoreClustersLifecycleStateEnum string + +// Set of constants representing the allowable values for ListDatastoreClustersLifecycleStateEnum +const ( + ListDatastoreClustersLifecycleStateCreating ListDatastoreClustersLifecycleStateEnum = "CREATING" + ListDatastoreClustersLifecycleStateUpdating ListDatastoreClustersLifecycleStateEnum = "UPDATING" + ListDatastoreClustersLifecycleStateActive ListDatastoreClustersLifecycleStateEnum = "ACTIVE" + ListDatastoreClustersLifecycleStateDeleting ListDatastoreClustersLifecycleStateEnum = "DELETING" + ListDatastoreClustersLifecycleStateDeleted ListDatastoreClustersLifecycleStateEnum = "DELETED" + ListDatastoreClustersLifecycleStateFailed ListDatastoreClustersLifecycleStateEnum = "FAILED" +) + +var mappingListDatastoreClustersLifecycleStateEnum = map[string]ListDatastoreClustersLifecycleStateEnum{ + "CREATING": ListDatastoreClustersLifecycleStateCreating, + "UPDATING": ListDatastoreClustersLifecycleStateUpdating, + "ACTIVE": ListDatastoreClustersLifecycleStateActive, + "DELETING": ListDatastoreClustersLifecycleStateDeleting, + "DELETED": ListDatastoreClustersLifecycleStateDeleted, + "FAILED": ListDatastoreClustersLifecycleStateFailed, +} + +var mappingListDatastoreClustersLifecycleStateEnumLowerCase = map[string]ListDatastoreClustersLifecycleStateEnum{ + "creating": ListDatastoreClustersLifecycleStateCreating, + "updating": ListDatastoreClustersLifecycleStateUpdating, + "active": ListDatastoreClustersLifecycleStateActive, + "deleting": ListDatastoreClustersLifecycleStateDeleting, + "deleted": ListDatastoreClustersLifecycleStateDeleted, + "failed": ListDatastoreClustersLifecycleStateFailed, +} + +// GetListDatastoreClustersLifecycleStateEnumValues Enumerates the set of values for ListDatastoreClustersLifecycleStateEnum +func GetListDatastoreClustersLifecycleStateEnumValues() []ListDatastoreClustersLifecycleStateEnum { + values := make([]ListDatastoreClustersLifecycleStateEnum, 0) + for _, v := range mappingListDatastoreClustersLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListDatastoreClustersLifecycleStateEnumStringValues Enumerates the set of values in String for ListDatastoreClustersLifecycleStateEnum +func GetListDatastoreClustersLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListDatastoreClustersLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDatastoreClustersLifecycleStateEnum(val string) (ListDatastoreClustersLifecycleStateEnum, bool) { + enum, ok := mappingListDatastoreClustersLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/list_datastores_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/list_datastores_request_response.go new file mode 100644 index 00000000000..6de697b2edd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/list_datastores_request_response.go @@ -0,0 +1,282 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDatastoresRequest wrapper for the ListDatastores operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListDatastores.go.html to see an example of how to use ListDatastoresRequest. +type ListDatastoresRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. + ClusterId *string `mandatory:"false" contributesTo:"query" name:"clusterId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + DatastoreId *string `mandatory:"false" contributesTo:"query" name:"datastoreId"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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`). The DISPLAYNAME sort order + // is case sensitive. + SortOrder ListDatastoresSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide one sort order (`sortOrder`). Default order for + // TIMECREATED is descending. Default order for DISPLAYNAME is ascending. The DISPLAYNAME + // sort order is case sensitive. + // **Note:** In general, some "List" operations (for example, `ListInstances`) let you + // optionally filter by availability domain if the scope of the resource type is within a + // single availability domain. If you call one of these "List" operations without specifying + // an availability domain, the resources are grouped by availability domain, then sorted. + SortBy ListDatastoresSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique 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"` + + // The lifecycle state of the resource. + LifecycleState ListDatastoresLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // 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 ListDatastoresRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDatastoresRequest) 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 ListDatastoresRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDatastoresRequest) 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 ListDatastoresRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListDatastoresSortOrderEnum(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(GetListDatastoresSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDatastoresSortByEnum(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(GetListDatastoresSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListDatastoresLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetListDatastoresLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDatastoresResponse wrapper for the ListDatastores operation +type ListDatastoresResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of DatastoreCollection instances + DatastoreCollection `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 list pagination. When this header appears in the response, additional pages + // of results remain. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListDatastoresResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDatastoresResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDatastoresSortOrderEnum Enum with underlying type: string +type ListDatastoresSortOrderEnum string + +// Set of constants representing the allowable values for ListDatastoresSortOrderEnum +const ( + ListDatastoresSortOrderAsc ListDatastoresSortOrderEnum = "ASC" + ListDatastoresSortOrderDesc ListDatastoresSortOrderEnum = "DESC" +) + +var mappingListDatastoresSortOrderEnum = map[string]ListDatastoresSortOrderEnum{ + "ASC": ListDatastoresSortOrderAsc, + "DESC": ListDatastoresSortOrderDesc, +} + +var mappingListDatastoresSortOrderEnumLowerCase = map[string]ListDatastoresSortOrderEnum{ + "asc": ListDatastoresSortOrderAsc, + "desc": ListDatastoresSortOrderDesc, +} + +// GetListDatastoresSortOrderEnumValues Enumerates the set of values for ListDatastoresSortOrderEnum +func GetListDatastoresSortOrderEnumValues() []ListDatastoresSortOrderEnum { + values := make([]ListDatastoresSortOrderEnum, 0) + for _, v := range mappingListDatastoresSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDatastoresSortOrderEnumStringValues Enumerates the set of values in String for ListDatastoresSortOrderEnum +func GetListDatastoresSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDatastoresSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDatastoresSortOrderEnum(val string) (ListDatastoresSortOrderEnum, bool) { + enum, ok := mappingListDatastoresSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDatastoresSortByEnum Enum with underlying type: string +type ListDatastoresSortByEnum string + +// Set of constants representing the allowable values for ListDatastoresSortByEnum +const ( + ListDatastoresSortByTimecreated ListDatastoresSortByEnum = "timeCreated" + ListDatastoresSortByDisplayname ListDatastoresSortByEnum = "displayName" +) + +var mappingListDatastoresSortByEnum = map[string]ListDatastoresSortByEnum{ + "timeCreated": ListDatastoresSortByTimecreated, + "displayName": ListDatastoresSortByDisplayname, +} + +var mappingListDatastoresSortByEnumLowerCase = map[string]ListDatastoresSortByEnum{ + "timecreated": ListDatastoresSortByTimecreated, + "displayname": ListDatastoresSortByDisplayname, +} + +// GetListDatastoresSortByEnumValues Enumerates the set of values for ListDatastoresSortByEnum +func GetListDatastoresSortByEnumValues() []ListDatastoresSortByEnum { + values := make([]ListDatastoresSortByEnum, 0) + for _, v := range mappingListDatastoresSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDatastoresSortByEnumStringValues Enumerates the set of values in String for ListDatastoresSortByEnum +func GetListDatastoresSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListDatastoresSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDatastoresSortByEnum(val string) (ListDatastoresSortByEnum, bool) { + enum, ok := mappingListDatastoresSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDatastoresLifecycleStateEnum Enum with underlying type: string +type ListDatastoresLifecycleStateEnum string + +// Set of constants representing the allowable values for ListDatastoresLifecycleStateEnum +const ( + ListDatastoresLifecycleStateCreating ListDatastoresLifecycleStateEnum = "CREATING" + ListDatastoresLifecycleStateUpdating ListDatastoresLifecycleStateEnum = "UPDATING" + ListDatastoresLifecycleStateActive ListDatastoresLifecycleStateEnum = "ACTIVE" + ListDatastoresLifecycleStateDeleting ListDatastoresLifecycleStateEnum = "DELETING" + ListDatastoresLifecycleStateDeleted ListDatastoresLifecycleStateEnum = "DELETED" + ListDatastoresLifecycleStateFailed ListDatastoresLifecycleStateEnum = "FAILED" +) + +var mappingListDatastoresLifecycleStateEnum = map[string]ListDatastoresLifecycleStateEnum{ + "CREATING": ListDatastoresLifecycleStateCreating, + "UPDATING": ListDatastoresLifecycleStateUpdating, + "ACTIVE": ListDatastoresLifecycleStateActive, + "DELETING": ListDatastoresLifecycleStateDeleting, + "DELETED": ListDatastoresLifecycleStateDeleted, + "FAILED": ListDatastoresLifecycleStateFailed, +} + +var mappingListDatastoresLifecycleStateEnumLowerCase = map[string]ListDatastoresLifecycleStateEnum{ + "creating": ListDatastoresLifecycleStateCreating, + "updating": ListDatastoresLifecycleStateUpdating, + "active": ListDatastoresLifecycleStateActive, + "deleting": ListDatastoresLifecycleStateDeleting, + "deleted": ListDatastoresLifecycleStateDeleted, + "failed": ListDatastoresLifecycleStateFailed, +} + +// GetListDatastoresLifecycleStateEnumValues Enumerates the set of values for ListDatastoresLifecycleStateEnum +func GetListDatastoresLifecycleStateEnumValues() []ListDatastoresLifecycleStateEnum { + values := make([]ListDatastoresLifecycleStateEnum, 0) + for _, v := range mappingListDatastoresLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListDatastoresLifecycleStateEnumStringValues Enumerates the set of values in String for ListDatastoresLifecycleStateEnum +func GetListDatastoresLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingListDatastoresLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDatastoresLifecycleStateEnum(val string) (ListDatastoresLifecycleStateEnum, bool) { + enum, ok := mappingListDatastoresLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/ocvp_datastore_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/ocvp_datastore_client.go new file mode 100644 index 00000000000..06906c73993 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/ocvp_datastore_client.go @@ -0,0 +1,525 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// DatastoreClient a client for Datastore +type DatastoreClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewDatastoreClientWithConfigurationProvider Creates a new default Datastore client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewDatastoreClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client DatastoreClient, err error) { + if enabled := common.CheckForEnabledServices("ocvp"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newDatastoreClientFromBaseClient(baseClient, provider) +} + +// NewDatastoreClientWithOboToken Creates a new default Datastore client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewDatastoreClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client DatastoreClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newDatastoreClientFromBaseClient(baseClient, configProvider) +} + +func newDatastoreClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client DatastoreClient, err error) { + // Datastore service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Datastore")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = DatastoreClient{BaseClient: baseClient} + client.BasePath = "20230701" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *DatastoreClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("ocvp", "https://ocvps.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *DatastoreClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *DatastoreClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// AddBlockVolumeToDatastore Add the specified Block Volume to the provided Datastore. +// Use the WorkRequest operations to track the +// addition of the block volume to the Datastore. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AddBlockVolumeToDatastore.go.html to see an example of how to use AddBlockVolumeToDatastore API. +// A default retry strategy applies to this operation AddBlockVolumeToDatastore() +func (client DatastoreClient) AddBlockVolumeToDatastore(ctx context.Context, request AddBlockVolumeToDatastoreRequest) (response AddBlockVolumeToDatastoreResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.addBlockVolumeToDatastore, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddBlockVolumeToDatastoreResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddBlockVolumeToDatastoreResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddBlockVolumeToDatastoreResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddBlockVolumeToDatastoreResponse") + } + return +} + +// addBlockVolumeToDatastore implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClient) addBlockVolumeToDatastore(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastores/{datastoreId}/actions/addBlockVolume", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddBlockVolumeToDatastoreResponse + 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/vmware/20230701/Datastore/AddBlockVolumeToDatastore" + err = common.PostProcessServiceError(err, "Datastore", "AddBlockVolumeToDatastore", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeDatastoreCompartment Moves an Datastore into a different compartment within the same tenancy. For information +// about moving resources between compartments, see +// Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ChangeDatastoreCompartment.go.html to see an example of how to use ChangeDatastoreCompartment API. +// A default retry strategy applies to this operation ChangeDatastoreCompartment() +func (client DatastoreClient) ChangeDatastoreCompartment(ctx context.Context, request ChangeDatastoreCompartmentRequest) (response ChangeDatastoreCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.changeDatastoreCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeDatastoreCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeDatastoreCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeDatastoreCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeDatastoreCompartmentResponse") + } + return +} + +// changeDatastoreCompartment implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClient) changeDatastoreCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastores/{datastoreId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeDatastoreCompartmentResponse + 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/vmware/20230701/Datastore/ChangeDatastoreCompartment" + err = common.PostProcessServiceError(err, "Datastore", "ChangeDatastoreCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateDatastore Creates a Oracle Cloud VMware Solution Datastore. +// Use the WorkRequest operations to track the +// creation of the Datastore. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/CreateDatastore.go.html to see an example of how to use CreateDatastore API. +// A default retry strategy applies to this operation CreateDatastore() +func (client DatastoreClient) CreateDatastore(ctx context.Context, request CreateDatastoreRequest) (response CreateDatastoreResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDatastore, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDatastoreResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDatastoreResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDatastoreResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDatastoreResponse") + } + return +} + +// createDatastore implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClient) createDatastore(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastores", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDatastoreResponse + 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/vmware/20230701/Datastore/CreateDatastore" + err = common.PostProcessServiceError(err, "Datastore", "CreateDatastore", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteDatastore Deletes the specified Datastore. +// Use the WorkRequest operations to track the +// deletion of the Datastore. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DeleteDatastore.go.html to see an example of how to use DeleteDatastore API. +// A default retry strategy applies to this operation DeleteDatastore() +func (client DatastoreClient) DeleteDatastore(ctx context.Context, request DeleteDatastoreRequest) (response DeleteDatastoreResponse, 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.deleteDatastore, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDatastoreResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDatastoreResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDatastoreResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDatastoreResponse") + } + return +} + +// deleteDatastore implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClient) deleteDatastore(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/datastores/{datastoreId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDatastoreResponse + 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/vmware/20230701/Datastore/DeleteDatastore" + err = common.PostProcessServiceError(err, "Datastore", "DeleteDatastore", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDatastore Get the specified Datastore's information. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/GetDatastore.go.html to see an example of how to use GetDatastore API. +// A default retry strategy applies to this operation GetDatastore() +func (client DatastoreClient) GetDatastore(ctx context.Context, request GetDatastoreRequest) (response GetDatastoreResponse, 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.getDatastore, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDatastoreResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDatastoreResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDatastoreResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDatastoreResponse") + } + return +} + +// getDatastore implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClient) getDatastore(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/datastores/{datastoreId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDatastoreResponse + 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/vmware/20230701/Datastore/GetDatastore" + err = common.PostProcessServiceError(err, "Datastore", "GetDatastore", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDatastores List the Datastores in the specified compartment. The list can be filtered +// by compartment, datastore id, display name and lifecycle state. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListDatastores.go.html to see an example of how to use ListDatastores API. +// A default retry strategy applies to this operation ListDatastores() +func (client DatastoreClient) ListDatastores(ctx context.Context, request ListDatastoresRequest) (response ListDatastoresResponse, 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.listDatastores, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDatastoresResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDatastoresResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDatastoresResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDatastoresResponse") + } + return +} + +// listDatastores implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClient) listDatastores(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/datastores", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDatastoresResponse + 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/vmware/20230701/Datastore/ListDatastores" + err = common.PostProcessServiceError(err, "Datastore", "ListDatastores", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateDatastore Updates the specified Datastore. +// **Important:** Updating a Datastore affects only certain attributes in the `Datastore` +// object and does not affect the VMware environment currently running. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/UpdateDatastore.go.html to see an example of how to use UpdateDatastore API. +// A default retry strategy applies to this operation UpdateDatastore() +func (client DatastoreClient) UpdateDatastore(ctx context.Context, request UpdateDatastoreRequest) (response UpdateDatastoreResponse, 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.updateDatastore, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateDatastoreResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateDatastoreResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDatastoreResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDatastoreResponse") + } + return +} + +// updateDatastore implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClient) updateDatastore(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/datastores/{datastoreId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateDatastoreResponse + 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/vmware/20230701/Datastore/UpdateDatastore" + err = common.PostProcessServiceError(err, "Datastore", "UpdateDatastore", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/ocvp_datastorecluster_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/ocvp_datastorecluster_client.go new file mode 100644 index 00000000000..2ddd1a84c44 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/ocvp_datastorecluster_client.go @@ -0,0 +1,842 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// DatastoreClusterClient a client for DatastoreCluster +type DatastoreClusterClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewDatastoreClusterClientWithConfigurationProvider Creates a new default DatastoreCluster client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewDatastoreClusterClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client DatastoreClusterClient, err error) { + if enabled := common.CheckForEnabledServices("ocvp"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newDatastoreClusterClientFromBaseClient(baseClient, provider) +} + +// NewDatastoreClusterClientWithOboToken Creates a new default DatastoreCluster client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewDatastoreClusterClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client DatastoreClusterClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newDatastoreClusterClientFromBaseClient(baseClient, configProvider) +} + +func newDatastoreClusterClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client DatastoreClusterClient, err error) { + // DatastoreCluster service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("DatastoreCluster")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = DatastoreClusterClient{BaseClient: baseClient} + client.BasePath = "20230701" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *DatastoreClusterClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("ocvp", "https://ocvps.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *DatastoreClusterClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *DatastoreClusterClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// AddDatastoreToDatastoreCluster Add the specified Datastore to the provided Datastore Cluster. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AddDatastoreToDatastoreCluster.go.html to see an example of how to use AddDatastoreToDatastoreCluster API. +// A default retry strategy applies to this operation AddDatastoreToDatastoreCluster() +func (client DatastoreClusterClient) AddDatastoreToDatastoreCluster(ctx context.Context, request AddDatastoreToDatastoreClusterRequest) (response AddDatastoreToDatastoreClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.addDatastoreToDatastoreCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddDatastoreToDatastoreClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddDatastoreToDatastoreClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddDatastoreToDatastoreClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddDatastoreToDatastoreClusterResponse") + } + return +} + +// addDatastoreToDatastoreCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) addDatastoreToDatastoreCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters/{datastoreClusterId}/actions/addDatastore", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddDatastoreToDatastoreClusterResponse + 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/vmware/20230701/DatastoreCluster/AddDatastoreToDatastoreCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "AddDatastoreToDatastoreCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// AttachDatastoreClusterToCluster Attach the specified Datastore Cluster to the provided Vmware Cluster. +// Use the WorkRequest operations to track the +// attachment of the Datastore. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AttachDatastoreClusterToCluster.go.html to see an example of how to use AttachDatastoreClusterToCluster API. +// A default retry strategy applies to this operation AttachDatastoreClusterToCluster() +func (client DatastoreClusterClient) AttachDatastoreClusterToCluster(ctx context.Context, request AttachDatastoreClusterToClusterRequest) (response AttachDatastoreClusterToClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.attachDatastoreClusterToCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AttachDatastoreClusterToClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AttachDatastoreClusterToClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AttachDatastoreClusterToClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachDatastoreClusterToClusterResponse") + } + return +} + +// attachDatastoreClusterToCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) attachDatastoreClusterToCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters/{datastoreClusterId}/actions/attachToCluster", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AttachDatastoreClusterToClusterResponse + 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/vmware/20230701/DatastoreCluster/AttachDatastoreClusterToCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "AttachDatastoreClusterToCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// AttachDatastoreClusterToEsxiHost Attach the specified Datastore Cluster to the provided ESXi Hosts. +// Use the WorkRequest operations to track the +// attachment of the Datastore. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/AttachDatastoreClusterToEsxiHost.go.html to see an example of how to use AttachDatastoreClusterToEsxiHost API. +// A default retry strategy applies to this operation AttachDatastoreClusterToEsxiHost() +func (client DatastoreClusterClient) AttachDatastoreClusterToEsxiHost(ctx context.Context, request AttachDatastoreClusterToEsxiHostRequest) (response AttachDatastoreClusterToEsxiHostResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.attachDatastoreClusterToEsxiHost, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AttachDatastoreClusterToEsxiHostResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AttachDatastoreClusterToEsxiHostResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AttachDatastoreClusterToEsxiHostResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AttachDatastoreClusterToEsxiHostResponse") + } + return +} + +// attachDatastoreClusterToEsxiHost implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) attachDatastoreClusterToEsxiHost(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters/{datastoreClusterId}/actions/attachToEsxiHost", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AttachDatastoreClusterToEsxiHostResponse + 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/vmware/20230701/DatastoreCluster/AttachDatastoreClusterToEsxiHost" + err = common.PostProcessServiceError(err, "DatastoreCluster", "AttachDatastoreClusterToEsxiHost", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeDatastoreClusterCompartment Moves an Datastore Cluster into a different compartment within the same tenancy. For information +// about moving resources between compartments, see +// Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ChangeDatastoreClusterCompartment.go.html to see an example of how to use ChangeDatastoreClusterCompartment API. +// A default retry strategy applies to this operation ChangeDatastoreClusterCompartment() +func (client DatastoreClusterClient) ChangeDatastoreClusterCompartment(ctx context.Context, request ChangeDatastoreClusterCompartmentRequest) (response ChangeDatastoreClusterCompartmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.changeDatastoreClusterCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeDatastoreClusterCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeDatastoreClusterCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeDatastoreClusterCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeDatastoreClusterCompartmentResponse") + } + return +} + +// changeDatastoreClusterCompartment implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) changeDatastoreClusterCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters/{datastoreClusterId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeDatastoreClusterCompartmentResponse + 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/vmware/20230701/DatastoreCluster/ChangeDatastoreClusterCompartment" + err = common.PostProcessServiceError(err, "DatastoreCluster", "ChangeDatastoreClusterCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateDatastoreCluster Creates a Oracle Cloud VMware Solution Datastore Cluster. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/CreateDatastoreCluster.go.html to see an example of how to use CreateDatastoreCluster API. +// A default retry strategy applies to this operation CreateDatastoreCluster() +func (client DatastoreClusterClient) CreateDatastoreCluster(ctx context.Context, request CreateDatastoreClusterRequest) (response CreateDatastoreClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createDatastoreCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDatastoreClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDatastoreClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDatastoreClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDatastoreClusterResponse") + } + return +} + +// createDatastoreCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) createDatastoreCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDatastoreClusterResponse + 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/vmware/20230701/DatastoreCluster/CreateDatastoreCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "CreateDatastoreCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteDatastoreCluster Deletes the specified Datastore Cluster. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DeleteDatastoreCluster.go.html to see an example of how to use DeleteDatastoreCluster API. +// A default retry strategy applies to this operation DeleteDatastoreCluster() +func (client DatastoreClusterClient) DeleteDatastoreCluster(ctx context.Context, request DeleteDatastoreClusterRequest) (response DeleteDatastoreClusterResponse, 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.deleteDatastoreCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDatastoreClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDatastoreClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDatastoreClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDatastoreClusterResponse") + } + return +} + +// deleteDatastoreCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) deleteDatastoreCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/datastoreClusters/{datastoreClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDatastoreClusterResponse + 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/vmware/20230701/DatastoreCluster/DeleteDatastoreCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "DeleteDatastoreCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DetachDatastoreClusterFromCluster Detach the specified Datastore Cluster from the provided Vmware Cluster. +// Use the WorkRequest operations to track the +// detachment of the Datastore. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DetachDatastoreClusterFromCluster.go.html to see an example of how to use DetachDatastoreClusterFromCluster API. +// A default retry strategy applies to this operation DetachDatastoreClusterFromCluster() +func (client DatastoreClusterClient) DetachDatastoreClusterFromCluster(ctx context.Context, request DetachDatastoreClusterFromClusterRequest) (response DetachDatastoreClusterFromClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.detachDatastoreClusterFromCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DetachDatastoreClusterFromClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DetachDatastoreClusterFromClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DetachDatastoreClusterFromClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachDatastoreClusterFromClusterResponse") + } + return +} + +// detachDatastoreClusterFromCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) detachDatastoreClusterFromCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters/{datastoreClusterId}/actions/detachFromCluster", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DetachDatastoreClusterFromClusterResponse + 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/vmware/20230701/DatastoreCluster/DetachDatastoreClusterFromCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "DetachDatastoreClusterFromCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DetachDatastoreClusterFromEsxiHost Detach the specified Datastore Cluster from the provided ESXi Hosts. +// Use the WorkRequest operations to track the +// detachment of the Datastore. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/DetachDatastoreClusterFromEsxiHost.go.html to see an example of how to use DetachDatastoreClusterFromEsxiHost API. +// A default retry strategy applies to this operation DetachDatastoreClusterFromEsxiHost() +func (client DatastoreClusterClient) DetachDatastoreClusterFromEsxiHost(ctx context.Context, request DetachDatastoreClusterFromEsxiHostRequest) (response DetachDatastoreClusterFromEsxiHostResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.detachDatastoreClusterFromEsxiHost, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DetachDatastoreClusterFromEsxiHostResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DetachDatastoreClusterFromEsxiHostResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DetachDatastoreClusterFromEsxiHostResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DetachDatastoreClusterFromEsxiHostResponse") + } + return +} + +// detachDatastoreClusterFromEsxiHost implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) detachDatastoreClusterFromEsxiHost(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters/{datastoreClusterId}/actions/detachFromEsxiHost", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DetachDatastoreClusterFromEsxiHostResponse + 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/vmware/20230701/DatastoreCluster/DetachDatastoreClusterFromEsxiHost" + err = common.PostProcessServiceError(err, "DatastoreCluster", "DetachDatastoreClusterFromEsxiHost", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetDatastoreCluster Get the specified Datastore Cluster information. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/GetDatastoreCluster.go.html to see an example of how to use GetDatastoreCluster API. +// A default retry strategy applies to this operation GetDatastoreCluster() +func (client DatastoreClusterClient) GetDatastoreCluster(ctx context.Context, request GetDatastoreClusterRequest) (response GetDatastoreClusterResponse, 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.getDatastoreCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDatastoreClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDatastoreClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDatastoreClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDatastoreClusterResponse") + } + return +} + +// getDatastoreCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) getDatastoreCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/datastoreClusters/{datastoreClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDatastoreClusterResponse + 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/vmware/20230701/DatastoreCluster/GetDatastoreCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "GetDatastoreCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListDatastoreClusters List the Datastore Clusters in the specified compartment. The list can be filtered +// by compartment, Datastore Cluster, Display name and Lifecycle state +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/ListDatastoreClusters.go.html to see an example of how to use ListDatastoreClusters API. +// A default retry strategy applies to this operation ListDatastoreClusters() +func (client DatastoreClusterClient) ListDatastoreClusters(ctx context.Context, request ListDatastoreClustersRequest) (response ListDatastoreClustersResponse, 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.listDatastoreClusters, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDatastoreClustersResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDatastoreClustersResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDatastoreClustersResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDatastoreClustersResponse") + } + return +} + +// listDatastoreClusters implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) listDatastoreClusters(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/datastoreClusters", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDatastoreClustersResponse + 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/vmware/20230701/DatastoreCluster/ListDatastoreClusters" + err = common.PostProcessServiceError(err, "DatastoreCluster", "ListDatastoreClusters", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveDatastoreFromDatastoreCluster Remove the specified Datastore from the provided Datastore Cluster. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/RemoveDatastoreFromDatastoreCluster.go.html to see an example of how to use RemoveDatastoreFromDatastoreCluster API. +// A default retry strategy applies to this operation RemoveDatastoreFromDatastoreCluster() +func (client DatastoreClusterClient) RemoveDatastoreFromDatastoreCluster(ctx context.Context, request RemoveDatastoreFromDatastoreClusterRequest) (response RemoveDatastoreFromDatastoreClusterResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.removeDatastoreFromDatastoreCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveDatastoreFromDatastoreClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveDatastoreFromDatastoreClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveDatastoreFromDatastoreClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveDatastoreFromDatastoreClusterResponse") + } + return +} + +// removeDatastoreFromDatastoreCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) removeDatastoreFromDatastoreCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/datastoreClusters/{datastoreClusterId}/actions/removeDatastore", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveDatastoreFromDatastoreClusterResponse + 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/vmware/20230701/DatastoreCluster/RemoveDatastoreFromDatastoreCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "RemoveDatastoreFromDatastoreCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateDatastoreCluster Updates the specified Datastore Cluster. +// **Important:** Updating a Datastore Cluster affects only certain attributes in the `Datastore Cluster` +// object and does not affect the VMware environment currently running. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/UpdateDatastoreCluster.go.html to see an example of how to use UpdateDatastoreCluster API. +// A default retry strategy applies to this operation UpdateDatastoreCluster() +func (client DatastoreClusterClient) UpdateDatastoreCluster(ctx context.Context, request UpdateDatastoreClusterRequest) (response UpdateDatastoreClusterResponse, 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.updateDatastoreCluster, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateDatastoreClusterResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateDatastoreClusterResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDatastoreClusterResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDatastoreClusterResponse") + } + return +} + +// updateDatastoreCluster implements the OCIOperation interface (enables retrying operations) +func (client DatastoreClusterClient) updateDatastoreCluster(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/datastoreClusters/{datastoreClusterId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateDatastoreClusterResponse + 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/vmware/20230701/DatastoreCluster/UpdateDatastoreCluster" + err = common.PostProcessServiceError(err, "DatastoreCluster", "UpdateDatastoreCluster", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/operation_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/operation_types.go index df87adeed08..d1ea61b6df7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/operation_types.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/operation_types.go @@ -19,90 +19,108 @@ type OperationTypesEnum string // Set of constants representing the allowable values for OperationTypesEnum const ( - OperationTypesCreateSddc OperationTypesEnum = "CREATE_SDDC" - OperationTypesDeleteSddc OperationTypesEnum = "DELETE_SDDC" - OperationTypesCreateCluster OperationTypesEnum = "CREATE_CLUSTER" - OperationTypesDeleteCluster OperationTypesEnum = "DELETE_CLUSTER" - OperationTypesCreateEsxiHost OperationTypesEnum = "CREATE_ESXI_HOST" - OperationTypesDeleteEsxiHost OperationTypesEnum = "DELETE_ESXI_HOST" - OperationTypesUpgradeHcx OperationTypesEnum = "UPGRADE_HCX" - OperationTypesDowngradeHcx OperationTypesEnum = "DOWNGRADE_HCX" - OperationTypesCancelDowngradeHcx OperationTypesEnum = "CANCEL_DOWNGRADE_HCX" - OperationTypesRefreshHcxLicenseStatus OperationTypesEnum = "REFRESH_HCX_LICENSE_STATUS" - OperationTypesSwapBilling OperationTypesEnum = "SWAP_BILLING" - OperationTypesReplaceHost OperationTypesEnum = "REPLACE_HOST" - OperationTypesInPlaceUpgrade OperationTypesEnum = "IN_PLACE_UPGRADE" - OperationTypesCreateDatastore OperationTypesEnum = "CREATE_DATASTORE" - OperationTypesUpdateDatastore OperationTypesEnum = "UPDATE_DATASTORE" - OperationTypesAddBlockVolumeToDatastore OperationTypesEnum = "ADD_BLOCK_VOLUME_TO_DATASTORE" - OperationTypesDeleteDatastore OperationTypesEnum = "DELETE_DATASTORE" - OperationTypesCreateDatastoreCluster OperationTypesEnum = "CREATE_DATASTORE_CLUSTER" - OperationTypesUpdateDatastoreCluster OperationTypesEnum = "UPDATE_DATASTORE_CLUSTER" - OperationTypesAttachDatastoreClusterToEsxiHost OperationTypesEnum = "ATTACH_DATASTORE_CLUSTER_TO_ESXI_HOST" - OperationTypesAttachDatastoreClusterToCluster OperationTypesEnum = "ATTACH_DATASTORE_CLUSTER_TO_CLUSTER" - OperationTypesDetachDatastoreClusterFromEsxiHost OperationTypesEnum = "DETACH_DATASTORE_CLUSTER_FROM_ESXI_HOST" - OperationTypesDetachDatastoreClusterFromCluster OperationTypesEnum = "DETACH_DATASTORE_CLUSTER_FROM_CLUSTER" - OperationTypesDeleteDatastoreCluster OperationTypesEnum = "DELETE_DATASTORE_CLUSTER" - OperationTypesAddDatastoreToDatastoreCluster OperationTypesEnum = "ADD_DATASTORE_TO_DATASTORE_CLUSTER" - OperationTypesRemoveDatastoreFromDatastoreCluster OperationTypesEnum = "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER" + OperationTypesCreateSddc OperationTypesEnum = "CREATE_SDDC" + OperationTypesDeleteSddc OperationTypesEnum = "DELETE_SDDC" + OperationTypesCreateCluster OperationTypesEnum = "CREATE_CLUSTER" + OperationTypesDeleteCluster OperationTypesEnum = "DELETE_CLUSTER" + OperationTypesCreateEsxiHost OperationTypesEnum = "CREATE_ESXI_HOST" + OperationTypesDeleteEsxiHost OperationTypesEnum = "DELETE_ESXI_HOST" + OperationTypesUpgradeHcx OperationTypesEnum = "UPGRADE_HCX" + OperationTypesDowngradeHcx OperationTypesEnum = "DOWNGRADE_HCX" + OperationTypesCancelDowngradeHcx OperationTypesEnum = "CANCEL_DOWNGRADE_HCX" + OperationTypesRefreshHcxLicenseStatus OperationTypesEnum = "REFRESH_HCX_LICENSE_STATUS" + OperationTypesSwapBilling OperationTypesEnum = "SWAP_BILLING" + OperationTypesReplaceHost OperationTypesEnum = "REPLACE_HOST" + OperationTypesInPlaceUpgrade OperationTypesEnum = "IN_PLACE_UPGRADE" + OperationTypesCreateDatastore OperationTypesEnum = "CREATE_DATASTORE" + OperationTypesUpdateDatastore OperationTypesEnum = "UPDATE_DATASTORE" + OperationTypesAddBlockVolumeToDatastore OperationTypesEnum = "ADD_BLOCK_VOLUME_TO_DATASTORE" + OperationTypesDeleteDatastore OperationTypesEnum = "DELETE_DATASTORE" + OperationTypesCreateDatastoreCluster OperationTypesEnum = "CREATE_DATASTORE_CLUSTER" + OperationTypesUpdateDatastoreCluster OperationTypesEnum = "UPDATE_DATASTORE_CLUSTER" + OperationTypesAttachDatastoreClusterToEsxiHost OperationTypesEnum = "ATTACH_DATASTORE_CLUSTER_TO_ESXI_HOST" + OperationTypesAttachDatastoreClusterToCluster OperationTypesEnum = "ATTACH_DATASTORE_CLUSTER_TO_CLUSTER" + OperationTypesDetachDatastoreClusterFromEsxiHost OperationTypesEnum = "DETACH_DATASTORE_CLUSTER_FROM_ESXI_HOST" + OperationTypesDetachDatastoreClusterFromCluster OperationTypesEnum = "DETACH_DATASTORE_CLUSTER_FROM_CLUSTER" + OperationTypesDeleteDatastoreCluster OperationTypesEnum = "DELETE_DATASTORE_CLUSTER" + OperationTypesAddDatastoreToDatastoreCluster OperationTypesEnum = "ADD_DATASTORE_TO_DATASTORE_CLUSTER" + OperationTypesRemoveDatastoreFromDatastoreCluster OperationTypesEnum = "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER" + OperationTypesCreateManagementAppliance OperationTypesEnum = "CREATE_MANAGEMENT_APPLIANCE" + OperationTypesUpdateManagementAppliance OperationTypesEnum = "UPDATE_MANAGEMENT_APPLIANCE" + OperationTypesDeleteManagementAppliance OperationTypesEnum = "DELETE_MANAGEMENT_APPLIANCE" + OperationTypesAbandonManagementApplianceJobs OperationTypesEnum = "ABANDON_MANAGEMENT_APPLIANCE_JOBS" + OperationTypesManagementApplianceEsxiHostProvisioning OperationTypesEnum = "MANAGEMENT_APPLIANCE_ESXI_HOST_PROVISIONING" + OperationTypesManagementApplianceDatastoreProvisioning OperationTypesEnum = "MANAGEMENT_APPLIANCE_DATASTORE_PROVISIONING" ) var mappingOperationTypesEnum = map[string]OperationTypesEnum{ - "CREATE_SDDC": OperationTypesCreateSddc, - "DELETE_SDDC": OperationTypesDeleteSddc, - "CREATE_CLUSTER": OperationTypesCreateCluster, - "DELETE_CLUSTER": OperationTypesDeleteCluster, - "CREATE_ESXI_HOST": OperationTypesCreateEsxiHost, - "DELETE_ESXI_HOST": OperationTypesDeleteEsxiHost, - "UPGRADE_HCX": OperationTypesUpgradeHcx, - "DOWNGRADE_HCX": OperationTypesDowngradeHcx, - "CANCEL_DOWNGRADE_HCX": OperationTypesCancelDowngradeHcx, - "REFRESH_HCX_LICENSE_STATUS": OperationTypesRefreshHcxLicenseStatus, - "SWAP_BILLING": OperationTypesSwapBilling, - "REPLACE_HOST": OperationTypesReplaceHost, - "IN_PLACE_UPGRADE": OperationTypesInPlaceUpgrade, - "CREATE_DATASTORE": OperationTypesCreateDatastore, - "UPDATE_DATASTORE": OperationTypesUpdateDatastore, - "ADD_BLOCK_VOLUME_TO_DATASTORE": OperationTypesAddBlockVolumeToDatastore, - "DELETE_DATASTORE": OperationTypesDeleteDatastore, - "CREATE_DATASTORE_CLUSTER": OperationTypesCreateDatastoreCluster, - "UPDATE_DATASTORE_CLUSTER": OperationTypesUpdateDatastoreCluster, - "ATTACH_DATASTORE_CLUSTER_TO_ESXI_HOST": OperationTypesAttachDatastoreClusterToEsxiHost, - "ATTACH_DATASTORE_CLUSTER_TO_CLUSTER": OperationTypesAttachDatastoreClusterToCluster, - "DETACH_DATASTORE_CLUSTER_FROM_ESXI_HOST": OperationTypesDetachDatastoreClusterFromEsxiHost, - "DETACH_DATASTORE_CLUSTER_FROM_CLUSTER": OperationTypesDetachDatastoreClusterFromCluster, - "DELETE_DATASTORE_CLUSTER": OperationTypesDeleteDatastoreCluster, - "ADD_DATASTORE_TO_DATASTORE_CLUSTER": OperationTypesAddDatastoreToDatastoreCluster, - "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER": OperationTypesRemoveDatastoreFromDatastoreCluster, + "CREATE_SDDC": OperationTypesCreateSddc, + "DELETE_SDDC": OperationTypesDeleteSddc, + "CREATE_CLUSTER": OperationTypesCreateCluster, + "DELETE_CLUSTER": OperationTypesDeleteCluster, + "CREATE_ESXI_HOST": OperationTypesCreateEsxiHost, + "DELETE_ESXI_HOST": OperationTypesDeleteEsxiHost, + "UPGRADE_HCX": OperationTypesUpgradeHcx, + "DOWNGRADE_HCX": OperationTypesDowngradeHcx, + "CANCEL_DOWNGRADE_HCX": OperationTypesCancelDowngradeHcx, + "REFRESH_HCX_LICENSE_STATUS": OperationTypesRefreshHcxLicenseStatus, + "SWAP_BILLING": OperationTypesSwapBilling, + "REPLACE_HOST": OperationTypesReplaceHost, + "IN_PLACE_UPGRADE": OperationTypesInPlaceUpgrade, + "CREATE_DATASTORE": OperationTypesCreateDatastore, + "UPDATE_DATASTORE": OperationTypesUpdateDatastore, + "ADD_BLOCK_VOLUME_TO_DATASTORE": OperationTypesAddBlockVolumeToDatastore, + "DELETE_DATASTORE": OperationTypesDeleteDatastore, + "CREATE_DATASTORE_CLUSTER": OperationTypesCreateDatastoreCluster, + "UPDATE_DATASTORE_CLUSTER": OperationTypesUpdateDatastoreCluster, + "ATTACH_DATASTORE_CLUSTER_TO_ESXI_HOST": OperationTypesAttachDatastoreClusterToEsxiHost, + "ATTACH_DATASTORE_CLUSTER_TO_CLUSTER": OperationTypesAttachDatastoreClusterToCluster, + "DETACH_DATASTORE_CLUSTER_FROM_ESXI_HOST": OperationTypesDetachDatastoreClusterFromEsxiHost, + "DETACH_DATASTORE_CLUSTER_FROM_CLUSTER": OperationTypesDetachDatastoreClusterFromCluster, + "DELETE_DATASTORE_CLUSTER": OperationTypesDeleteDatastoreCluster, + "ADD_DATASTORE_TO_DATASTORE_CLUSTER": OperationTypesAddDatastoreToDatastoreCluster, + "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER": OperationTypesRemoveDatastoreFromDatastoreCluster, + "CREATE_MANAGEMENT_APPLIANCE": OperationTypesCreateManagementAppliance, + "UPDATE_MANAGEMENT_APPLIANCE": OperationTypesUpdateManagementAppliance, + "DELETE_MANAGEMENT_APPLIANCE": OperationTypesDeleteManagementAppliance, + "ABANDON_MANAGEMENT_APPLIANCE_JOBS": OperationTypesAbandonManagementApplianceJobs, + "MANAGEMENT_APPLIANCE_ESXI_HOST_PROVISIONING": OperationTypesManagementApplianceEsxiHostProvisioning, + "MANAGEMENT_APPLIANCE_DATASTORE_PROVISIONING": OperationTypesManagementApplianceDatastoreProvisioning, } var mappingOperationTypesEnumLowerCase = map[string]OperationTypesEnum{ - "create_sddc": OperationTypesCreateSddc, - "delete_sddc": OperationTypesDeleteSddc, - "create_cluster": OperationTypesCreateCluster, - "delete_cluster": OperationTypesDeleteCluster, - "create_esxi_host": OperationTypesCreateEsxiHost, - "delete_esxi_host": OperationTypesDeleteEsxiHost, - "upgrade_hcx": OperationTypesUpgradeHcx, - "downgrade_hcx": OperationTypesDowngradeHcx, - "cancel_downgrade_hcx": OperationTypesCancelDowngradeHcx, - "refresh_hcx_license_status": OperationTypesRefreshHcxLicenseStatus, - "swap_billing": OperationTypesSwapBilling, - "replace_host": OperationTypesReplaceHost, - "in_place_upgrade": OperationTypesInPlaceUpgrade, - "create_datastore": OperationTypesCreateDatastore, - "update_datastore": OperationTypesUpdateDatastore, - "add_block_volume_to_datastore": OperationTypesAddBlockVolumeToDatastore, - "delete_datastore": OperationTypesDeleteDatastore, - "create_datastore_cluster": OperationTypesCreateDatastoreCluster, - "update_datastore_cluster": OperationTypesUpdateDatastoreCluster, - "attach_datastore_cluster_to_esxi_host": OperationTypesAttachDatastoreClusterToEsxiHost, - "attach_datastore_cluster_to_cluster": OperationTypesAttachDatastoreClusterToCluster, - "detach_datastore_cluster_from_esxi_host": OperationTypesDetachDatastoreClusterFromEsxiHost, - "detach_datastore_cluster_from_cluster": OperationTypesDetachDatastoreClusterFromCluster, - "delete_datastore_cluster": OperationTypesDeleteDatastoreCluster, - "add_datastore_to_datastore_cluster": OperationTypesAddDatastoreToDatastoreCluster, - "remove_datastore_from_datastore_cluster": OperationTypesRemoveDatastoreFromDatastoreCluster, + "create_sddc": OperationTypesCreateSddc, + "delete_sddc": OperationTypesDeleteSddc, + "create_cluster": OperationTypesCreateCluster, + "delete_cluster": OperationTypesDeleteCluster, + "create_esxi_host": OperationTypesCreateEsxiHost, + "delete_esxi_host": OperationTypesDeleteEsxiHost, + "upgrade_hcx": OperationTypesUpgradeHcx, + "downgrade_hcx": OperationTypesDowngradeHcx, + "cancel_downgrade_hcx": OperationTypesCancelDowngradeHcx, + "refresh_hcx_license_status": OperationTypesRefreshHcxLicenseStatus, + "swap_billing": OperationTypesSwapBilling, + "replace_host": OperationTypesReplaceHost, + "in_place_upgrade": OperationTypesInPlaceUpgrade, + "create_datastore": OperationTypesCreateDatastore, + "update_datastore": OperationTypesUpdateDatastore, + "add_block_volume_to_datastore": OperationTypesAddBlockVolumeToDatastore, + "delete_datastore": OperationTypesDeleteDatastore, + "create_datastore_cluster": OperationTypesCreateDatastoreCluster, + "update_datastore_cluster": OperationTypesUpdateDatastoreCluster, + "attach_datastore_cluster_to_esxi_host": OperationTypesAttachDatastoreClusterToEsxiHost, + "attach_datastore_cluster_to_cluster": OperationTypesAttachDatastoreClusterToCluster, + "detach_datastore_cluster_from_esxi_host": OperationTypesDetachDatastoreClusterFromEsxiHost, + "detach_datastore_cluster_from_cluster": OperationTypesDetachDatastoreClusterFromCluster, + "delete_datastore_cluster": OperationTypesDeleteDatastoreCluster, + "add_datastore_to_datastore_cluster": OperationTypesAddDatastoreToDatastoreCluster, + "remove_datastore_from_datastore_cluster": OperationTypesRemoveDatastoreFromDatastoreCluster, + "create_management_appliance": OperationTypesCreateManagementAppliance, + "update_management_appliance": OperationTypesUpdateManagementAppliance, + "delete_management_appliance": OperationTypesDeleteManagementAppliance, + "abandon_management_appliance_jobs": OperationTypesAbandonManagementApplianceJobs, + "management_appliance_esxi_host_provisioning": OperationTypesManagementApplianceEsxiHostProvisioning, + "management_appliance_datastore_provisioning": OperationTypesManagementApplianceDatastoreProvisioning, } // GetOperationTypesEnumValues Enumerates the set of values for OperationTypesEnum @@ -143,6 +161,12 @@ func GetOperationTypesEnumStringValues() []string { "DELETE_DATASTORE_CLUSTER", "ADD_DATASTORE_TO_DATASTORE_CLUSTER", "REMOVE_DATASTORE_FROM_DATASTORE_CLUSTER", + "CREATE_MANAGEMENT_APPLIANCE", + "UPDATE_MANAGEMENT_APPLIANCE", + "DELETE_MANAGEMENT_APPLIANCE", + "ABANDON_MANAGEMENT_APPLIANCE_JOBS", + "MANAGEMENT_APPLIANCE_ESXI_HOST_PROVISIONING", + "MANAGEMENT_APPLIANCE_DATASTORE_PROVISIONING", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/remove_datastore_from_datastore_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/remove_datastore_from_datastore_cluster_details.go new file mode 100644 index 00000000000..1ed1a67aa03 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/remove_datastore_from_datastore_cluster_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveDatastoreFromDatastoreClusterDetails Details for the datastore removal from Datastore Cluster. +type RemoveDatastoreFromDatastoreClusterDetails struct { + + // A list of datastores to be removed. + DatastoreIds []string `mandatory:"true" json:"datastoreIds"` +} + +func (m RemoveDatastoreFromDatastoreClusterDetails) 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 RemoveDatastoreFromDatastoreClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/remove_datastore_from_datastore_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/remove_datastore_from_datastore_cluster_request_response.go new file mode 100644 index 00000000000..c6b324e52d9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/remove_datastore_from_datastore_cluster_request_response.go @@ -0,0 +1,108 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveDatastoreFromDatastoreClusterRequest wrapper for the RemoveDatastoreFromDatastoreCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/RemoveDatastoreFromDatastoreCluster.go.html to see an example of how to use RemoveDatastoreFromDatastoreClusterRequest. +type RemoveDatastoreFromDatastoreClusterRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // The information about datastore removal from the Datastore Cluster. + RemoveDatastoreFromDatastoreClusterDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of executing that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations (for example, if a resource + // has been deleted and purged from the system, then a retry of the original creation request + // may be rejected). + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique 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 RemoveDatastoreFromDatastoreClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveDatastoreFromDatastoreClusterRequest) 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 RemoveDatastoreFromDatastoreClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveDatastoreFromDatastoreClusterRequest) 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 RemoveDatastoreFromDatastoreClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveDatastoreFromDatastoreClusterResponse wrapper for the RemoveDatastoreFromDatastoreCluster operation +type RemoveDatastoreFromDatastoreClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response RemoveDatastoreFromDatastoreClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveDatastoreFromDatastoreClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_cluster_details.go index 85632b69f6e..6ca86771331 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_cluster_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_cluster_details.go @@ -25,7 +25,7 @@ import ( type UpdateClusterDetails struct { // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Cluster. - // Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. + // Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. DisplayName *string `mandatory:"false" json:"displayName"` NetworkConfiguration *NetworkConfiguration `mandatory:"false" json:"networkConfiguration"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_cluster_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_cluster_details.go new file mode 100644 index 00000000000..856eeada240 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_cluster_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDatastoreClusterDetails The Datastore Cluster information to be updated. +type UpdateDatastoreClusterDetails struct { + + // A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateDatastoreClusterDetails) 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 UpdateDatastoreClusterDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_cluster_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_cluster_request_response.go new file mode 100644 index 00000000000..2f7eef82298 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_cluster_request_response.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDatastoreClusterRequest wrapper for the UpdateDatastoreCluster operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/UpdateDatastoreCluster.go.html to see an example of how to use UpdateDatastoreClusterRequest. +type UpdateDatastoreClusterRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + DatastoreClusterId *string `mandatory:"true" contributesTo:"path" name:"datastoreClusterId"` + + // The information to be updated. + UpdateDatastoreClusterDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique 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 UpdateDatastoreClusterRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDatastoreClusterRequest) 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 UpdateDatastoreClusterRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDatastoreClusterRequest) 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 UpdateDatastoreClusterRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDatastoreClusterResponse wrapper for the UpdateDatastoreCluster operation +type UpdateDatastoreClusterResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response UpdateDatastoreClusterResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDatastoreClusterResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_details.go new file mode 100644 index 00000000000..e57ba10a6e1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Oracle Cloud VMware Solution API +// +// Use the Oracle Cloud VMware API to create SDDCs and manage ESXi hosts and software. +// For more information, see Oracle Cloud VMware Solution (https://docs.oracle.com/iaas/Content/VMware/Concepts/ocvsoverview.htm). +// + +package ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDatastoreDetails The Datastore information to be updated. +type UpdateDatastoreDetails struct { + + // A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, + // whitespaces, dashes and underscores. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a + // namespace. For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateDatastoreDetails) 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 UpdateDatastoreDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_request_response.go new file mode 100644 index 00000000000..20ba0795500 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_datastore_request_response.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2025, 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 ocvp + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDatastoreRequest wrapper for the UpdateDatastore operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/ocvp/UpdateDatastore.go.html to see an example of how to use UpdateDatastoreRequest. +type UpdateDatastoreRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + DatastoreId *string `mandatory:"true" contributesTo:"path" name:"datastoreId"` + + // The information to be updated. + UpdateDatastoreDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call + // for a resource, set the `if-match` parameter to the value of the + // etag from a previous GET or POST response for that resource. + // The resource will be updated or deleted only if the etag you + // provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique 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 UpdateDatastoreRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDatastoreRequest) 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 UpdateDatastoreRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDatastoreRequest) 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 UpdateDatastoreRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDatastoreResponse wrapper for the UpdateDatastore operation +type UpdateDatastoreResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response UpdateDatastoreResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDatastoreResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_esxi_host_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_esxi_host_details.go index 30af77dbae5..1f72ced4c77 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_esxi_host_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/ocvp/update_esxi_host_details.go @@ -20,7 +20,7 @@ import ( type UpdateEsxiHostDetails struct { // A descriptive name for the ESXi host. It's changeable. - // Esxi Host name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the Cluster. + // Esxi Host name requirements are 1-25 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the Cluster. // Avoid entering confidential information. DisplayName *string `mandatory:"false" json:"displayName"` @@ -29,7 +29,9 @@ type UpdateEsxiHostDetails struct { // ListSupportedCommitments. NextCommitment CommitmentEnum `mandatory:"false" json:"nextCommitment,omitempty"` - // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the deleted ESXi Host with LeftOver billing cycle. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the deleted ESXi Host with leftover billing cycle. + // **Note:** This option also requires the `nextCommitment` parameter to be populated with a value other than `HOUR`. Otherwise, + // any update request fails with the error “Next SKU can’t be NULL or Hourly.” BillingDonorHostId *string `mandatory:"false" json:"billingDonorHostId"` // Free-form tags for this resource. Each tag is a simple key-value pair with no diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/action_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/action_type.go new file mode 100644 index 00000000000..1e454617b49 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/action_type.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "strings" +) + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeCreated ActionTypeEnum = "CREATED" + ActionTypeUpdated ActionTypeEnum = "UPDATED" + ActionTypeDeleted ActionTypeEnum = "DELETED" + ActionTypeInProgress ActionTypeEnum = "IN_PROGRESS" + ActionTypeRelated ActionTypeEnum = "RELATED" + ActionTypeFailed ActionTypeEnum = "FAILED" +) + +var mappingActionTypeEnum = map[string]ActionTypeEnum{ + "CREATED": ActionTypeCreated, + "UPDATED": ActionTypeUpdated, + "DELETED": ActionTypeDeleted, + "IN_PROGRESS": ActionTypeInProgress, + "RELATED": ActionTypeRelated, + "FAILED": ActionTypeFailed, +} + +var mappingActionTypeEnumLowerCase = map[string]ActionTypeEnum{ + "created": ActionTypeCreated, + "updated": ActionTypeUpdated, + "deleted": ActionTypeDeleted, + "in_progress": ActionTypeInProgress, + "related": ActionTypeRelated, + "failed": ActionTypeFailed, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionTypeEnumStringValues Enumerates the set of values in String for ActionTypeEnum +func GetActionTypeEnumStringValues() []string { + return []string{ + "CREATED", + "UPDATED", + "DELETED", + "IN_PROGRESS", + "RELATED", + "FAILED", + } +} + +// GetMappingActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionTypeEnum(val string) (ActionTypeEnum, bool) { + enum, ok := mappingActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/adw_admin_password_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/adw_admin_password_details.go new file mode 100644 index 00000000000..4d36a98c0a1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/adw_admin_password_details.go @@ -0,0 +1,126 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AdwAdminPasswordDetails Details for the ADW Admin password. +// Password can be passed as `VaultSecretPasswordDetails` or `PlainTextPasswordDetails`. +// Example: `{"passwordType":"PLAIN_TEXT","password":"..."}` +// Example: `{"passwordType":"VAULT_SECRET","secretId":"ocid..."}` +type AdwAdminPasswordDetails interface { +} + +type adwadminpassworddetails struct { + JsonData []byte + PasswordType string `json:"passwordType"` +} + +// UnmarshalJSON unmarshals json +func (m *adwadminpassworddetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshaleradwadminpassworddetails adwadminpassworddetails + s := struct { + Model Unmarshaleradwadminpassworddetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.PasswordType = s.Model.PasswordType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *adwadminpassworddetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.PasswordType { + case "PLAIN_TEXT": + mm := PlainTextPasswordDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "VAULT_SECRET": + mm := VaultSecretPasswordDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for AdwAdminPasswordDetails: %s.", m.PasswordType) + return *m, nil + } +} + +func (m adwadminpassworddetails) 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 adwadminpassworddetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AdwAdminPasswordDetailsPasswordTypeEnum Enum with underlying type: string +type AdwAdminPasswordDetailsPasswordTypeEnum string + +// Set of constants representing the allowable values for AdwAdminPasswordDetailsPasswordTypeEnum +const ( + AdwAdminPasswordDetailsPasswordTypePlainText AdwAdminPasswordDetailsPasswordTypeEnum = "PLAIN_TEXT" + AdwAdminPasswordDetailsPasswordTypeVaultSecret AdwAdminPasswordDetailsPasswordTypeEnum = "VAULT_SECRET" +) + +var mappingAdwAdminPasswordDetailsPasswordTypeEnum = map[string]AdwAdminPasswordDetailsPasswordTypeEnum{ + "PLAIN_TEXT": AdwAdminPasswordDetailsPasswordTypePlainText, + "VAULT_SECRET": AdwAdminPasswordDetailsPasswordTypeVaultSecret, +} + +var mappingAdwAdminPasswordDetailsPasswordTypeEnumLowerCase = map[string]AdwAdminPasswordDetailsPasswordTypeEnum{ + "plain_text": AdwAdminPasswordDetailsPasswordTypePlainText, + "vault_secret": AdwAdminPasswordDetailsPasswordTypeVaultSecret, +} + +// GetAdwAdminPasswordDetailsPasswordTypeEnumValues Enumerates the set of values for AdwAdminPasswordDetailsPasswordTypeEnum +func GetAdwAdminPasswordDetailsPasswordTypeEnumValues() []AdwAdminPasswordDetailsPasswordTypeEnum { + values := make([]AdwAdminPasswordDetailsPasswordTypeEnum, 0) + for _, v := range mappingAdwAdminPasswordDetailsPasswordTypeEnum { + values = append(values, v) + } + return values +} + +// GetAdwAdminPasswordDetailsPasswordTypeEnumStringValues Enumerates the set of values in String for AdwAdminPasswordDetailsPasswordTypeEnum +func GetAdwAdminPasswordDetailsPasswordTypeEnumStringValues() []string { + return []string{ + "PLAIN_TEXT", + "VAULT_SECRET", + } +} + +// GetMappingAdwAdminPasswordDetailsPasswordTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAdwAdminPasswordDetailsPasswordTypeEnum(val string) (AdwAdminPasswordDetailsPasswordTypeEnum, bool) { + enum, ok := mappingAdwAdminPasswordDetailsPasswordTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/cancel_work_request_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/cancel_work_request_request_response.go new file mode 100644 index 00000000000..908d2b859f9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/cancel_work_request_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CancelWorkRequestRequest wrapper for the CancelWorkRequest operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequestRequest. +type CancelWorkRequestRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 CancelWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CancelWorkRequestRequest) 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 CancelWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CancelWorkRequestResponse wrapper for the CancelWorkRequest operation +type CancelWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // 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"` +} + +func (response CancelWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CancelWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/change_resource_analytics_instance_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/change_resource_analytics_instance_compartment_details.go new file mode 100644 index 00000000000..cbd985a56ce --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/change_resource_analytics_instance_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeResourceAnalyticsInstanceCompartmentDetails The configuration details for the move operation. +type ChangeResourceAnalyticsInstanceCompartmentDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the ResourceAnalyticsInstance to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeResourceAnalyticsInstanceCompartmentDetails) 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 ChangeResourceAnalyticsInstanceCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/change_resource_analytics_instance_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/change_resource_analytics_instance_compartment_request_response.go new file mode 100644 index 00000000000..28be56af45c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/change_resource_analytics_instance_compartment_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeResourceAnalyticsInstanceCompartmentRequest wrapper for the ChangeResourceAnalyticsInstanceCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ChangeResourceAnalyticsInstanceCompartment.go.html to see an example of how to use ChangeResourceAnalyticsInstanceCompartmentRequest. +type ChangeResourceAnalyticsInstanceCompartmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"true" contributesTo:"path" name:"resourceAnalyticsInstanceId"` + + // The information to be updated. + ChangeResourceAnalyticsInstanceCompartmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ChangeResourceAnalyticsInstanceCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeResourceAnalyticsInstanceCompartmentRequest) 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 ChangeResourceAnalyticsInstanceCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeResourceAnalyticsInstanceCompartmentRequest) 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 ChangeResourceAnalyticsInstanceCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeResourceAnalyticsInstanceCompartmentResponse wrapper for the ChangeResourceAnalyticsInstanceCompartment operation +type ChangeResourceAnalyticsInstanceCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response ChangeResourceAnalyticsInstanceCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeResourceAnalyticsInstanceCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_monitored_region_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_monitored_region_details.go new file mode 100644 index 00000000000..425f9f869f7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_monitored_region_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateMonitoredRegionDetails The data to create a MonitoredRegion. +type CreateMonitoredRegionDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this MonitoredRegion. + ResourceAnalyticsInstanceId *string `mandatory:"true" json:"resourceAnalyticsInstanceId"` + + // The Region Identifier (https://docs.oracle.com/iaas/Content/General/Concepts/regions.htm) of this MonitoredRegion. + RegionId *string `mandatory:"true" json:"regionId"` +} + +func (m CreateMonitoredRegionDetails) 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 CreateMonitoredRegionDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_monitored_region_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_monitored_region_request_response.go new file mode 100644 index 00000000000..f6b5814d50f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_monitored_region_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateMonitoredRegionRequest wrapper for the CreateMonitoredRegion operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CreateMonitoredRegion.go.html to see an example of how to use CreateMonitoredRegionRequest. +type CreateMonitoredRegionRequest struct { + + // Details for the new MonitoredRegion. + CreateMonitoredRegionDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 CreateMonitoredRegionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateMonitoredRegionRequest) 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 CreateMonitoredRegionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateMonitoredRegionRequest) 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 CreateMonitoredRegionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateMonitoredRegionResponse wrapper for the CreateMonitoredRegion operation +type CreateMonitoredRegionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MonitoredRegion instance + MonitoredRegion `presentIn:"body"` + + // URL for the created MonitoredRegion. The MonitoredRegion OCID is generated after this request is sent. + Location *string `presentIn:"header" name:"location"` + + // Same as location. + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response CreateMonitoredRegionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateMonitoredRegionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_resource_analytics_instance_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_resource_analytics_instance_details.go new file mode 100644 index 00000000000..32f1cad51a3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_resource_analytics_instance_details.go @@ -0,0 +1,167 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateResourceAnalyticsInstanceDetails The data to create a ResourceAnalyticsInstance. +type CreateResourceAnalyticsInstanceDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the ResourceAnalyticsInstance in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + AdwAdminPassword AdwAdminPasswordDetails `mandatory:"true" json:"adwAdminPassword"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A description of the ResourceAnalyticsInstance instance. + Description *string `mandatory:"false" json:"description"` + + // Require mutual TLS (mTLS) when authenticating connections to the ADW database. + IsMutualTlsRequired *bool `mandatory:"false" json:"isMutualTlsRequired"` + + // List of Network Security Group OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)'s. + // Example: `["ocid...", "ocid..."]` + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // The Oracle license model that applies to the ADW instance. + LicenseModel CreateResourceAnalyticsInstanceDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateResourceAnalyticsInstanceDetails) 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 CreateResourceAnalyticsInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCreateResourceAnalyticsInstanceDetailsLicenseModelEnum(string(m.LicenseModel)); !ok && m.LicenseModel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LicenseModel: %s. Supported values are: %s.", m.LicenseModel, strings.Join(GetCreateResourceAnalyticsInstanceDetailsLicenseModelEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *CreateResourceAnalyticsInstanceDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + IsMutualTlsRequired *bool `json:"isMutualTlsRequired"` + NsgIds []string `json:"nsgIds"` + LicenseModel CreateResourceAnalyticsInstanceDetailsLicenseModelEnum `json:"licenseModel"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + CompartmentId *string `json:"compartmentId"` + AdwAdminPassword adwadminpassworddetails `json:"adwAdminPassword"` + SubnetId *string `json:"subnetId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.IsMutualTlsRequired = model.IsMutualTlsRequired + + m.NsgIds = make([]string, len(model.NsgIds)) + copy(m.NsgIds, model.NsgIds) + m.LicenseModel = model.LicenseModel + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.CompartmentId = model.CompartmentId + + nn, e = model.AdwAdminPassword.UnmarshalPolymorphicJSON(model.AdwAdminPassword.JsonData) + if e != nil { + return + } + if nn != nil { + m.AdwAdminPassword = nn.(AdwAdminPasswordDetails) + } else { + m.AdwAdminPassword = nil + } + + m.SubnetId = model.SubnetId + + return +} + +// CreateResourceAnalyticsInstanceDetailsLicenseModelEnum Enum with underlying type: string +type CreateResourceAnalyticsInstanceDetailsLicenseModelEnum string + +// Set of constants representing the allowable values for CreateResourceAnalyticsInstanceDetailsLicenseModelEnum +const ( + CreateResourceAnalyticsInstanceDetailsLicenseModelLicenseIncluded CreateResourceAnalyticsInstanceDetailsLicenseModelEnum = "LICENSE_INCLUDED" + CreateResourceAnalyticsInstanceDetailsLicenseModelBringYourOwnLicense CreateResourceAnalyticsInstanceDetailsLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingCreateResourceAnalyticsInstanceDetailsLicenseModelEnum = map[string]CreateResourceAnalyticsInstanceDetailsLicenseModelEnum{ + "LICENSE_INCLUDED": CreateResourceAnalyticsInstanceDetailsLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": CreateResourceAnalyticsInstanceDetailsLicenseModelBringYourOwnLicense, +} + +var mappingCreateResourceAnalyticsInstanceDetailsLicenseModelEnumLowerCase = map[string]CreateResourceAnalyticsInstanceDetailsLicenseModelEnum{ + "license_included": CreateResourceAnalyticsInstanceDetailsLicenseModelLicenseIncluded, + "bring_your_own_license": CreateResourceAnalyticsInstanceDetailsLicenseModelBringYourOwnLicense, +} + +// GetCreateResourceAnalyticsInstanceDetailsLicenseModelEnumValues Enumerates the set of values for CreateResourceAnalyticsInstanceDetailsLicenseModelEnum +func GetCreateResourceAnalyticsInstanceDetailsLicenseModelEnumValues() []CreateResourceAnalyticsInstanceDetailsLicenseModelEnum { + values := make([]CreateResourceAnalyticsInstanceDetailsLicenseModelEnum, 0) + for _, v := range mappingCreateResourceAnalyticsInstanceDetailsLicenseModelEnum { + values = append(values, v) + } + return values +} + +// GetCreateResourceAnalyticsInstanceDetailsLicenseModelEnumStringValues Enumerates the set of values in String for CreateResourceAnalyticsInstanceDetailsLicenseModelEnum +func GetCreateResourceAnalyticsInstanceDetailsLicenseModelEnumStringValues() []string { + return []string{ + "LICENSE_INCLUDED", + "BRING_YOUR_OWN_LICENSE", + } +} + +// GetMappingCreateResourceAnalyticsInstanceDetailsLicenseModelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCreateResourceAnalyticsInstanceDetailsLicenseModelEnum(val string) (CreateResourceAnalyticsInstanceDetailsLicenseModelEnum, bool) { + enum, ok := mappingCreateResourceAnalyticsInstanceDetailsLicenseModelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_resource_analytics_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_resource_analytics_instance_request_response.go new file mode 100644 index 00000000000..0ce5b7e60a9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_resource_analytics_instance_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateResourceAnalyticsInstanceRequest wrapper for the CreateResourceAnalyticsInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CreateResourceAnalyticsInstance.go.html to see an example of how to use CreateResourceAnalyticsInstanceRequest. +type CreateResourceAnalyticsInstanceRequest struct { + + // Details for the new ResourceAnalyticsInstance. + CreateResourceAnalyticsInstanceDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 CreateResourceAnalyticsInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateResourceAnalyticsInstanceRequest) 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 CreateResourceAnalyticsInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateResourceAnalyticsInstanceRequest) 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 CreateResourceAnalyticsInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateResourceAnalyticsInstanceResponse wrapper for the CreateResourceAnalyticsInstance operation +type CreateResourceAnalyticsInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ResourceAnalyticsInstance instance + ResourceAnalyticsInstance `presentIn:"body"` + + // URL for the created ResourceAnalyticsInstance. The ResourceAnalyticsInstance OCID is generated after this request is sent. + Location *string `presentIn:"header" name:"location"` + + // Same as location. + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response CreateResourceAnalyticsInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateResourceAnalyticsInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_tenancy_attachment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_tenancy_attachment_details.go new file mode 100644 index 00000000000..8a6b3241dd5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_tenancy_attachment_details.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateTenancyAttachmentDetails The data to create a TenancyAttachment. +type CreateTenancyAttachmentDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this TenancyAttachment. + ResourceAnalyticsInstanceId *string `mandatory:"true" json:"resourceAnalyticsInstanceId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy associated with this TenancyAttachment. + TenancyId *string `mandatory:"true" json:"tenancyId"` + + // A description of the tenancy. + Description *string `mandatory:"false" json:"description"` +} + +func (m CreateTenancyAttachmentDetails) 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 CreateTenancyAttachmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_tenancy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_tenancy_attachment_request_response.go new file mode 100644 index 00000000000..7dccace8550 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/create_tenancy_attachment_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateTenancyAttachmentRequest wrapper for the CreateTenancyAttachment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CreateTenancyAttachment.go.html to see an example of how to use CreateTenancyAttachmentRequest. +type CreateTenancyAttachmentRequest struct { + + // Details for the new TenancyAttachment. + CreateTenancyAttachmentDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 CreateTenancyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateTenancyAttachmentRequest) 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 CreateTenancyAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateTenancyAttachmentRequest) 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 CreateTenancyAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateTenancyAttachmentResponse wrapper for the CreateTenancyAttachment operation +type CreateTenancyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TenancyAttachment instance + TenancyAttachment `presentIn:"body"` + + // URL for the created TenancyAttachment. The TenancyAttachment OCID is generated after this request is sent. + Location *string `presentIn:"header" name:"location"` + + // Same as location. + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response CreateTenancyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateTenancyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_monitored_region_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_monitored_region_request_response.go new file mode 100644 index 00000000000..c8e62f9c5cd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_monitored_region_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteMonitoredRegionRequest wrapper for the DeleteMonitoredRegion operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/DeleteMonitoredRegion.go.html to see an example of how to use DeleteMonitoredRegionRequest. +type DeleteMonitoredRegionRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. + MonitoredRegionId *string `mandatory:"true" contributesTo:"path" name:"monitoredRegionId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 DeleteMonitoredRegionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteMonitoredRegionRequest) 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 DeleteMonitoredRegionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteMonitoredRegionRequest) 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 DeleteMonitoredRegionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteMonitoredRegionResponse wrapper for the DeleteMonitoredRegion operation +type DeleteMonitoredRegionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response DeleteMonitoredRegionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteMonitoredRegionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_resource_analytics_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_resource_analytics_instance_request_response.go new file mode 100644 index 00000000000..7f9a6107868 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_resource_analytics_instance_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteResourceAnalyticsInstanceRequest wrapper for the DeleteResourceAnalyticsInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/DeleteResourceAnalyticsInstance.go.html to see an example of how to use DeleteResourceAnalyticsInstanceRequest. +type DeleteResourceAnalyticsInstanceRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"true" contributesTo:"path" name:"resourceAnalyticsInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 DeleteResourceAnalyticsInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteResourceAnalyticsInstanceRequest) 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 DeleteResourceAnalyticsInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteResourceAnalyticsInstanceRequest) 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 DeleteResourceAnalyticsInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteResourceAnalyticsInstanceResponse wrapper for the DeleteResourceAnalyticsInstance operation +type DeleteResourceAnalyticsInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response DeleteResourceAnalyticsInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteResourceAnalyticsInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_tenancy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_tenancy_attachment_request_response.go new file mode 100644 index 00000000000..c4c8c593756 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/delete_tenancy_attachment_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteTenancyAttachmentRequest wrapper for the DeleteTenancyAttachment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/DeleteTenancyAttachment.go.html to see an example of how to use DeleteTenancyAttachmentRequest. +type DeleteTenancyAttachmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. + TenancyAttachmentId *string `mandatory:"true" contributesTo:"path" name:"tenancyAttachmentId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 DeleteTenancyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteTenancyAttachmentRequest) 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 DeleteTenancyAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteTenancyAttachmentRequest) 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 DeleteTenancyAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteTenancyAttachmentResponse wrapper for the DeleteTenancyAttachment operation +type DeleteTenancyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response DeleteTenancyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteTenancyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_monitored_region_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_monitored_region_request_response.go new file mode 100644 index 00000000000..9008076baa4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_monitored_region_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetMonitoredRegionRequest wrapper for the GetMonitoredRegion operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetMonitoredRegion.go.html to see an example of how to use GetMonitoredRegionRequest. +type GetMonitoredRegionRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. + MonitoredRegionId *string `mandatory:"true" contributesTo:"path" name:"monitoredRegionId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 GetMonitoredRegionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetMonitoredRegionRequest) 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 GetMonitoredRegionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMonitoredRegionRequest) 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 GetMonitoredRegionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetMonitoredRegionResponse wrapper for the GetMonitoredRegion operation +type GetMonitoredRegionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MonitoredRegion instance + MonitoredRegion `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetMonitoredRegionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetMonitoredRegionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_resource_analytics_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_resource_analytics_instance_request_response.go new file mode 100644 index 00000000000..b90dc7f2c84 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_resource_analytics_instance_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetResourceAnalyticsInstanceRequest wrapper for the GetResourceAnalyticsInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetResourceAnalyticsInstance.go.html to see an example of how to use GetResourceAnalyticsInstanceRequest. +type GetResourceAnalyticsInstanceRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"true" contributesTo:"path" name:"resourceAnalyticsInstanceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 GetResourceAnalyticsInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetResourceAnalyticsInstanceRequest) 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 GetResourceAnalyticsInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetResourceAnalyticsInstanceRequest) 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 GetResourceAnalyticsInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetResourceAnalyticsInstanceResponse wrapper for the GetResourceAnalyticsInstance operation +type GetResourceAnalyticsInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ResourceAnalyticsInstance instance + ResourceAnalyticsInstance `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetResourceAnalyticsInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetResourceAnalyticsInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_tenancy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_tenancy_attachment_request_response.go new file mode 100644 index 00000000000..2b9896deb96 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_tenancy_attachment_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetTenancyAttachmentRequest wrapper for the GetTenancyAttachment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetTenancyAttachment.go.html to see an example of how to use GetTenancyAttachmentRequest. +type GetTenancyAttachmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. + TenancyAttachmentId *string `mandatory:"true" contributesTo:"path" name:"tenancyAttachmentId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 GetTenancyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetTenancyAttachmentRequest) 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 GetTenancyAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetTenancyAttachmentRequest) 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 GetTenancyAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetTenancyAttachmentResponse wrapper for the GetTenancyAttachment operation +type GetTenancyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The TenancyAttachment instance + TenancyAttachment `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` +} + +func (response GetTenancyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetTenancyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_work_request_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_work_request_request_response.go new file mode 100644 index 00000000000..3d0ac0c3a45 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/get_work_request_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) 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 GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) 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 GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // 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"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_monitored_regions_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_monitored_regions_request_response.go new file mode 100644 index 00000000000..a3ce5b0b9e7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_monitored_regions_request_response.go @@ -0,0 +1,214 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListMonitoredRegionsRequest wrapper for the ListMonitoredRegions operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListMonitoredRegions.go.html to see an example of how to use ListMonitoredRegionsRequest. +type ListMonitoredRegionsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"false" contributesTo:"query" name:"resourceAnalyticsInstanceId"` + + // A filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState MonitoredRegionLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListMonitoredRegionsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `TIME_CREATED` + // is descending. Default order for `REGION_ID` is ascending. + SortBy ListMonitoredRegionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListMonitoredRegionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListMonitoredRegionsRequest) 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 ListMonitoredRegionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListMonitoredRegionsRequest) 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 ListMonitoredRegionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingMonitoredRegionLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetMonitoredRegionLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListMonitoredRegionsSortOrderEnum(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(GetListMonitoredRegionsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListMonitoredRegionsSortByEnum(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(GetListMonitoredRegionsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListMonitoredRegionsResponse wrapper for the ListMonitoredRegions operation +type ListMonitoredRegionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of MonitoredRegionCollection instances + MonitoredRegionCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListMonitoredRegionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListMonitoredRegionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListMonitoredRegionsSortOrderEnum Enum with underlying type: string +type ListMonitoredRegionsSortOrderEnum string + +// Set of constants representing the allowable values for ListMonitoredRegionsSortOrderEnum +const ( + ListMonitoredRegionsSortOrderAsc ListMonitoredRegionsSortOrderEnum = "ASC" + ListMonitoredRegionsSortOrderDesc ListMonitoredRegionsSortOrderEnum = "DESC" +) + +var mappingListMonitoredRegionsSortOrderEnum = map[string]ListMonitoredRegionsSortOrderEnum{ + "ASC": ListMonitoredRegionsSortOrderAsc, + "DESC": ListMonitoredRegionsSortOrderDesc, +} + +var mappingListMonitoredRegionsSortOrderEnumLowerCase = map[string]ListMonitoredRegionsSortOrderEnum{ + "asc": ListMonitoredRegionsSortOrderAsc, + "desc": ListMonitoredRegionsSortOrderDesc, +} + +// GetListMonitoredRegionsSortOrderEnumValues Enumerates the set of values for ListMonitoredRegionsSortOrderEnum +func GetListMonitoredRegionsSortOrderEnumValues() []ListMonitoredRegionsSortOrderEnum { + values := make([]ListMonitoredRegionsSortOrderEnum, 0) + for _, v := range mappingListMonitoredRegionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListMonitoredRegionsSortOrderEnumStringValues Enumerates the set of values in String for ListMonitoredRegionsSortOrderEnum +func GetListMonitoredRegionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListMonitoredRegionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMonitoredRegionsSortOrderEnum(val string) (ListMonitoredRegionsSortOrderEnum, bool) { + enum, ok := mappingListMonitoredRegionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListMonitoredRegionsSortByEnum Enum with underlying type: string +type ListMonitoredRegionsSortByEnum string + +// Set of constants representing the allowable values for ListMonitoredRegionsSortByEnum +const ( + ListMonitoredRegionsSortByTimeCreated ListMonitoredRegionsSortByEnum = "TIME_CREATED" + ListMonitoredRegionsSortByRegionId ListMonitoredRegionsSortByEnum = "REGION_ID" +) + +var mappingListMonitoredRegionsSortByEnum = map[string]ListMonitoredRegionsSortByEnum{ + "TIME_CREATED": ListMonitoredRegionsSortByTimeCreated, + "REGION_ID": ListMonitoredRegionsSortByRegionId, +} + +var mappingListMonitoredRegionsSortByEnumLowerCase = map[string]ListMonitoredRegionsSortByEnum{ + "time_created": ListMonitoredRegionsSortByTimeCreated, + "region_id": ListMonitoredRegionsSortByRegionId, +} + +// GetListMonitoredRegionsSortByEnumValues Enumerates the set of values for ListMonitoredRegionsSortByEnum +func GetListMonitoredRegionsSortByEnumValues() []ListMonitoredRegionsSortByEnum { + values := make([]ListMonitoredRegionsSortByEnum, 0) + for _, v := range mappingListMonitoredRegionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListMonitoredRegionsSortByEnumStringValues Enumerates the set of values in String for ListMonitoredRegionsSortByEnum +func GetListMonitoredRegionsSortByEnumStringValues() []string { + return []string{ + "TIME_CREATED", + "REGION_ID", + } +} + +// GetMappingListMonitoredRegionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListMonitoredRegionsSortByEnum(val string) (ListMonitoredRegionsSortByEnum, bool) { + enum, ok := mappingListMonitoredRegionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_resource_analytics_instances_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_resource_analytics_instances_request_response.go new file mode 100644 index 00000000000..3620f56cdcc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_resource_analytics_instances_request_response.go @@ -0,0 +1,217 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListResourceAnalyticsInstancesRequest wrapper for the ListResourceAnalyticsInstances operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListResourceAnalyticsInstances.go.html to see an example of how to use ListResourceAnalyticsInstancesRequest. +type ListResourceAnalyticsInstancesRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState ResourceAnalyticsInstanceLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given display name exactly. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListResourceAnalyticsInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `TIME_CREATED` + // is descending. Default order for `DISPLAY_NAME` is ascending. + SortBy ListResourceAnalyticsInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListResourceAnalyticsInstancesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListResourceAnalyticsInstancesRequest) 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 ListResourceAnalyticsInstancesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListResourceAnalyticsInstancesRequest) 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 ListResourceAnalyticsInstancesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceAnalyticsInstanceLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetResourceAnalyticsInstanceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListResourceAnalyticsInstancesSortOrderEnum(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(GetListResourceAnalyticsInstancesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListResourceAnalyticsInstancesSortByEnum(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(GetListResourceAnalyticsInstancesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListResourceAnalyticsInstancesResponse wrapper for the ListResourceAnalyticsInstances operation +type ListResourceAnalyticsInstancesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ResourceAnalyticsInstanceCollection instances + ResourceAnalyticsInstanceCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListResourceAnalyticsInstancesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListResourceAnalyticsInstancesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListResourceAnalyticsInstancesSortOrderEnum Enum with underlying type: string +type ListResourceAnalyticsInstancesSortOrderEnum string + +// Set of constants representing the allowable values for ListResourceAnalyticsInstancesSortOrderEnum +const ( + ListResourceAnalyticsInstancesSortOrderAsc ListResourceAnalyticsInstancesSortOrderEnum = "ASC" + ListResourceAnalyticsInstancesSortOrderDesc ListResourceAnalyticsInstancesSortOrderEnum = "DESC" +) + +var mappingListResourceAnalyticsInstancesSortOrderEnum = map[string]ListResourceAnalyticsInstancesSortOrderEnum{ + "ASC": ListResourceAnalyticsInstancesSortOrderAsc, + "DESC": ListResourceAnalyticsInstancesSortOrderDesc, +} + +var mappingListResourceAnalyticsInstancesSortOrderEnumLowerCase = map[string]ListResourceAnalyticsInstancesSortOrderEnum{ + "asc": ListResourceAnalyticsInstancesSortOrderAsc, + "desc": ListResourceAnalyticsInstancesSortOrderDesc, +} + +// GetListResourceAnalyticsInstancesSortOrderEnumValues Enumerates the set of values for ListResourceAnalyticsInstancesSortOrderEnum +func GetListResourceAnalyticsInstancesSortOrderEnumValues() []ListResourceAnalyticsInstancesSortOrderEnum { + values := make([]ListResourceAnalyticsInstancesSortOrderEnum, 0) + for _, v := range mappingListResourceAnalyticsInstancesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListResourceAnalyticsInstancesSortOrderEnumStringValues Enumerates the set of values in String for ListResourceAnalyticsInstancesSortOrderEnum +func GetListResourceAnalyticsInstancesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListResourceAnalyticsInstancesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListResourceAnalyticsInstancesSortOrderEnum(val string) (ListResourceAnalyticsInstancesSortOrderEnum, bool) { + enum, ok := mappingListResourceAnalyticsInstancesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListResourceAnalyticsInstancesSortByEnum Enum with underlying type: string +type ListResourceAnalyticsInstancesSortByEnum string + +// Set of constants representing the allowable values for ListResourceAnalyticsInstancesSortByEnum +const ( + ListResourceAnalyticsInstancesSortByTimeCreated ListResourceAnalyticsInstancesSortByEnum = "TIME_CREATED" + ListResourceAnalyticsInstancesSortByDisplayName ListResourceAnalyticsInstancesSortByEnum = "DISPLAY_NAME" +) + +var mappingListResourceAnalyticsInstancesSortByEnum = map[string]ListResourceAnalyticsInstancesSortByEnum{ + "TIME_CREATED": ListResourceAnalyticsInstancesSortByTimeCreated, + "DISPLAY_NAME": ListResourceAnalyticsInstancesSortByDisplayName, +} + +var mappingListResourceAnalyticsInstancesSortByEnumLowerCase = map[string]ListResourceAnalyticsInstancesSortByEnum{ + "time_created": ListResourceAnalyticsInstancesSortByTimeCreated, + "display_name": ListResourceAnalyticsInstancesSortByDisplayName, +} + +// GetListResourceAnalyticsInstancesSortByEnumValues Enumerates the set of values for ListResourceAnalyticsInstancesSortByEnum +func GetListResourceAnalyticsInstancesSortByEnumValues() []ListResourceAnalyticsInstancesSortByEnum { + values := make([]ListResourceAnalyticsInstancesSortByEnum, 0) + for _, v := range mappingListResourceAnalyticsInstancesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListResourceAnalyticsInstancesSortByEnumStringValues Enumerates the set of values in String for ListResourceAnalyticsInstancesSortByEnum +func GetListResourceAnalyticsInstancesSortByEnumStringValues() []string { + return []string{ + "TIME_CREATED", + "DISPLAY_NAME", + } +} + +// GetMappingListResourceAnalyticsInstancesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListResourceAnalyticsInstancesSortByEnum(val string) (ListResourceAnalyticsInstancesSortByEnum, bool) { + enum, ok := mappingListResourceAnalyticsInstancesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_tenancy_attachments_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_tenancy_attachments_request_response.go new file mode 100644 index 00000000000..516bd4c109c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_tenancy_attachments_request_response.go @@ -0,0 +1,214 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListTenancyAttachmentsRequest wrapper for the ListTenancyAttachments operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListTenancyAttachments.go.html to see an example of how to use ListTenancyAttachmentsRequest. +type ListTenancyAttachmentsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"false" contributesTo:"query" name:"resourceAnalyticsInstanceId"` + + // A filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState TenancyAttachmentLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + 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.oracle.com/iaas/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 ListTenancyAttachmentsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `TIME_CREATED` + // is descending. Default order for `DESCRIPTION` is ascending. + SortBy ListTenancyAttachmentsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ListTenancyAttachmentsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListTenancyAttachmentsRequest) 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 ListTenancyAttachmentsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListTenancyAttachmentsRequest) 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 ListTenancyAttachmentsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTenancyAttachmentLifecycleStateEnum(string(request.LifecycleState)); !ok && request.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", request.LifecycleState, strings.Join(GetTenancyAttachmentLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListTenancyAttachmentsSortOrderEnum(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(GetListTenancyAttachmentsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListTenancyAttachmentsSortByEnum(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(GetListTenancyAttachmentsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListTenancyAttachmentsResponse wrapper for the ListTenancyAttachments operation +type ListTenancyAttachmentsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of TenancyAttachmentCollection instances + TenancyAttachmentCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListTenancyAttachmentsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListTenancyAttachmentsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListTenancyAttachmentsSortOrderEnum Enum with underlying type: string +type ListTenancyAttachmentsSortOrderEnum string + +// Set of constants representing the allowable values for ListTenancyAttachmentsSortOrderEnum +const ( + ListTenancyAttachmentsSortOrderAsc ListTenancyAttachmentsSortOrderEnum = "ASC" + ListTenancyAttachmentsSortOrderDesc ListTenancyAttachmentsSortOrderEnum = "DESC" +) + +var mappingListTenancyAttachmentsSortOrderEnum = map[string]ListTenancyAttachmentsSortOrderEnum{ + "ASC": ListTenancyAttachmentsSortOrderAsc, + "DESC": ListTenancyAttachmentsSortOrderDesc, +} + +var mappingListTenancyAttachmentsSortOrderEnumLowerCase = map[string]ListTenancyAttachmentsSortOrderEnum{ + "asc": ListTenancyAttachmentsSortOrderAsc, + "desc": ListTenancyAttachmentsSortOrderDesc, +} + +// GetListTenancyAttachmentsSortOrderEnumValues Enumerates the set of values for ListTenancyAttachmentsSortOrderEnum +func GetListTenancyAttachmentsSortOrderEnumValues() []ListTenancyAttachmentsSortOrderEnum { + values := make([]ListTenancyAttachmentsSortOrderEnum, 0) + for _, v := range mappingListTenancyAttachmentsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListTenancyAttachmentsSortOrderEnumStringValues Enumerates the set of values in String for ListTenancyAttachmentsSortOrderEnum +func GetListTenancyAttachmentsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListTenancyAttachmentsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListTenancyAttachmentsSortOrderEnum(val string) (ListTenancyAttachmentsSortOrderEnum, bool) { + enum, ok := mappingListTenancyAttachmentsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListTenancyAttachmentsSortByEnum Enum with underlying type: string +type ListTenancyAttachmentsSortByEnum string + +// Set of constants representing the allowable values for ListTenancyAttachmentsSortByEnum +const ( + ListTenancyAttachmentsSortByTimeCreated ListTenancyAttachmentsSortByEnum = "TIME_CREATED" + ListTenancyAttachmentsSortByDescription ListTenancyAttachmentsSortByEnum = "DESCRIPTION" +) + +var mappingListTenancyAttachmentsSortByEnum = map[string]ListTenancyAttachmentsSortByEnum{ + "TIME_CREATED": ListTenancyAttachmentsSortByTimeCreated, + "DESCRIPTION": ListTenancyAttachmentsSortByDescription, +} + +var mappingListTenancyAttachmentsSortByEnumLowerCase = map[string]ListTenancyAttachmentsSortByEnum{ + "time_created": ListTenancyAttachmentsSortByTimeCreated, + "description": ListTenancyAttachmentsSortByDescription, +} + +// GetListTenancyAttachmentsSortByEnumValues Enumerates the set of values for ListTenancyAttachmentsSortByEnum +func GetListTenancyAttachmentsSortByEnumValues() []ListTenancyAttachmentsSortByEnum { + values := make([]ListTenancyAttachmentsSortByEnum, 0) + for _, v := range mappingListTenancyAttachmentsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListTenancyAttachmentsSortByEnumStringValues Enumerates the set of values in String for ListTenancyAttachmentsSortByEnum +func GetListTenancyAttachmentsSortByEnumStringValues() []string { + return []string{ + "TIME_CREATED", + "DESCRIPTION", + } +} + +// GetMappingListTenancyAttachmentsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListTenancyAttachmentsSortByEnum(val string) (ListTenancyAttachmentsSortByEnum, bool) { + enum, ok := mappingListTenancyAttachmentsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_request_errors_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_request_errors_request_response.go new file mode 100644 index 00000000000..b2d360d2427 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_request_errors_request_response.go @@ -0,0 +1,199 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for `timestamp` is descending. + SortBy ListWorkRequestErrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestErrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // 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 ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) 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 ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) 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 ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestErrorsSortByEnum(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(GetListWorkRequestErrorsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestErrorsSortOrderEnum(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(GetListWorkRequestErrorsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-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 `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimestamp ListWorkRequestErrorsSortByEnum = "timestamp" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +// GetListWorkRequestErrorsSortByEnumValues Enumerates the set of values for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumValues() []ListWorkRequestErrorsSortByEnum { + values := make([]ListWorkRequestErrorsSortByEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestErrorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortByEnum(val string) (ListWorkRequestErrorsSortByEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestErrorsSortOrderEnum Enum with underlying type: string +type ListWorkRequestErrorsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortOrderEnum +const ( + ListWorkRequestErrorsSortOrderAsc ListWorkRequestErrorsSortOrderEnum = "ASC" + ListWorkRequestErrorsSortOrderDesc ListWorkRequestErrorsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestErrorsSortOrderEnum = map[string]ListWorkRequestErrorsSortOrderEnum{ + "ASC": ListWorkRequestErrorsSortOrderAsc, + "DESC": ListWorkRequestErrorsSortOrderDesc, +} + +var mappingListWorkRequestErrorsSortOrderEnumLowerCase = map[string]ListWorkRequestErrorsSortOrderEnum{ + "asc": ListWorkRequestErrorsSortOrderAsc, + "desc": ListWorkRequestErrorsSortOrderDesc, +} + +// GetListWorkRequestErrorsSortOrderEnumValues Enumerates the set of values for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumValues() []ListWorkRequestErrorsSortOrderEnum { + values := make([]ListWorkRequestErrorsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestErrorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortOrderEnum(val string) (ListWorkRequestErrorsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_request_logs_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_request_logs_request_response.go new file mode 100644 index 00000000000..5f555273978 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_request_logs_request_response.go @@ -0,0 +1,199 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for `timestamp` is descending. + SortBy ListWorkRequestLogsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // 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 ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) 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 ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) 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 ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestLogsSortByEnum(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(GetListWorkRequestLogsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestLogsSortOrderEnum(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(GetListWorkRequestLogsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-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 `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimestamp ListWorkRequestLogsSortByEnum = "timestamp" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +// GetListWorkRequestLogsSortByEnumValues Enumerates the set of values for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumValues() []ListWorkRequestLogsSortByEnum { + values := make([]ListWorkRequestLogsSortByEnum, 0) + for _, v := range mappingListWorkRequestLogsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestLogsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortByEnum(val string) (ListWorkRequestLogsSortByEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestLogsSortOrderEnum Enum with underlying type: string +type ListWorkRequestLogsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortOrderEnum +const ( + ListWorkRequestLogsSortOrderAsc ListWorkRequestLogsSortOrderEnum = "ASC" + ListWorkRequestLogsSortOrderDesc ListWorkRequestLogsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestLogsSortOrderEnum = map[string]ListWorkRequestLogsSortOrderEnum{ + "ASC": ListWorkRequestLogsSortOrderAsc, + "DESC": ListWorkRequestLogsSortOrderDesc, +} + +var mappingListWorkRequestLogsSortOrderEnumLowerCase = map[string]ListWorkRequestLogsSortOrderEnum{ + "asc": ListWorkRequestLogsSortOrderAsc, + "desc": ListWorkRequestLogsSortOrderDesc, +} + +// GetListWorkRequestLogsSortOrderEnumValues Enumerates the set of values for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumValues() []ListWorkRequestLogsSortOrderEnum { + values := make([]ListWorkRequestLogsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestLogsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestLogsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortOrderEnum(val string) (ListWorkRequestLogsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_requests_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_requests_request_response.go new file mode 100644 index 00000000000..d9f3c924622 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/list_work_requests_request_response.go @@ -0,0 +1,277 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // A filter to return only the resources that match the given lifecycle state. + Status ListWorkRequestsStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource affected by the work request. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // 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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for `timeAccepted` is descending. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // 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 ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) 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 ListWorkRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) 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 ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestsStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetListWorkRequestsStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortOrderEnum(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(GetListWorkRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortByEnum(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(GetListWorkRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `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 list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsStatusEnum Enum with underlying type: string +type ListWorkRequestsStatusEnum string + +// Set of constants representing the allowable values for ListWorkRequestsStatusEnum +const ( + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "needs_attention": ListWorkRequestsStatusNeedsAttention, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, +} + +// GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumValues() []ListWorkRequestsStatusEnum { + values := make([]ListWorkRequestsStatusEnum, 0) + for _, v := range mappingListWorkRequestsStatusEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsStatusEnumStringValues Enumerates the set of values in String for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingListWorkRequestsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsStatusEnum(val string) (ListWorkRequestsStatusEnum, bool) { + enum, ok := mappingListWorkRequestsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrderEnum = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +var mappingListWorkRequestsSortOrderEnumLowerCase = map[string]ListWorkRequestsSortOrderEnum{ + "asc": ListWorkRequestsSortOrderAsc, + "desc": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortOrderEnum(val string) (ListWorkRequestsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortByTimeaccepted ListWorkRequestsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestsSortByEnum = map[string]ListWorkRequestsSortByEnum{ + "timeAccepted": ListWorkRequestsSortByTimeaccepted, +} + +var mappingListWorkRequestsSortByEnumLowerCase = map[string]ListWorkRequestsSortByEnum{ + "timeaccepted": ListWorkRequestsSortByTimeaccepted, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortByEnum(val string) (ListWorkRequestsSortByEnum, bool) { + enum, ok := mappingListWorkRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region.go new file mode 100644 index 00000000000..09163d68b07 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region.go @@ -0,0 +1,128 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MonitoredRegion A MonitoredRegion is a region to collect data for the associated ResourceAnalyticsInstance. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to +// an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.oracle.com/iaas/Content/Identity/policiesgs/get-started-with-policies.htm). +type MonitoredRegion struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this MonitoredRegion. + ResourceAnalyticsInstanceId *string `mandatory:"true" json:"resourceAnalyticsInstanceId"` + + // The Region Identifier (https://docs.oracle.com/iaas/Content/General/Concepts/regions.htm) of this MonitoredRegion. + RegionId *string `mandatory:"true" json:"regionId"` + + // The date and time the MonitoredRegion was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the MonitoredRegion. + LifecycleState MonitoredRegionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the MonitoredRegion was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the MonitoredRegion in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m MonitoredRegion) 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 MonitoredRegion) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingMonitoredRegionLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetMonitoredRegionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MonitoredRegionLifecycleStateEnum Enum with underlying type: string +type MonitoredRegionLifecycleStateEnum string + +// Set of constants representing the allowable values for MonitoredRegionLifecycleStateEnum +const ( + MonitoredRegionLifecycleStateCreating MonitoredRegionLifecycleStateEnum = "CREATING" + MonitoredRegionLifecycleStateUpdating MonitoredRegionLifecycleStateEnum = "UPDATING" + MonitoredRegionLifecycleStateActive MonitoredRegionLifecycleStateEnum = "ACTIVE" + MonitoredRegionLifecycleStateDeleting MonitoredRegionLifecycleStateEnum = "DELETING" + MonitoredRegionLifecycleStateDeleted MonitoredRegionLifecycleStateEnum = "DELETED" + MonitoredRegionLifecycleStateFailed MonitoredRegionLifecycleStateEnum = "FAILED" +) + +var mappingMonitoredRegionLifecycleStateEnum = map[string]MonitoredRegionLifecycleStateEnum{ + "CREATING": MonitoredRegionLifecycleStateCreating, + "UPDATING": MonitoredRegionLifecycleStateUpdating, + "ACTIVE": MonitoredRegionLifecycleStateActive, + "DELETING": MonitoredRegionLifecycleStateDeleting, + "DELETED": MonitoredRegionLifecycleStateDeleted, + "FAILED": MonitoredRegionLifecycleStateFailed, +} + +var mappingMonitoredRegionLifecycleStateEnumLowerCase = map[string]MonitoredRegionLifecycleStateEnum{ + "creating": MonitoredRegionLifecycleStateCreating, + "updating": MonitoredRegionLifecycleStateUpdating, + "active": MonitoredRegionLifecycleStateActive, + "deleting": MonitoredRegionLifecycleStateDeleting, + "deleted": MonitoredRegionLifecycleStateDeleted, + "failed": MonitoredRegionLifecycleStateFailed, +} + +// GetMonitoredRegionLifecycleStateEnumValues Enumerates the set of values for MonitoredRegionLifecycleStateEnum +func GetMonitoredRegionLifecycleStateEnumValues() []MonitoredRegionLifecycleStateEnum { + values := make([]MonitoredRegionLifecycleStateEnum, 0) + for _, v := range mappingMonitoredRegionLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetMonitoredRegionLifecycleStateEnumStringValues Enumerates the set of values in String for MonitoredRegionLifecycleStateEnum +func GetMonitoredRegionLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingMonitoredRegionLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingMonitoredRegionLifecycleStateEnum(val string) (MonitoredRegionLifecycleStateEnum, bool) { + enum, ok := mappingMonitoredRegionLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region_collection.go new file mode 100644 index 00000000000..f3da4f6b06b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MonitoredRegionCollection Results of a MonitoredRegion search. Contains both MonitoredRegionSummary items and other information, such as metadata. +type MonitoredRegionCollection struct { + + // List of MonitoredRegions. + Items []MonitoredRegionSummary `mandatory:"true" json:"items"` +} + +func (m MonitoredRegionCollection) 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 MonitoredRegionCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region_summary.go new file mode 100644 index 00000000000..666366bdc2e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/monitored_region_summary.go @@ -0,0 +1,67 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MonitoredRegionSummary Summary information about a MonitoredRegion. +type MonitoredRegionSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this MonitoredRegion. + ResourceAnalyticsInstanceId *string `mandatory:"true" json:"resourceAnalyticsInstanceId"` + + // The Region Identifier (https://docs.oracle.com/iaas/Content/General/Concepts/regions.htm) of this MonitoredRegion. + RegionId *string `mandatory:"true" json:"regionId"` + + // The date and time the MonitoredRegion was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the MonitoredRegion. + LifecycleState MonitoredRegionLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the MonitoredRegion was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the MonitoredRegion in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m MonitoredRegionSummary) 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 MonitoredRegionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingMonitoredRegionLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetMonitoredRegionLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/operation_status.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/operation_status.go new file mode 100644 index 00000000000..1b08d3a5b23 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/operation_status.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "needs_attention": OperationStatusNeedsAttention, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/operation_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/operation_type.go new file mode 100644 index 00000000000..ba38e2021db --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/operation_type.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypeCreateResourceAnalyticsInstance OperationTypeEnum = "CREATE_RESOURCE_ANALYTICS_INSTANCE" + OperationTypeUpdateResourceAnalyticsInstance OperationTypeEnum = "UPDATE_RESOURCE_ANALYTICS_INSTANCE" + OperationTypeDeleteResourceAnalyticsInstance OperationTypeEnum = "DELETE_RESOURCE_ANALYTICS_INSTANCE" + OperationTypeMoveResourceAnalyticsInstance OperationTypeEnum = "MOVE_RESOURCE_ANALYTICS_INSTANCE" + OperationTypeCreateTenancyAttachment OperationTypeEnum = "CREATE_TENANCY_ATTACHMENT" + OperationTypeUpdateTenancyAttachment OperationTypeEnum = "UPDATE_TENANCY_ATTACHMENT" + OperationTypeDeleteTenancyAttachment OperationTypeEnum = "DELETE_TENANCY_ATTACHMENT" + OperationTypeCreateMonitoredRegion OperationTypeEnum = "CREATE_MONITORED_REGION" + OperationTypeDeleteMonitoredRegion OperationTypeEnum = "DELETE_MONITORED_REGION" + OperationTypeEnableOac OperationTypeEnum = "ENABLE_OAC" + OperationTypeDisableOac OperationTypeEnum = "DISABLE_OAC" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "CREATE_RESOURCE_ANALYTICS_INSTANCE": OperationTypeCreateResourceAnalyticsInstance, + "UPDATE_RESOURCE_ANALYTICS_INSTANCE": OperationTypeUpdateResourceAnalyticsInstance, + "DELETE_RESOURCE_ANALYTICS_INSTANCE": OperationTypeDeleteResourceAnalyticsInstance, + "MOVE_RESOURCE_ANALYTICS_INSTANCE": OperationTypeMoveResourceAnalyticsInstance, + "CREATE_TENANCY_ATTACHMENT": OperationTypeCreateTenancyAttachment, + "UPDATE_TENANCY_ATTACHMENT": OperationTypeUpdateTenancyAttachment, + "DELETE_TENANCY_ATTACHMENT": OperationTypeDeleteTenancyAttachment, + "CREATE_MONITORED_REGION": OperationTypeCreateMonitoredRegion, + "DELETE_MONITORED_REGION": OperationTypeDeleteMonitoredRegion, + "ENABLE_OAC": OperationTypeEnableOac, + "DISABLE_OAC": OperationTypeDisableOac, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "create_resource_analytics_instance": OperationTypeCreateResourceAnalyticsInstance, + "update_resource_analytics_instance": OperationTypeUpdateResourceAnalyticsInstance, + "delete_resource_analytics_instance": OperationTypeDeleteResourceAnalyticsInstance, + "move_resource_analytics_instance": OperationTypeMoveResourceAnalyticsInstance, + "create_tenancy_attachment": OperationTypeCreateTenancyAttachment, + "update_tenancy_attachment": OperationTypeUpdateTenancyAttachment, + "delete_tenancy_attachment": OperationTypeDeleteTenancyAttachment, + "create_monitored_region": OperationTypeCreateMonitoredRegion, + "delete_monitored_region": OperationTypeDeleteMonitoredRegion, + "enable_oac": OperationTypeEnableOac, + "disable_oac": OperationTypeDisableOac, +} + +// GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum +func GetOperationTypeEnumValues() []OperationTypeEnum { + values := make([]OperationTypeEnum, 0) + for _, v := range mappingOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypeEnumStringValues Enumerates the set of values in String for OperationTypeEnum +func GetOperationTypeEnumStringValues() []string { + return []string{ + "CREATE_RESOURCE_ANALYTICS_INSTANCE", + "UPDATE_RESOURCE_ANALYTICS_INSTANCE", + "DELETE_RESOURCE_ANALYTICS_INSTANCE", + "MOVE_RESOURCE_ANALYTICS_INSTANCE", + "CREATE_TENANCY_ATTACHMENT", + "UPDATE_TENANCY_ATTACHMENT", + "DELETE_TENANCY_ATTACHMENT", + "CREATE_MONITORED_REGION", + "DELETE_MONITORED_REGION", + "ENABLE_OAC", + "DISABLE_OAC", + } +} + +// GetMappingOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypeEnum(val string) (OperationTypeEnum, bool) { + enum, ok := mappingOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/plain_text_password_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/plain_text_password_details.go new file mode 100644 index 00000000000..4851916c159 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/plain_text_password_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PlainTextPasswordDetails Details for the PLAIN_TEXT ADW Admin password. +type PlainTextPasswordDetails struct { + + // Password for the ADW to be created in User Tenancy. The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. + Password *string `mandatory:"true" json:"password"` +} + +func (m PlainTextPasswordDetails) 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 PlainTextPasswordDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m PlainTextPasswordDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypePlainTextPasswordDetails PlainTextPasswordDetails + s := struct { + DiscriminatorParam string `json:"passwordType"` + MarshalTypePlainTextPasswordDetails + }{ + "PLAIN_TEXT", + (MarshalTypePlainTextPasswordDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance.go new file mode 100644 index 00000000000..443e1412310 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance.go @@ -0,0 +1,151 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnalyticsInstance A ResourceAnalyticsInstance is an ADW housing analytics for all of a customers' OCI resources. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to +// an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.oracle.com/iaas/Content/Identity/policiesgs/get-started-with-policies.htm). +type ResourceAnalyticsInstance struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the ResourceAnalyticsInstance was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the ResourceAnalyticsInstance. + LifecycleState ResourceAnalyticsInstanceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // A description of the ResourceAnalyticsInstance instance. + Description *string `mandatory:"false" json:"description"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the created ADW instance. + AdwId *string `mandatory:"false" json:"adwId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OAC enabled for the ResourceAnalyticsInstance. + OacId *string `mandatory:"false" json:"oacId"` + + // The date and time the ResourceAnalyticsInstance was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the ResourceAnalyticsInstance in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ResourceAnalyticsInstance) 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 ResourceAnalyticsInstance) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceAnalyticsInstanceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResourceAnalyticsInstanceLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceAnalyticsInstanceLifecycleStateEnum Enum with underlying type: string +type ResourceAnalyticsInstanceLifecycleStateEnum string + +// Set of constants representing the allowable values for ResourceAnalyticsInstanceLifecycleStateEnum +const ( + ResourceAnalyticsInstanceLifecycleStateCreating ResourceAnalyticsInstanceLifecycleStateEnum = "CREATING" + ResourceAnalyticsInstanceLifecycleStateUpdating ResourceAnalyticsInstanceLifecycleStateEnum = "UPDATING" + ResourceAnalyticsInstanceLifecycleStateActive ResourceAnalyticsInstanceLifecycleStateEnum = "ACTIVE" + ResourceAnalyticsInstanceLifecycleStateNeedsAttention ResourceAnalyticsInstanceLifecycleStateEnum = "NEEDS_ATTENTION" + ResourceAnalyticsInstanceLifecycleStateDeleting ResourceAnalyticsInstanceLifecycleStateEnum = "DELETING" + ResourceAnalyticsInstanceLifecycleStateDeleted ResourceAnalyticsInstanceLifecycleStateEnum = "DELETED" + ResourceAnalyticsInstanceLifecycleStateFailed ResourceAnalyticsInstanceLifecycleStateEnum = "FAILED" +) + +var mappingResourceAnalyticsInstanceLifecycleStateEnum = map[string]ResourceAnalyticsInstanceLifecycleStateEnum{ + "CREATING": ResourceAnalyticsInstanceLifecycleStateCreating, + "UPDATING": ResourceAnalyticsInstanceLifecycleStateUpdating, + "ACTIVE": ResourceAnalyticsInstanceLifecycleStateActive, + "NEEDS_ATTENTION": ResourceAnalyticsInstanceLifecycleStateNeedsAttention, + "DELETING": ResourceAnalyticsInstanceLifecycleStateDeleting, + "DELETED": ResourceAnalyticsInstanceLifecycleStateDeleted, + "FAILED": ResourceAnalyticsInstanceLifecycleStateFailed, +} + +var mappingResourceAnalyticsInstanceLifecycleStateEnumLowerCase = map[string]ResourceAnalyticsInstanceLifecycleStateEnum{ + "creating": ResourceAnalyticsInstanceLifecycleStateCreating, + "updating": ResourceAnalyticsInstanceLifecycleStateUpdating, + "active": ResourceAnalyticsInstanceLifecycleStateActive, + "needs_attention": ResourceAnalyticsInstanceLifecycleStateNeedsAttention, + "deleting": ResourceAnalyticsInstanceLifecycleStateDeleting, + "deleted": ResourceAnalyticsInstanceLifecycleStateDeleted, + "failed": ResourceAnalyticsInstanceLifecycleStateFailed, +} + +// GetResourceAnalyticsInstanceLifecycleStateEnumValues Enumerates the set of values for ResourceAnalyticsInstanceLifecycleStateEnum +func GetResourceAnalyticsInstanceLifecycleStateEnumValues() []ResourceAnalyticsInstanceLifecycleStateEnum { + values := make([]ResourceAnalyticsInstanceLifecycleStateEnum, 0) + for _, v := range mappingResourceAnalyticsInstanceLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetResourceAnalyticsInstanceLifecycleStateEnumStringValues Enumerates the set of values in String for ResourceAnalyticsInstanceLifecycleStateEnum +func GetResourceAnalyticsInstanceLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "NEEDS_ATTENTION", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingResourceAnalyticsInstanceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceAnalyticsInstanceLifecycleStateEnum(val string) (ResourceAnalyticsInstanceLifecycleStateEnum, bool) { + enum, ok := mappingResourceAnalyticsInstanceLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_collection.go new file mode 100644 index 00000000000..c49025ff60c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnalyticsInstanceCollection Results of a ResourceAnalyticsInstance search. Contains both ResourceAnalyticsInstanceSummary items and other information, such as metadata. +type ResourceAnalyticsInstanceCollection struct { + + // List of ResourceAnalyticsInstanceSummary's. + Items []ResourceAnalyticsInstanceSummary `mandatory:"true" json:"items"` +} + +func (m ResourceAnalyticsInstanceCollection) 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 ResourceAnalyticsInstanceCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_disable_oac_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_disable_oac_request_response.go new file mode 100644 index 00000000000..f8adc986e27 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_disable_oac_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ResourceAnalyticsInstanceDisableOacRequest wrapper for the ResourceAnalyticsInstanceDisableOac operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ResourceAnalyticsInstanceDisableOac.go.html to see an example of how to use ResourceAnalyticsInstanceDisableOacRequest. +type ResourceAnalyticsInstanceDisableOacRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"true" contributesTo:"path" name:"resourceAnalyticsInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ResourceAnalyticsInstanceDisableOacRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ResourceAnalyticsInstanceDisableOacRequest) 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 ResourceAnalyticsInstanceDisableOacRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ResourceAnalyticsInstanceDisableOacRequest) 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 ResourceAnalyticsInstanceDisableOacRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceAnalyticsInstanceDisableOacResponse wrapper for the ResourceAnalyticsInstanceDisableOac operation +type ResourceAnalyticsInstanceDisableOacResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response ResourceAnalyticsInstanceDisableOacResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ResourceAnalyticsInstanceDisableOacResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_enable_oac_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_enable_oac_details.go new file mode 100644 index 00000000000..64f278235f1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_enable_oac_details.go @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnalyticsInstanceEnableOacDetails The configuration details for the enable OAC operation. +// Example: `{"attachmentType":"MANAGED","attachmentDetails":{...}}` +type ResourceAnalyticsInstanceEnableOacDetails struct { + + // The type of attachment the OAC instance is using. + AttachmentType ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum `mandatory:"true" json:"attachmentType"` + + AttachmentDetails *ResourceAnalyticsInstanceOacAttachmentDetails `mandatory:"true" json:"attachmentDetails"` +} + +func (m ResourceAnalyticsInstanceEnableOacDetails) 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 ResourceAnalyticsInstanceEnableOacDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum(string(m.AttachmentType)); !ok && m.AttachmentType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttachmentType: %s. Supported values are: %s.", m.AttachmentType, strings.Join(GetResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum Enum with underlying type: string +type ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum string + +// Set of constants representing the allowable values for ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum +const ( + ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeManaged ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum = "MANAGED" +) + +var mappingResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum = map[string]ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum{ + "MANAGED": ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeManaged, +} + +var mappingResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnumLowerCase = map[string]ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum{ + "managed": ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeManaged, +} + +// GetResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnumValues Enumerates the set of values for ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum +func GetResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnumValues() []ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum { + values := make([]ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum, 0) + for _, v := range mappingResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum { + values = append(values, v) + } + return values +} + +// GetResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnumStringValues Enumerates the set of values in String for ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum +func GetResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnumStringValues() []string { + return []string{ + "MANAGED", + } +} + +// GetMappingResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum(val string) (ResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnum, bool) { + enum, ok := mappingResourceAnalyticsInstanceEnableOacDetailsAttachmentTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_enable_oac_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_enable_oac_request_response.go new file mode 100644 index 00000000000..4fde5f3804c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_enable_oac_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ResourceAnalyticsInstanceEnableOacRequest wrapper for the ResourceAnalyticsInstanceEnableOac operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ResourceAnalyticsInstanceEnableOac.go.html to see an example of how to use ResourceAnalyticsInstanceEnableOacRequest. +type ResourceAnalyticsInstanceEnableOacRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"true" contributesTo:"path" name:"resourceAnalyticsInstanceId"` + + // The information to be updated. + ResourceAnalyticsInstanceEnableOacDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 ResourceAnalyticsInstanceEnableOacRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ResourceAnalyticsInstanceEnableOacRequest) 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 ResourceAnalyticsInstanceEnableOacRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ResourceAnalyticsInstanceEnableOacRequest) 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 ResourceAnalyticsInstanceEnableOacRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceAnalyticsInstanceEnableOacResponse wrapper for the ResourceAnalyticsInstanceEnableOac operation +type ResourceAnalyticsInstanceEnableOacResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response ResourceAnalyticsInstanceEnableOacResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ResourceAnalyticsInstanceEnableOacResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_oac_attachment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_oac_attachment_details.go new file mode 100644 index 00000000000..02483c7dd31 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_oac_attachment_details.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnalyticsInstanceOacAttachmentDetails Additional details needed when attaching the OAC instance. +// Example: `{"idcsDomainId":"ocid...","networkDetails":{...}, ...}` +type ResourceAnalyticsInstanceOacAttachmentDetails struct { + + // IDCS domain OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) identifying a stripe and service administrator user. + IdcsDomainId *string `mandatory:"true" json:"idcsDomainId"` + + NetworkDetails *ResourceAnalyticsInstanceOacNetworkDetails `mandatory:"false" json:"networkDetails"` + + // Deprecated. Use `networkDetails.subnetId` instead. + SubnetId *string `mandatory:"false" json:"subnetId"` + + // Deprecated. Use `networkDetails.nsgIds` instead. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // The Oracle license model that applies to the OAC instance. + LicenseModel ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum `mandatory:"false" json:"licenseModel,omitempty"` +} + +func (m ResourceAnalyticsInstanceOacAttachmentDetails) 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 ResourceAnalyticsInstanceOacAttachmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum(string(m.LicenseModel)); !ok && m.LicenseModel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LicenseModel: %s. Supported values are: %s.", m.LicenseModel, strings.Join(GetResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum Enum with underlying type: string +type ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum string + +// Set of constants representing the allowable values for ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum +const ( + ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelLicenseIncluded ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum = "LICENSE_INCLUDED" + ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelBringYourOwnLicense ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum = "BRING_YOUR_OWN_LICENSE" +) + +var mappingResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum = map[string]ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum{ + "LICENSE_INCLUDED": ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelLicenseIncluded, + "BRING_YOUR_OWN_LICENSE": ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelBringYourOwnLicense, +} + +var mappingResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnumLowerCase = map[string]ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum{ + "license_included": ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelLicenseIncluded, + "bring_your_own_license": ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelBringYourOwnLicense, +} + +// GetResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnumValues Enumerates the set of values for ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum +func GetResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnumValues() []ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum { + values := make([]ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum, 0) + for _, v := range mappingResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum { + values = append(values, v) + } + return values +} + +// GetResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnumStringValues Enumerates the set of values in String for ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum +func GetResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnumStringValues() []string { + return []string{ + "LICENSE_INCLUDED", + "BRING_YOUR_OWN_LICENSE", + } +} + +// GetMappingResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum(val string) (ResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnum, bool) { + enum, ok := mappingResourceAnalyticsInstanceOacAttachmentDetailsLicenseModelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_oac_network_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_oac_network_details.go new file mode 100644 index 00000000000..872a223e967 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_oac_network_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnalyticsInstanceOacNetworkDetails Details required when provisioning OAC on a private network. +// Example: `{"subnetId":"ocid...", ...}` +type ResourceAnalyticsInstanceOacNetworkDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet for the private network details. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // List of Network Security Group OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm)'s for the private network details. + // Example: `["ocid...", "ocid..."]` + NsgIds []string `mandatory:"false" json:"nsgIds"` +} + +func (m ResourceAnalyticsInstanceOacNetworkDetails) 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 ResourceAnalyticsInstanceOacNetworkDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_summary.go new file mode 100644 index 00000000000..c004c1c6dd3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resource_analytics_instance_summary.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceAnalyticsInstanceSummary Summary information about a ResourceAnalyticsInstance. +type ResourceAnalyticsInstanceSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name. Does not have to be unique, and it's changeable. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the ResourceAnalyticsInstance was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the ResourceAnalyticsInstance. + LifecycleState ResourceAnalyticsInstanceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // A description of the ResourceAnalyticsInstance instance. + Description *string `mandatory:"false" json:"description"` + + // The date and time the ResourceAnalyticsInstance was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the ResourceAnalyticsInstance in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ResourceAnalyticsInstanceSummary) 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 ResourceAnalyticsInstanceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceAnalyticsInstanceLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResourceAnalyticsInstanceLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_monitoredregion_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_monitoredregion_client.go new file mode 100644 index 00000000000..b259d1a0784 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_monitoredregion_client.go @@ -0,0 +1,329 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// MonitoredRegionClient a client for MonitoredRegion +type MonitoredRegionClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewMonitoredRegionClientWithConfigurationProvider Creates a new default MonitoredRegion client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewMonitoredRegionClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client MonitoredRegionClient, err error) { + if enabled := common.CheckForEnabledServices("resourceanalytics"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newMonitoredRegionClientFromBaseClient(baseClient, provider) +} + +// NewMonitoredRegionClientWithOboToken Creates a new default MonitoredRegion client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewMonitoredRegionClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client MonitoredRegionClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newMonitoredRegionClientFromBaseClient(baseClient, configProvider) +} + +func newMonitoredRegionClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client MonitoredRegionClient, err error) { + // MonitoredRegion service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("MonitoredRegion")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = MonitoredRegionClient{BaseClient: baseClient} + client.BasePath = "20241031" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *MonitoredRegionClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("resourceanalytics", "https://resource-analytics.{region}.ocp.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *MonitoredRegionClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *MonitoredRegionClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateMonitoredRegion Creates a MonitoredRegion. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CreateMonitoredRegion.go.html to see an example of how to use CreateMonitoredRegion API. +// A default retry strategy applies to this operation CreateMonitoredRegion() +func (client MonitoredRegionClient) CreateMonitoredRegion(ctx context.Context, request CreateMonitoredRegionRequest) (response CreateMonitoredRegionResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createMonitoredRegion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateMonitoredRegionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateMonitoredRegionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateMonitoredRegionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateMonitoredRegionResponse") + } + return +} + +// createMonitoredRegion implements the OCIOperation interface (enables retrying operations) +func (client MonitoredRegionClient) createMonitoredRegion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/monitoredRegions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateMonitoredRegionResponse + 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/resource-analytics/20241031/MonitoredRegion/CreateMonitoredRegion" + err = common.PostProcessServiceError(err, "MonitoredRegion", "CreateMonitoredRegion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteMonitoredRegion Deletes a MonitoredRegion. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/DeleteMonitoredRegion.go.html to see an example of how to use DeleteMonitoredRegion API. +// A default retry strategy applies to this operation DeleteMonitoredRegion() +func (client MonitoredRegionClient) DeleteMonitoredRegion(ctx context.Context, request DeleteMonitoredRegionRequest) (response DeleteMonitoredRegionResponse, 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.deleteMonitoredRegion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteMonitoredRegionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteMonitoredRegionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteMonitoredRegionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteMonitoredRegionResponse") + } + return +} + +// deleteMonitoredRegion implements the OCIOperation interface (enables retrying operations) +func (client MonitoredRegionClient) deleteMonitoredRegion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/monitoredRegions/{monitoredRegionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteMonitoredRegionResponse + 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/resource-analytics/20241031/MonitoredRegion/DeleteMonitoredRegion" + err = common.PostProcessServiceError(err, "MonitoredRegion", "DeleteMonitoredRegion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetMonitoredRegion Gets information about a MonitoredRegion. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetMonitoredRegion.go.html to see an example of how to use GetMonitoredRegion API. +// A default retry strategy applies to this operation GetMonitoredRegion() +func (client MonitoredRegionClient) GetMonitoredRegion(ctx context.Context, request GetMonitoredRegionRequest) (response GetMonitoredRegionResponse, 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.getMonitoredRegion, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetMonitoredRegionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetMonitoredRegionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetMonitoredRegionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMonitoredRegionResponse") + } + return +} + +// getMonitoredRegion implements the OCIOperation interface (enables retrying operations) +func (client MonitoredRegionClient) getMonitoredRegion(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/monitoredRegions/{monitoredRegionId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetMonitoredRegionResponse + 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/resource-analytics/20241031/MonitoredRegion/GetMonitoredRegion" + err = common.PostProcessServiceError(err, "MonitoredRegion", "GetMonitoredRegion", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMonitoredRegions Gets a list of MonitoredRegions. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListMonitoredRegions.go.html to see an example of how to use ListMonitoredRegions API. +// A default retry strategy applies to this operation ListMonitoredRegions() +func (client MonitoredRegionClient) ListMonitoredRegions(ctx context.Context, request ListMonitoredRegionsRequest) (response ListMonitoredRegionsResponse, 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.listMonitoredRegions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMonitoredRegionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMonitoredRegionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMonitoredRegionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMonitoredRegionsResponse") + } + return +} + +// listMonitoredRegions implements the OCIOperation interface (enables retrying operations) +func (client MonitoredRegionClient) listMonitoredRegions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/monitoredRegions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMonitoredRegionsResponse + 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/resource-analytics/20241031/MonitoredRegionCollection/ListMonitoredRegions" + err = common.PostProcessServiceError(err, "MonitoredRegion", "ListMonitoredRegions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_resourceanalyticsinstance_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_resourceanalyticsinstance_client.go new file mode 100644 index 00000000000..dda9b712f42 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_resourceanalyticsinstance_client.go @@ -0,0 +1,850 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ResourceAnalyticsInstanceClient a client for ResourceAnalyticsInstance +type ResourceAnalyticsInstanceClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewResourceAnalyticsInstanceClientWithConfigurationProvider Creates a new default ResourceAnalyticsInstance client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewResourceAnalyticsInstanceClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ResourceAnalyticsInstanceClient, err error) { + if enabled := common.CheckForEnabledServices("resourceanalytics"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newResourceAnalyticsInstanceClientFromBaseClient(baseClient, provider) +} + +// NewResourceAnalyticsInstanceClientWithOboToken Creates a new default ResourceAnalyticsInstance client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewResourceAnalyticsInstanceClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ResourceAnalyticsInstanceClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newResourceAnalyticsInstanceClientFromBaseClient(baseClient, configProvider) +} + +func newResourceAnalyticsInstanceClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ResourceAnalyticsInstanceClient, err error) { + // ResourceAnalyticsInstance service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ResourceAnalyticsInstance")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ResourceAnalyticsInstanceClient{BaseClient: baseClient} + client.BasePath = "20241031" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ResourceAnalyticsInstanceClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("resourceanalytics", "https://resource-analytics.{region}.ocp.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ResourceAnalyticsInstanceClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *ResourceAnalyticsInstanceClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CancelWorkRequest Cancels a work request. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CancelWorkRequest.go.html to see an example of how to use CancelWorkRequest API. +// A default retry strategy applies to this operation CancelWorkRequest() +func (client ResourceAnalyticsInstanceClient) CancelWorkRequest(ctx context.Context, request CancelWorkRequestRequest) (response CancelWorkRequestResponse, 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.cancelWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CancelWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CancelWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CancelWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CancelWorkRequestResponse") + } + return +} + +// cancelWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) cancelWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CancelWorkRequestResponse + 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/resource-analytics/20241031/WorkRequest/CancelWorkRequest" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "CancelWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeResourceAnalyticsInstanceCompartment Moves a ResourceAnalyticsInstance into a different compartment within the same tenancy. For information about moving resources between +// compartments, see Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ChangeResourceAnalyticsInstanceCompartment.go.html to see an example of how to use ChangeResourceAnalyticsInstanceCompartment API. +// A default retry strategy applies to this operation ChangeResourceAnalyticsInstanceCompartment() +func (client ResourceAnalyticsInstanceClient) ChangeResourceAnalyticsInstanceCompartment(ctx context.Context, request ChangeResourceAnalyticsInstanceCompartmentRequest) (response ChangeResourceAnalyticsInstanceCompartmentResponse, 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.changeResourceAnalyticsInstanceCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeResourceAnalyticsInstanceCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeResourceAnalyticsInstanceCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeResourceAnalyticsInstanceCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeResourceAnalyticsInstanceCompartmentResponse") + } + return +} + +// changeResourceAnalyticsInstanceCompartment implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) changeResourceAnalyticsInstanceCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/resourceAnalyticsInstances/{resourceAnalyticsInstanceId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeResourceAnalyticsInstanceCompartmentResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstance/ChangeResourceAnalyticsInstanceCompartment" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "ChangeResourceAnalyticsInstanceCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateResourceAnalyticsInstance Creates a ResourceAnalyticsInstance. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CreateResourceAnalyticsInstance.go.html to see an example of how to use CreateResourceAnalyticsInstance API. +// A default retry strategy applies to this operation CreateResourceAnalyticsInstance() +func (client ResourceAnalyticsInstanceClient) CreateResourceAnalyticsInstance(ctx context.Context, request CreateResourceAnalyticsInstanceRequest) (response CreateResourceAnalyticsInstanceResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createResourceAnalyticsInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateResourceAnalyticsInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateResourceAnalyticsInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateResourceAnalyticsInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateResourceAnalyticsInstanceResponse") + } + return +} + +// createResourceAnalyticsInstance implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) createResourceAnalyticsInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/resourceAnalyticsInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateResourceAnalyticsInstanceResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstance/CreateResourceAnalyticsInstance" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "CreateResourceAnalyticsInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteResourceAnalyticsInstance Deletes a ResourceAnalyticsInstance. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/DeleteResourceAnalyticsInstance.go.html to see an example of how to use DeleteResourceAnalyticsInstance API. +// A default retry strategy applies to this operation DeleteResourceAnalyticsInstance() +func (client ResourceAnalyticsInstanceClient) DeleteResourceAnalyticsInstance(ctx context.Context, request DeleteResourceAnalyticsInstanceRequest) (response DeleteResourceAnalyticsInstanceResponse, 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.deleteResourceAnalyticsInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteResourceAnalyticsInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteResourceAnalyticsInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteResourceAnalyticsInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteResourceAnalyticsInstanceResponse") + } + return +} + +// deleteResourceAnalyticsInstance implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) deleteResourceAnalyticsInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/resourceAnalyticsInstances/{resourceAnalyticsInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteResourceAnalyticsInstanceResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstance/DeleteResourceAnalyticsInstance" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "DeleteResourceAnalyticsInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetResourceAnalyticsInstance Gets information about a ResourceAnalyticsInstance. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetResourceAnalyticsInstance.go.html to see an example of how to use GetResourceAnalyticsInstance API. +// A default retry strategy applies to this operation GetResourceAnalyticsInstance() +func (client ResourceAnalyticsInstanceClient) GetResourceAnalyticsInstance(ctx context.Context, request GetResourceAnalyticsInstanceRequest) (response GetResourceAnalyticsInstanceResponse, 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.getResourceAnalyticsInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetResourceAnalyticsInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetResourceAnalyticsInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetResourceAnalyticsInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetResourceAnalyticsInstanceResponse") + } + return +} + +// getResourceAnalyticsInstance implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) getResourceAnalyticsInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/resourceAnalyticsInstances/{resourceAnalyticsInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetResourceAnalyticsInstanceResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstance/GetResourceAnalyticsInstance" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "GetResourceAnalyticsInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the details of a work request. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client ResourceAnalyticsInstanceClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, 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.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + 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/resource-analytics/20241031/WorkRequest/GetWorkRequest" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListResourceAnalyticsInstances Gets a list of ResourceAnalyticsInstances. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListResourceAnalyticsInstances.go.html to see an example of how to use ListResourceAnalyticsInstances API. +// A default retry strategy applies to this operation ListResourceAnalyticsInstances() +func (client ResourceAnalyticsInstanceClient) ListResourceAnalyticsInstances(ctx context.Context, request ListResourceAnalyticsInstancesRequest) (response ListResourceAnalyticsInstancesResponse, 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.listResourceAnalyticsInstances, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListResourceAnalyticsInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListResourceAnalyticsInstancesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListResourceAnalyticsInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListResourceAnalyticsInstancesResponse") + } + return +} + +// listResourceAnalyticsInstances implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) listResourceAnalyticsInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/resourceAnalyticsInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListResourceAnalyticsInstancesResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstanceCollection/ListResourceAnalyticsInstances" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "ListResourceAnalyticsInstances", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Lists the errors for a work request. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client ResourceAnalyticsInstanceClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, 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.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + 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/resource-analytics/20241031/WorkRequestError/ListWorkRequestErrors" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Lists the logs for a work request. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client ResourceAnalyticsInstanceClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, 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.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + 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/resource-analytics/20241031/WorkRequestLogEntry/ListWorkRequestLogs" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in a compartment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client ResourceAnalyticsInstanceClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, 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.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + 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/resource-analytics/20241031/WorkRequest/ListWorkRequests" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ResourceAnalyticsInstanceDisableOac Disable an OAC instance for a ResourceAnalyticsInstance. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ResourceAnalyticsInstanceDisableOac.go.html to see an example of how to use ResourceAnalyticsInstanceDisableOac API. +func (client ResourceAnalyticsInstanceClient) ResourceAnalyticsInstanceDisableOac(ctx context.Context, request ResourceAnalyticsInstanceDisableOacRequest) (response ResourceAnalyticsInstanceDisableOacResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.resourceAnalyticsInstanceDisableOac, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ResourceAnalyticsInstanceDisableOacResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ResourceAnalyticsInstanceDisableOacResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ResourceAnalyticsInstanceDisableOacResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ResourceAnalyticsInstanceDisableOacResponse") + } + return +} + +// resourceAnalyticsInstanceDisableOac implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) resourceAnalyticsInstanceDisableOac(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/resourceAnalyticsInstances/{resourceAnalyticsInstanceId}/actions/disableOac", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ResourceAnalyticsInstanceDisableOacResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstance/ResourceAnalyticsInstanceDisableOac" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "ResourceAnalyticsInstanceDisableOac", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ResourceAnalyticsInstanceEnableOac Attaches an OAC instance to a ResourceAnalyticsInstance. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ResourceAnalyticsInstanceEnableOac.go.html to see an example of how to use ResourceAnalyticsInstanceEnableOac API. +func (client ResourceAnalyticsInstanceClient) ResourceAnalyticsInstanceEnableOac(ctx context.Context, request ResourceAnalyticsInstanceEnableOacRequest) (response ResourceAnalyticsInstanceEnableOacResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.resourceAnalyticsInstanceEnableOac, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ResourceAnalyticsInstanceEnableOacResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ResourceAnalyticsInstanceEnableOacResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ResourceAnalyticsInstanceEnableOacResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ResourceAnalyticsInstanceEnableOacResponse") + } + return +} + +// resourceAnalyticsInstanceEnableOac implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) resourceAnalyticsInstanceEnableOac(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/resourceAnalyticsInstances/{resourceAnalyticsInstanceId}/actions/enableOac", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ResourceAnalyticsInstanceEnableOacResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstance/ResourceAnalyticsInstanceEnableOac" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "ResourceAnalyticsInstanceEnableOac", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateResourceAnalyticsInstance Updates a ResourceAnalyticsInstance. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/UpdateResourceAnalyticsInstance.go.html to see an example of how to use UpdateResourceAnalyticsInstance API. +// A default retry strategy applies to this operation UpdateResourceAnalyticsInstance() +func (client ResourceAnalyticsInstanceClient) UpdateResourceAnalyticsInstance(ctx context.Context, request UpdateResourceAnalyticsInstanceRequest) (response UpdateResourceAnalyticsInstanceResponse, 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.updateResourceAnalyticsInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateResourceAnalyticsInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateResourceAnalyticsInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateResourceAnalyticsInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateResourceAnalyticsInstanceResponse") + } + return +} + +// updateResourceAnalyticsInstance implements the OCIOperation interface (enables retrying operations) +func (client ResourceAnalyticsInstanceClient) updateResourceAnalyticsInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/resourceAnalyticsInstances/{resourceAnalyticsInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateResourceAnalyticsInstanceResponse + 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/resource-analytics/20241031/ResourceAnalyticsInstance/UpdateResourceAnalyticsInstance" + err = common.PostProcessServiceError(err, "ResourceAnalyticsInstance", "UpdateResourceAnalyticsInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_tenancyattachment_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_tenancyattachment_client.go new file mode 100644 index 00000000000..2bf0a803a2a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/resourceanalytics_tenancyattachment_client.go @@ -0,0 +1,387 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// TenancyAttachmentClient a client for TenancyAttachment +type TenancyAttachmentClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewTenancyAttachmentClientWithConfigurationProvider Creates a new default TenancyAttachment client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewTenancyAttachmentClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client TenancyAttachmentClient, err error) { + if enabled := common.CheckForEnabledServices("resourceanalytics"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newTenancyAttachmentClientFromBaseClient(baseClient, provider) +} + +// NewTenancyAttachmentClientWithOboToken Creates a new default TenancyAttachment client with the given configuration provider. +// The obotoken will be added to default headers and signed; the configuration provider will be used for the signer +// +// as well as reading the region +func NewTenancyAttachmentClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client TenancyAttachmentClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newTenancyAttachmentClientFromBaseClient(baseClient, configProvider) +} + +func newTenancyAttachmentClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client TenancyAttachmentClient, err error) { + // TenancyAttachment service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("TenancyAttachment")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = TenancyAttachmentClient{BaseClient: baseClient} + client.BasePath = "20241031" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *TenancyAttachmentClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("resourceanalytics", "https://resource-analytics.{region}.ocp.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *TenancyAttachmentClient) setConfigurationProvider(configProvider common.ConfigurationProvider) error { + if ok, err := common.IsConfigurationProviderValid(configProvider); !ok { + return err + } + + // Error has been checked already + region, _ := configProvider.Region() + client.SetRegion(region) + if client.Host == "" { + return fmt.Errorf("invalid region or Host. Endpoint cannot be constructed without endpointServiceName or serviceEndpointTemplate for a dotted region") + } + client.config = &configProvider + return nil +} + +// ConfigurationProvider the ConfigurationProvider used in this client, or null if none set +func (client *TenancyAttachmentClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// CreateTenancyAttachment Creates a TenancyAttachment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/CreateTenancyAttachment.go.html to see an example of how to use CreateTenancyAttachment API. +// A default retry strategy applies to this operation CreateTenancyAttachment() +func (client TenancyAttachmentClient) CreateTenancyAttachment(ctx context.Context, request CreateTenancyAttachmentRequest) (response CreateTenancyAttachmentResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.createTenancyAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateTenancyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateTenancyAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateTenancyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateTenancyAttachmentResponse") + } + return +} + +// createTenancyAttachment implements the OCIOperation interface (enables retrying operations) +func (client TenancyAttachmentClient) createTenancyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/tenancyAttachments", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateTenancyAttachmentResponse + 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/resource-analytics/20241031/TenancyAttachment/CreateTenancyAttachment" + err = common.PostProcessServiceError(err, "TenancyAttachment", "CreateTenancyAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteTenancyAttachment Deletes a TenancyAttachment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/DeleteTenancyAttachment.go.html to see an example of how to use DeleteTenancyAttachment API. +// A default retry strategy applies to this operation DeleteTenancyAttachment() +func (client TenancyAttachmentClient) DeleteTenancyAttachment(ctx context.Context, request DeleteTenancyAttachmentRequest) (response DeleteTenancyAttachmentResponse, 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.deleteTenancyAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteTenancyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteTenancyAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteTenancyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteTenancyAttachmentResponse") + } + return +} + +// deleteTenancyAttachment implements the OCIOperation interface (enables retrying operations) +func (client TenancyAttachmentClient) deleteTenancyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/tenancyAttachments/{tenancyAttachmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteTenancyAttachmentResponse + 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/resource-analytics/20241031/TenancyAttachment/DeleteTenancyAttachment" + err = common.PostProcessServiceError(err, "TenancyAttachment", "DeleteTenancyAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetTenancyAttachment Gets information about a TenancyAttachment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/GetTenancyAttachment.go.html to see an example of how to use GetTenancyAttachment API. +// A default retry strategy applies to this operation GetTenancyAttachment() +func (client TenancyAttachmentClient) GetTenancyAttachment(ctx context.Context, request GetTenancyAttachmentRequest) (response GetTenancyAttachmentResponse, 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.getTenancyAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetTenancyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetTenancyAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetTenancyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetTenancyAttachmentResponse") + } + return +} + +// getTenancyAttachment implements the OCIOperation interface (enables retrying operations) +func (client TenancyAttachmentClient) getTenancyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tenancyAttachments/{tenancyAttachmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetTenancyAttachmentResponse + 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/resource-analytics/20241031/TenancyAttachment/GetTenancyAttachment" + err = common.PostProcessServiceError(err, "TenancyAttachment", "GetTenancyAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListTenancyAttachments Gets a list of TenancyAttachments. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/ListTenancyAttachments.go.html to see an example of how to use ListTenancyAttachments API. +// A default retry strategy applies to this operation ListTenancyAttachments() +func (client TenancyAttachmentClient) ListTenancyAttachments(ctx context.Context, request ListTenancyAttachmentsRequest) (response ListTenancyAttachmentsResponse, 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.listTenancyAttachments, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListTenancyAttachmentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListTenancyAttachmentsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListTenancyAttachmentsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListTenancyAttachmentsResponse") + } + return +} + +// listTenancyAttachments implements the OCIOperation interface (enables retrying operations) +func (client TenancyAttachmentClient) listTenancyAttachments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/tenancyAttachments", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListTenancyAttachmentsResponse + 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/resource-analytics/20241031/TenancyAttachmentCollection/ListTenancyAttachments" + err = common.PostProcessServiceError(err, "TenancyAttachment", "ListTenancyAttachments", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateTenancyAttachment Updates a TenancyAttachment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/UpdateTenancyAttachment.go.html to see an example of how to use UpdateTenancyAttachment API. +// A default retry strategy applies to this operation UpdateTenancyAttachment() +func (client TenancyAttachmentClient) UpdateTenancyAttachment(ctx context.Context, request UpdateTenancyAttachmentRequest) (response UpdateTenancyAttachmentResponse, 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.updateTenancyAttachment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateTenancyAttachmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateTenancyAttachmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateTenancyAttachmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateTenancyAttachmentResponse") + } + return +} + +// updateTenancyAttachment implements the OCIOperation interface (enables retrying operations) +func (client TenancyAttachmentClient) updateTenancyAttachment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/tenancyAttachments/{tenancyAttachmentId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateTenancyAttachmentResponse + 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/resource-analytics/20241031/TenancyAttachment/UpdateTenancyAttachment" + err = common.PostProcessServiceError(err, "TenancyAttachment", "UpdateTenancyAttachment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/sort_order.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/sort_order.go new file mode 100644 index 00000000000..8e0e12efc22 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/sort_order.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "strings" +) + +// SortOrderEnum Enum with underlying type: string +type SortOrderEnum string + +// Set of constants representing the allowable values for SortOrderEnum +const ( + SortOrderAsc SortOrderEnum = "ASC" + SortOrderDesc SortOrderEnum = "DESC" +) + +var mappingSortOrderEnum = map[string]SortOrderEnum{ + "ASC": SortOrderAsc, + "DESC": SortOrderDesc, +} + +var mappingSortOrderEnumLowerCase = map[string]SortOrderEnum{ + "asc": SortOrderAsc, + "desc": SortOrderDesc, +} + +// GetSortOrderEnumValues Enumerates the set of values for SortOrderEnum +func GetSortOrderEnumValues() []SortOrderEnum { + values := make([]SortOrderEnum, 0) + for _, v := range mappingSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetSortOrderEnumStringValues Enumerates the set of values in String for SortOrderEnum +func GetSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingSortOrderEnum(val string) (SortOrderEnum, bool) { + enum, ok := mappingSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment.go new file mode 100644 index 00000000000..7ddc5578f0d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment.go @@ -0,0 +1,138 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TenancyAttachment A TenancyAttachment is a customers' tenancy attached to a ResourceAnalyticsInstance. Attached tenancies will be included in analytics collection. +// To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to +// an administrator. If you're an administrator who needs to write policies to give users access, see +// Getting Started with Policies (https://docs.oracle.com/iaas/Content/Identity/policiesgs/get-started-with-policies.htm). +type TenancyAttachment struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this TenancyAttachment. + ResourceAnalyticsInstanceId *string `mandatory:"true" json:"resourceAnalyticsInstanceId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy associated with this TenancyAttachment. + TenancyId *string `mandatory:"true" json:"tenancyId"` + + // Whether the tenancy is the tenancy used when creating Resource Analytics Instance. + IsReportingTenancy *bool `mandatory:"true" json:"isReportingTenancy"` + + // The date and time the TenancyAttachment was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the TenancyAttachment. + LifecycleState TenancyAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // A description of the tenancy. + Description *string `mandatory:"false" json:"description"` + + // The date and time the TenancyAttachment was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the TenancyAttachment in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m TenancyAttachment) 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 TenancyAttachment) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTenancyAttachmentLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetTenancyAttachmentLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// TenancyAttachmentLifecycleStateEnum Enum with underlying type: string +type TenancyAttachmentLifecycleStateEnum string + +// Set of constants representing the allowable values for TenancyAttachmentLifecycleStateEnum +const ( + TenancyAttachmentLifecycleStateCreating TenancyAttachmentLifecycleStateEnum = "CREATING" + TenancyAttachmentLifecycleStateUpdating TenancyAttachmentLifecycleStateEnum = "UPDATING" + TenancyAttachmentLifecycleStateActive TenancyAttachmentLifecycleStateEnum = "ACTIVE" + TenancyAttachmentLifecycleStateNeedsAttention TenancyAttachmentLifecycleStateEnum = "NEEDS_ATTENTION" + TenancyAttachmentLifecycleStateDeleting TenancyAttachmentLifecycleStateEnum = "DELETING" + TenancyAttachmentLifecycleStateDeleted TenancyAttachmentLifecycleStateEnum = "DELETED" + TenancyAttachmentLifecycleStateFailed TenancyAttachmentLifecycleStateEnum = "FAILED" +) + +var mappingTenancyAttachmentLifecycleStateEnum = map[string]TenancyAttachmentLifecycleStateEnum{ + "CREATING": TenancyAttachmentLifecycleStateCreating, + "UPDATING": TenancyAttachmentLifecycleStateUpdating, + "ACTIVE": TenancyAttachmentLifecycleStateActive, + "NEEDS_ATTENTION": TenancyAttachmentLifecycleStateNeedsAttention, + "DELETING": TenancyAttachmentLifecycleStateDeleting, + "DELETED": TenancyAttachmentLifecycleStateDeleted, + "FAILED": TenancyAttachmentLifecycleStateFailed, +} + +var mappingTenancyAttachmentLifecycleStateEnumLowerCase = map[string]TenancyAttachmentLifecycleStateEnum{ + "creating": TenancyAttachmentLifecycleStateCreating, + "updating": TenancyAttachmentLifecycleStateUpdating, + "active": TenancyAttachmentLifecycleStateActive, + "needs_attention": TenancyAttachmentLifecycleStateNeedsAttention, + "deleting": TenancyAttachmentLifecycleStateDeleting, + "deleted": TenancyAttachmentLifecycleStateDeleted, + "failed": TenancyAttachmentLifecycleStateFailed, +} + +// GetTenancyAttachmentLifecycleStateEnumValues Enumerates the set of values for TenancyAttachmentLifecycleStateEnum +func GetTenancyAttachmentLifecycleStateEnumValues() []TenancyAttachmentLifecycleStateEnum { + values := make([]TenancyAttachmentLifecycleStateEnum, 0) + for _, v := range mappingTenancyAttachmentLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetTenancyAttachmentLifecycleStateEnumStringValues Enumerates the set of values in String for TenancyAttachmentLifecycleStateEnum +func GetTenancyAttachmentLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "NEEDS_ATTENTION", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingTenancyAttachmentLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingTenancyAttachmentLifecycleStateEnum(val string) (TenancyAttachmentLifecycleStateEnum, bool) { + enum, ok := mappingTenancyAttachmentLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment_collection.go new file mode 100644 index 00000000000..1fb52e8a1fe --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TenancyAttachmentCollection Results of a TenancyAttachment search. Contains both TenancyAttachmentSummary items and other information, such as metadata. +type TenancyAttachmentCollection struct { + + // List of TenancyAttachments. + Items []TenancyAttachmentSummary `mandatory:"true" json:"items"` +} + +func (m TenancyAttachmentCollection) 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 TenancyAttachmentCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment_summary.go new file mode 100644 index 00000000000..8e960fb1c13 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/tenancy_attachment_summary.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TenancyAttachmentSummary Summary information about a TenancyAttachment. +type TenancyAttachmentSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this TenancyAttachment. + ResourceAnalyticsInstanceId *string `mandatory:"true" json:"resourceAnalyticsInstanceId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy associated with this TenancyAttachment. + TenancyId *string `mandatory:"true" json:"tenancyId"` + + // Whether the tenancy is the tenancy used when creating Resource Analytics Instance. + IsReportingTenancy *bool `mandatory:"true" json:"isReportingTenancy"` + + // The date and time the TenancyAttachment was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the TenancyAttachment. + LifecycleState TenancyAttachmentLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // A description of the tenancy. + Description *string `mandatory:"false" json:"description"` + + // The date and time the TenancyAttachment was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the TenancyAttachment in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m TenancyAttachmentSummary) 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 TenancyAttachmentSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingTenancyAttachmentLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetTenancyAttachmentLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_resource_analytics_instance_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_resource_analytics_instance_details.go new file mode 100644 index 00000000000..cbf259268e5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_resource_analytics_instance_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateResourceAnalyticsInstanceDetails The data to update a ResourceAnalyticsInstance. +type UpdateResourceAnalyticsInstanceDetails struct { + + // A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A description of the ResourceAnalyticsInstance instance. + Description *string `mandatory:"false" json:"description"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateResourceAnalyticsInstanceDetails) 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 UpdateResourceAnalyticsInstanceDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_resource_analytics_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_resource_analytics_instance_request_response.go new file mode 100644 index 00000000000..b4176e0f3dc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_resource_analytics_instance_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateResourceAnalyticsInstanceRequest wrapper for the UpdateResourceAnalyticsInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/UpdateResourceAnalyticsInstance.go.html to see an example of how to use UpdateResourceAnalyticsInstanceRequest. +type UpdateResourceAnalyticsInstanceRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + ResourceAnalyticsInstanceId *string `mandatory:"true" contributesTo:"path" name:"resourceAnalyticsInstanceId"` + + // The information to be updated. + UpdateResourceAnalyticsInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 UpdateResourceAnalyticsInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateResourceAnalyticsInstanceRequest) 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 UpdateResourceAnalyticsInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateResourceAnalyticsInstanceRequest) 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 UpdateResourceAnalyticsInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateResourceAnalyticsInstanceResponse wrapper for the UpdateResourceAnalyticsInstance operation +type UpdateResourceAnalyticsInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response UpdateResourceAnalyticsInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateResourceAnalyticsInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_tenancy_attachment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_tenancy_attachment_details.go new file mode 100644 index 00000000000..d86f87eba57 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_tenancy_attachment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateTenancyAttachmentDetails The data to update a TenancyAttachment. +type UpdateTenancyAttachmentDetails struct { + + // A description of the tenancy. + Description *string `mandatory:"true" json:"description"` +} + +func (m UpdateTenancyAttachmentDetails) 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 UpdateTenancyAttachmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_tenancy_attachment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_tenancy_attachment_request_response.go new file mode 100644 index 00000000000..6d8d39b53ff --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/update_tenancy_attachment_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2025, 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 resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateTenancyAttachmentRequest wrapper for the UpdateTenancyAttachment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/resourceanalytics/UpdateTenancyAttachment.go.html to see an example of how to use UpdateTenancyAttachmentRequest. +type UpdateTenancyAttachmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. + TenancyAttachmentId *string `mandatory:"true" contributesTo:"path" name:"tenancyAttachmentId"` + + // The information to be updated. + UpdateTenancyAttachmentDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + 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 UpdateTenancyAttachmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateTenancyAttachmentRequest) 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 UpdateTenancyAttachmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateTenancyAttachmentRequest) 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 UpdateTenancyAttachmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateTenancyAttachmentResponse wrapper for the UpdateTenancyAttachment operation +type UpdateTenancyAttachmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // 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"` +} + +func (response UpdateTenancyAttachmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateTenancyAttachmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/vault_secret_password_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/vault_secret_password_details.go new file mode 100644 index 00000000000..dca3ae88568 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/vault_secret_password_details.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// VaultSecretPasswordDetails Secret details for the ADW Admin password. +type VaultSecretPasswordDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the vault secret to use as the ADW admin password. + SecretId *string `mandatory:"true" json:"secretId"` +} + +func (m VaultSecretPasswordDetails) 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 VaultSecretPasswordDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m VaultSecretPasswordDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeVaultSecretPasswordDetails VaultSecretPasswordDetails + s := struct { + DiscriminatorParam string `json:"passwordType"` + MarshalTypeVaultSecretPasswordDetails + }{ + "VAULT_SECRET", + (MarshalTypeVaultSecretPasswordDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request.go new file mode 100644 index 00000000000..ae5f7ea1c22 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest An asynchronous work request. Work requests help you monitor long-running operations. When you start a long-running operation, +// the service creates a work request. A work request is an activity log that lets you track each step in the operation's +// progress. Each work request has an OCID that lets you interact with it programmatically and use it for automation. +type WorkRequest struct { + + // The asynchronous operation tracked by this work request. + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // The status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources that are affected by the work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Shows the progress of the operation tracked by the work request, as a percentage of the total work + // that must be performed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the work request was created, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request was started, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request was finished, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // The date and time the work request was updated, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m WorkRequest) 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 WorkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_error.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_error.go new file mode 100644 index 00000000000..429a96d407a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_error.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestError An error encountered while performing an operation that is tracked by a work request. +type WorkRequestError struct { + + // A machine-usable code for the error that occurred. For a list of error codes, see + // API Errors (https://docs.oracle.com/iaas/Content/API/References/apierrors.htm). + Code *string `mandatory:"true" json:"code"` + + // A human-readable error message. + Message *string `mandatory:"true" json:"message"` + + // The date and time the error occurred, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) 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 WorkRequestError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_error_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_error_collection.go new file mode 100644 index 00000000000..7676dbd32a0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_error_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection A list of work request errors. Can contain both errors and other information, such as metadata. +type WorkRequestErrorCollection struct { + + // A list of work request errors. + Items []WorkRequestError `mandatory:"true" json:"items"` +} + +func (m WorkRequestErrorCollection) 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 WorkRequestErrorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_log_entry.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_log_entry.go new file mode 100644 index 00000000000..292686afed1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_log_entry.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntry A log message from performing an operation that is tracked by a work request. +type WorkRequestLogEntry struct { + + // A human-readable log message. + Message *string `mandatory:"true" json:"message"` + + // The date and time the log message was written, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestLogEntry) 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 WorkRequestLogEntry) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_log_entry_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_log_entry_collection.go new file mode 100644 index 00000000000..c48326fcb0f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_log_entry_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection A list of work request logs. Can contain both logs and other information, such as metadata. +type WorkRequestLogEntryCollection struct { + + // A list of work request log entries. + Items []WorkRequestLogEntry `mandatory:"true" json:"items"` +} + +func (m WorkRequestLogEntryCollection) 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 WorkRequestLogEntryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_resource.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_resource.go new file mode 100644 index 00000000000..71645b24813 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_resource.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestResource A resource created or operated on by a work request. +type WorkRequestResource struct { + + // The resource type that the work request affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource is affected by the operation tracked in the work request. + // A resource being created, updated, or deleted remains in the IN_PROGRESS state until + // work is complete for that resource, at which point it transitions to CREATED, UPDATED, + // or DELETED, respectively. + ActionType ActionTypeEnum `mandatory:"true" json:"actionType"` + + // An OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) or other unique identifier for the resource. + Identifier *string `mandatory:"true" json:"identifier"` + + // The URI path that you can use for a GET request to access the resource metadata. + EntityUri *string `mandatory:"false" json:"entityUri"` + + // Additional information that helps to explain the resource. + Metadata map[string]string `mandatory:"false" json:"metadata"` +} + +func (m WorkRequestResource) 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 WorkRequestResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_resource_metadata_key.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_resource_metadata_key.go new file mode 100644 index 00000000000..035789c112d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_resource_metadata_key.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "strings" +) + +// WorkRequestResourceMetadataKeyEnum Enum with underlying type: string +type WorkRequestResourceMetadataKeyEnum string + +// Set of constants representing the allowable values for WorkRequestResourceMetadataKeyEnum +const ( + WorkRequestResourceMetadataKeyIsDryRun WorkRequestResourceMetadataKeyEnum = "IS_DRY_RUN" +) + +var mappingWorkRequestResourceMetadataKeyEnum = map[string]WorkRequestResourceMetadataKeyEnum{ + "IS_DRY_RUN": WorkRequestResourceMetadataKeyIsDryRun, +} + +var mappingWorkRequestResourceMetadataKeyEnumLowerCase = map[string]WorkRequestResourceMetadataKeyEnum{ + "is_dry_run": WorkRequestResourceMetadataKeyIsDryRun, +} + +// GetWorkRequestResourceMetadataKeyEnumValues Enumerates the set of values for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumValues() []WorkRequestResourceMetadataKeyEnum { + values := make([]WorkRequestResourceMetadataKeyEnum, 0) + for _, v := range mappingWorkRequestResourceMetadataKeyEnum { + values = append(values, v) + } + return values +} + +// GetWorkRequestResourceMetadataKeyEnumStringValues Enumerates the set of values in String for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumStringValues() []string { + return []string{ + "IS_DRY_RUN", + } +} + +// GetMappingWorkRequestResourceMetadataKeyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingWorkRequestResourceMetadataKeyEnum(val string) (WorkRequestResourceMetadataKeyEnum, bool) { + enum, ok := mappingWorkRequestResourceMetadataKeyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_summary.go new file mode 100644 index 00000000000..47bdb50bc29 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_summary.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary Summary information about an asynchronous work request. +type WorkRequestSummary struct { + + // The asynchronous operation tracked by this work request. + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // The status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources that are affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Shows the progress of the operation tracked by the work request, as a percentage of the total work + // that must be performed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the work request was created, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request was started, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request was finished, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // The date and time the work request was updated, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m WorkRequestSummary) 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 WorkRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_summary_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_summary_collection.go new file mode 100644 index 00000000000..af7d4368fff --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/resourceanalytics/work_request_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, 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. + +// Resource Analytics API +// +// Use the Resource Analytics API to manage Resource Analytics Instances. +// + +package resourceanalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection A list of work requests. Can contain both work requests and other information, such as metadata. +type WorkRequestSummaryCollection struct { + + // A list of work requests. + Items []WorkRequestSummary `mandatory:"true" json:"items"` +} + +func (m WorkRequestSummaryCollection) 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 WorkRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf("%s", strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b33359bc4a0..c20e96a7349 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -288,8 +288,8 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.1.0 ## explicit; go 1.13 github.com/oklog/run -# github.com/oracle/oci-go-sdk/v65 v65.101.0 -## explicit; go 1.13 +# github.com/oracle/oci-go-sdk/v65 v65.101.1 +## explicit; go 1.23.0 github.com/oracle/oci-go-sdk/v65/adm github.com/oracle/oci-go-sdk/v65/aidocument github.com/oracle/oci-go-sdk/v65/ailanguage @@ -377,6 +377,7 @@ github.com/oracle/oci-go-sdk/v65/managementdashboard github.com/oracle/oci-go-sdk/v65/marketplace github.com/oracle/oci-go-sdk/v65/mediaservices github.com/oracle/oci-go-sdk/v65/monitoring +github.com/oracle/oci-go-sdk/v65/multicloud github.com/oracle/oci-go-sdk/v65/mysql github.com/oracle/oci-go-sdk/v65/networkfirewall github.com/oracle/oci-go-sdk/v65/networkloadbalancer @@ -402,6 +403,7 @@ github.com/oracle/oci-go-sdk/v65/psql github.com/oracle/oci-go-sdk/v65/queue github.com/oracle/oci-go-sdk/v65/recovery github.com/oracle/oci-go-sdk/v65/redis +github.com/oracle/oci-go-sdk/v65/resourceanalytics github.com/oracle/oci-go-sdk/v65/resourcemanager github.com/oracle/oci-go-sdk/v65/resourcescheduler github.com/oracle/oci-go-sdk/v65/sch diff --git a/website/docs/d/core_instance.html.markdown b/website/docs/d/core_instance.html.markdown index acc2cb25ee3..3fda3bb8ea3 100644 --- a/website/docs/d/core_instance.html.markdown +++ b/website/docs/d/core_instance.html.markdown @@ -105,6 +105,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. +* `is_ai_enterprise_enabled` - Whether AI enterprise is enabled on the instance. * `is_cross_numa_node` - Whether the instance’s OCPUs and memory are distributed across multiple NUMA nodes. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. diff --git a/website/docs/d/core_instance_configuration.html.markdown b/website/docs/d/core_instance_configuration.html.markdown index 67edaa99ca7..593a2f37d47 100644 --- a/website/docs/d/core_instance_configuration.html.markdown +++ b/website/docs/d/core_instance_configuration.html.markdown @@ -164,6 +164,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. @@ -402,6 +403,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. diff --git a/website/docs/d/core_instance_configurations.html.markdown b/website/docs/d/core_instance_configurations.html.markdown index 94ab8c9a9a5..201105f1f93 100644 --- a/website/docs/d/core_instance_configurations.html.markdown +++ b/website/docs/d/core_instance_configurations.html.markdown @@ -171,6 +171,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. @@ -409,6 +410,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. diff --git a/website/docs/d/core_instances.html.markdown b/website/docs/d/core_instances.html.markdown index 7b31bd2cc77..47f358dce75 100644 --- a/website/docs/d/core_instances.html.markdown +++ b/website/docs/d/core_instances.html.markdown @@ -122,6 +122,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. +* `is_ai_enterprise_enabled` - Whether AI enterprise is enabled on the instance. * `is_cross_numa_node` - Whether the instance’s OCPUs and memory are distributed across multiple NUMA nodes. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. diff --git a/website/docs/d/database_autonomous_container_database.html.markdown b/website/docs/d/database_autonomous_container_database.html.markdown index 0a69b7a7aaa..47f5a0310b2 100644 --- a/website/docs/d/database_autonomous_container_database.html.markdown +++ b/website/docs/d/database_autonomous_container_database.html.markdown @@ -34,10 +34,14 @@ The following attributes are exported: * `associated_backup_configuration_details` - A backup config object holds information about preferred backup destinations only. This object holds information about the associated backup destinations, such as secondary backup destinations created for local backups or remote replicated backups. * `backup_destination_attach_history` - The timestamps at which this backup destination is used as the preferred destination to host the Autonomous Container Database backups. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups and manual backups, but not long term backups. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `space_utilized_in_gbs` - The total space utilized (in GBs) by this Autonomous Container Database on this backup destination, rounded to the nearest integer. * `time_at_which_storage_details_are_updated` - The latest timestamp when the backup destination details, such as 'spaceUtilized,' are updated. * `type` - Type of the database backup destination. @@ -46,16 +50,16 @@ The following attributes are exported: * `autonomous_exadata_infrastructure_id` - **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. * `autonomous_vm_cluster_id` - The OCID of the Autonomous VM Cluster. * `availability_domain` - The availability domain of the Autonomous Container Database. -* `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database.
For Autonomous Databases on Dedicated Exadata Infrastructure, the CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. +* `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database. * `backup_config` - Backup options for the Autonomous Container Database. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -104,7 +108,7 @@ The following attributes are exported: * `time_lag_refreshed_on` - Timestamp when the lags were last calculated for a standby. * `time_last_role_changed` - The date and time when the last role change action happened. * `time_last_synced` - The date and time of the last update to the apply lag, apply rate, and transport lag values. - * `transport_lag` - The approximate number of seconds of redo data not yet available on the standby Autonomous Container Database, as computed by the reporting database. Example: `7 seconds` + * `transport_lag` - The approximate number of seconds of redo data not yet available on the standby Autonomous Container Database, as computed by the reporting database. Example: `7 seconds` * `db_name` - The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. * `db_split_threshold` - The CPU value beyond which an Autonomous Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs. * `db_unique_name` - **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. @@ -112,7 +116,7 @@ The following attributes are exported: * `defined_tags` - 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` - The user-provided name for the Autonomous Container Database. * `distribution_affinity` - Determines whether an Autonomous Database must be opened across the maximum number of nodes or the least number of nodes. By default, Minimum nodes is selected. -* `dst_file_version` - DST Time-zone File version of the Autonomous Container Database. +* `dst_file_version` - DST Time-Zone File version of the Autonomous Container Database. * `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 of the Autonomous Container Database. * `infrastructure_type` - The infrastructure type this resource belongs to. @@ -126,7 +130,6 @@ The following attributes are exported: * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. * `key_store_wallet_name` - The wallet name for Oracle Key Vault. -* `key_version_id` - (Optional) The OCID of the key version that is used in rotate key operations. * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. * `largest_provisionable_autonomous_database_in_cpus` - The largest Autonomous Database (CPU) that can be created in a new Autonomous Container Database. @@ -137,8 +140,7 @@ The following attributes are exported: * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). * `days_of_week` - Days during the week when maintenance should be performed. * `name` - Name of the day of the week. - * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - * 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC * `is_custom_action_timeout_enabled` - If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. * `is_monthly_patching_enabled` - If true, enables the monthly patching option. * `lead_time_in_weeks` - Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. @@ -150,7 +152,8 @@ The following attributes are exported: * `preference` - The maintenance window scheduling preference. * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU in the Autonomous VM Cluster. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU in the Autonomous VM Cluster. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `okv_end_point_group_name` - The OKV End Point Group name for the Autonomous Container Database. @@ -172,8 +175,8 @@ The following attributes are exported: * `time_created` - The date and time the Autonomous Container Database was created. * `time_of_last_backup` - The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database. * `time_snapshot_standby_revert` - The date and time the Autonomous Container Database will be reverted to Standby from Snapshot Standby. -* `total_cpus` - The number of CPUs allocated to the Autonomous VM cluster.
For Autonomous Databases on Dedicated Exadata Infrastructure, the CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. -* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). +* `total_cpus` - The number of CPUs allocated to the Autonomous VM cluster. +* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `version_preference` - The next maintenance version preference. * `vm_failover_reservation` - The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option. diff --git a/website/docs/d/database_autonomous_container_databases.html.markdown b/website/docs/d/database_autonomous_container_databases.html.markdown index 4e6158ea0de..56b86a30fc8 100644 --- a/website/docs/d/database_autonomous_container_databases.html.markdown +++ b/website/docs/d/database_autonomous_container_databases.html.markdown @@ -43,7 +43,7 @@ The following arguments are supported: * `compartment_id` - (Required) The compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). * `display_name` - (Optional) A filter to return only resources that match the entire display name given. The match is not case sensitive. * `infrastructure_type` - (Optional) A filter to return only resources that match the given Infrastructure Type. -* `service_level_agreement_type` - (Optional) A filter to return only resources that match the given service level agreement type exactly. +* `service_level_agreement_type` - (Optional) A filter to return only resources that match the given service-level agreement type exactly. * `state` - (Optional) A filter to return only resources that match the given lifecycle state exactly. @@ -59,10 +59,14 @@ The following attributes are exported: * `associated_backup_configuration_details` - A backup config object holds information about preferred backup destinations only. This object holds information about the associated backup destinations, such as secondary backup destinations created for local backups or remote replicated backups. * `backup_destination_attach_history` - The timestamps at which this backup destination is used as the preferred destination to host the Autonomous Container Database backups. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups and manual backups, but not long term backups. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `space_utilized_in_gbs` - The total space utilized (in GBs) by this Autonomous Container Database on this backup destination, rounded to the nearest integer. * `time_at_which_storage_details_are_updated` - The latest timestamp when the backup destination details, such as 'spaceUtilized,' are updated. * `type` - Type of the database backup destination. @@ -71,16 +75,16 @@ The following attributes are exported: * `autonomous_exadata_infrastructure_id` - **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. * `autonomous_vm_cluster_id` - The OCID of the Autonomous VM Cluster. * `availability_domain` - The availability domain of the Autonomous Container Database. -* `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database.
For Autonomous Databases on Dedicated Exadata Infrastructure, the CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. +* `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database. * `backup_config` - Backup options for the Autonomous Container Database. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -129,7 +133,7 @@ The following attributes are exported: * `time_lag_refreshed_on` - Timestamp when the lags were last calculated for a standby. * `time_last_role_changed` - The date and time when the last role change action happened. * `time_last_synced` - The date and time of the last update to the apply lag, apply rate, and transport lag values. - * `transport_lag` - The approximate number of seconds of redo data not yet available on the standby Autonomous Container Database, as computed by the reporting database. Example: `7 seconds` + * `transport_lag` - The approximate number of seconds of redo data not yet available on the standby Autonomous Container Database, as computed by the reporting database. Example: `7 seconds` * `db_name` - The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. * `db_split_threshold` - The CPU value beyond which an Autonomous Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs. * `db_unique_name` - **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. @@ -137,7 +141,7 @@ The following attributes are exported: * `defined_tags` - 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` - The user-provided name for the Autonomous Container Database. * `distribution_affinity` - Determines whether an Autonomous Database must be opened across the maximum number of nodes or the least number of nodes. By default, Minimum nodes is selected. -* `dst_file_version` - DST Time-zone File version of the Autonomous Container Database. +* `dst_file_version` - DST Time-Zone File version of the Autonomous Container Database. * `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 of the Autonomous Container Database. * `infrastructure_type` - The infrastructure type this resource belongs to. @@ -161,8 +165,7 @@ The following attributes are exported: * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). * `days_of_week` - Days during the week when maintenance should be performed. * `name` - Name of the day of the week. - * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - * 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC * `is_custom_action_timeout_enabled` - If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. * `is_monthly_patching_enabled` - If true, enables the monthly patching option. * `lead_time_in_weeks` - Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. @@ -174,7 +177,8 @@ The following attributes are exported: * `preference` - The maintenance window scheduling preference. * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU in the Autonomous VM Cluster. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU in the Autonomous VM Cluster. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `okv_end_point_group_name` - The OKV End Point Group name for the Autonomous Container Database. @@ -196,8 +200,8 @@ The following attributes are exported: * `time_created` - The date and time the Autonomous Container Database was created. * `time_of_last_backup` - The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database. * `time_snapshot_standby_revert` - The date and time the Autonomous Container Database will be reverted to Standby from Snapshot Standby. -* `total_cpus` - The number of CPUs allocated to the Autonomous VM cluster.
For Autonomous Databases on Dedicated Exadata Infrastructure, the CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. -* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). +* `total_cpus` - The number of CPUs allocated to the Autonomous VM cluster. +* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `version_preference` - The next maintenance version preference. * `vm_failover_reservation` - The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option. diff --git a/website/docs/d/database_autonomous_database.html.markdown b/website/docs/d/database_autonomous_database.html.markdown index ab157fe21c9..230275d64b6 100644 --- a/website/docs/d/database_autonomous_database.html.markdown +++ b/website/docs/d/database_autonomous_database.html.markdown @@ -34,26 +34,28 @@ The following arguments are supported: The following attributes are exported: * `actual_used_data_storage_size_in_tbs` - The current amount of storage in use for user and system data, in terabytes (TB). +* `additional_attributes` - Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. Example: `{ "gcpAccountName": "gcpName" }` * `allocated_storage_size_in_tbs` - The amount of storage currently allocated for the database tables and billed for, rounded up. When auto-scaling is not enabled, this value is equal to the `dataStorageSizeInTBs` value. You can compare this value to the `actualUsedDataStorageSizeInTBs` value to determine if a manual shrink operation is appropriate for your allocated storage. - **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. + **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. * `apex_details` - Information about Oracle APEX Application Development. - * `apex_version` - The Oracle APEX Application Development version. - * `ords_version` - The Oracle REST Data Services (ORDS) version. -* `are_primary_whitelisted_ips_used` - This field will be null if the Autonomous Database is not Data Guard enabled or Access Control is disabled. It's value would be `TRUE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses primary IP access control list (ACL) for standby. It's value would be `FALSE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses different IP access control list (ACL) for standby compared to primary. + * `apex_version` - The Oracle APEX Application Development version. + * `ords_version` - The Oracle REST Data Services (ORDS) version. +* `are_primary_whitelisted_ips_used` - This field will be null if the Autonomous Database is not Data Guard enabled or Access Control is disabled. It's value would be `TRUE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses primary IP access control list (ACL) for standby. It's value would be `FALSE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses different IP access control list (ACL) for standby compared to primary. * `auto_refresh_frequency_in_seconds` - The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter. * `auto_refresh_point_lag_in_seconds` - The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. -* `autonomous_container_database_id` - The Autonomous Container Database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `autonomous_container_database_id` - The Autonomous Container Database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Used only by Autonomous Database on Dedicated Exadata Infrastructure. * `autonomous_maintenance_schedule_type` - The maintenance schedule type of the Autonomous Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle * `availability_domain` - The availability domain where the Autonomous Database Serverless instance is located. * `available_upgrade_versions` - List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. * `backup_config` - Autonomous Database configuration details for storing [manual backups](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/backup-restore.html#GUID-9035DFB8-4702-4CEB-8281-C2A303820809) in the [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) service. - * `manual_backup_bucket_name` - Name of [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) bucket to use for storing manual backups. - * `manual_backup_type` - The manual backup destination type. -* `backup_retention_period_in_days` - Retention period, in days, for backups. + * `manual_backup_bucket_name` - Name of [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) bucket to use for storing manual backups. + * `manual_backup_type` - The manual backup destination type. +* `backup_retention_period_in_days` - Retention period, in days, for long-term backups +* `byol_compute_count_limit` - The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed. * `character_set` - The character set for the autonomous database. The default is AL32UTF8. Allowed values are: -AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS + AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS * `clone_table_space_list` - A list of the source Autonomous Database's table space number(s) used to create this partial clone from the backup. * `clone_type` - The Autonomous Database clone type. * `cluster_placement_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster placement group of the Autonomous Serverless Database. @@ -61,20 +63,21 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `compute_count` - The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. * `compute_model` - 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. ECPU compute model is the recommended model and OCPU compute model is legacy. * `connection_strings` - The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value. - * `all_connection_strings` - Returns all connection strings that can be used to connect to the Autonomous Database. For more information, please see [Predefined Database Service Names for Autonomous Transaction Processing](https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) - * `dedicated` - The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. - * `high` - The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. - * `low` - The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. - * `medium` - The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. - * `profiles` - A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. - * `consumer_group` - Consumer group used by the connection. - * `display_name` - A user-friendly name for the connection. - * `host_format` - Host format used in connection string. - * `protocol` - Protocol used by the connection. - * `session_mode` - Specifies whether the listener performs a direct hand-off of the session, or redirects the session. In RAC deployments where SCAN is used, sessions are redirected to a Node VIP. Use `DIRECT` for direct hand-offs. Use `REDIRECT` to redirect the session. - * `syntax_format` - Specifies whether the connection string is using the long (`LONG`), Easy Connect (`EZCONNECT`), or Easy Connect Plus (`EZCONNECTPLUS`) format. Autonomous Databases on shared Exadata infrastructure always use the long format. - * `tls_authentication` - Specifies whether the TLS handshake is using one-way (`SERVER`) or mutual (`MUTUAL`) authentication. - * `value` - Connection string value. + * `all_connection_strings` - Returns all connection strings that can be used to connect to the Autonomous Database. For more information, please see [Predefined Database Service Names for Autonomous Transaction Processing](https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) + * `dedicated` - The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + * `high` - The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. + * `low` - The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. + * `medium` - The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. + * `profiles` - A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. + * `consumer_group` - Consumer group used by the connection. + * `display_name` - A user-friendly name for the connection. + * `host_format` - Host format used in connection string. + * `is_regional` - True for a regional connection string, applicable to cross-region DG only. + * `protocol` - Protocol used by the connection. + * `session_mode` - Specifies whether the listener performs a direct hand-off of the session, or redirects the session. In RAC deployments where SCAN is used, sessions are redirected to a Node VIP. Use `DIRECT` for direct hand-offs. Use `REDIRECT` to redirect the session. + * `syntax_format` - Specifies whether the connection string is using the long (`LONG`), Easy Connect (`EZCONNECT`), or Easy Connect Plus (`EZCONNECTPLUS`) format. Autonomous Database Serverless instances always use the long format. + * `tls_authentication` - Specifies whether the TLS handshake is using one-way (`SERVER`) or mutual (`MUTUAL`) authentication. + * `value` - Connection string value. * `connection_urls` - The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. Note that these URLs are provided by the console only for databases on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). Example: `{"sqlDevWebUrl": "https:///ords...", "apexUrl", "https:///ords..."}` * `apex_url` - Oracle Application Express (APEX) URL. * `database_transforms_url` - The URL of the Database Transforms for the Autonomous Database. @@ -86,15 +89,21 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `sql_dev_web_url` - Oracle SQL Developer Web URL. * `cpu_core_count` - The number of CPU cores to be made available to the database. When the ECPU is selected, the value for cpuCoreCount is 0. For Autonomous Database on Dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. - **Note:** This parameter cannot be used with the `ocpuCount` parameter. + **Note:** This parameter cannot be used with the `ocpuCount` parameter. * `customer_contacts` - Customer Contacts. - * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. + * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. * `data_safe_status` - Status of the Data Safe registration for this Autonomous Database. Could be REGISTERED or NOT_REGISTERED. * `data_storage_size_in_gb` - The quantity of data in the database, in gigabytes. + + For Autonomous Transaction Processing databases using ECPUs on Serverless Infrastructure, this value is always populated. In all the other cases, this value will be null and `dataStorageSizeInTBs` will be populated instead. * `data_storage_size_in_tbs` - The quantity of data in the database, in terabytes. + + The following points apply to Autonomous Databases on Serverless Infrastructure: + * This is an integer field whose value remains null when the data size is in GBs and cannot be converted to TBs (by dividing the GB value by 1024) without rounding error. + * To get the exact value of data storage size without rounding error, please see `dataStorageSizeInGBs` of Autonomous Database. * `database_edition` - The Oracle Database Edition that applies to the Autonomous databases. * `database_management_status` - Status of Database Management for this Autonomous Database. -* `dataguard_region_type` - **Deprecated.** The Autonomous Data Guard region type of the Autonomous Database. For Autonomous Database Serverless, Autonomous Data Guard associations have designated primary and standby regions, and these region types do not change when the database changes roles. The standby regions in Autonomous Data Guard associations can be the same region designated as the primary region, or they can be remote regions. Certain database administrative operations may be available only in the primary region of the Autonomous Data Guard association, and cannot be performed when the database using the primary role is operating in a remote Autonomous Data Guard standby region. +* `dataguard_region_type` - **Deprecated.** The Autonomous Data Guard region type of the Autonomous Database. For Autonomous Database Serverless, Autonomous Data Guard associations have designated primary and standby regions, and these region types do not change when the database changes roles. The standby regions in Autonomous Data Guard associations can be the same region designated as the primary region, or they can be remote regions. Certain database administrative operations may be available only in the primary region of the Autonomous Data Guard association, and cannot be performed when the database using the primary role is operating in a remote Autonomous Data Guard standby region. * `db_name` - The database name. * `db_tools_details` - The list of database tools details. @@ -110,7 +119,7 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * AJD - indicates an Autonomous JSON Database * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `defined_tags` - 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). * `disaster_recovery_region_type` - **Deprecated.** The disaster recovery (DR) region type of the Autonomous Database. For Autonomous Database Serverless instances, DR associations have designated primary and standby regions. These region types do not change when the database changes roles. The standby region in DR associations can be the same region as the primary region, or they can be in a remote regions. Some database administration operations may be available only in the primary region of the DR association, and cannot be performed when the database using the primary role is operating in a remote region. * `display_name` - The user-friendly name for the Autonomous Database. The name does not have to be unique. @@ -123,9 +132,13 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI @@ -139,9 +152,13 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI @@ -155,19 +172,19 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `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. This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. For Autonomous Database Serverless instances, `whitelistedIps` is used. -* `is_auto_scaling_enabled` - Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. +* `is_auto_scaling_enabled` - Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. * `is_auto_scaling_for_storage_enabled` - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. * `is_backup_retention_locked` - Indicates if the Autonomous Database is backup retention locked. * `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). -* `is_dev_tier` - Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See [Autonomous Database documentation](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. +* `is_dev_tier` - Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. * `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled * `is_local_data_guard_enabled` - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_mtls_connection_required` - Specifies if the Autonomous Database requires mTLS connections. - This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: * CreateAutonomousDatabase @@ -180,61 +197,64 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `is_remote_data_guard_enabled` - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `key_history_entry` - Key History Entry. - * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. - * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. - * `time_activated` - The date and time the kms key activated. - * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). -* `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store. + * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. + * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. + * `time_activated` - The date and time the kms key activated. + * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. +* `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. * `key_store_wallet_name` - The wallet name for Oracle Key Vault. -* `key_version_id` - (Optional) The OCID of the key version that is used in rotate key operations. * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_lifecycle_details` - KMS key lifecycle details. -* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. +* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. * `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Oracle Database service. Note that when provisioning an [Autonomous Database on dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Information about the current lifecycle state. * `local_adg_auto_failover_max_data_loss_limit` - 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 * `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `local_standby_db` - Autonomous Data Guard standby database details. * `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. - * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. - * `lifecycle_details` - Additional information about the current lifecycle state. - * `state` - The current state of the Autonomous Database. - * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. -* `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. * `lifecycle_details` - Additional information about the current lifecycle state. + * `maintenance_target_component` - The component chosen for maintenance. * `state` - The current state of the Autonomous Database. * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + * `time_maintenance_begin` - The date and time when maintenance will begin. + * `time_maintenance_end` - The date and time when maintenance will end. * `long_term_backup_schedule` - Details for the long-term backup schedule. * `is_disabled` - Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. * `repeat_cadence` - The frequency of the long-term backup schedule * `retention_period_in_days` - Retention period, in days, for long-term backups * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. * `maintenance_target_component` - The component chosen for maintenance. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU. +<<<<<<< HEAD +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU. +* `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. +======= +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. +>>>>>>> 13121aec084 (Added - Support for Immutable Backup and Undelete DB | ADB-D and ADB on ExaC@C) * `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `nsg_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** - * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. + * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. * `ocpu_count` - The number of OCPU cores to be made available to the database. - The following points apply: - * For Autonomous Databases on dedicated Exadata infrastructure, to provision less than 1 core, enter a fractional value in an increment of 0.1. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. (Note that fractional OCPU values are not supported for Autonomous Databasese on shared Exadata infrastructure.) - * To provision 1 or more cores, you must enter an integer between 1 and the maximum number of cores available for the infrastructure shape. For example, you can provision 2 cores or 3 cores, but not 2.5 cores. This applies to Autonomous Databases on both shared and dedicated Exadata infrastructure. + The following points apply: + * For Autonomous Databases on Dedicated Exadata Infrastructure, to provision less than 1 core, enter a fractional value in an increment of 0.1. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. (Note that fractional OCPU values are not supported for Autonomous Database Serverless instances.) + * To provision cores, enter an integer between 1 and the maximum number of cores available for the infrastructure shape. For example, you can provision 2 cores or 3 cores, but not 2.5 cores. This applies to Autonomous Databases on both serverless and dedicated Exadata infrastructure. + * For Autonomous Database Serverless instances, this parameter is not used. - For Autonomous Databases on dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. + For Autonomous Databases on Dedicated Exadata Infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbde/index.html) for shape details. **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. * `open_mode` - Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `operations_insights_status` - Status of Operations Insights for this Autonomous Database. * `peer_db_ids` - The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. -* `peer_db_id` - The database [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. * `permission_level` - The Autonomous Database permission level. Restricted mode allows access only by admin users. This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. @@ -267,6 +287,8 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `total_compute_capacity` - Resource Pool total capacity, it's currently 4x of pool size * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. * `enable_delete_scheduled_operations` - If omitted or set to false the provider will not delete scheduled_operations from the Autonomous Database. If set to true, provider will delete scheduled_operations from the Autonomous Database. + * `is_disabled` - Indicates if the resource pool should be deleted for the Autonomous Database. + * `pool_size` - Resource pool size. * `scheduled_operations` - The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. @@ -289,21 +311,21 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `time_maintenance_end` - The date and time when maintenance will end. * `standby_whitelisted_ips` - The client IP access control list (ACL). This feature is available for [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` + For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it’s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the Autonomous Database. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. - **Subnet Restrictions:** - * For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. - * For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. - * For Autonomous Database, setting this will disable public secure access to the database. + **Subnet Restrictions:** + * For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. + * For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. + * For Autonomous Database, setting this will disable public secure access to the database. + These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet. * `subscription_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription with which resource needs to be associated with. - These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet. * `supported_regions_to_clone_to` - The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. * `system_tags` - System 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). * `time_created` - The date and time the Autonomous Database was created. @@ -329,12 +351,12 @@ AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8 * `total_backup_storage_size_in_gbs` - The backup storage to the database. * `used_data_storage_size_in_gbs` - The storage space consumed by Autonomous Database in GBs. * `used_data_storage_size_in_tbs` - The amount of storage that has been used for Autonomous Databases in dedicated infrastructure, in terabytes. -* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). +* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `whitelisted_ips` - The client IP access control list (ACL). This feature is available for [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. -* `is_disconnect_peer` - If true, this will disconnect the Autonomous Database from its peer and the Autonomous Database can work permanently as a standalone database. To disconnect a cross region standby, please also provide the OCID of the standby database in the `peerDbId` parameter. - For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` + For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it’s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. \ No newline at end of file + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + diff --git a/website/docs/d/database_autonomous_database_backup.html.markdown b/website/docs/d/database_autonomous_database_backup.html.markdown index 3f7e3504826..0c3d0a2e290 100644 --- a/website/docs/d/database_autonomous_database_backup.html.markdown +++ b/website/docs/d/database_autonomous_database_backup.html.markdown @@ -34,12 +34,13 @@ The following attributes are exported: * `autonomous_database_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database. * `backup_destination_details` - Backup destination details + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. + * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -48,6 +49,7 @@ The following attributes are exported: * `db_version` - A valid Oracle Database version for Autonomous Database. * `display_name` - The user-friendly name for the backup. The name does not have to be unique. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. +* `infrastructure_type` - The infrastructure type this resource belongs to. * `is_automatic` - Indicates whether the backup is user-initiated or automatic. * `is_restorable` - Indicates whether the backup can be used to restore the associated Autonomous Database. * `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. @@ -55,8 +57,26 @@ The following attributes are exported: * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. * `lifecycle_details` - Additional information about the current lifecycle state. +* `region` - Name of the region in which backup is taken in. * `retention_period_in_days` - Retention period, in days, for long-term backups * `size_in_tbs` - The backup size in terrabytes (TB). +* `source_database_details` - Source Autonomous Database details. + * `autonomous_container_database_customer_contacts` - Customer Contacts for the Autonomous Container Database. Setting this to an empty list removes all customer contacts. + * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. + * `autonomous_container_database_display_name` - The user-provided name for the Autonomous Container Database. + * `autonomous_container_database_dst_file_version` - DST Time-Zone File version of the Autonomous Container Database. + * `autonomous_container_database_name` - Autonomous Container Database name. + * `autonomous_database_customer_contacts` - Customer Contacts for the Autonomous database. + * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. + * `autonomous_database_name` - Autonomous Database's name. + * `autonomous_vm_cluster_display_name` - Autonomous VM cluster's user-friendly name. + * `db_workload` - The Autonomous Database workload type. The following values are valid: + * OLTP - indicates an Autonomous Transaction Processing database + * DW - indicates an Autonomous Data Warehouse database + * AJD - indicates an Autonomous JSON Database + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the backup. * `time_available_till` - Timestamp until when the backup will be available * `time_ended` - The date and time the backup completed. diff --git a/website/docs/d/database_autonomous_database_backups.html.markdown b/website/docs/d/database_autonomous_database_backups.html.markdown index fb49ab1047a..f39f0b6ffa0 100644 --- a/website/docs/d/database_autonomous_database_backups.html.markdown +++ b/website/docs/d/database_autonomous_database_backups.html.markdown @@ -20,8 +20,11 @@ data "oci_database_autonomous_database_backups" "test_autonomous_database_backup #Optional autonomous_database_id = oci_database_autonomous_database.test_autonomous_database.id + backup_destination_id = oci_database_backup_destination.test_backup_destination.id compartment_id = var.compartment_id display_name = var.autonomous_database_backup_display_name + infrastructure_type = var.autonomous_database_backup_infrastructure_type + key_store_id = oci_database_key_store.test_key_store.id state = var.autonomous_database_backup_state type = var.autonomous_database_backup_type } @@ -32,8 +35,11 @@ data "oci_database_autonomous_database_backups" "test_autonomous_database_backup The following arguments are supported: * `autonomous_database_id` - (Optional) The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `backup_destination_id` - (Optional) A filter to return only resources that have the given backup destination id. * `compartment_id` - (Optional) The compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). * `display_name` - (Optional) A filter to return only resources that match the entire display name given. The match is not case sensitive. +* `infrastructure_type` - (Optional) A filter to return only resources that match the given Infrastructure Type. +* `key_store_id` - (Optional) A filter to return only resources that have the given key store id. * `state` - (Optional) A filter to return only resources that match the given lifecycle state exactly. * `type` - (Optional) A filter to return only backups that matches with the given type of Backup. @@ -50,12 +56,13 @@ The following attributes are exported: * `autonomous_database_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database. * `backup_destination_details` - Backup destination details + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. + * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -64,6 +71,7 @@ The following attributes are exported: * `db_version` - A valid Oracle Database version for Autonomous Database. * `display_name` - The user-friendly name for the backup. The name does not have to be unique. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. +* `infrastructure_type` - The infrastructure type this resource belongs to. * `is_automatic` - Indicates whether the backup is user-initiated or automatic. * `is_restorable` - Indicates whether the backup can be used to restore the associated Autonomous Database. * `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. @@ -71,8 +79,26 @@ The following attributes are exported: * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. * `lifecycle_details` - Additional information about the current lifecycle state. +* `region` - Name of the region in which backup is taken in. * `retention_period_in_days` - Retention period, in days, for long-term backups * `size_in_tbs` - The backup size in terrabytes (TB). +* `source_database_details` - Source Autonomous Database details. + * `autonomous_container_database_customer_contacts` - Customer Contacts for the Autonomous Container Database. Setting this to an empty list removes all customer contacts. + * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. + * `autonomous_container_database_display_name` - The user-provided name for the Autonomous Container Database. + * `autonomous_container_database_dst_file_version` - DST Time-Zone File version of the Autonomous Container Database. + * `autonomous_container_database_name` - Autonomous Container Database name. + * `autonomous_database_customer_contacts` - Customer Contacts for the Autonomous database. + * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. + * `autonomous_database_name` - Autonomous Database's name. + * `autonomous_vm_cluster_display_name` - Autonomous VM cluster's user-friendly name. + * `db_workload` - The Autonomous Database workload type. The following values are valid: + * OLTP - indicates an Autonomous Transaction Processing database + * DW - indicates an Autonomous Data Warehouse database + * AJD - indicates an Autonomous JSON Database + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the backup. * `time_available_till` - Timestamp until when the backup will be available * `time_ended` - The date and time the backup completed. diff --git a/website/docs/d/database_autonomous_databases.html.markdown b/website/docs/d/database_autonomous_databases.html.markdown index a4691d268cc..4470745f964 100644 --- a/website/docs/d/database_autonomous_databases.html.markdown +++ b/website/docs/d/database_autonomous_databases.html.markdown @@ -1,3 +1,5 @@ + + --- subcategory: "Database" layout: "oci" @@ -50,7 +52,6 @@ The following arguments are supported: * `is_free_tier` - (Optional) Filter on the value of the resource's 'isFreeTier' property. A value of `true` returns only Always Free resources. A value of `false` excludes Always Free resources from the returned results. Omitting this parameter returns both Always Free and paid resources. * `is_refreshable_clone` - (Optional) Filter on the value of the resource's 'isRefreshableClone' property. A value of `true` returns only refreshable clones. A value of `false` excludes refreshable clones from the returned results. Omitting this parameter returns both refreshable clones and databases that are not refreshable clones. * `is_resource_pool_leader` - (Optional) Filter if the resource is the resource pool leader. A value of `true` returns only resource pool leader. -* `lifecycle_state_not_equal_to` - (Optional) A filter to return only resources that not match the given lifecycle state. * `resource_pool_leader_id` - (Optional) The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resourcepool Leader Autonomous Database. * `state` - (Optional) A filter to return only resources that match the given lifecycle state exactly. @@ -59,6 +60,7 @@ The following arguments are supported: The following attributes are exported: +<<<<<<< HEAD * `autonomous_databases` - The list of autonomous_databases. ### AutonomousDatabase Reference @@ -66,50 +68,52 @@ The following attributes are exported: The following attributes are exported: * `actual_used_data_storage_size_in_tbs` - The current amount of storage in use for user and system data, in terabytes (TB). +* `additional_attributes` - Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. Example: `{ "gcpAccountName": "gcpName" }` +======= +* `actual_used_data_storage_size_in_tbs` - The current amount of storage in use for user and system data, in terabytes (TB). +>>>>>>> 13121aec084 (Added - Support for Immutable Backup and Undelete DB | ADB-D and ADB on ExaC@C) * `allocated_storage_size_in_tbs` - The amount of storage currently allocated for the database tables and billed for, rounded up. When auto-scaling is not enabled, this value is equal to the `dataStorageSizeInTBs` value. You can compare this value to the `actualUsedDataStorageSizeInTBs` value to determine if a manual shrink operation is appropriate for your allocated storage. - **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. + **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. * `apex_details` - Information about Oracle APEX Application Development. * `apex_version` - The Oracle APEX Application Development version. * `ords_version` - The Oracle REST Data Services (ORDS) version. -* `are_primary_whitelisted_ips_used` - This field will be null if the Autonomous Database is not Data Guard enabled or Access Control is disabled. It's value would be `TRUE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses primary IP access control list (ACL) for standby. It's value would be `FALSE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses different IP access control list (ACL) for standby compared to primary. +* `are_primary_whitelisted_ips_used` - This field will be null if the Autonomous Database is not Data Guard enabled or Access Control is disabled. It's value would be `TRUE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses primary IP access control list (ACL) for standby. It's value would be `FALSE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses different IP access control list (ACL) for standby compared to primary. * `auto_refresh_frequency_in_seconds` - The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter. * `auto_refresh_point_lag_in_seconds` - The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. -* `autonomous_container_database_id` - The Autonomous Container Database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Used only by Autonomous Database on Dedicated Exadata Infrastructure. +* `autonomous_container_database_id` - The Autonomous Container Database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). * `autonomous_maintenance_schedule_type` - The maintenance schedule type of the Autonomous Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle * `availability_domain` - The availability domain where the Autonomous Database Serverless instance is located. * `available_upgrade_versions` - List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. -* `backup_config` - Autonomous Database configuration details for storing [manual backups](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/backup-restore.html#GUID-9035DFB8-4702-4CEB-8281-C2A303820809) in the [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) service. +* `backup_config` - Autonomous Database configuration details for storing [manual backups](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/backup-restore.html#GUID-9035DFB8-4702-4CEB-8281-C2A303820809) in the [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) service. * `manual_backup_bucket_name` - Name of [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) bucket to use for storing manual backups. * `manual_backup_type` - The manual backup destination type. -* `backup_retention_period_in_days` - Retention period, in days, for long-term backups -* `byol_compute_count_limit` - The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed. +* `backup_retention_period_in_days` - Retention period, in days, for backups. * `character_set` - The character set for the autonomous database. The default is AL32UTF8. Allowed values are: - AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS +AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS * `clone_table_space_list` - A list of the source Autonomous Database's table space number(s) used to create this partial clone from the backup. * `clone_type` - The Autonomous Database clone type. * `cluster_placement_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster placement group of the Autonomous Serverless Database. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. -* `compute_count` - The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. +* `compute_count` - The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. For an Autonomous Database Serverless instance, the 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. * `compute_model` - 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. ECPU compute model is the recommended model and OCPU compute model is legacy. * `connection_strings` - The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value. - * `all_connection_strings` - Returns all connection strings that can be used to connect to the Autonomous Database. For more information, please see [Predefined Database Service Names for Autonomous Transaction Processing](https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) + * `all_connection_strings` - Returns all connection strings that can be used to connect to the Autonomous Database. For more information, please see [Predefined Database Service Names for Autonomous Transaction Processing](https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) * `dedicated` - The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. * `high` - The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. * `low` - The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. * `medium` - The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. - * `profiles` - A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. + * `profiles` - A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. * `consumer_group` - Consumer group used by the connection. * `display_name` - A user-friendly name for the connection. * `host_format` - Host format used in connection string. - * `is_regional` - True for a regional connection string, applicable to cross-region DG only. * `protocol` - Protocol used by the connection. * `session_mode` - Specifies whether the listener performs a direct hand-off of the session, or redirects the session. In RAC deployments where SCAN is used, sessions are redirected to a Node VIP. Use `DIRECT` for direct hand-offs. Use `REDIRECT` to redirect the session. - * `syntax_format` - Specifies whether the connection string is using the long (`LONG`), Easy Connect (`EZCONNECT`), or Easy Connect Plus (`EZCONNECTPLUS`) format. Autonomous Database Serverless instances always use the long format. + * `syntax_format` - Specifies whether the connection string is using the long (`LONG`), Easy Connect (`EZCONNECT`), or Easy Connect Plus (`EZCONNECTPLUS`) format. Autonomous Databases on shared Exadata infrastructure always use the long format. * `tls_authentication` - Specifies whether the TLS handshake is using one-way (`SERVER`) or mutual (`MUTUAL`) authentication. * `value` - Connection string value. -* `connection_urls` - The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. Note that these URLs are provided by the console only for databases on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). Example: `{"sqlDevWebUrl": "https:///ords...", "apexUrl", "https:///ords..."}` +* `connection_urls` - The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. Note that these URLs are provided by the console only for databases on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). Example: `{"sqlDevWebUrl": "https:///ords...", "apexUrl", "https:///ords..."}` * `apex_url` - Oracle Application Express (APEX) URL. * `database_transforms_url` - The URL of the Database Transforms for the Autonomous Database. * `graph_studio_url` - The URL of the Graph Studio for the Autonomous Database. @@ -120,25 +124,19 @@ The following attributes are exported: * `sql_dev_web_url` - Oracle SQL Developer Web URL. * `cpu_core_count` - The number of CPU cores to be made available to the database. When the ECPU is selected, the value for cpuCoreCount is 0. For Autonomous Database on Dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. - **Note:** This parameter cannot be used with the `ocpuCount` parameter. + **Note:** This parameter cannot be used with the `ocpuCount` parameter. * `customer_contacts` - Customer Contacts. * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. * `data_safe_status` - Status of the Data Safe registration for this Autonomous Database. Could be REGISTERED or NOT_REGISTERED. * `data_storage_size_in_gb` - The quantity of data in the database, in gigabytes. - - For Autonomous Transaction Processing databases using ECPUs on Serverless Infrastructure, this value is always populated. In all the other cases, this value will be null and `dataStorageSizeInTBs` will be populated instead. * `data_storage_size_in_tbs` - The quantity of data in the database, in terabytes. - - The following points apply to Autonomous Databases on Serverless Infrastructure: - * This is an integer field whose value remains null when the data size is in GBs and cannot be converted to TBs (by dividing the GB value by 1024) without rounding error. - * To get the exact value of data storage size without rounding error, please see `dataStorageSizeInGBs` of Autonomous Database. -* `database_edition` - The Oracle Database Edition that applies to the Autonomous databases. +* `database_edition` - The Oracle Database Edition that applies to the Autonomous databases. * `database_management_status` - Status of Database Management for this Autonomous Database. * `dataguard_region_type` - **Deprecated.** The Autonomous Data Guard region type of the Autonomous Database. For Autonomous Database Serverless, Autonomous Data Guard associations have designated primary and standby regions, and these region types do not change when the database changes roles. The standby regions in Autonomous Data Guard associations can be the same region designated as the primary region, or they can be remote regions. Certain database administrative operations may be available only in the primary region of the Autonomous Data Guard association, and cannot be performed when the database using the primary role is operating in a remote Autonomous Data Guard standby region. * `db_name` - The database name. * `db_tools_details` - The list of database tools details. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. * `compute_count` - Compute used by database tools. * `is_enabled` - Indicates whether tool is enabled. * `max_idle_time_in_minutes` - The max idle time, in minutes, after which the VM used by database tools will be terminated. @@ -163,9 +161,13 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI @@ -179,15 +181,19 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI * `time_activated` - The date and time the encryption key was activated. * `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"}` +* `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. This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. @@ -200,40 +206,41 @@ The following attributes are exported: * `is_backup_retention_locked` - Indicates if the Autonomous Database is backup retention locked. * `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). -* `is_dev_tier` - Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. * `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. - - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled +* `is_dev_tier` - Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See [Autonomous Database documentation](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled * `is_local_data_guard_enabled` - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_mtls_connection_required` - Specifies if the Autonomous Database requires mTLS connections. - This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: + Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: * CreateAutonomousDatabase * GetAutonomousDatabase - * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. + * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. * `is_preview` - Indicates if the Autonomous Database version is a preview version. * `is_reconnect_clone_enabled` - Indicates if the refreshable clone can be reconnected to its source database. * `is_refreshable_clone` - Indicates if the Autonomous Database is a refreshable clone. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `is_remote_data_guard_enabled` - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `key_history_entry` - Key History Entry. * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. - * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. + * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. * `time_activated` - The date and time the kms key activated. * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. * `key_store_wallet_name` - The wallet name for Oracle Key Vault. * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_lifecycle_details` - KMS key lifecycle details. -* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. +* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. * `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Oracle Database service. Note that when provisioning an [Autonomous Database on dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Information about the current lifecycle state. * `local_adg_auto_failover_max_data_loss_limit` - 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 +* `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. +* `local_standby_db` - Autonomous Data Guard standby database details. * `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `local_standby_db` - Autonomous Data Guard standby database details. * `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. @@ -242,39 +249,47 @@ The following attributes are exported: * `maintenance_target_component` - The component chosen for maintenance. * `state` - The current state of the Autonomous Database. * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. + * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. + * `time_maintenance_begin` - The date and time when maintenance will begin. + * `time_maintenance_end` - The date and time when maintenance will end. +* `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. + * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. + * `lifecycle_details` - Additional information about the current lifecycle state. + * `state` - The current state of the Autonomous Database. + * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the standby Autonomous Database. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. - * `time_maintenance_begin` - The date and time when maintenance will begin. - * `time_maintenance_end` - The date and time when maintenance will end. * `long_term_backup_schedule` - Details for the long-term backup schedule. - * `is_disabled` - Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. + * `is_disabled` - Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. * `repeat_cadence` - The frequency of the long-term backup schedule * `retention_period_in_days` - Retention period, in days, for long-term backups * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. * `maintenance_target_component` - The component chosen for maintenance. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. -* `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. +* `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `nsg_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** - * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. + * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. * `ocpu_count` - The number of OCPU cores to be made available to the database. - The following points apply: + The following points apply: * For Autonomous Databases on Dedicated Exadata Infrastructure, to provision less than 1 core, enter a fractional value in an increment of 0.1. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. (Note that fractional OCPU values are not supported for Autonomous Database Serverless instances.) * To provision cores, enter an integer between 1 and the maximum number of cores available for the infrastructure shape. For example, you can provision 2 cores or 3 cores, but not 2.5 cores. This applies to Autonomous Databases on both serverless and dedicated Exadata infrastructure. * For Autonomous Database Serverless instances, this parameter is not used. - For Autonomous Databases on Dedicated Exadata Infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbde/index.html) for shape details. + For Autonomous Databases on dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. - **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. + **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. * `open_mode` - Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `operations_insights_status` - Status of Operations Insights for this Autonomous Database. * `peer_db_ids` - The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. +* `peer_db_id` - The database [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. * `permission_level` - The Autonomous Database permission level. Restricted mode allows access only by admin users. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `private_endpoint` - The private endpoint for the resource. * `private_endpoint_ip` - The private endpoint Ip address for the resource. * `private_endpoint_label` - The private endpoint label for the resource. @@ -303,9 +318,10 @@ The following attributes are exported: * `pool_size` - Resource pool size. * `total_compute_capacity` - Resource Pool total capacity, it's currently 4x of pool size * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. +* `enable_delete_scheduled_operations` - If omitted or set to false the provider will not delete scheduled_operations from the Autonomous Database. If set to true, provider will delete scheduled_operations from the Autonomous Database. * `scheduled_operations` - The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `day_of_week` - Day of the week. * `name` - Name of the day of the week. * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" @@ -325,29 +341,27 @@ The following attributes are exported: * `time_maintenance_end` - The date and time when maintenance will end. * `standby_whitelisted_ips` - The client IP access control list (ACL). This feature is available for [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it’s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` + For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the Autonomous Database. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. - **Subnet Restrictions:** + **Subnet Restrictions:** * For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. * For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. * For Autonomous Database, setting this will disable public secure access to the database. - These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet. * `subscription_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription with which resource needs to be associated with. -* `supported_regions_to_clone_to` - The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. -* `system_tags` - System 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). + These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet. +* `supported_regions_to_clone_to` - The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. +* `system_tags` - System 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). * `time_created` - The date and time the Autonomous Database was created. * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the Autonomous Database. For databases that have standbys in both the primary Data Guard region and a remote Data Guard standby region, this is the latest timestamp of either the database using the "primary" role in the primary Data Guard region, or database located in the remote Data Guard standby region. -* `time_deletion_of_free_autonomous_database` - The date and time the Always Free database will be automatically deleted because of inactivity. If the database is in the STOPPED state and without activity until this time, it will be deleted. +* `time_deletion_of_free_autonomous_database` - The date and time the Always Free database will be automatically deleted because of inactivity. If the database is in the STOPPED state and without activity until this time, it will be deleted. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. -* `time_earliest_available_db_version_upgrade` - The earliest(min) date and time the Autonomous Database can be scheduled to upgrade to 23ai. -* `time_latest_available_db_version_upgrade` - The max date and time the Autonomous Database can be scheduled to upgrade to 23ai. * `time_local_data_guard_enabled` - The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. * `time_maintenance_begin` - The date and time when maintenance will begin. * `time_maintenance_end` - The date and time when maintenance will end. @@ -359,18 +373,17 @@ The following attributes are exported: * `time_of_last_switchover` - The timestamp of the last switchover operation for the Autonomous Database. * `time_of_next_refresh` - The date and time of next refresh. * `time_reclamation_of_free_autonomous_database` - The date and time the Always Free database will be stopped because of inactivity. If this time is reached without any database activity, the database will automatically be put into the STOPPED state. -* `time_scheduled_db_version_upgrade` - The date and time the Autonomous Database scheduled to upgrade to 23ai. -* `time_undeleted` - The date and time the Autonomous Database was most recently undeleted. +* `time_undeleted` - The date and time the Autonomous Database was most recently undeleted. * `time_until_reconnect_clone_enabled` - The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. * `total_backup_storage_size_in_gbs` - The backup storage to the database. * `used_data_storage_size_in_gbs` - The storage space consumed by Autonomous Database in GBs. * `used_data_storage_size_in_tbs` - The amount of storage that has been used for Autonomous Databases in dedicated infrastructure, in terabytes. -* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. +* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). * `whitelisted_ips` - The client IP access control list (ACL). This feature is available for [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. +* `is_disconnect_peer` - If true, this will disconnect the Autonomous Database from its peer and the Autonomous Database can work permanently as a standalone database. To disconnect a cross region standby, please also provide the OCID of the standby database in the `peerDbId` parameter. - For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it’s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. \ No newline at end of file diff --git a/website/docs/d/database_autonomous_databases_clones.html.markdown b/website/docs/d/database_autonomous_databases_clones.html.markdown index 4284d1bc3d4..3b773844f95 100644 --- a/website/docs/d/database_autonomous_databases_clones.html.markdown +++ b/website/docs/d/database_autonomous_databases_clones.html.markdown @@ -49,51 +49,54 @@ The following attributes are exported: The following attributes are exported: +<<<<<<< HEAD * `actual_used_data_storage_size_in_tbs` - The current amount of storage in use for user and system data, in terabytes (TB). +* `additional_attributes` - Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. Example: `{ "gcpAccountName": "gcpName" }` +======= +* `actual_used_data_storage_size_in_tbs` - The current amount of storage in use for user and system data, in terabytes (TB). +>>>>>>> 13121aec084 (Added - Support for Immutable Backup and Undelete DB | ADB-D and ADB on ExaC@C) * `allocated_storage_size_in_tbs` - The amount of storage currently allocated for the database tables and billed for, rounded up. When auto-scaling is not enabled, this value is equal to the `dataStorageSizeInTBs` value. You can compare this value to the `actualUsedDataStorageSizeInTBs` value to determine if a manual shrink operation is appropriate for your allocated storage. - **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. + **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. * `apex_details` - Information about Oracle APEX Application Development. * `apex_version` - The Oracle APEX Application Development version. * `ords_version` - The Oracle REST Data Services (ORDS) version. -* `are_primary_whitelisted_ips_used` - This field will be null if the Autonomous Database is not Data Guard enabled or Access Control is disabled. It's value would be `TRUE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses primary IP access control list (ACL) for standby. It's value would be `FALSE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses different IP access control list (ACL) for standby compared to primary. +* `are_primary_whitelisted_ips_used` - This field will be null if the Autonomous Database is not Data Guard enabled or Access Control is disabled. It's value would be `TRUE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses primary IP access control list (ACL) for standby. It's value would be `FALSE` if Autonomous Database is Data Guard enabled and Access Control is enabled and if the Autonomous Database uses different IP access control list (ACL) for standby compared to primary. * `auto_refresh_frequency_in_seconds` - The frequency a refreshable clone is refreshed after auto-refresh is enabled. The minimum is 1 hour. The maximum is 7 days. The date and time that auto-refresh is enabled is controlled by the `timeOfAutoRefreshStart` parameter. * `auto_refresh_point_lag_in_seconds` - The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. -* `autonomous_container_database_id` - The Autonomous Container Database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Used only by Autonomous Database on Dedicated Exadata Infrastructure. -* `autonomous_maintenance_schedule_type` - The maintenance schedule type of the Autonomous Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle -* `availability_domain` - The availability domain where the Autonomous Database Serverless instance is located. +* `autonomous_container_database_id` - The Autonomous Container Database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `autonomous_maintenance_schedule_type` - The maintenance schedule type of the Autonomous Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle* `availability_domain` - The availability domain where the Autonomous Database Serverless instance is located. * `available_upgrade_versions` - List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. -* `backup_config` - Autonomous Database configuration details for storing [manual backups](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/backup-restore.html#GUID-9035DFB8-4702-4CEB-8281-C2A303820809) in the [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) service. +* `backup_config` - Autonomous Database configuration details for storing [manual backups](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/backup-restore.html#GUID-9035DFB8-4702-4CEB-8281-C2A303820809) in the [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) service. * `manual_backup_bucket_name` - Name of [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) bucket to use for storing manual backups. * `manual_backup_type` - The manual backup destination type. -* `backup_retention_period_in_days` - Retention period, in days, for long-term backups -* `byol_compute_count_limit` - The maximum number of CPUs allowed with a Bring Your Own License (BYOL), including those used for auto-scaling, disaster recovery, tools, etc. Any CPU usage above this limit is considered as License Included and billed. +* `backup_retention_period_in_days` - Retention period, in days, for backups. * `character_set` - The character set for the autonomous database. The default is AL32UTF8. Allowed values are: - AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS +AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS * `clone_table_space_list` - A list of the source Autonomous Database's table space number(s) used to create this partial clone from the backup. * `clone_type` - The Autonomous Database clone type. * `cluster_placement_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster placement group of the Autonomous Serverless Database. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. -* `compute_count` - The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. +* `compute_count` - The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. For an Autonomous Database Serverless instance, the 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. * `compute_model` - 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. ECPU compute model is the recommended model and OCPU compute model is legacy. * `connection_strings` - The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value. - * `all_connection_strings` - Returns all connection strings that can be used to connect to the Autonomous Database. For more information, please see [Predefined Database Service Names for Autonomous Transaction Processing](https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) + * `all_connection_strings` - Returns all connection strings that can be used to connect to the Autonomous Database. For more information, please see [Predefined Database Service Names for Autonomous Transaction Processing](https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) * `dedicated` - The database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. * `high` - The High database service provides the highest level of resources to each SQL statement resulting in the highest performance, but supports the fewest number of concurrent SQL statements. * `low` - The Low database service provides the least level of resources to each SQL statement, but supports the most number of concurrent SQL statements. * `medium` - The Medium database service provides a lower level of resources to each SQL statement potentially resulting a lower level of performance, but supports more concurrent SQL statements. - * `profiles` - A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. + * `profiles` - A list of connection string profiles to allow clients to group, filter and select connection string values based on structured metadata. * `consumer_group` - Consumer group used by the connection. * `display_name` - A user-friendly name for the connection. * `host_format` - Host format used in connection string. * `is_regional` - True for a regional connection string, applicable to cross-region DG only. * `protocol` - Protocol used by the connection. * `session_mode` - Specifies whether the listener performs a direct hand-off of the session, or redirects the session. In RAC deployments where SCAN is used, sessions are redirected to a Node VIP. Use `DIRECT` for direct hand-offs. Use `REDIRECT` to redirect the session. - * `syntax_format` - Specifies whether the connection string is using the long (`LONG`), Easy Connect (`EZCONNECT`), or Easy Connect Plus (`EZCONNECTPLUS`) format. Autonomous Database Serverless instances always use the long format. + * `syntax_format` - Specifies whether the connection string is using the long (`LONG`), Easy Connect (`EZCONNECT`), or Easy Connect Plus (`EZCONNECTPLUS`) format. Autonomous Database Serverless instances always use the long format. * `tls_authentication` - Specifies whether the TLS handshake is using one-way (`SERVER`) or mutual (`MUTUAL`) authentication. * `value` - Connection string value. -* `connection_urls` - The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. Note that these URLs are provided by the console only for databases on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). Example: `{"sqlDevWebUrl": "https:///ords...", "apexUrl", "https:///ords..."}` +* `connection_urls` - The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. Note that these URLs are provided by the console only for databases on [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). Example: `{"sqlDevWebUrl": "https:///ords...", "apexUrl", "https:///ords..."}` * `apex_url` - Oracle Application Express (APEX) URL. * `database_transforms_url` - The URL of the Database Transforms for the Autonomous Database. * `graph_studio_url` - The URL of the Graph Studio for the Autonomous Database. @@ -104,25 +107,19 @@ The following attributes are exported: * `sql_dev_web_url` - Oracle SQL Developer Web URL. * `cpu_core_count` - The number of CPU cores to be made available to the database. When the ECPU is selected, the value for cpuCoreCount is 0. For Autonomous Database on Dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://www.oracle.com/pls/topic/lookup?ctx=en/cloud/paas/autonomous-database&id=ATPFG-GUID-B0F033C1-CC5A-42F0-B2E7-3CECFEDA1FD1) for shape details. - **Note:** This parameter cannot be used with the `ocpuCount` parameter. + **Note:** This parameter cannot be used with the `ocpuCount` parameter. * `customer_contacts` - Customer Contacts. * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. * `data_safe_status` - Status of the Data Safe registration for this Autonomous Database. * `data_storage_size_in_gb` - The quantity of data in the database, in gigabytes. - - For Autonomous Transaction Processing databases using ECPUs on Serverless Infrastructure, this value is always populated. In all the other cases, this value will be null and `dataStorageSizeInTBs` will be populated instead. * `data_storage_size_in_tbs` - The quantity of data in the database, in terabytes. - - The following points apply to Autonomous Databases on Serverless Infrastructure: - * This is an integer field whose value remains null when the data size is in GBs and cannot be converted to TBs (by dividing the GB value by 1024) without rounding error. - * To get the exact value of data storage size without rounding error, please see `dataStorageSizeInGBs` of Autonomous Database. -* `database_edition` - The Oracle Database Edition that applies to the Autonomous databases. +* `database_edition` - The Oracle Database Edition that applies to the Autonomous databases. * `database_management_status` - Status of Database Management for this Autonomous Database. * `dataguard_region_type` - **Deprecated.** The Autonomous Data Guard region type of the Autonomous Database. For Autonomous Database Serverless, Autonomous Data Guard associations have designated primary and standby regions, and these region types do not change when the database changes roles. The standby regions in Autonomous Data Guard associations can be the same region designated as the primary region, or they can be remote regions. Certain database administrative operations may be available only in the primary region of the Autonomous Data Guard association, and cannot be performed when the database using the primary role is operating in a remote Autonomous Data Guard standby region. * `db_name` - The database name. * `db_tools_details` - The list of database tools details. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, isLocalDataGuardEnabled, or isFreeTier. * `compute_count` - Compute used by database tools. * `is_enabled` - Indicates whether tool is enabled. * `max_idle_time_in_minutes` - The max idle time, in minutes, after which the VM used by database tools will be terminated. @@ -147,9 +144,13 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI @@ -163,15 +164,19 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI * `time_activated` - The date and time the encryption key was activated. * `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"}` +* `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. This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. @@ -184,43 +189,42 @@ The following attributes are exported: * `is_backup_retention_locked` - Indicates if the Autonomous Database is backup retention locked. * `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). -* `is_dev_tier` - Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. +* `is_dev_tier` - Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See [Autonomous Database documentation](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. * `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled * `is_local_data_guard_enabled` - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_mtls_connection_required` - Specifies if the Autonomous Database requires mTLS connections. - This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. - Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: + Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs: * CreateAutonomousDatabase * GetAutonomousDatabase - * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. + * UpdateAutonomousDatabase Details: Prior to the July 1, 2023 change, the isMTLSConnectionRequired attribute default value was true. This applies to Autonomous Database Serverless. Does this impact me? If you use or maintain custom scripts or Terraform scripts referencing the CreateAutonomousDatabase, GetAutonomousDatabase, or UpdateAutonomousDatabase APIs, you want to check, and possibly modify, the scripts for the changed default value of the attribute. Should you choose not to leave your scripts unchanged, the API calls containing this attribute will continue to work, but the default value will switch from true to false. How do I make this change? Using either Oracle Cloud Infrastructure SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. * `is_preview` - Indicates if the Autonomous Database version is a preview version. * `is_reconnect_clone_enabled` - Indicates if the refreshable clone can be reconnected to its source database. * `is_refreshable_clone` - Indicates if the Autonomous Database is a refreshable clone. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `is_remote_data_guard_enabled` - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `key_history_entry` - Key History Entry. * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. - * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. + * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. * `time_activated` - The date and time the kms key activated. * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. * `key_store_wallet_name` - The wallet name for Oracle Key Vault. * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_lifecycle_details` - KMS key lifecycle details. -* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. +* `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. * `license_model` - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Oracle Database service. Note that when provisioning an [Autonomous Database on dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html), this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) database, if a value is not specified, the system defaults the value to `BRING_YOUR_OWN_LICENSE`. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, maxCpuCoreCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `lifecycle_details` - Information about the current lifecycle state. * `local_adg_auto_failover_max_data_loss_limit` - 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 -* `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. -* `local_standby_db` - Autonomous Data Guard standby database details. - * `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. +* `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. +* `local_standby_db` - Autonomous Data Guard standby database details.* `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. * `lifecycle_details` - Additional information about the current lifecycle state. * `maintenance_target_component` - The component chosen for maintenance. @@ -230,35 +234,39 @@ The following attributes are exported: * `time_maintenance_begin` - The date and time when maintenance will begin. * `time_maintenance_end` - The date and time when maintenance will end. * `long_term_backup_schedule` - Details for the long-term backup schedule. - * `is_disabled` - Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. + * `is_disabled` - Indicates if the long-term backup schedule should be deleted. The default value is `FALSE`. * `repeat_cadence` - The frequency of the long-term backup schedule * `retention_period_in_days` - Retention period, in days, for long-term backups * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. + * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. +* `max_cpu_core_count` - The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled. * `maintenance_target_component` - The component chosen for maintenance. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. -* `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. +* `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `nsg_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** - * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. + * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. * `ocpu_count` - The number of OCPU cores to be made available to the database. - The following points apply: + The following points apply: * For Autonomous Databases on Dedicated Exadata Infrastructure, to provision less than 1 core, enter a fractional value in an increment of 0.1. For example, you can provision 0.3 or 0.4 cores, but not 0.35 cores. (Note that fractional OCPU values are not supported for Autonomous Database Serverless instances.) * To provision cores, enter an integer between 1 and the maximum number of cores available for the infrastructure shape. For example, you can provision 2 cores or 3 cores, but not 2.5 cores. This applies to Autonomous Databases on both serverless and dedicated Exadata infrastructure. * For Autonomous Database Serverless instances, this parameter is not used. - For Autonomous Databases on Dedicated Exadata Infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbde/index.html) for shape details. + For Autonomous Databases on Dedicated Exadata Infrastructure, the maximum number of cores is determined by the infrastructure shape. See [Characteristics of Infrastructure Shapes](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbde/index.html) for shape details. - **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. + **Note:** This parameter cannot be used with the `cpuCoreCount` parameter. * `open_mode` - Indicates the Autonomous Database mode. The database can be opened in `READ_ONLY` or `READ_WRITE` mode. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `operations_insights_status` - Status of Operations Insights for this Autonomous Database. * `peer_db_ids` - The list of [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs. +* `peer_db_id` - The database [OCIDs](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Disaster Recovery peer (source Primary) database, which is located in a different (remote) region from the current peer database. * `permission_level` - The Autonomous Database permission level. Restricted mode allows access only by admin users. - This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `private_endpoint` - The private endpoint for the resource. * `private_endpoint_ip` - The private endpoint Ip address for the resource. * `private_endpoint_label` - The resource's private endpoint label. @@ -266,7 +274,7 @@ The following attributes are exported: * Resetting the endpoint label to an empty string, after the creation of the private endpoint database, changes the private endpoint database to a public endpoint database. * Setting the endpoint label to a non-empty string value, updates to a new private endpoint database, when the database is disabled and re-enabled. - This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. + This setting cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier. * `provisionable_cpus` - An array of CPU values that an Autonomous Database can be scaled to. * `public_connection_urls` - The Public URLs of Private Endpoint database for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. * `apex_url` - Oracle Application Express (APEX) URL. @@ -281,9 +289,8 @@ The following attributes are exported: * `refreshable_mode` - The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous Database. * `refreshable_status` - The refresh status of the clone. REFRESHING indicates that the clone is currently being refreshed with data from the source Autonomous Database. * `remote_disaster_recovery_configuration` - Configurations of a Disaster Recovery. - * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. - * `is_replicate_automatic_backups` - If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based DR between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database. - * `is_snapshot_standby` - Indicates if user wants to convert to a snapshot standby. For example, true would set a standby database to snapshot standby database. False would set a snapshot standby database back to regular standby database. + * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. + * `is_snapshot_standby` - Indicates if user wants to convert to a snapshot standby. For example, true would set a standby database to snapshot standby database. False would set a snapshot standby database back to regular standby database. * `time_snapshot_standby_enabled_till` - Time and date stored as an RFC 3339 formatted timestamp string. For example, 2022-01-01T12:00:00.000Z would set a limit for the snapshot standby to be converted back to a cross-region standby database. * `resource_pool_leader_id` - The unique identifier for leader autonomous database OCID [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). * `resource_pool_summary` - The configuration details for resource pool @@ -295,7 +302,7 @@ The following attributes are exported: * `enable_delete_scheduled_operations` - If omitted or set to false the provider will not delete scheduled_operations from the Autonomous Database. If set to true, provider will delete scheduled_operations from the Autonomous Database. * `scheduled_operations` - The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `day_of_week` - Day of the week. * `name` - Name of the day of the week. * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" @@ -303,8 +310,7 @@ The following attributes are exported: * `security_attributes` - Security Attributes 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). Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "audit"}}}` * `service_console_url` - The URL of the Service Console for the Autonomous Database. * `source_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source Autonomous Database that was cloned to create the current Autonomous Database. -* `standby_db` - **Deprecated** Autonomous Data Guard standby database details. - * `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. +* `standby_db` - **Deprecated** Autonomous Data Guard standby database details.* `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. * `lifecycle_details` - Additional information about the current lifecycle state. * `maintenance_target_component` - The component chosen for maintenance. @@ -315,52 +321,49 @@ The following attributes are exported: * `time_maintenance_end` - The date and time when maintenance will end. * `standby_whitelisted_ips` - The client IP access control list (ACL). This feature is available for [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. - For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it’s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` + For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the Autonomous Database. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. - **Subnet Restrictions:** + **Subnet Restrictions:** * For bare metal DB systems and for single node virtual machine DB systems, do not use a subnet that overlaps with 192.168.16.16/28. * For Exadata and virtual machine 2-node RAC systems, do not use a subnet that overlaps with 192.168.128.0/20. * For Autonomous Database, setting this will disable public secure access to the database. - These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet. + These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet. * `subscription_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription with which resource needs to be associated with. -* `supported_regions_to_clone_to` - The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. -* `system_tags` - System 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). +* `supported_regions_to_clone_to` - The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database. +* `system_tags` - System 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). * `time_created` - The date and time the Autonomous Database was created. * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the Autonomous Database. For databases that have standbys in both the primary Data Guard region and a remote Data Guard standby region, this is the latest timestamp of either the database using the "primary" role in the primary Data Guard region, or database located in the remote Data Guard standby region. -* `time_deletion_of_free_autonomous_database` - The date and time the Always Free database will be automatically deleted because of inactivity. If the database is in the STOPPED state and without activity until this time, it will be deleted. +* `time_deletion_of_free_autonomous_database` - The date and time the Always Free database will be automatically deleted because of inactivity. If the database is in the STOPPED state and without activity until this time, it will be deleted. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. -* `time_earliest_available_db_version_upgrade` - The earliest(min) date and time the Autonomous Database can be scheduled to upgrade to 23ai. -* `time_latest_available_db_version_upgrade` - The max date and time the Autonomous Database can be scheduled to upgrade to 23ai. * `time_local_data_guard_enabled` - The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. * `time_maintenance_begin` - The date and time when maintenance will begin. * `time_maintenance_end` - The date and time when maintenance will end. * `time_of_auto_refresh_start` - The the date and time that auto-refreshing will begin for an Autonomous Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the `autoRefreshFrequencyInSeconds` parameter. -* `time_of_joining_resource_pool` - The time the member joined the resource pool. * `time_of_last_failover` - The timestamp of the last failover operation. * `time_of_last_refresh` - The date and time when last refresh happened. * `time_of_last_refresh_point` - The refresh point timestamp (UTC). The refresh point is the time to which the database was most recently refreshed. Data created after the refresh point is not included in the refresh. * `time_of_last_switchover` - The timestamp of the last switchover operation for the Autonomous Database. * `time_of_next_refresh` - The date and time of next refresh. * `time_reclamation_of_free_autonomous_database` - The date and time the Always Free database will be stopped because of inactivity. If this time is reached without any database activity, the database will automatically be put into the STOPPED state. -* `time_scheduled_db_version_upgrade` - The date and time the Autonomous Database scheduled to upgrade to 23ai. -* `time_undeleted` - The date and time the Autonomous Database was most recently undeleted. +* `time_undeleted` - The date and time the Autonomous Database was most recently undeleted. * `time_until_reconnect_clone_enabled` - The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. * `total_backup_storage_size_in_gbs` - The backup storage to the database. * `used_data_storage_size_in_gbs` - The storage space consumed by Autonomous Database in GBs. * `used_data_storage_size_in_tbs` - The amount of storage that has been used for Autonomous Databases in dedicated infrastructure, in terabytes. -* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. +* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). * `whitelisted_ips` - The client IP access control list (ACL). This feature is available for [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. If `arePrimaryWhitelistedIpsUsed` is 'TRUE' then Autonomous Database uses this primary's IP access control list (ACL) for the disaster recovery peer called `standbywhitelistedips`. +* `is_disconnect_peer` - If true, this will disconnect the Autonomous Database from its peer and the Autonomous Database can work permanently as a standalone database. To disconnect a cross region standby, please also provide the OCID of the standby database in the `peerDbId` parameter. - For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Multiple IPs and VCN OCIDs should be separate strings separated by commas, but if it’s other configurations that need multiple pieces of information then its each piece is connected with semicolon (;) as a delimiter. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` + For Autonomous Database Serverless, this is an array of CIDR (classless inter-domain routing) notations for a subnet or VCN OCID (virtual cloud network Oracle Cloud ID). Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: `["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.","ocid1.vcn.oc1.sea.;1.1.1.1","ocid1.vcn.oc1.sea.;1.1.0.0/16"]` For Exadata Cloud@Customer, this is an array of IP addresses or CIDR notations. Example: `["1.1.1.1","1.1.1.0/24","1.1.2.25"]` - For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. + For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry. - This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. diff --git a/website/docs/d/database_autonomous_vm_cluster.html.markdown b/website/docs/d/database_autonomous_vm_cluster.html.markdown index 9183c1de8f4..61bf4c2efd2 100644 --- a/website/docs/d/database_autonomous_vm_cluster.html.markdown +++ b/website/docs/d/database_autonomous_vm_cluster.html.markdown @@ -69,7 +69,8 @@ The following attributes are exported: * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `max_acds_lowest_scaled_value` - The lowest value to which maximum number of ACDs can be scaled down. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of nodes in the Autonomous VM Cluster. diff --git a/website/docs/d/database_autonomous_vm_cluster_resource_usage.html.markdown b/website/docs/d/database_autonomous_vm_cluster_resource_usage.html.markdown index 59f88504375..86b6420e036 100644 --- a/website/docs/d/database_autonomous_vm_cluster_resource_usage.html.markdown +++ b/website/docs/d/database_autonomous_vm_cluster_resource_usage.html.markdown @@ -57,7 +57,8 @@ The following attributes are exported: * `exadata_storage_in_tbs` - Total exadata storage allocated for the Autonomous VM Cluster. DATA + RECOVERY + SPARSE + any overhead in TBs. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous VM cluster. * `is_local_backup_enabled` - If true, database backup on local Exadata storage is configured for the Autonomous VM cluster. If false, database backup on local Exadata storage is not available in the Autonomous VM cluster. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per each CPU core. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `non_provisionable_autonomous_container_databases` - The number of non-provisionable Autonomous Container Databases in an Autonomous VM Cluster. * `provisionable_autonomous_container_databases` - The number of provisionable Autonomous Container Databases in an Autonomous VM Cluster. diff --git a/website/docs/d/database_autonomous_vm_clusters.html.markdown b/website/docs/d/database_autonomous_vm_clusters.html.markdown index f2b31152127..bef278c93fd 100644 --- a/website/docs/d/database_autonomous_vm_clusters.html.markdown +++ b/website/docs/d/database_autonomous_vm_clusters.html.markdown @@ -83,7 +83,8 @@ The following attributes are exported: * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `max_acds_lowest_scaled_value` - The lowest value to which maximum number of ACDs can be scaled down. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of nodes in the Autonomous VM Cluster. diff --git a/website/docs/d/database_backup_destination.html.markdown b/website/docs/d/database_backup_destination.html.markdown index 887efc03f2e..d4ddbb16594 100644 --- a/website/docs/d/database_backup_destination.html.markdown +++ b/website/docs/d/database_backup_destination.html.markdown @@ -36,6 +36,10 @@ The following attributes are exported: * `associated_databases` - List of databases associated with the backup destination. * `db_name` - The display name of the database that is associated with the backup destination. * `id` - The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `associated_long_term_backup_count` - Indicates the number of long term backups of Autonomous Databases associated with this backup destination. +* `associated_long_term_backups` - List of long term backups of Autonomous Databases associated with this backup destination.The maximum associated number of long term backup listed here would be 1024. + * `display_name` - The display name for the long term backup for the autonomous database. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `connection_string` - For a RECOVERY_APPLIANCE backup destination, the connection string for connecting to the Recovery Appliance. * `defined_tags` - 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). diff --git a/website/docs/d/database_backup_destinations.html.markdown b/website/docs/d/database_backup_destinations.html.markdown index bf2ef418e15..d936b7c0966 100644 --- a/website/docs/d/database_backup_destinations.html.markdown +++ b/website/docs/d/database_backup_destinations.html.markdown @@ -46,6 +46,10 @@ The following attributes are exported: * `associated_databases` - List of databases associated with the backup destination. * `db_name` - The display name of the database that is associated with the backup destination. * `id` - The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `associated_long_term_backup_count` - Indicates the number of long term backups of Autonomous Databases associated with this backup destination. +* `associated_long_term_backups` - List of long term backups of Autonomous Databases associated with this backup destination.The maximum associated number of long term backup listed here would be 1024. + * `display_name` - The display name for the long term backup for the autonomous database. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `connection_string` - For a RECOVERY_APPLIANCE backup destination, the connection string for connecting to the Recovery Appliance. * `defined_tags` - 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). diff --git a/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown b/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown index 8a961a0d03a..ebc3fd45dd4 100644 --- a/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown +++ b/website/docs/d/database_cloud_autonomous_vm_cluster.html.markdown @@ -83,7 +83,8 @@ The following attributes are exported: * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `max_acds_lowest_scaled_value` - The lowest value to which maximum number of ACDs can be scaled down. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of database servers in the cloud VM cluster. diff --git a/website/docs/d/database_cloud_autonomous_vm_cluster_resource_usage.html.markdown b/website/docs/d/database_cloud_autonomous_vm_cluster_resource_usage.html.markdown index 3eaa7b5de47..181583b572f 100644 --- a/website/docs/d/database_cloud_autonomous_vm_cluster_resource_usage.html.markdown +++ b/website/docs/d/database_cloud_autonomous_vm_cluster_resource_usage.html.markdown @@ -56,7 +56,8 @@ The following attributes are exported: * `display_name` - The user-friendly name for the Autonomous VM cluster. The name does not need to be unique. * `exadata_storage_in_tbs` - Total exadata storage allocated for the Autonomous VM Cluster. DATA + RECOVERY + SPARSE + any overhead in TBs. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Cloud Autonomous VM cluster. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per each CPU core. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `non_provisionable_autonomous_container_databases` - The number of non-provisionable Autonomous Container Databases in an Autonomous VM Cluster. * `provisionable_autonomous_container_databases` - The number of provisionable Autonomous Container Databases in an Autonomous VM Cluster. diff --git a/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown b/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown index 2684eb340be..5585db503f7 100644 --- a/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown +++ b/website/docs/d/database_cloud_autonomous_vm_clusters.html.markdown @@ -99,7 +99,8 @@ The following attributes are exported: * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `max_acds_lowest_scaled_value` - The lowest value to which maximum number of ACDs can be scaled down. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of database servers in the cloud VM cluster. diff --git a/website/docs/d/database_database.html.markdown b/website/docs/d/database_database.html.markdown index c074686c40f..9fae125117f 100644 --- a/website/docs/d/database_database.html.markdown +++ b/website/docs/d/database_database.html.markdown @@ -68,6 +68,7 @@ The following attributes are exported: * `auto_full_backup_window` - Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `is_remote` - Indicates whether the backup destination is cross-region or local region. diff --git a/website/docs/d/database_databases.html.markdown b/website/docs/d/database_databases.html.markdown index 2cf82dbb5a5..6e6ad9c182e 100644 --- a/website/docs/d/database_databases.html.markdown +++ b/website/docs/d/database_databases.html.markdown @@ -85,12 +85,12 @@ The following attributes are exported: * `auto_full_backup_window` - Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `recovery_window_in_days` - Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups only. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. * `run_immediate_full_backup` - If set to true, configures automatic full backups in the local region (the region of the DB system) for the first backup run immediately. diff --git a/website/docs/d/database_key_store.html.markdown b/website/docs/d/database_key_store.html.markdown index 984570e0d59..67bcada3b7f 100644 --- a/website/docs/d/database_key_store.html.markdown +++ b/website/docs/d/database_key_store.html.markdown @@ -37,6 +37,10 @@ The following attributes are exported: * `db_name` - The name of the database that is associated with the key store. * `db_unique_name` - The unique name of the database that is associated with the key store. * `id` - The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `associated_long_term_backup_count` - Indicates the number of long term backups of Autonomous Databases associated with this backup destination. +* `associated_long_term_backups` - List of long term backups of Autonomous Databases associated with this backup destination.The maximum associated number of long term backup listed here would be 1024. + * `display_name` - The display name for the long term backup for the autonomous database. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `defined_tags` - 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` - The user-friendly name for the key store. The name does not need to be unique. diff --git a/website/docs/d/database_key_stores.html.markdown b/website/docs/d/database_key_stores.html.markdown index 9e7ce6007f6..ba9b8f5d91a 100644 --- a/website/docs/d/database_key_stores.html.markdown +++ b/website/docs/d/database_key_stores.html.markdown @@ -43,6 +43,10 @@ The following attributes are exported: * `db_name` - The name of the database that is associated with the key store. * `db_unique_name` - The unique name of the database that is associated with the key store. * `id` - The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `associated_long_term_backup_count` - Indicates the number of long term backups of Autonomous Databases associated with this backup destination. +* `associated_long_term_backups` - List of long term backups of Autonomous Databases associated with this backup destination.The maximum associated number of long term backup listed here would be 1024. + * `display_name` - The display name for the long term backup for the autonomous database. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `defined_tags` - 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` - The user-friendly name for the key store. The name does not need to be unique. diff --git a/website/docs/d/fleet_software_update_fsu_collection.html.markdown b/website/docs/d/fleet_software_update_fsu_collection.html.markdown index 8787583da69..e8c606b783e 100644 --- a/website/docs/d/fleet_software_update_fsu_collection.html.markdown +++ b/website/docs/d/fleet_software_update_fsu_collection.html.markdown @@ -36,32 +36,53 @@ The following attributes are exported: * `active_fsu_cycle` - Active Exadata Fleet Update Cycle resource for this Collection. Object would be null if there is no active Cycle. * `display_name` - Display name of the active Exadata Fleet Update Cycle resource. * `id` - OCID of the active Exadata Fleet Update Cycle resource. -* `compartment_id` - Compartment Identifier +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. +* `components` - Details of components in an Exadata software stack. + * `component_type` - Type of component in an Exadata software stack. + * `fleet_discovery` - Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. + * `filters` - Filters to perform the target discovery. + * `entity_type` - Type of resource to match in the discovery. + * `exadata_releases` - List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. + * `operator` - Type of join for each element in this filter. + * `tags` - [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `key` - Freeform tag key. + * `namespace` - Defined tag namespace. + * `value` - Freeform tag value. + * `type` - Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - Supported fleet discovery strategies. + * `targets` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. + * `source_major_version` - Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in an Exadata Fleet Update Collection. Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` -* `display_name` - Exadata Fleet Update Collection resource display name. -* `fleet_discovery` - Supported fleet discovery strategies for DB Collections. If specified on an Update Collection request, this will re-discover the targets of the Collection. +* `display_name` - The user-friendly name for the Exadata Fleet Update Collection. +* `fleet_discovery` - Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. * `filters` - Filters to perform the target discovery. * `entity_type` - Type of resource to match in the discovery. - * `identifiers` - Related resource Ids to include in the discovery. All must match the specified entityType. - * `mode` - INCLUDE or EXCLUDE the filter results in the discovery for DB targets. Supported for 'FSUCOLLECTION' RESOURCE_ID filter only. + * `exadata_releases` - List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. * `names` - List of Database unique names to include in the discovery. * `operator` - Type of join for each element in this filter. - * `tags` - Freeform tags to include in the discovery. + * `tags` - [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. * `key` - Freeform tag key. * `namespace` - Defined tag namespace. * `value` - Freeform tag value. - * `type` - Type of filters supported for Database targets discovery. - * `versions` - List of Versions strings to include in the discovery. - * `fsu_discovery_id` - OCIDs of Fleet Software Update Discovery. - * `query` - Oracle Cloud Infrastructure Search Service query string. - * `strategy` - Possible fleet discovery strategies. - * `targets` - OCIDs of target resources to include. For EXACC service type Collections only VMClusters are allowed. For EXACS service type Collections only CloudVMClusters are allowed. + * `type` - Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - Supported fleet discovery strategies. + * `targets` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. * `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` -* `id` - OCID identifier for the Exadata Fleet Update Collection. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. * `last_completed_fsu_cycle_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle. * `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. * `service_type` - Exadata service type for the target resource members. -* `source_major_version` - Database Major Version of targets to be included in the Exadata Fleet Update Collection. https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbVersionSummary/ListDbVersions Only Database targets that match the version specified in this value would be added to the Exadata Fleet Update Collection. +* `source_major_version` - Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the Exadata Fleet Update Collection. Only Exadata VM Clusters whose 'systemVersion' is related to the major version will be added to the Exadata Fleet Update Collection. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) * `state` - The current state of the Exadata Fleet Update Collection. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `target_count` - Number of targets that are members of this Collection. diff --git a/website/docs/d/fleet_software_update_fsu_collections.html.markdown b/website/docs/d/fleet_software_update_fsu_collections.html.markdown index e23fbf64abf..38cc08dd561 100644 --- a/website/docs/d/fleet_software_update_fsu_collections.html.markdown +++ b/website/docs/d/fleet_software_update_fsu_collections.html.markdown @@ -50,32 +50,53 @@ The following attributes are exported: * `active_fsu_cycle` - Active Exadata Fleet Update Cycle resource for this Collection. Object would be null if there is no active Cycle. * `display_name` - Display name of the active Exadata Fleet Update Cycle resource. * `id` - OCID of the active Exadata Fleet Update Cycle resource. -* `compartment_id` - Compartment Identifier +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. +* `components` - Details of components in an Exadata software stack. + * `component_type` - Type of component in an Exadata software stack. + * `fleet_discovery` - Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. + * `filters` - Filters to perform the target discovery. + * `entity_type` - Type of resource to match in the discovery. + * `exadata_releases` - List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. + * `operator` - Type of join for each element in this filter. + * `tags` - [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `key` - Freeform tag key. + * `namespace` - Defined tag namespace. + * `value` - Freeform tag value. + * `type` - Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - Supported fleet discovery strategies. + * `targets` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. + * `source_major_version` - Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in an Exadata Fleet Update Collection. Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` -* `display_name` - Exadata Fleet Update Collection resource display name. -* `fleet_discovery` - Supported fleet discovery strategies for DB Collections. If specified on an Update Collection request, this will re-discover the targets of the Collection. +* `display_name` - The user-friendly name for the Exadata Fleet Update Collection. +* `fleet_discovery` - Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. * `filters` - Filters to perform the target discovery. * `entity_type` - Type of resource to match in the discovery. - * `identifiers` - Related resource Ids to include in the discovery. All must match the specified entityType. - * `mode` - INCLUDE or EXCLUDE the filter results in the discovery for DB targets. Supported for 'FSUCOLLECTION' RESOURCE_ID filter only. + * `exadata_releases` - List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. * `names` - List of Database unique names to include in the discovery. * `operator` - Type of join for each element in this filter. - * `tags` - Freeform tags to include in the discovery. + * `tags` - [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. * `key` - Freeform tag key. * `namespace` - Defined tag namespace. * `value` - Freeform tag value. - * `type` - Type of filters supported for Database targets discovery. - * `versions` - List of Versions strings to include in the discovery. - * `fsu_discovery_id` - OCIDs of Fleet Software Update Discovery. - * `query` - Oracle Cloud Infrastructure Search Service query string. - * `strategy` - Possible fleet discovery strategies. - * `targets` - OCIDs of target resources to include. For EXACC service type Collections only VMClusters are allowed. For EXACS service type Collections only CloudVMClusters are allowed. + * `type` - Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - Supported fleet discovery strategies. + * `targets` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. * `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` -* `id` - OCID identifier for the Exadata Fleet Update Collection. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. * `last_completed_fsu_cycle_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle. * `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. * `service_type` - Exadata service type for the target resource members. -* `source_major_version` - Database Major Version of targets to be included in the Exadata Fleet Update Collection. https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbVersionSummary/ListDbVersions Only Database targets that match the version specified in this value would be added to the Exadata Fleet Update Collection. +* `source_major_version` - Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the Exadata Fleet Update Collection. Only Exadata VM Clusters whose 'systemVersion' is related to the major version will be added to the Exadata Fleet Update Collection. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) * `state` - The current state of the Exadata Fleet Update Collection. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `target_count` - Number of targets that are members of this Collection. diff --git a/website/docs/d/fleet_software_update_fsu_cycle.html.markdown b/website/docs/d/fleet_software_update_fsu_cycle.html.markdown index 40b624148c3..26a26c8801a 100644 --- a/website/docs/d/fleet_software_update_fsu_cycle.html.markdown +++ b/website/docs/d/fleet_software_update_fsu_cycle.html.markdown @@ -41,30 +41,38 @@ The following attributes are exported: * `is_wait_for_batch_resume` - True to wait for customer to resume the Apply Action once the first half is done. False to automatically patch the second half. * `percentage` - Percentage of availability in the service during the Patch operation. * `type` - Supported batching strategies. -* `collection_type` - Type of Collection this Exadata Fleet Update Cycle belongs to. -* `compartment_id` - Compartment Identifier. +* `collection_type` - Type of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `diagnostics_collection` - Details to configure diagnostics collection for targets affected by this Exadata Fleet Update Maintenance Cycle. * `log_collection_mode` - Enable incident logs and trace collection. Allow Oracle to collect incident logs and traces to enable fault diagnosis and issue resolution according to the selected mode. -* `display_name` - Exadata Fleet Update Cycle display name. -* `executing_fsu_action_id` - OCID identifier for the Action that is currently in execution, if applicable. +* `display_name` - The user-friendly name for the Exadata Fleet Update Cycle. +* `executing_fsu_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Action that is currently in progress, if applicable. * `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` -* `fsu_collection_id` - OCID identifier for the Collection ID the Exadata Fleet Update Cycle is assigned to. +* `fsu_collection_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. * `goal_version_details` - Goal version or image details for the Exadata Fleet Update Cycle. + * `components` - Details of goal versions for components in an Exadata software stack. + * `component_type` - Type of component in an Exadata software stack. + * `goal_version_details` - Details of goal 'GUEST_OS' software version. + * `goal_software_image_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom 'GI' software image. + * `goal_type` - Preference to use an Oracle released 'GI' software image or a custom 'GI' software image. + * `goal_version` - Goal version string matching an Oracle released 'GUEST_OS' software image. + * `home_policy` - Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. + * `new_home_prefix` - Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. * `home_policy` - Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. * `new_home_prefix` - Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. - * `software_image_id` - Target database software image OCID. - * `type` - Type of goal target version specified - * `version` - Target DB or GI version string for the Exadata Fleet Update Cycle. -* `id` - OCID identifier for the Exadata Fleet Update Cycle. -* `is_ignore_missing_patches` - List of identifiers of patches to ignore. -* `is_ignore_patches` - Ignore patch conflicts or missing patches between the source and goal homes. -* `is_keep_placement` - Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same instances before and after the move operation. + * `software_image_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the goal database software image. + * `type` - Type of goal version specified + * `version` - Goal version string for the Exadata Fleet Update Cycle. Applicable to Database, Grid Infrastructure, or Exadata Image software updates. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Cycle. +* `is_ignore_missing_patches` - List of identifiers of patches to ignore. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_ignore_patches` - Ignore patch conflicts or missing patches between the source and goal homes. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_keep_placement` - Ensure that database services are online on the same VMs before and after the maintenance update. * `last_completed_action` - The latest Action type that was completed in the Exadata Fleet Update Cycle. No value would indicate that the Cycle has not completed any Action yet. * `last_completed_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action in the Exadata Fleet Update Cycle. * `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. -* `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds. -* `next_action_to_execute` - In this array all the possible actions will be listed. The first element is the suggested Action. +* `max_drain_timeout_in_seconds` - Timeout for session draining for database services specified in seconds. +* `next_action_to_execute` - All possible Exadata Fleet Update Actions will be listed. The first element is the suggested Exadata Fleet Update Action. * `time_to_start` - The date and time the Exadata Fleet Update Action is expected to start. Null if no Action has been scheduled. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29. * `type` - Type of Exadata Fleet Update Action * `rollback_cycle_state` - Current rollback cycle state if rollback maintenance cycle action has been attempted. No value would indicate that the Cycle has not run a rollback maintenance cycle action before. @@ -79,6 +87,9 @@ The following attributes are exported: * `type` - Type of Exadata Fleet Update Cycle. * `upgrade_details` - Details of supported upgrade options for DB or GI collection. * `collection_type` - Type of Exadata Fleet Update collection being upgraded. + * `is_ignore_post_upgrade_errors` - Ignore errors during post Oracle Grid Infrastructure upgrade Cluster Verification Utility (CVU) check. + * `is_ignore_prerequisites` - Ignore the Cluster Verification Utility (CVU) prerequisite checks. * `is_recompile_invalid_objects` - Enables or disables the recompilation of invalid objects. * `is_time_zone_upgrade` - Enables or disables time zone upgrade. + * `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds. diff --git a/website/docs/d/fleet_software_update_fsu_cycles.html.markdown b/website/docs/d/fleet_software_update_fsu_cycles.html.markdown index c7af0ff9eef..9070d187d87 100644 --- a/website/docs/d/fleet_software_update_fsu_cycles.html.markdown +++ b/website/docs/d/fleet_software_update_fsu_cycles.html.markdown @@ -59,30 +59,38 @@ The following attributes are exported: * `is_wait_for_batch_resume` - True to wait for customer to resume the Apply Action once the first half is done. False to automatically patch the second half. * `percentage` - Percentage of availability in the service during the Patch operation. * `type` - Supported batching strategies. -* `collection_type` - Type of Collection this Exadata Fleet Update Cycle belongs to. -* `compartment_id` - Compartment Identifier. +* `collection_type` - Type of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `diagnostics_collection` - Details to configure diagnostics collection for targets affected by this Exadata Fleet Update Maintenance Cycle. * `log_collection_mode` - Enable incident logs and trace collection. Allow Oracle to collect incident logs and traces to enable fault diagnosis and issue resolution according to the selected mode. -* `display_name` - Exadata Fleet Update Cycle display name. -* `executing_fsu_action_id` - OCID identifier for the Action that is currently in execution, if applicable. +* `display_name` - The user-friendly name for the Exadata Fleet Update Cycle. +* `executing_fsu_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Action that is currently in progress, if applicable. * `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` -* `fsu_collection_id` - OCID identifier for the Collection ID the Exadata Fleet Update Cycle is assigned to. +* `fsu_collection_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. * `goal_version_details` - Goal version or image details for the Exadata Fleet Update Cycle. + * `components` - Details of goal versions for components in an Exadata software stack. + * `component_type` - Type of component in an Exadata software stack. + * `goal_version_details` - Details of goal 'GUEST_OS' software version. + * `goal_software_image_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom 'GI' software image. + * `goal_type` - Preference to use an Oracle released 'GI' software image or a custom 'GI' software image. + * `goal_version` - Goal version string matching an Oracle released 'GUEST_OS' software image. + * `home_policy` - Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. + * `new_home_prefix` - Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. * `home_policy` - Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. * `new_home_prefix` - Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. - * `software_image_id` - Target database software image OCID. - * `type` - Type of goal target version specified - * `version` - Target DB or GI version string for the Exadata Fleet Update Cycle. -* `id` - OCID identifier for the Exadata Fleet Update Cycle. -* `is_ignore_missing_patches` - List of identifiers of patches to ignore. -* `is_ignore_patches` - Ignore patch conflicts or missing patches between the source and goal homes. -* `is_keep_placement` - Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same instances before and after the move operation. + * `software_image_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the goal database software image. + * `type` - Type of goal version specified + * `version` - Goal version string for the Exadata Fleet Update Cycle. Applicable to Database, Grid Infrastructure, or Exadata Image software updates. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Cycle. +* `is_ignore_missing_patches` - List of identifiers of patches to ignore. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_ignore_patches` - Ignore patch conflicts or missing patches between the source and goal homes. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_keep_placement` - Ensure that database services are online on the same VMs before and after the maintenance update. * `last_completed_action` - The latest Action type that was completed in the Exadata Fleet Update Cycle. No value would indicate that the Cycle has not completed any Action yet. * `last_completed_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action in the Exadata Fleet Update Cycle. * `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. -* `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds. -* `next_action_to_execute` - In this array all the possible actions will be listed. The first element is the suggested Action. +* `max_drain_timeout_in_seconds` - Timeout for session draining for database services specified in seconds. +* `next_action_to_execute` - All possible Exadata Fleet Update Actions will be listed. The first element is the suggested Exadata Fleet Update Action. * `time_to_start` - The date and time the Exadata Fleet Update Action is expected to start. Null if no Action has been scheduled. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29. * `type` - Type of Exadata Fleet Update Action * `rollback_cycle_state` - Current rollback cycle state if rollback maintenance cycle action has been attempted. No value would indicate that the Cycle has not run a rollback maintenance cycle action before. @@ -97,6 +105,9 @@ The following attributes are exported: * `type` - Type of Exadata Fleet Update Cycle. * `upgrade_details` - Details of supported upgrade options for DB or GI collection. * `collection_type` - Type of Exadata Fleet Update collection being upgraded. + * `is_ignore_post_upgrade_errors` - Ignore errors during post Oracle Grid Infrastructure upgrade Cluster Verification Utility (CVU) check. + * `is_ignore_prerequisites` - Ignore the Cluster Verification Utility (CVU) prerequisite checks. * `is_recompile_invalid_objects` - Enables or disables the recompilation of invalid objects. * `is_time_zone_upgrade` - Enables or disables time zone upgrade. + * `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds. diff --git a/website/docs/d/functions_function.html.markdown b/website/docs/d/functions_function.html.markdown index 511b9751524..a920efed0de 100644 --- a/website/docs/d/functions_function.html.markdown +++ b/website/docs/d/functions_function.html.markdown @@ -38,7 +38,14 @@ The following attributes are exported: The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8. * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `detached_mode_timeout_in_seconds` - Timeout for detached function invocations. Value in seconds. Example: `{"detachedModeTimeoutInSeconds": 900}` * `display_name` - The display name of the function. The display name is unique within the application containing the function. +* `failure_destination` - An object that represents the destination to which Oracle Functions will send an invocation record with the details of the error of the failed detached function invocation. A notification is an example of a failure destination. Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` + * `channel_id` - The ID of the channel in the queue. + * `kind` - The type of destination for the response to a failed detached function invocation. + * `queue_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `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 function. * `image` - The qualified name of the Docker image to use in the function, including the image tag. The image should be in the Oracle Cloud Infrastructure Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1` @@ -53,6 +60,12 @@ The following attributes are exported: * `pbf_listing_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the PbfListing this function is sourced from. * `source_type` - Type of the Function Source. Possible values: PRE_BUILT_FUNCTIONS. * `state` - The current state of the function. +* `success_destination` - An object that represents the destination to which Oracle Functions will send an invocation record with the details of the successful detached function invocation. A stream is an example of a success destination. Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` + * `channel_id` - The ID of the channel in the queue. + * `kind` - The type of destination for the response to a successful detached function invocation. + * `queue_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `time_created` - The time the function was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` * `time_updated` - The time the function was updated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` * `timeout_in_seconds` - Timeout for executions of the function. Value in seconds. diff --git a/website/docs/d/functions_functions.html.markdown b/website/docs/d/functions_functions.html.markdown index a3ceceb97a8..13b6e4b47e0 100644 --- a/website/docs/d/functions_functions.html.markdown +++ b/website/docs/d/functions_functions.html.markdown @@ -52,7 +52,14 @@ The following attributes are exported: The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8. * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `detached_mode_timeout_in_seconds` - Timeout for detached function invocations. Value in seconds. Example: `{"detachedModeTimeoutInSeconds": 900}` * `display_name` - The display name of the function. The display name is unique within the application containing the function. +* `failure_destination` - An object that represents the destination to which Oracle Functions will send an invocation record with the details of the error of the failed detached function invocation. A notification is an example of a failure destination. Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` + * `channel_id` - The ID of the channel in the queue. + * `kind` - The type of destination for the response to a failed detached function invocation. + * `queue_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `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 function. * `image` - The qualified name of the Docker image to use in the function, including the image tag. The image should be in the Oracle Cloud Infrastructure Registry that is in the same region as the function itself. Example: `phx.ocir.io/ten/functions/function:0.0.1` @@ -67,6 +74,12 @@ The following attributes are exported: * `pbf_listing_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the PbfListing this function is sourced from. * `source_type` - Type of the Function Source. Possible values: PRE_BUILT_FUNCTIONS. * `state` - The current state of the function. +* `success_destination` - An object that represents the destination to which Oracle Functions will send an invocation record with the details of the successful detached function invocation. A stream is an example of a success destination. Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` + * `channel_id` - The ID of the channel in the queue. + * `kind` - The type of destination for the response to a successful detached function invocation. + * `queue_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `time_created` - The time the function was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` * `time_updated` - The time the function was updated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` * `timeout_in_seconds` - Timeout for executions of the function. Value in seconds. diff --git a/website/docs/d/generative_ai_dedicated_ai_cluster.html.markdown b/website/docs/d/generative_ai_dedicated_ai_cluster.html.markdown index fc904670a65..72573687173 100644 --- a/website/docs/d/generative_ai_dedicated_ai_cluster.html.markdown +++ b/website/docs/d/generative_ai_dedicated_ai_cluster.html.markdown @@ -32,5 +32,14 @@ The following arguments are supported: The following attributes are exported: +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `description` - An optional description of the dedicated AI cluster. +* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the dedicated AI cluster. +* `lifecycle_details` - A message describing the current state with detail that can provide actionable information. +* `state` - The current state of the dedicated AI cluster. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_updated` - The date and time the dedicated AI cluster was updated, in the format defined by RFC 3339 +* `unit_count` - The number of dedicated units in this AI cluster. +* `unit_shape` - The shape of dedicated unit in this AI cluster. The underlying hardware configuration is hidden from customers. diff --git a/website/docs/d/generative_ai_dedicated_ai_clusters.html.markdown b/website/docs/d/generative_ai_dedicated_ai_clusters.html.markdown index da89ccf2d5c..120b5d8917b 100644 --- a/website/docs/d/generative_ai_dedicated_ai_clusters.html.markdown +++ b/website/docs/d/generative_ai_dedicated_ai_clusters.html.markdown @@ -46,5 +46,14 @@ The following attributes are exported: The following attributes are exported: +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `description` - An optional description of the dedicated AI cluster. +* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the dedicated AI cluster. +* `lifecycle_details` - A message describing the current state with detail that can provide actionable information. +* `state` - The current state of the dedicated AI cluster. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_updated` - The date and time the dedicated AI cluster was updated, in the format defined by RFC 3339 +* `unit_count` - The number of dedicated units in this AI cluster. +* `unit_shape` - The shape of dedicated unit in this AI cluster. The underlying hardware configuration is hidden from customers. diff --git a/website/docs/d/generative_ai_endpoint.html.markdown b/website/docs/d/generative_ai_endpoint.html.markdown index 0844b441061..dc1ce4bfcea 100644 --- a/website/docs/d/generative_ai_endpoint.html.markdown +++ b/website/docs/d/generative_ai_endpoint.html.markdown @@ -32,9 +32,13 @@ The following arguments are supported: The following attributes are exported: -* `description` - An optional description of the endpoint. -* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. -* `model_id` - The OCID of the model that's used to create this endpoint. +* `content_moderation_config` - The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses. + * `is_enabled` - Whether to enable the content moderation feature. + * `mode` - Enum for the modes of operation for inference protection. + * `model_id` - The OCID of the model used for the feature. +* `dedicated_ai_cluster_id` - The OCID of the dedicated AI cluster on which the model will be deployed to. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `lifecycle_details` - A message describing the current state of the endpoint in more detail that can provide actionable information. * `state` - The current state of the endpoint. -* `time_updated` - The date and time that the endpoint was updated in the format of an RFC3339 datetime string. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` diff --git a/website/docs/d/generative_ai_endpoints.html.markdown b/website/docs/d/generative_ai_endpoints.html.markdown index c111df19ce5..51dc4fd27ee 100644 --- a/website/docs/d/generative_ai_endpoints.html.markdown +++ b/website/docs/d/generative_ai_endpoints.html.markdown @@ -21,6 +21,7 @@ data "oci_generative_ai_endpoints" "test_endpoints" { #Optional display_name = var.endpoint_display_name + generative_ai_private_endpoint_id = oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint.id id = var.endpoint_id state = var.endpoint_state } @@ -32,6 +33,7 @@ The following arguments are supported: * `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. * `display_name` - (Optional) A filter to return only resources that match the given display name exactly. +* `generative_ai_private_endpoint_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the private endpoint. * `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the endpoint. * `state` - (Optional) A filter to return only resources that their lifecycle state matches the given lifecycle state. @@ -46,9 +48,13 @@ The following attributes are exported: The following attributes are exported: -* `description` - An optional description of the endpoint. -* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. -* `model_id` - The OCID of the model that's used to create this endpoint. +* `content_moderation_config` - The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses. + * `is_enabled` - Whether to enable the content moderation feature. + * `mode` - Enum for the modes of operation for inference protection. + * `model_id` - The OCID of the model used for the feature. +* `dedicated_ai_cluster_id` - The OCID of the dedicated AI cluster on which the model will be deployed to. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `lifecycle_details` - A message describing the current state of the endpoint in more detail that can provide actionable information. * `state` - The current state of the endpoint. -* `time_updated` - The date and time that the endpoint was updated in the format of an RFC3339 datetime string. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` diff --git a/website/docs/d/generative_ai_generative_ai_private_endpoint.html.markdown b/website/docs/d/generative_ai_generative_ai_private_endpoint.html.markdown new file mode 100644 index 00000000000..d719b4a0cfb --- /dev/null +++ b/website/docs/d/generative_ai_generative_ai_private_endpoint.html.markdown @@ -0,0 +1,44 @@ +--- +subcategory: "Generative AI" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_generative_ai_generative_ai_private_endpoint" +sidebar_current: "docs-oci-datasource-generative_ai-generative_ai_private_endpoint" +description: |- + Provides details about a specific Generative Ai Private Endpoint in Oracle Cloud Infrastructure Generative AI service +--- + +# Data Source: oci_generative_ai_generative_ai_private_endpoint +This data source provides details about a specific Generative Ai Private Endpoint resource in Oracle Cloud Infrastructure Generative AI service. + +Retrieves an Generative AI private endpoint using a `privateEndpointId`. + + +## Example Usage + +```hcl +data "oci_generative_ai_generative_ai_private_endpoint" "test_generative_ai_private_endpoint" { + #Required + generative_ai_private_endpoint_id = oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `generative_ai_private_endpoint_id` - (Required) The unique id for a Generative AI private endpoint. + + +## Attributes Reference + +The following attributes are exported: + +* `description` - A description of this private endpoint. +* `display_name` - A user friendly name. It doesn't have to be unique. Avoid entering confidential information. +* `fqdn` - Fully qualified domain name the customer will use for access (for eg: xyz.oraclecloud.com) +* `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 of a private endpoint. +* `nsg_ids` - A list of the OCIDs of the network security groups that the private endpoint's VNIC belongs to. +* `private_endpoint_ip` - The private IP address (in the customer's VCN) that represents the access point for the associated endpoint service. +* `state` - The current state of the Generative AI Private Endpoint. + diff --git a/website/docs/d/generative_ai_generative_ai_private_endpoints.html.markdown b/website/docs/d/generative_ai_generative_ai_private_endpoints.html.markdown new file mode 100644 index 00000000000..aecc86b823b --- /dev/null +++ b/website/docs/d/generative_ai_generative_ai_private_endpoints.html.markdown @@ -0,0 +1,58 @@ +--- +subcategory: "Generative AI" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_generative_ai_generative_ai_private_endpoints" +sidebar_current: "docs-oci-datasource-generative_ai-generative_ai_private_endpoints" +description: |- + Provides the list of Generative Ai Private Endpoints in Oracle Cloud Infrastructure Generative AI service +--- + +# Data Source: oci_generative_ai_generative_ai_private_endpoints +This data source provides the list of Generative Ai Private Endpoints in Oracle Cloud Infrastructure Generative AI service. + +Lists all Generative AI private endpoints in the specified compartment. + + +## Example Usage + +```hcl +data "oci_generative_ai_generative_ai_private_endpoints" "test_generative_ai_private_endpoints" { + #Required + compartment_id = var.compartment_id + + #Optional + display_name = var.generative_ai_private_endpoint_display_name + id = var.generative_ai_private_endpoint_id + state = var.generative_ai_private_endpoint_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `display_name` - (Optional) A filter to return only resources that match the given display name exactly. +* `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the private endpoint. +* `state` - (Optional) The lifecycle state of Generative AI private endpoints. + + +## Attributes Reference + +The following attributes are exported: + +* `generative_ai_private_endpoint_collection` - The list of generative_ai_private_endpoint_collection. + +### GenerativeAiPrivateEndpoint Reference + +The following attributes are exported: + +* `description` - A description of this private endpoint. +* `display_name` - A user friendly name. It doesn't have to be unique. Avoid entering confidential information. +* `fqdn` - Fully qualified domain name the customer will use for access (for eg: xyz.oraclecloud.com) +* `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 of a private endpoint. +* `nsg_ids` - A list of the OCIDs of the network security groups that the private endpoint's VNIC belongs to. +* `private_endpoint_ip` - The private IP address (in the customer's VCN) that represents the access point for the associated endpoint service. +* `state` - The current state of the Generative AI Private Endpoint. + diff --git a/website/docs/d/generative_ai_model.html.markdown b/website/docs/d/generative_ai_model.html.markdown index a372a65480b..1899b0243fe 100644 --- a/website/docs/d/generative_ai_model.html.markdown +++ b/website/docs/d/generative_ai_model.html.markdown @@ -32,9 +32,8 @@ The following arguments are supported: The following attributes are exported: -* `base_model_id` - The OCID of the base model that's used for fine-tuning. For pretrained models, the value is null. -* `capabilities` - Describes what this model can be used for. * `compartment_id` - The compartment OCID for fine-tuned models. For pretrained models, this value is null. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` * `description` - An optional description of the model. * `display_name` - A user-friendly name. * `fine_tune_details` - Details about fine-tuning a custom model. diff --git a/website/docs/d/generative_ai_models.html.markdown b/website/docs/d/generative_ai_models.html.markdown index 22e3da140c9..e6c1be9ba9d 100644 --- a/website/docs/d/generative_ai_models.html.markdown +++ b/website/docs/d/generative_ai_models.html.markdown @@ -50,9 +50,8 @@ The following attributes are exported: The following attributes are exported: -* `base_model_id` - The OCID of the base model that's used for fine-tuning. For pretrained models, the value is null. -* `capabilities` - Describes what this model can be used for. * `compartment_id` - The compartment OCID for fine-tuned models. For pretrained models, this value is null. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` * `description` - An optional description of the model. * `display_name` - A user-friendly name. * `fine_tune_details` - Details about fine-tuning a custom model. @@ -89,8 +88,8 @@ The following attributes are exported: * `state` - The lifecycle state of the model. * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The date and time that the model was created in the format of an RFC3339 datetime string. -* `time_updated` - The date and time that the model was updated in the format of an RFC3339 datetime string. * `time_deprecated` - Corresponds to the time when the custom model and its associated foundation model will be deprecated. +* `time_updated` - The date and time that the model was updated in the format of an RFC3339 datetime string. * `type` - The model type indicating whether this is a pretrained/base model or a custom/fine-tuned model. * `vendor` - The provider of the base model. * `version` - The version of the model. diff --git a/website/docs/d/multicloud_external_location_mapping_metadata.html.markdown b/website/docs/d/multicloud_external_location_mapping_metadata.html.markdown new file mode 100644 index 00000000000..dd23711a743 --- /dev/null +++ b/website/docs/d/multicloud_external_location_mapping_metadata.html.markdown @@ -0,0 +1,59 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_external_location_mapping_metadata" +sidebar_current: "docs-oci-datasource-multicloud-external_location_mapping_metadata" +description: |- + Provides the list of External Location Mapping Metadata in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_external_location_mapping_metadata +This data source provides the list of External Location Mapping Metadata in Oracle Cloud Infrastructure Multicloud service. + +List externalLocation metadata from Oracle Cloud Infrastructure to the Cloud Service Provider for regions, Physical Availability Zones. + +## Example Usage + +```hcl +data "oci_multicloud_external_location_mapping_metadata" "test_external_location_mapping_metadata" { + #Required + compartment_id = var.compartment_id + subscription_service_name = var.subscription_service_name_list + + #Optional + subscription_id = var.subscription_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `subscription_service_name` - (Required) The subscription type values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] +* `subscription_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + + +## Attributes Reference + +The following attributes are exported: + +* `external_location_mapping_metadatum_summary_collection` - The list of ExternalLocationMappingMetadata. + +### ExternalLocationMappingMetadata Reference + +The following attributes are exported: + +* `items` - List of ExternalLocationMappingMetadatumSummary + * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` + * `external_location` - External location for CSP Region, CSP-Physical-AZ + * `csp_physical_az` - A mapping of Oracle Cloud Infrastructure site group name to CSP physical availability zone name + * `csp_physical_az_display_name` - User friendly display name for cspPhysicalAZ + * `csp_region` - CSP region corresponding to the given Oracle Cloud Infrastructure region + * `csp_region_display_name` - CSP region display Name corresponding to the given Oracle Cloud Infrastructure region + * `service_name` - The serviceName that externalLocation map object belongs to + * `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"}` + * `oci_logical_ad` - Oracle Cloud Infrastructure logical ad name + * `oci_physical_ad` - Oracle Cloud Infrastructure physical ad name + * `oci_region` - Oracle Cloud Infrastructure region identifier https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm + * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"} \ No newline at end of file diff --git a/website/docs/d/multicloud_external_location_summaries_metadata.html.markdown b/website/docs/d/multicloud_external_location_summaries_metadata.html.markdown new file mode 100644 index 00000000000..93ed38e1e1d --- /dev/null +++ b/website/docs/d/multicloud_external_location_summaries_metadata.html.markdown @@ -0,0 +1,56 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_external_location_summaries_metadata" +sidebar_current: "docs-oci-datasource-multicloud-external_location_summaries_metadata" +description: |- + Provides the list of External Location Summaries Metadata in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_external_location_summaries_metadata +This data source provides the list of External Location Summaries Metadata in Oracle Cloud Infrastructure Multicloud service. + +List externalLocationSummary metadata from Oracle Cloud Infrastructure Region to the Cloud Service Provider region across all regions. + +## Example Usage + +```hcl +data "oci_multicloud_external_location_summaries_metadata" "test_external_location_summaries_metadata" { + #Required + compartment_id = var.compartment_id + subscription_service_name = var.subscription_service_name + + #Optional + entity_type = var.entity_type + subscription_id = var.subscription_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `subscription_service_name` - (Required) The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] +* `entity_type` - (Optional) The resource type query (i.e. dbsystem, instance etc.) +* `subscription_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. + + +## Attributes Reference + +The following attributes are exported: + +* `external_location_summaries_metadatum_summary_collection` - The list of ExternalLocationSummariesMetadata. + +### ExternalLocationSummariesMetadata Reference + +The following attributes are exported: + +* `items` - List of ExternalLocationSummariesMetadatumSummary + * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` + * `external_location` - External location for CSP Region + * `csp_region` - CSP region corresponding to the given Oracle Cloud Infrastructure region + * `csp_region_display_name` - CSP region display Name corresponding to the given Oracle Cloud Infrastructure region + * `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"}` + * `oci_region` - Oracle Cloud Infrastructure region identifier https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm + * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` \ No newline at end of file diff --git a/website/docs/d/multicloud_external_locations_metadata.html.markdown b/website/docs/d/multicloud_external_locations_metadata.html.markdown new file mode 100644 index 00000000000..16b108de519 --- /dev/null +++ b/website/docs/d/multicloud_external_locations_metadata.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_external_locations_metadata" +sidebar_current: "docs-oci-datasource-multicloud-external_locations_metadata" +description: |- + Provides the list of External Locations Metadata in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_external_locations_metadata +This data source provides the list of External Locations Metadata in Oracle Cloud Infrastructure Multicloud service. + +List externalLocationDetail metadata from Oracle Cloud Infrastructure to Cloud Service Provider for regions, Availability Zones, and Cluster Placement Group ID. + +## Example Usage + +```hcl +data "oci_multicloud_external_locations_metadata" "test_external_locations_metadata" { + #Required + compartment_id = var.compartment_id + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name + + #Optional + entity_type = var.external_locations_metadata_entity_type + linked_compartment_id = var.linked_compartment_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `subscription_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. +* `subscription_service_name` - (Required) The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] +* `entity_type` - (Optional) The resource type query (i.e. dbsystem, instance etc.) +* `linked_compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which linked to Resource. + + +## Attributes Reference + +The following attributes are exported: + +* `external_locations_metadatum_collection` - The list of ExternalLocationsMetadata. + +### ExternalLocationsMetadata Reference + +The following attributes are exported: + +* `items` - List of ExternalLocationsMetadatumSummary + * `cpg_id` - Cluster Placement Group OCID + * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` + * `external_location` - External location for CSP Region, CSP-Physical-AZ, CSP-Logical-AZ + * `csp_logical_az` - A mapping of CSP physical availability zone to CSP logical availability zone. + * `csp_physical_az` - A mapping of Oracle Cloud Infrastructure site group name to CSP physical availability zone name + * `csp_physical_az_display_name` - User friendly display name for cspPhysicalAZ + * `csp_region` - CSP region corresponding to the given Oracle Cloud Infrastructure region + * `csp_region_display_name` - CSP region display Name corresponding to the given Oracle Cloud Infrastructure region + * `csp_zone_key_reference_id` - This is CSP zone key reference + * `key_name` - KeyName for Azure=AzureSubscriptionId Aws=AwsAccountId GCP=GcpProjectName + * `key_value` - Value of keyName GcpProjectName: A human-readable name for your project. The project name isn't used by any Google APIs. You can edit the project name at any time during or after project creation. Project names do not need to be unique. AzureSubscriptionId: A unique alphanumeric string that identifies your Azure subscription. AwsAccountId: a unique 12-digit number that identifies an Amazon Web Services (AWS) account + * `service_name` - The serviceName that externalLocation map object belongs to. + * `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"}` + * `oci_logical_ad` - Oracle Cloud Infrastructure logical ad name + * `oci_physical_ad` - Oracle Cloud Infrastructure physical ad name + * `oci_region` - Oracle Cloud Infrastructure region identifier https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm + * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` \ No newline at end of file diff --git a/website/docs/d/multicloud_network_anchor.html.markdown b/website/docs/d/multicloud_network_anchor.html.markdown new file mode 100644 index 00000000000..4eb6c065c69 --- /dev/null +++ b/website/docs/d/multicloud_network_anchor.html.markdown @@ -0,0 +1,78 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_network_anchor" +sidebar_current: "docs-oci-datasource-multicloud-network_anchor" +description: |- + Provides details about a specific Network Anchor in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_network_anchor +This data source provides details about a specific Network Anchor resource in Oracle Cloud Infrastructure Multicloud service. + +Gets information about a NetworkAnchor. + +## Example Usage + +```hcl +data "oci_multicloud_network_anchor" "test_network_anchor" { + #Required + network_anchor_id = var.network_anchor_id + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name + + #Optional + external_location = var.network_anchor_external_location +} +``` + +## Argument Reference + +The following arguments are supported: + +* `network_anchor_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. +* `subscription_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. +* `subscription_service_name` - (Required) The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] +* `external_location` - (Optional) OMHub Control Plane must know underlying CSP CP Region External Location Name. + + +## Attributes Reference + +The following attributes are exported: + +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. +* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `resource_anchor_id` - Oracle Cloud Infrastructure resource anchor Id (OCID). +* `time_created` - The date and time the NetworkAnchor was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the NetworkAnchor was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `network_anchor_lifecycle_state` - The current state of the NetworkAnchor. +* `lifecycle_details` - A message that describes the current state of the NetworkAnchor in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `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"}` +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `setup_mode` - AUTO_BIND - when passed compartment will be created on-behalf of customer and bind to this resource anchor NO_AUTO_BIND - compartment will not be created and later customer can bind existing compartment. to this resource anchor. This is for future use only +* `cluster_placement_group_id` - The CPG ID in which Network Anchor will be created. +* `oci_metadata_item` - Oracle Cloud Infrastructure network anchor related meta data items + * `network_anchor_connection_status` - This can be merge to lifecycleState CONNECTED - Partner and CSI information is assigned and MulticloudLink provisioned. DISCONNECTED - Only partner cloud information is assigned. CONNECTING - Oracle Cloud Infrastructure information is assigned and the control plane is provisioning resources. ACTIVE - Network anchor is connected and resources (VNICs) exist within a subnet. ERROR - DRG attach fails during connection. FAILED - Network anchor creation failed NEEDS_ATTENTION - Network anchor is in temporary bad state UPDATING - Network anchor is getting updated. DELETING - Network anchor is getting deleted DELETED - A connected network anchor is deleted. + * `vcn` - Oracle Cloud Infrastructure VCN basic information object. It is optional and planned to used for future for network anchor + * `backup_cidr_blocks` - Oracle Cloud Infrastructure backup cidr block. CSP can set this property It's optional only if disconnect anchor is allowed. IPv4 CIDR blocks for the VCN that meet the following criteria Type: [string (length: 1–32), ...] The CIDR blocks must be valid. They must not overlap with each other or with the on-premises network CIDR block. + * `cidr_blocks` - Oracle Cloud Infrastructure primary cidr block. CSP can set this property It's optional only if disconnect anchor is allowed IPv4 CIDR blocks for the VCN that meet the following criteria Type: [string (length: 1–32), ...] The CIDR blocks must be valid. They must not overlap with each other or with the on-premises network CIDR block. + * `dns_label` - Oracle Cloud Infrastructure DNS label. This is optional if DNS config is provided. + * `vcn_id` - Oracle Cloud Infrastructure VCN OCID. CSP can not set this property. + * `dns` - Oracle Cloud Infrastructure network anchor related meta data items + * `custom_domain_name` - Full custom domain name. If this field is passed dnsLabel will be ignored + * `subnets` - Network subnets + * `label` - Subnet label. CSP can set this property + * `subnet_id` - OCID for existing the subnet. CSP can not set this property. + * `type` - Defines if the subnet is the primary or backup for the network + * `dns_listening_endpoint_ip_address` - The DNS Listener Endpoint Address. + * `dns_forwarding_endpoint_ip_address` - The DNS Listener Forwarding Address. + * `dns_forwarding_config` - DNS forward configuration +* `cloud_service_provider_metadata_item` - Cloud Service Provider metadata item. Warning - In future this object can change to generic object with future Cloud Service Provider based on CloudServiceProvider field. This can be one of CSP provider type Azure, GCP and AWS + * `cidr_blocks` - An Azure/GCP/AWS cidrBlocks + * `dns_forwarding_config` - DNS domain ip mapping forwarding configuration + * `network_anchor_uri` - CSP network anchor Uri + * `odb_network_id` - CSP oracle database network anchor unique ID/name + * `region` - Azure/GCP/AWS region + diff --git a/website/docs/d/multicloud_network_anchors.html.markdown b/website/docs/d/multicloud_network_anchors.html.markdown new file mode 100644 index 00000000000..7996bd64eee --- /dev/null +++ b/website/docs/d/multicloud_network_anchors.html.markdown @@ -0,0 +1,73 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_network_anchors" +sidebar_current: "docs-oci-datasource-multicloud-network_anchors" +description: |- + Provides the list of Network Anchors in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_network_anchors +This data source provides the list of Network Anchors in Oracle Cloud Infrastructure Multicloud service. + +Gets a list of NetworkAnchors. + +## Example Usage + +```hcl +data "oci_multicloud_network_anchors" "test_network_anchors" { + #Required + external_location = var.external_location + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name + + #Optional + compartment_id = var.compartment_id + network_anchor_lifecycle_state = var.network_anchor_lifecycle_state + display_name = var.display_name + network_anchor_oci_subnet_id = var.network_anchor_oci_subnet_id + network_anchor_oci_vcn_id = var.network_anchor_oci_vcn_id + id = var.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `external_location` - (Required) OMHub Control Plane must know underlying CSP CP Region External Location Name. +* `subscription_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. +* `subscription_service_name` - (Required) The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] +* `compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `network_anchor_lifecycle_state` - (Optional) A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. +* `display_name` - (Optional) A filter to return only resources that match the given display name exactly. +* `network_anchor_oci_subnet_id` - (Optional) A filter to return only NetworkAnchor resources that match the given Oracle Cloud Infrastructure subnet Id. +* `network_anchor_oci_vcn_id` - (Optional) A filter to return only NetworkAnchor resources that match the given Oracle Cloud Infrastructure Vcn Id. +* `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. + +Note: one of the arguments `compartment_id` or `id` must be specified. + +## Attributes Reference + +The following attributes are exported: + +* `network_anchor_collection` - The list of NetworkAnchor. + +### NetworkAnchor Reference + +The following attributes are exported: + +* `items` - List of NetworkAnchorSummary + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the NetworkAnchor. + * `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. + * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + * `resource_anchor_id` - Oracle Cloud Infrastructure resource anchor Id (OCID). + * `vcn_id` - Oracle Cloud Infrastructure VCN OCID. CSP can not set this property. + * `cluster_placement_group_id` - The CPG ID in which Network Anchor will be created. + * `time_created` - The date and time the NetworkAnchor was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + * `time_updated` - The date and time the NetworkAnchor was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + * `network_anchor_lifecycle_state` - The current state of the NetworkAnchor. + * `lifecycle_details` - A message that describes the current state of the NetworkAnchor in more detail. For example, can be used to provide actionable information for a resource in the Failed state. + * `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"}` + * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` + * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` \ No newline at end of file diff --git a/website/docs/d/multicloud_om_hub_multi_cloud_metadata.html.markdown b/website/docs/d/multicloud_om_hub_multi_cloud_metadata.html.markdown new file mode 100644 index 00000000000..faa4ab579ff --- /dev/null +++ b/website/docs/d/multicloud_om_hub_multi_cloud_metadata.html.markdown @@ -0,0 +1,42 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_om_hub_multi_cloud_metadata" +sidebar_current: "docs-oci-datasource-multicloud-om_hub_multi_cloud_metadata" +description: |- + Provides details about a specific OmHub MultiCloud base compartment in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_om_hub_multi_clouds_metadata +This data source provides details about a specific OmHub MultiCloud base compartment in Oracle Cloud Infrastructure Multicloud service. + +Gets information about multicloud base compartment + +## Example Usage + +```hcl +data "oci_multicloud_om_hub_multi_cloud_metadata" "test_om_hub_multi_cloud_metadata" { + #Required + compartment_id = var.compartment_id + subscription_id = var.subscription_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `subscription_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure subscription. + + +## Attributes Reference + +The following attributes are exported: + +* `base_compartment_id` - MultiCloud base compartment OCID associated with subscriptionId. +* `base_subscription_id` - Oracle Cloud Infrastructure subscriptionId. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `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"}` +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the multicloud compartment was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` \ No newline at end of file diff --git a/website/docs/d/multicloud_om_hub_multi_clouds_metadata.html.markdown b/website/docs/d/multicloud_om_hub_multi_clouds_metadata.html.markdown new file mode 100644 index 00000000000..bf79d8facd6 --- /dev/null +++ b/website/docs/d/multicloud_om_hub_multi_clouds_metadata.html.markdown @@ -0,0 +1,46 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_om_hub_multi_clouds_metadata" +sidebar_current: "docs-oci-datasource-multicloud-om_hub_multi_clouds_metadata" +description: |- + Provides the list of compartments under a root compartment in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_om_hub_multi_clouds_metadata +This data source provides the list of compartments under a root compartment in Oracle Cloud Infrastructure Multicloud service. + +Gets a list of multicloud metadata with multicloud base compartment and subscription across Cloud Service Providers. + +## Example Usage + +```hcl +data "oci_multicloud_om_hub_multi_clouds_metadata" "test_om_hub_multi_clouds_metadata" { + #Required + compartment_id = var.compartment_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the root compartment in which to list resources. + +## Attributes Reference + +The following attributes are exported: + +* `multi_cloud_metadata_collection` - The list of MultiCloudMetadataCollection. + +### MultiCloudMetadataCollection Reference + +The following attributes are exported: + +* `items` - List of MultiCloudMetadataSummary + * `compartment_id` - MultiCloud base compartment OCID associated with subscriptionId. + * `time_created` - The date and time the multicloud compartment was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + * `subscription_id` - Oracle Cloud Infrastructure subscriptionId. + * `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"}` + * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` + * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` \ No newline at end of file diff --git a/website/docs/d/multicloud_resource_anchor.html.markdown b/website/docs/d/multicloud_resource_anchor.html.markdown new file mode 100644 index 00000000000..6bfada33570 --- /dev/null +++ b/website/docs/d/multicloud_resource_anchor.html.markdown @@ -0,0 +1,62 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_resource_anchor" +sidebar_current: "docs-oci-datasource-multicloud-resource_anchor" +description: |- + Provides details about a specific Resource Anchor in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_resource_anchor +This data source provides details about a specific Resource Anchor resource in Oracle Cloud Infrastructure Multicloud service. + +Gets information about a ResourceAnchor. + +## Example Usage + +```hcl +data "oci_multicloud_resource_anchor" "test_resource_anchor" { + #Required + resource_anchor_id = var.resource_anchor_id + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name +} +``` + +## Argument Reference + +The following arguments are supported: + +* `resource_anchor_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnchor. +* `subscription_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. +* `subscription_service_name` - (Required) The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] + + +## Attributes Reference + +The following attributes are exported: + +* `cloud_service_provider_metadata_item` - Cloud Service Provider metadata item. Warning - In future this object can change to generic object with future Cloud Service Provider based on CloudServiceProvider field. This can be one of CSP provider type Azure, GCP and AWS. + * `account_id` - AWS accountId that was used for creating this resource anchor resource. + * `project_number` - GCP project number that was used for creating this resource anchor resource. + * `region` - The Azure, AWS or GCP region. + * `resource_anchor_name` - CSP resource anchor ID or name. + * `resource_anchor_uri` - CSP resource anchor Uri. + * `resource_group` - Azure resource group that was used for creating this resource. + * `subscription` - Azure subscription that was used for creating this resource. + * `subscription_type` - Oracle Cloud Infrastructure Subscription Type. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnchor. +* `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"}` +* `lifecycle_details` - A message that describes the current state of the ResourceAnchor in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `linked_compartment_id` - Optional - Oracle Cloud Infrastructure compartment Id (OCID) which was created or linked by customer with resource anchor. This compartmentId is different from where resource Anchor live. +* `region` - Oracle Cloud Infrastructure Region that resource is created. +* `setup_mode` - AUTO_BIND - when passed compartment will be created on-behalf of customer and bind to this resource anchor NO_AUTO_BIND - compartment will not be created and later customer can bind existing compartment. to this resource anchor. This is for future use only +* `lifecycle_state` - The current state of the ResourceAnchor. +* `resource_anchor_subscription_id` - Oracle Cloud Infrastructure Subscription Id +* `subscription_type` - subscription type +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the ResourceAnchor was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the ResourceAnchor was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` \ No newline at end of file diff --git a/website/docs/d/multicloud_resource_anchors.html.markdown b/website/docs/d/multicloud_resource_anchors.html.markdown new file mode 100644 index 00000000000..2ee65d0bb64 --- /dev/null +++ b/website/docs/d/multicloud_resource_anchors.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "Multicloud" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_multicloud_resource_anchors" +sidebar_current: "docs-oci-datasource-multicloud-resource_anchors" +description: |- + Provides the list of Resource Anchors in Oracle Cloud Infrastructure Multicloud service +--- + +# Data Source: oci_multicloud_resource_anchors +This data source provides the list of Resource Anchors in Oracle Cloud Infrastructure Multicloud service. + +Gets a list of ResourceAnchors. + +## Example Usage + +```hcl +data "oci_multicloud_resource_anchors" "test_resource_anchors" { + #Required + subscription_id = var.subscription_id + subscription_service_name = var.subscription_service_name + + #Optional + compartment_id = var.compartment_id + display_name = var.resource_anchor_display_name + id = var.resource_anchor_id + is_compartment_id_in_subtree = var.resource_anchor_is_compartment_id_in_subtree + linked_compartment_id = var.linked_compartment_id + lifecycle_state = var.resource_anchor_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `subscription_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription in which to list resources. +* `subscription_service_name` - (Required) The subscription service name values from [ORACLEDBATAZURE, ORACLEDBATGOOGLE, ORACLEDBATAWS] +* `compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `display_name` - (Optional) A filter to return only resources that match the given display name exactly. +* `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnchor. +* `is_compartment_id_in_subtree` - (Optional) Check the sub-compartments of a given compartmentId +* `linked_compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which linked to Resource. +* `lifecycle_state` - (Optional) A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. + + +## Attributes Reference + +The following attributes are exported: + +* `resource_anchor_collection` - The list of ResourceAnchorCollection. + +### ResourceAnchorCollection Reference + +The following attributes are exported: + +* `items` - List of ResourceAnchorSummary + * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` + * `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. + * `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 ResourceAnchor. + * `lifecycle_details` - A message that describes the current state of the ResourceAnchor in more detail. For example, can be used to provide actionable information for a resource in the Failed state. + * `lifecycle_state` - The current state of the ResourceAnchor. + * `subscription_id` - Oracle Cloud Infrastructure Subscription Id + * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` + * `time_created` - The date and time the ResourceAnchor was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + * `time_updated` - The date and time the ResourceAnchor was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` \ No newline at end of file diff --git a/website/docs/d/ocvp_cluster.html.markdown b/website/docs/d/ocvp_cluster.html.markdown index ce1b8f53a02..1f5b5552b90 100644 --- a/website/docs/d/ocvp_cluster.html.markdown +++ b/website/docs/d/ocvp_cluster.html.markdown @@ -35,6 +35,7 @@ The following attributes are exported: * `capacity_reservation_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Cluster. * `compute_availability_domain` - The availability domain the ESXi hosts are running in. For Multi-AD Cluster, it is `multi-AD`. Example: `Uocm:PHX-AD-1`, `multi-AD` +* `datastore_cluster_ids` - A list of datastore clusters. * `datastores` - Datastores used for the Cluster. * `block_volume_ids` - A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. * `capacity` - Size of the Block Storage Volume in GB. diff --git a/website/docs/d/ocvp_clusters.html.markdown b/website/docs/d/ocvp_clusters.html.markdown index 23fc25f4c91..b94881a189a 100644 --- a/website/docs/d/ocvp_clusters.html.markdown +++ b/website/docs/d/ocvp_clusters.html.markdown @@ -49,6 +49,7 @@ The following attributes are exported: * `capacity_reservation_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Cluster. * `compute_availability_domain` - The availability domain the ESXi hosts are running in. For Multi-AD Cluster, it is `multi-AD`. Example: `Uocm:PHX-AD-1`, `multi-AD` +* `datastore_cluster_ids` - A list of datastore clusters. * `datastores` - Datastores used for the Cluster. * `block_volume_ids` - A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. * `capacity` - Size of the Block Storage Volume in GB. diff --git a/website/docs/d/ocvp_datastore.html.markdown b/website/docs/d/ocvp_datastore.html.markdown new file mode 100644 index 00000000000..aa4fba5fa03 --- /dev/null +++ b/website/docs/d/ocvp_datastore.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "Oracle Cloud VMware Solution" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_ocvp_datastore" +sidebar_current: "docs-oci-datasource-ocvp-datastore" +description: |- + Provides details about a specific Datastore in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service +--- + +# Data Source: oci_ocvp_datastore +This data source provides details about a specific Datastore resource in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service. + +Get the specified Datastore's information. + +## Example Usage + +```hcl +data "oci_ocvp_datastore" "test_datastore" { + #Required + datastore_id = oci_ocvp_datastore.test_datastore.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `datastore_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. + + +## Attributes Reference + +The following attributes are exported: + +* `availability_domain` - The availability domain of the Datastore. +* `block_volume_details` - The list of Block Volume details that belong to the datastore. + * `attachments` - List of BlockVolumeAttachment objects containing information about attachment details + * `esxi_host_id` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi host that block volume is attached to. + * `ip_address` - The IP address of block volume attachment. + * `port` - The port of block volume attachment. + * `id` - An [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Block Storage Volume. + * `iqn` - An IQN of the Block Storage Volume. +* `block_volume_ids` - The List of Block volume [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s that belong to the Datastore. +* `capacity_in_gbs` - Total size of the datastore in GB. +* `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore is attached to. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Datastore. +* `datastore_cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the datastore cluster that Datastore belongs to. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `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 Datastore. +* `sddc_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore is associated with. +* `state` - The current state of the Datastore. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{orcl-cloud: {free-tier-retain: true}}` +* `time_created` - The date and time the Datastore was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the Datastore was updated, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). + diff --git a/website/docs/d/ocvp_datastore_cluster.html.markdown b/website/docs/d/ocvp_datastore_cluster.html.markdown new file mode 100644 index 00000000000..189462c5629 --- /dev/null +++ b/website/docs/d/ocvp_datastore_cluster.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "Oracle Cloud VMware Solution" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_ocvp_datastore_cluster" +sidebar_current: "docs-oci-datasource-ocvp-datastore_cluster" +description: |- + Provides details about a specific Datastore Cluster in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service +--- + +# Data Source: oci_ocvp_datastore_cluster +This data source provides details about a specific Datastore Cluster resource in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service. + +Get the specified Datastore Cluster information. + +## Example Usage + +```hcl +data "oci_ocvp_datastore_cluster" "test_datastore_cluster" { + #Required + datastore_cluster_id = oci_ocvp_datastore_cluster.test_datastore_cluster.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `datastore_cluster_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. + + +## Attributes Reference + +The following attributes are exported: + +* `availability_domain` - The availability domain of the Datastore Cluster. +* `capacity_in_gbs` - Total size of all datastores associated with the datastore cluster in GB. +* `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore cluster is attached to. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Datastore. +* `datastore_cluster_type` - Type of the datastore cluster. +* `datastore_ids` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastores that belong to the Datastore Cluster +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `esxi_host_ids` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi hosts to attach the datastore to. All ESXi hosts must belong to the same VMware cluster. +* `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 Datastore cluster. +* `sddc_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore cluster is associated with. +* `state` - The current state of the Datastore Cluster. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{orcl-cloud: {free-tier-retain: true}}` +* `time_created` - The date and time the Datastore Cluster was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the Datastore Cluster was updated, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). + diff --git a/website/docs/d/ocvp_datastore_clusters.html.markdown b/website/docs/d/ocvp_datastore_clusters.html.markdown new file mode 100644 index 00000000000..5e882b4d15c --- /dev/null +++ b/website/docs/d/ocvp_datastore_clusters.html.markdown @@ -0,0 +1,69 @@ +--- +subcategory: "Oracle Cloud VMware Solution" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_ocvp_datastore_clusters" +sidebar_current: "docs-oci-datasource-ocvp-datastore_clusters" +description: |- + Provides the list of Datastore Clusters in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service +--- + +# Data Source: oci_ocvp_datastore_clusters +This data source provides the list of Datastore Clusters in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service. + +List the Datastore Clusters in the specified compartment. The list can be filtered +by compartment, Datastore Cluster, Display name and Lifecycle state + + +## Example Usage + +```hcl +data "oci_ocvp_datastore_clusters" "test_datastore_clusters" { + #Required + compartment_id = var.compartment_id + + #Optional + cluster_id = oci_ocvp_cluster.test_cluster.id + datastore_cluster_id = oci_ocvp_datastore_cluster.test_datastore_cluster.id + display_name = var.datastore_cluster_display_name + state = var.datastore_cluster_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `cluster_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `datastore_cluster_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore Cluster. +* `display_name` - (Optional) A filter to return only resources that match the given display name exactly. +* `state` - (Optional) The lifecycle state of the resource. + + +## Attributes Reference + +The following attributes are exported: + +* `datastore_cluster_collection` - The list of datastore_cluster_collection. + +### DatastoreCluster Reference + +The following attributes are exported: + +* `availability_domain` - The availability domain of the Datastore Cluster. +* `capacity_in_gbs` - Total size of all datastores associated with the datastore cluster in GB. +* `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore cluster is attached to. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Datastore. +* `datastore_cluster_type` - Type of the datastore cluster. +* `datastore_ids` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastores that belong to the Datastore Cluster +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `esxi_host_ids` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi hosts to attach the datastore to. All ESXi hosts must belong to the same VMware cluster. +* `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 Datastore cluster. +* `sddc_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore cluster is associated with. +* `state` - The current state of the Datastore Cluster. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{orcl-cloud: {free-tier-retain: true}}` +* `time_created` - The date and time the Datastore Cluster was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the Datastore Cluster was updated, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). + diff --git a/website/docs/d/ocvp_datastores.html.markdown b/website/docs/d/ocvp_datastores.html.markdown new file mode 100644 index 00000000000..857372c44e7 --- /dev/null +++ b/website/docs/d/ocvp_datastores.html.markdown @@ -0,0 +1,75 @@ +--- +subcategory: "Oracle Cloud VMware Solution" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_ocvp_datastores" +sidebar_current: "docs-oci-datasource-ocvp-datastores" +description: |- + Provides the list of Datastores in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service +--- + +# Data Source: oci_ocvp_datastores +This data source provides the list of Datastores in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service. + +List the Datastores in the specified compartment. The list can be filtered +by compartment, datastore id, display name and lifecycle state. + + +## Example Usage + +```hcl +data "oci_ocvp_datastores" "test_datastores" { + #Required + compartment_id = var.compartment_id + + #Optional + cluster_id = oci_ocvp_cluster.test_cluster.id + datastore_id = oci_ocvp_datastore.test_datastore.id + display_name = var.datastore_display_name + state = var.datastore_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `cluster_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC Cluster. +* `compartment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `datastore_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore. +* `display_name` - (Optional) A filter to return only resources that match the given display name exactly. +* `state` - (Optional) The lifecycle state of the resource. + + +## Attributes Reference + +The following attributes are exported: + +* `datastore_collection` - The list of datastore_collection. + +### Datastore Reference + +The following attributes are exported: + +* `availability_domain` - The availability domain of the Datastore. +* `block_volume_details` - The list of Block Volume details that belong to the datastore. + * `attachments` - List of BlockVolumeAttachment objects containing information about attachment details + * `esxi_host_id` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi host that block volume is attached to. + * `ip_address` - The IP address of block volume attachment. + * `port` - The port of block volume attachment. + * `id` - An [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Block Storage Volume. + * `iqn` - An IQN of the Block Storage Volume. +* `block_volume_ids` - The List of Block volume [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s that belong to the Datastore. +* `capacity_in_gbs` - Total size of the datastore in GB. +* `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore is attached to. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Datastore. +* `datastore_cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the datastore cluster that Datastore belongs to. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `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 Datastore. +* `sddc_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore is associated with. +* `state` - The current state of the Datastore. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{orcl-cloud: {free-tier-retain: true}}` +* `time_created` - The date and time the Datastore was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the Datastore was updated, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). + diff --git a/website/docs/d/ocvp_esxi_host.html.markdown b/website/docs/d/ocvp_esxi_host.html.markdown index 1ae78a8de39..7a0e6fc9225 100644 --- a/website/docs/d/ocvp_esxi_host.html.markdown +++ b/website/docs/d/ocvp_esxi_host.html.markdown @@ -38,7 +38,14 @@ The following attributes are exported: * `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Cluster that the ESXi host belongs to. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Cluster. * `compute_availability_domain` - The availability domain of the ESXi host. -* `compute_instance_id` - In terms of implementation, an ESXi host is a Compute instance that is configured with the chosen bundle of VMware software. The `computeInstanceId` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of that Compute instance. +* `compute_instance_id` - In terms of implementation, an ESXi host is a Compute instance that is configured with the chosen bundle of VMware software. The `computeInstanceId` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of that Compute instance. +* `datastore_attachments` - List of DatastoreAttachment objects containing information about attachment details + * `block_volume_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Block Volume that belongs to the datastore. + * `datastore_id` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore that ESXi host is attached to. + * `ip_address` - The IP address of datastore attachment. + * `port` - The port of datastore attachment. + * `volume_iqn` - An IQN of the Block Storage Volume. +* `datastore_cluster_ids` - A list of datastore clusters. * `current_sku` - (**Deprecated**) The billing option currently used by the ESXi host. [ListSupportedSkus](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/SupportedSkuSummary/ListSupportedSkus). **Deprecated**. Please use `current_commitment` instead. * `current_commitment` - The billing option currently used by the ESXi host. [ListSupportedCommitments](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20230701/SupportedCommitmentSummary/ListSupportedCommitments). * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` diff --git a/website/docs/d/ocvp_esxi_hosts.html.markdown b/website/docs/d/ocvp_esxi_hosts.html.markdown index c0b8f979ef8..e6992bde453 100644 --- a/website/docs/d/ocvp_esxi_hosts.html.markdown +++ b/website/docs/d/ocvp_esxi_hosts.html.markdown @@ -68,7 +68,14 @@ The following attributes are exported: * `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Cluster that the ESXi host belongs to. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Cluster. * `compute_availability_domain` - The availability domain of the ESXi host. -* `compute_instance_id` - In terms of implementation, an ESXi host is a Compute instance that is configured with the chosen bundle of VMware software. The `computeInstanceId` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of that Compute instance. +* `compute_instance_id` - In terms of implementation, an ESXi host is a Compute instance that is configured with the chosen bundle of VMware software. The `computeInstanceId` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of that Compute instance. +* `datastore_attachments` - List of DatastoreAttachment objects containing information about attachment details + * `block_volume_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Block Volume that belongs to the datastore. + * `datastore_id` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore that ESXi host is attached to. + * `ip_address` - The IP address of datastore attachment. + * `port` - The port of datastore attachment. + * `volume_iqn` - An IQN of the Block Storage Volume. +* `datastore_cluster_ids` - A list of datastore clusters. * `current_sku` - (**Deprecated**) The billing option currently used by the ESXi host. [ListSupportedSkus](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/SupportedSkuSummary/ListSupportedSkus). **Deprecated**. Please use `current_commitment` instead. * `current_commitment` - The billing option currently used by the ESXi host. [ListSupportedCommitments](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20230701/SupportedCommitmentSummary/ListSupportedCommitments). * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` diff --git a/website/docs/d/ocvp_sddc.html.markdown b/website/docs/d/ocvp_sddc.html.markdown index 1a1db529509..2f61c084c0e 100644 --- a/website/docs/d/ocvp_sddc.html.markdown +++ b/website/docs/d/ocvp_sddc.html.markdown @@ -69,10 +69,11 @@ The following attributes are exported: * `initial_cluster_configurations` - The configurations for Clusters initially created in the SDDC. * `capacity_reservation_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. * `compute_availability_domain` - The availability domain to create the Cluster's ESXi hosts in. For multi-AD Cluster deployment, set to `multi-AD`. + * `datastore_cluster_ids` - A list of datastore clusters. * `datastores` - A list of datastore info for the Cluster. This value is required only when `initialHostShapeName` is a standard shape. * `block_volume_ids` - A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. * `datastore_type` - Type of the datastore. - * `display_name` - A descriptive name for the Cluster. Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. + * `display_name` - A descriptive name for the Cluster. Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. * `esxi_hosts_count` - The number of ESXi hosts to create in the Cluster. You can add more hosts later (see [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost)). Creating a Cluster with a ESXi host count of 1 will be considered a single ESXi host Cluster. **Note:** If you later delete EXSi hosts from a production Cluster to total less than 3, you are still billed for the 3 minimum recommended ESXi hosts. Also, you cannot add more VMware workloads to the Cluster until it again has at least 3 ESXi hosts. diff --git a/website/docs/d/ocvp_sddcs.html.markdown b/website/docs/d/ocvp_sddcs.html.markdown index 695a4163871..52e904f6974 100644 --- a/website/docs/d/ocvp_sddcs.html.markdown +++ b/website/docs/d/ocvp_sddcs.html.markdown @@ -67,7 +67,72 @@ The following attributes are exported: * `activation_key` - HCX on-premise license key value. * `status` - status of HCX on-premise license. * `system_name` - Name of the system that consumed the HCX on-premise license -* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC. +* `initial_configuration` - Details of SDDC initial configuration + * `initial_cluster_configurations` - The configurations for Clusters initially created in the SDDC. + * `capacity_reservation_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. + * `compute_availability_domain` - The availability domain to create the Cluster's ESXi hosts in. For multi-AD Cluster deployment, set to `multi-AD`. + * `datastore_cluster_ids` - A list of datastore clusters. + * `datastores` - A list of datastore info for the Cluster. This value is required only when `initialHostShapeName` is a standard shape. + * `block_volume_ids` - A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. + * `datastore_type` - Type of the datastore. + * `display_name` - A descriptive name for the Cluster. Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. + * `esxi_hosts_count` - The number of ESXi hosts to create in the Cluster. You can add more hosts later (see [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost)). Creating a Cluster with a ESXi host count of 1 will be considered a single ESXi host Cluster. + + **Note:** If you later delete EXSi hosts from a production Cluster to total less than 3, you are still billed for the 3 minimum recommended ESXi hosts. Also, you cannot add more VMware workloads to the Cluster until it again has at least 3 ESXi hosts. + * `initial_commitment` - The billing option selected during Cluster creation. [ListSupportedCommitments](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/SupportedCommitmentSummary/ListSupportedCommitments). + * `initial_host_ocpu_count` - The initial OCPU count of the Cluster's ESXi hosts. + * `initial_host_shape_name` - The initial compute shape of the Cluster's ESXi hosts. [ListSupportedHostShapes](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/SupportedHostShapes/ListSupportedHostShapes). + * `instance_display_name_prefix` - A prefix used in the name of each ESXi host and Compute instance in the Cluster. If this isn't set, the Cluster's `displayName` is used as the prefix. + + For example, if the value is `myCluster`, the ESXi hosts are named `myCluster-1`, `myCluster-2`, and so on. + * `is_shielded_instance_enabled` - Indicates whether shielded instance is enabled for this Cluster. + * `network_configuration` - The network configurations used by Cluster, including [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the management subnet and VLANs. + * `hcx_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC for the HCX component of the VMware environment. This VLAN is a mandatory attribute for Management Cluster when HCX is enabled. + + This attribute is not guaranteed to reflect the HCX VLAN currently used by the ESXi hosts in the SDDC. The purpose of this attribute is to show the HCX VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this SDDC in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20230701/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the SDDC to use a different VLAN for the HCX component of the VMware environment, you should use [UpdateSddc](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20230701/Sddc/UpdateSddc) to update the SDDC's `hcxVlanId` with that new VLAN's OCID. + * `nsx_edge_uplink1vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC for the NSX Edge Uplink 1 component of the VMware environment. This VLAN is a mandatory attribute for Management Cluster. + + This attribute is not guaranteed to reflect the NSX Edge Uplink 1 VLAN currently used by the ESXi hosts in the Cluster. The purpose of this attribute is to show the NSX Edge Uplink 1 VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this Cluster in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN for the NSX Edge Uplink 1 component of the VMware environment, you should use [UpdateCluster](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/Cluster/UpdateCluster) to update the Cluster's `nsxEdgeUplink1VlanId` with that new VLAN's OCID. + * `nsx_edge_uplink2vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC for the NSX Edge Uplink 2 component of the VMware environment. This VLAN is a mandatory attribute for Management Cluster. + + This attribute is not guaranteed to reflect the NSX Edge Uplink 2 VLAN currently used by the ESXi hosts in the Cluster. The purpose of this attribute is to show the NSX Edge Uplink 2 VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this Cluster in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN for the NSX Edge Uplink 2 component of the VMware environment, you should use [UpdateCluster](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/Cluster/UpdateCluster) to update the Cluster's `nsxEdgeUplink2VlanId` with that new VLAN's OCID. + * `nsx_edge_vtep_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster for the NSX Edge VTEP component of the VMware environment. + + This attribute is not guaranteed to reflect the NSX Edge VTEP VLAN currently used by the ESXi hosts in the Cluster. The purpose of this attribute is to show the NSX Edge VTEP VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this Cluster in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN for the NSX Edge VTEP component of the VMware environment, you should use [UpdateCluster](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/Cluster/UpdateCluster) to update the Cluster's `nsxEdgeVTepVlanId` with that new VLAN's OCID. + * `nsx_vtep_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster for the NSX VTEP component of the VMware environment. + + This attribute is not guaranteed to reflect the NSX VTEP VLAN currently used by the ESXi hosts in the Cluster. The purpose of this attribute is to show the NSX VTEP VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this Cluster in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN for the NSX VTEP component of the VMware environment, you should use [UpdateCluster](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/Cluster/UpdateCluster) to update the Cluster's `nsxVTepVlanId` with that new VLAN's OCID. + * `provisioning_subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the management subnet used to provision the Cluster. + * `provisioning_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster for the Provisioning component of the VMware environment. + * `replication_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster for the vSphere Replication component of the VMware environment. + * `vmotion_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster for the vMotion component of the VMware environment. + + This attribute is not guaranteed to reflect the vMotion VLAN currently used by the ESXi hosts in the Cluster. The purpose of this attribute is to show the vMotion VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this Cluster in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN for the vMotion component of the VMware environment, you should use [UpdateCluster](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/UpdateCluster) to update the Cluster's `vmotionVlanId` with that new VLAN's OCID. + * `vsan_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the Cluster for the vSAN component of the VMware environment. + + This attribute is not guaranteed to reflect the vSAN VLAN currently used by the ESXi hosts in the Cluster. The purpose of this attribute is to show the vSAN VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this Cluster in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN for the vSAN component of the VMware environment, you should use [UpdateCluster](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/Cluster/UpdateCluster) to update the Cluster's `vsanVlanId` with that new VLAN's OCID. + * `vsphere_vlan_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VLAN used by the SDDC for the vSphere component of the VMware environment. This VLAN is a mandatory attribute for Management Cluster. + + This attribute is not guaranteed to reflect the vSphere VLAN currently used by the ESXi hosts in the Cluster. The purpose of this attribute is to show the vSphere VLAN that the Oracle Cloud VMware Solution will use for any new ESXi hosts that you *add to this Cluster in the future* with [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost). + + Therefore, if you change the existing ESXi hosts in the Cluster to use a different VLAN for the vSphere component of the VMware environment, you should use [UpdateCluster](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/Sddc/UpdateSddc) to update the Cluster's `vsphereVlanId` with that new VLAN's OCID. + * `vsphere_type` - vSphere Cluster types. + * `workload_network_cidr` - The CIDR block for the IP addresses that VMware VMs in the Cluster use to run application workloads. * `initial_host_ocpu_count` - (**Deprecated**) The initial OCPU count of the SDDC's ESXi hosts. * `initial_host_shape_name` - (**Deprecated**) The initial compute shape of the SDDC's ESXi hosts. [ListSupportedHostShapes](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/SupportedHostShapes/ListSupportedHostShapes). * `is_hcx_enabled` - (**Deprecated**) Indicates whether HCX is enabled for this SDDC. **Deprecated**. Please use `hcx_mode` instead. diff --git a/website/docs/d/resource_analytics_monitored_region.html.markdown b/website/docs/d/resource_analytics_monitored_region.html.markdown new file mode 100644 index 00000000000..10f45033dda --- /dev/null +++ b/website/docs/d/resource_analytics_monitored_region.html.markdown @@ -0,0 +1,43 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_monitored_region" +sidebar_current: "docs-oci-datasource-resource_analytics-monitored_region" +description: |- + Provides details about a specific Monitored Region in Oracle Cloud Infrastructure Resource Analytics service +--- + +# Data Source: oci_resource_analytics_monitored_region +This data source provides details about a specific Monitored Region resource in Oracle Cloud Infrastructure Resource Analytics service. + +Gets information about a MonitoredRegion. + +## Example Usage + +```hcl +data "oci_resource_analytics_monitored_region" "test_monitored_region" { + #Required + monitored_region_id = oci_resource_analytics_monitored_region.test_monitored_region.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `monitored_region_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. + + +## Attributes Reference + +The following attributes are exported: + +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. +* `lifecycle_details` - A message that describes the current state of the MonitoredRegion in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `region_id` - The [Region Identifier](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm) of this MonitoredRegion. +* `resource_analytics_instance_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this MonitoredRegion. +* `state` - The current state of the MonitoredRegion. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the MonitoredRegion was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the MonitoredRegion was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + diff --git a/website/docs/d/resource_analytics_monitored_regions.html.markdown b/website/docs/d/resource_analytics_monitored_regions.html.markdown new file mode 100644 index 00000000000..670549a5f68 --- /dev/null +++ b/website/docs/d/resource_analytics_monitored_regions.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_monitored_regions" +sidebar_current: "docs-oci-datasource-resource_analytics-monitored_regions" +description: |- + Provides the list of Monitored Regions in Oracle Cloud Infrastructure Resource Analytics service +--- + +# Data Source: oci_resource_analytics_monitored_regions +This data source provides the list of Monitored Regions in Oracle Cloud Infrastructure Resource Analytics service. + +Gets a list of MonitoredRegions. + + +## Example Usage + +```hcl +data "oci_resource_analytics_monitored_regions" "test_monitored_regions" { + + #Optional + id = var.monitored_region_id + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id + state = var.monitored_region_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. +* `resource_analytics_instance_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a ResourceAnalyticsInstance. +* `state` - (Optional) A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. + + +## Attributes Reference + +The following attributes are exported: + +* `monitored_region_collection` - The list of monitored_region_collection. + +### MonitoredRegion Reference + +The following attributes are exported: + +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. +* `lifecycle_details` - A message that describes the current state of the MonitoredRegion in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `region_id` - The [Region Identifier](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm) of this MonitoredRegion. +* `resource_analytics_instance_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this MonitoredRegion. +* `state` - The current state of the MonitoredRegion. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the MonitoredRegion was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the MonitoredRegion was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + diff --git a/website/docs/d/resource_analytics_resource_analytics_instance.html.markdown b/website/docs/d/resource_analytics_resource_analytics_instance.html.markdown new file mode 100644 index 00000000000..23415be387d --- /dev/null +++ b/website/docs/d/resource_analytics_resource_analytics_instance.html.markdown @@ -0,0 +1,48 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_resource_analytics_instance" +sidebar_current: "docs-oci-datasource-resource_analytics-resource_analytics_instance" +description: |- + Provides details about a specific Resource Analytics Instance in Oracle Cloud Infrastructure Resource Analytics service +--- + +# Data Source: oci_resource_analytics_resource_analytics_instance +This data source provides details about a specific Resource Analytics Instance resource in Oracle Cloud Infrastructure Resource Analytics service. + +Gets information about a ResourceAnalyticsInstance. + +## Example Usage + +```hcl +data "oci_resource_analytics_resource_analytics_instance" "test_resource_analytics_instance" { + #Required + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `resource_analytics_instance_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. + + +## Attributes Reference + +The following attributes are exported: + +* `adw_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the created ADW instance. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `description` - A description of the ResourceAnalyticsInstance instance. +* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. +* `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 ResourceAnalyticsInstance. +* `lifecycle_details` - A message that describes the current state of the ResourceAnalyticsInstance in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `oac_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OAC enabled for the ResourceAnalyticsInstance. +* `state` - The current state of the ResourceAnalyticsInstance. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the ResourceAnalyticsInstance was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the ResourceAnalyticsInstance was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + diff --git a/website/docs/d/resource_analytics_resource_analytics_instances.html.markdown b/website/docs/d/resource_analytics_resource_analytics_instances.html.markdown new file mode 100644 index 00000000000..cc0c9dfcd7d --- /dev/null +++ b/website/docs/d/resource_analytics_resource_analytics_instances.html.markdown @@ -0,0 +1,62 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_resource_analytics_instances" +sidebar_current: "docs-oci-datasource-resource_analytics-resource_analytics_instances" +description: |- + Provides the list of Resource Analytics Instances in Oracle Cloud Infrastructure Resource Analytics service +--- + +# Data Source: oci_resource_analytics_resource_analytics_instances +This data source provides the list of Resource Analytics Instances in Oracle Cloud Infrastructure Resource Analytics service. + +Gets a list of ResourceAnalyticsInstances. + + +## Example Usage + +```hcl +data "oci_resource_analytics_resource_analytics_instances" "test_resource_analytics_instances" { + + #Optional + compartment_id = var.compartment_id + display_name = var.resource_analytics_instance_display_name + id = var.resource_analytics_instance_id + state = var.resource_analytics_instance_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `display_name` - (Optional) A filter to return only resources that match the given display name exactly. +* `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. +* `state` - (Optional) A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. + + +## Attributes Reference + +The following attributes are exported: + +* `resource_analytics_instance_collection` - The list of resource_analytics_instance_collection. + +### ResourceAnalyticsInstance Reference + +The following attributes are exported: + +* `adw_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the created ADW instance. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `description` - A description of the ResourceAnalyticsInstance instance. +* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. +* `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 ResourceAnalyticsInstance. +* `lifecycle_details` - A message that describes the current state of the ResourceAnalyticsInstance in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `oac_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OAC enabled for the ResourceAnalyticsInstance. +* `state` - The current state of the ResourceAnalyticsInstance. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the ResourceAnalyticsInstance was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the ResourceAnalyticsInstance was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + diff --git a/website/docs/d/resource_analytics_tenancy_attachment.html.markdown b/website/docs/d/resource_analytics_tenancy_attachment.html.markdown new file mode 100644 index 00000000000..176e39f1513 --- /dev/null +++ b/website/docs/d/resource_analytics_tenancy_attachment.html.markdown @@ -0,0 +1,45 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_tenancy_attachment" +sidebar_current: "docs-oci-datasource-resource_analytics-tenancy_attachment" +description: |- + Provides details about a specific Tenancy Attachment in Oracle Cloud Infrastructure Resource Analytics service +--- + +# Data Source: oci_resource_analytics_tenancy_attachment +This data source provides details about a specific Tenancy Attachment resource in Oracle Cloud Infrastructure Resource Analytics service. + +Gets information about a TenancyAttachment. + +## Example Usage + +```hcl +data "oci_resource_analytics_tenancy_attachment" "test_tenancy_attachment" { + #Required + tenancy_attachment_id = oci_resource_analytics_tenancy_attachment.test_tenancy_attachment.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `tenancy_attachment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. + + +## Attributes Reference + +The following attributes are exported: + +* `description` - A description of the tenancy. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. +* `is_reporting_tenancy` - Whether the tenancy is the tenancy used when creating Resource Analytics Instance. +* `lifecycle_details` - A message that describes the current state of the TenancyAttachment in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `resource_analytics_instance_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this TenancyAttachment. +* `state` - The current state of the TenancyAttachment. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `tenancy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy associated with this TenancyAttachment. +* `time_created` - The date and time the TenancyAttachment was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the TenancyAttachment was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + diff --git a/website/docs/d/resource_analytics_tenancy_attachments.html.markdown b/website/docs/d/resource_analytics_tenancy_attachments.html.markdown new file mode 100644 index 00000000000..b3b788f8d37 --- /dev/null +++ b/website/docs/d/resource_analytics_tenancy_attachments.html.markdown @@ -0,0 +1,57 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_tenancy_attachments" +sidebar_current: "docs-oci-datasource-resource_analytics-tenancy_attachments" +description: |- + Provides the list of Tenancy Attachments in Oracle Cloud Infrastructure Resource Analytics service +--- + +# Data Source: oci_resource_analytics_tenancy_attachments +This data source provides the list of Tenancy Attachments in Oracle Cloud Infrastructure Resource Analytics service. + +Gets a list of TenancyAttachments. + + +## Example Usage + +```hcl +data "oci_resource_analytics_tenancy_attachments" "test_tenancy_attachments" { + + #Optional + id = var.tenancy_attachment_id + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id + state = var.tenancy_attachment_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. +* `resource_analytics_instance_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a ResourceAnalyticsInstance. +* `state` - (Optional) A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. + + +## Attributes Reference + +The following attributes are exported: + +* `tenancy_attachment_collection` - The list of tenancy_attachment_collection. + +### TenancyAttachment Reference + +The following attributes are exported: + +* `description` - A description of the tenancy. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. +* `is_reporting_tenancy` - Whether the tenancy is the tenancy used when creating Resource Analytics Instance. +* `lifecycle_details` - A message that describes the current state of the TenancyAttachment in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `resource_analytics_instance_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this TenancyAttachment. +* `state` - The current state of the TenancyAttachment. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `tenancy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy associated with this TenancyAttachment. +* `time_created` - The date and time the TenancyAttachment was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the TenancyAttachment was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + diff --git a/website/docs/guides/resource_discovery.html.markdown b/website/docs/guides/resource_discovery.html.markdown index 7bcd9bec01d..667b38dde84 100644 --- a/website/docs/guides/resource_discovery.html.markdown +++ b/website/docs/guides/resource_discovery.html.markdown @@ -184,7 +184,6 @@ Make sure the `output_path` is empty before running resource discovery * `identity_domains` - Discovers identity_domains resources within the specified compartment * `integration` - Discovers integration resources within the specified compartment * `jms` - Discovers jms resources within the specified compartment - * `jms_utils` - Discovers jms_utils resources within the specified compartment * `kms` - Discovers kms resources within the specified compartment * `license_manager` - Discovers license_manager resources within the specified compartment * `limits` - Discovers limits resources across the entire tenancy @@ -218,6 +217,7 @@ Make sure the `output_path` is empty before running resource discovery * `queue` - Discovers queue resources within the specified compartment * `recovery` - Discovers recovery resources within the specified compartment * `redis` - Discovers redis resources within the specified compartment + * `resource_analytics` - Discovers resource_analytics resources within the specified compartment * `resource_scheduler` - Discovers resource_scheduler resources within the specified compartment * `resourcemanager` - Discovers resourcemanager resources within the specified compartment * `sch` - Discovers sch resources within the specified compartment @@ -669,13 +669,6 @@ database * oci\_database\_exadb\_vm\_cluster * oci\_database\_autonomous\_database\_software\_image * oci\_database\_cloud\_exadata\_infrastructure\_configure\_exascale\_management -* oci\_database\_scheduling\_plan -* oci\_database\_scheduling\_policy\_scheduling\_window -* oci\_database\_scheduling\_policy -* oci\_database\_execution\_action -* oci\_database\_execution\_window -* oci\_database\_scheduled\_action -* oci\_database\_exadata\_infrastructure\_configure\_exascale\_management * oci\_database\_autonomous\_container\_database\_snapshot\_standby * oci\_database\_autonomous\_container\_database\_add\_standby * oci\_database\_pluggable\_database\_snapshot @@ -732,9 +725,6 @@ datascience * oci\_datascience\_pipeline\_run * oci\_datascience\_pipeline * oci\_datascience\_data\_science\_private\_endpoint -* oci\_datascience\_schedule -* oci\_datascience\_model\_defined\_metadata\_artifact -* oci\_datascience\_model\_custom\_metadata\_artifact * oci\_datascience\_ml\_application\_implementation * oci\_datascience\_ml\_application\_instance * oci\_datascience\_ml\_application @@ -802,13 +792,6 @@ dns * oci\_dns\_steering\_policy\_attachment * oci\_dns\_tsig\_key * oci\_dns\_rrset -* oci\_dns\_resolver -* oci\_dns\_resolver\_endpoint -* oci\_dns\_view - -em_warehouse - -* oci\_em\_warehouse\_em\_warehouse email @@ -874,6 +857,7 @@ generative_ai * oci\_generative\_ai\_dedicated\_ai\_cluster * oci\_generative\_ai\_endpoint * oci\_generative\_ai\_model +* oci\_generative\_ai\_generative\_ai\_private\_endpoint generative_ai_agent @@ -988,11 +972,7 @@ jms * oci\_jms\_fleet * oci\_jms\_fleet\_advanced\_feature\_configuration * oci\_jms\_jms\_plugin - -jms_utils - -* oci\_jms\_utils\_subscription\_acknowledgment\_configuration -* oci\_jms\_utils\_analyze\_applications\_configuration +* oci\_jms\_task\_schedule kms @@ -1151,6 +1131,8 @@ ocvp * oci\_ocvp\_sddc * oci\_ocvp\_esxi\_host * oci\_ocvp\_cluster +* oci\_ocvp\_datastore +* oci\_ocvp\_datastore\_cluster oda @@ -1272,6 +1254,12 @@ redis * oci\_redis\_oci\_cache\_user * oci\_redis\_oci\_cache\_config\_set +resource_analytics + +* oci\_resource\_analytics\_resource\_analytics\_instance +* oci\_resource\_analytics\_tenancy\_attachment +* oci\_resource\_analytics\_monitored\_region + resource_scheduler * oci\_resource\_scheduler\_schedule @@ -1369,4 +1357,3 @@ zpr * oci\_zpr\_configuration * oci\_zpr\_zpr\_policy - diff --git a/website/docs/r/core_instance.html.markdown b/website/docs/r/core_instance.html.markdown index 58f51f068b1..dced107396f 100644 --- a/website/docs/r/core_instance.html.markdown +++ b/website/docs/r/core_instance.html.markdown @@ -127,6 +127,7 @@ resource "oci_core_instance" "test_instance" { are_legacy_imds_endpoints_disabled = var.instance_instance_options_are_legacy_imds_endpoints_disabled } ipxe_script = var.instance_ipxe_script + is_ai_enterprise_enabled = var.instance_is_ai_enterprise_enabled is_pv_encryption_in_transit_enabled = var.instance_is_pv_encryption_in_transit_enabled launch_options { @@ -369,6 +370,7 @@ The following arguments are supported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. +* `is_ai_enterprise_enabled` - (Optional) (Updatable) Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - (Optional) Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. Use this field only during create. To update use `is_pv_encryption_in_transit_enabled` under `launch_options` instead. * `launch_options` - (Optional) (Updatable) Options for tuning the compatibility and performance of VM shapes. The values that you specify override any default values. * `boot_volume_type` - (Optional) (Updatable) Emulation type for the boot volume. @@ -605,6 +607,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. +* `is_ai_enterprise_enabled` - Whether AI enterprise is enabled on the instance. * `is_cross_numa_node` - Whether the instance’s OCPUs and memory are distributed across multiple NUMA nodes. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. diff --git a/website/docs/r/core_instance_configuration.html.markdown b/website/docs/r/core_instance_configuration.html.markdown index 1d428bafb3d..08c906b7dd3 100644 --- a/website/docs/r/core_instance_configuration.html.markdown +++ b/website/docs/r/core_instance_configuration.html.markdown @@ -146,6 +146,7 @@ resource "oci_core_instance_configuration" "test_instance_configuration" { are_legacy_imds_endpoints_disabled = var.instance_configuration_instance_details_launch_details_instance_options_are_legacy_imds_endpoints_disabled } ipxe_script = var.instance_configuration_instance_details_launch_details_ipxe_script + is_ai_enterprise_enabled = var.instance_configuration_instance_details_launch_details_is_ai_enterprise_enabled is_pv_encryption_in_transit_enabled = var.instance_configuration_instance_details_launch_details_is_pv_encryption_in_transit_enabled launch_mode = var.instance_configuration_instance_details_launch_details_launch_mode launch_options { @@ -342,6 +343,7 @@ resource "oci_core_instance_configuration" "test_instance_configuration" { are_legacy_imds_endpoints_disabled = var.instance_configuration_instance_details_options_launch_details_instance_options_are_legacy_imds_endpoints_disabled } ipxe_script = var.instance_configuration_instance_details_options_launch_details_ipxe_script + is_ai_enterprise_enabled = var.instance_configuration_instance_details_options_launch_details_is_ai_enterprise_enabled is_pv_encryption_in_transit_enabled = var.instance_configuration_instance_details_options_launch_details_is_pv_encryption_in_transit_enabled launch_mode = var.instance_configuration_instance_details_options_launch_details_launch_mode launch_options { @@ -614,6 +616,7 @@ The following arguments are supported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - (Applicable when instance_type=compute) Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - (Applicable when instance_type=compute) Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - (Applicable when instance_type=compute) Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. @@ -854,6 +857,7 @@ The following arguments are supported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - (Applicable when instance_type=instance_options) Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - (Applicable when instance_type=instance_options) Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - (Applicable when instance_type=instance_options) Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. @@ -1155,6 +1159,7 @@ The following attributes are exported: For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. @@ -1387,8 +1392,9 @@ The following attributes are exported: The default iPXE script connects to the instance's local boot volume over iSCSI and performs a network boot. If you use a custom iPXE script and want to network-boot from the instance's local boot volume over iSCSI the same way as the default iPXE script, you should use the following iSCSI IP address: 169.254.0.2, and boot volume IQN: iqn.2015-02.oracle.boot. For more information about the Bring Your Own Image feature of Oracle Cloud Infrastructure, see [Bring Your Own Image](https://docs.cloud.oracle.com/iaas/Content/Compute/References/bringyourownimage.htm). - + For more information about iPXE, see http://ipxe.org. + * `is_ai_enterprise_enabled` - Whether to enable AI enterprise on the instance. * `is_pv_encryption_in_transit_enabled` - Whether to enable in-transit encryption for the data volume's paravirtualized attachment. The default value is false. * `launch_mode` - Specifies the configuration mode for launching virtual machine (VM) instances. The configuration modes are: * `NATIVE` - VM instances launch with iSCSI boot and VFIO devices. The default value for platform images. diff --git a/website/docs/r/database_autonomous_container_database.html.markdown b/website/docs/r/database_autonomous_container_database.html.markdown index 5a76d4b3e18..f3a8b6a6466 100644 --- a/website/docs/r/database_autonomous_container_database.html.markdown +++ b/website/docs/r/database_autonomous_container_database.html.markdown @@ -23,7 +23,7 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container #Optional autonomous_container_database_backup_id = oci_database_autonomous_container_database_backup.test_autonomous_container_database_backup.id - cloud_autonomous_vm_cluster_id = oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id + autonomous_exadata_infrastructure_id = oci_database_autonomous_exadata_infrastructure.test_autonomous_exadata_infrastructure.id autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id backup_config { @@ -33,16 +33,19 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container type = var.autonomous_container_database_backup_config_backup_destination_details_type #Optional + backup_retention_policy_on_terminate = var.autonomous_container_database_backup_config_backup_destination_details_backup_retention_policy_on_terminate dbrs_policy_id = oci_identity_policy.test_policy.id id = var.autonomous_container_database_backup_config_backup_destination_details_id internet_proxy = var.autonomous_container_database_backup_config_backup_destination_details_internet_proxy is_remote = var.autonomous_container_database_backup_config_backup_destination_details_is_remote + is_retention_lock_enabled = var.autonomous_container_database_backup_config_backup_destination_details_is_retention_lock_enabled remote_region = var.autonomous_container_database_backup_config_backup_destination_details_remote_region vpc_password = var.autonomous_container_database_backup_config_backup_destination_details_vpc_password vpc_user = var.autonomous_container_database_backup_config_backup_destination_details_vpc_user } recovery_window_in_days = var.autonomous_container_database_backup_config_recovery_window_in_days } + cloud_autonomous_vm_cluster_id = oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id compartment_id = var.compartment_id customer_contacts { @@ -62,6 +65,7 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container is_dst_file_update_enabled = var.autonomous_container_database_is_dst_file_update_enabled key_store_id = oci_database_key_store.test_key_store.id kms_key_id = oci_kms_key.test_key.id + kms_key_version_id = oci_kms_key_version.test_key_version.id maintenance_window_details { #Optional @@ -84,10 +88,7 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container weeks_of_month = var.autonomous_container_database_maintenance_window_details_weeks_of_month } net_services_architecture = var.autonomous_container_database_net_services_architecture - okv_end_point_group_name = var.autonomous_container_database_okv_end_point_group_name - peer_autonomous_container_database_display_name = var.autonomous_container_database_peer_autonomous_container_database_display_name - peer_cloud_autonomous_vm_cluster_id = oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id - protection_mode = var.autonomous_container_database_protection_mode + okv_end_point_group_name = oci_identity_group.test_group.name peer_autonomous_container_database_backup_config { #Optional @@ -96,10 +97,12 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container type = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_type #Optional + backup_retention_policy_on_terminate = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_backup_retention_policy_on_terminate dbrs_policy_id = oci_identity_policy.test_policy.id id = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_id internet_proxy = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_internet_proxy is_remote = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_is_remote + is_retention_lock_enabled = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_is_retention_lock_enabled remote_region = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_remote_region vpc_password = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_vpc_password vpc_user = var.autonomous_container_database_peer_autonomous_container_database_backup_config_backup_destination_details_vpc_user @@ -107,14 +110,18 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container recovery_window_in_days = var.autonomous_container_database_peer_autonomous_container_database_backup_config_recovery_window_in_days } peer_autonomous_container_database_compartment_id = oci_identity_compartment.test_compartment.id + peer_autonomous_container_database_display_name = var.autonomous_container_database_peer_autonomous_container_database_display_name + peer_autonomous_exadata_infrastructure_id = oci_database_autonomous_exadata_infrastructure.test_autonomous_exadata_infrastructure.id peer_autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id + peer_cloud_autonomous_vm_cluster_id = oci_database_cloud_autonomous_vm_cluster.test_cloud_autonomous_vm_cluster.id peer_db_unique_name = var.autonomous_container_database_peer_db_unique_name + protection_mode = var.autonomous_container_database_protection_mode service_level_agreement_type = var.autonomous_container_database_service_level_agreement_type source = var.autonomous_container_database_source + standby_maintenance_buffer_in_days = var.autonomous_container_database_standby_maintenance_buffer_in_days vault_id = oci_kms_vault.test_vault.id version_preference = var.autonomous_container_database_version_preference vm_failover_reservation = var.autonomous_container_database_vm_failover_reservation - standby_maintenance_buffer_in_days = var.autonomous_container_database_standby_maintenance_buffer_in_days } ``` @@ -122,20 +129,18 @@ resource "oci_database_autonomous_container_database" "test_autonomous_container The following arguments are supported: - +* `autonomous_container_database_backup_id` - (Required when source=BACKUP_FROM_ID) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source ACD backup that you will clone to create a new ACD. * `autonomous_exadata_infrastructure_id` - (Optional) **No longer used.** This parameter is no longer used for Autonomous Database on dedicated Exadata infrasture. Specify a `cloudAutonomousVmClusterId` instead. Using this parameter will cause the operation to fail. - * `autonomous_vm_cluster_id` - (Optional) The OCID of the Autonomous VM Cluster. -* `cloud_autonomous_vm_cluster_id` - (Optional) The OCID of the Cloud Autonomous VM Cluster. * `backup_config` - (Optional) (Updatable) Backup options for the Autonomous Container Database. * `backup_destination_details` - (Optional) (Updatable) Backup destination details. + * `backup_retention_policy_on_terminate` - (Optional) (Updatable) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - (Optional) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - (Optional) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - (Optional) (Updatable) Proxy URL to connect to object store. - * `is_remote` - (Optional) (Updatable) Indicates whether the backup destination is cross-region or local region. - * `remote_region` - (Optional) (Updatable) The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - (Optional) (Updatable) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Optional) (Updatable) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - (Optional) (Updatable) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - (Required) (Updatable) Type of the database backup destination. * `vpc_password` - (Optional) (Updatable) For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - (Optional) (Updatable) For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -153,18 +158,17 @@ The following arguments are supported: * `display_name` - (Required) (Updatable) The display name for the Autonomous Container Database. * `distribution_affinity` - (Optional) Determines whether an Autonomous Database must be opened across a minimum or maximum of nodes. By default, Minimum nodes is selected. * `fast_start_fail_over_lag_limit_in_seconds` - (Optional) (Updatable) The lag time for my preference based on data loss tolerance in seconds. -* `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"}` +* `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"}` +* `is_automatic_failover_enabled` - (Optional) (Updatable) Indicates whether Automatic Failover is enabled for Autonomous Container Database Dataguard Association * `is_dst_file_update_enabled` - (Optional) (Updatable) Indicates if an automatic DST Time Zone file update is enabled for the Autonomous Container Database. If enabled along with Release Update, patching will be done in a Non-Rolling manner. -* `is_automatic_failover_enabled` - (Optional) Indicates whether Automatic Failover is enabled for Autonomous Container Database Dataguard Association. Input DataType: boolean. Example : is_automatic_failover_enabled = true. -* `key_store_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store. -* `key_version_id` - (Optional) The OCID of the key version that is used in rotate key operations. +* `key_store_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. * `kms_key_id` - (Optional) The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. +* `kms_key_version_id` - (Optional) The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. * `maintenance_window_details` - (Optional) (Updatable) The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window. * `custom_action_timeout_in_mins` - (Optional) (Updatable) Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). * `days_of_week` - (Optional) (Updatable) Days during the week when maintenance should be performed. * `name` - (Required) (Updatable) Name of the day of the week. - * `hours_of_day` - (Optional) (Updatable) The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - * 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + * `hours_of_day` - (Optional) (Updatable) The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC * `is_custom_action_timeout_enabled` - (Optional) (Updatable) If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. * `is_monthly_patching_enabled` - (Optional) (Updatable) If true, enables the monthly patching option. * `lead_time_in_weeks` - (Optional) (Updatable) Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. @@ -174,36 +178,33 @@ The following arguments are supported: *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - (Optional) (Updatable) The maintenance window scheduling preference. - * `skip_ru` - (Optional) (Updatable) If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. - * `weeks_of_month` - (Optional) (Updatable) Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. + * `skip_ru` - (Optional) (Updatable) If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. + * `weeks_of_month` - (Optional) (Updatable) Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `net_services_architecture` - (Optional) Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `okv_end_point_group_name` - (Optional) (Updatable) The OKV End Point Group name for the Autonomous Container Database. * `patch_model` - (Required) (Updatable) Database Patch model preference. -* `peer_autonomous_container_database_display_name` - (Optional) The display name for the peer Autonomous Container Database. -* `peer_autonomous_exadata_infrastructure_id` - (End of Life) The OCID of the peer Autonomous Exadata Infrastructure for autonomous dataguard. Please use peer_cloud_autonomous_vm_cluster_id instead. -* `peer_cloud_autonomous_vm_cluster_id` - The OCID of the peer Autonomous Cloud VM Cluster for autonomous dataguard. -* `protection_mode` - (Optional) The protection mode of this Data Guard association. For more information, see [Oracle Data Guard Protection Modes](http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) in the Oracle Data Guard documentation. -* `peer_autonomous_container_database_backup_config` - (Optional) +* `peer_autonomous_container_database_backup_config` - (Optional) Backup options for the standby Autonomous Container Database. * `backup_destination_details` - (Optional) Backup destination details. + * `backup_retention_policy_on_terminate` - (Optional) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - (Optional) Proxy URL to connect to object store. - * `is_remote` - (Optional) Indicates whether the backup destination is cross-region or local region. - * `remote_region` - (Optional) The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - (Optional) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Optional) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - (Optional) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - (Required) Type of the database backup destination. * `vpc_password` - (Optional) For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - (Optional) For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `recovery_window_in_days` - (Optional) Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. If the number of specified days is 0 then there will be no backups. * `peer_autonomous_container_database_compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the standby Autonomous Container Database will be created. * `peer_autonomous_container_database_display_name` - (Optional) The display name for the peer Autonomous Container Database. -* `peer_autonomous_exadata_infrastructure_id` - (Optional) *No longer used.* This parameter is no longer used for Autonomous Database on dedicated Exadata infrasture. Specify a `peerCloudAutonomousVmClusterId` instead. Using this parameter will cause the operation to fail. +* `peer_autonomous_exadata_infrastructure_id` - (Optional) *No longer used.* This parameter is no longer used for Autonomous Database on dedicated Exadata infrasture. Specify a `peerCloudAutonomousVmClusterId` instead. Using this parameter will cause the operation to fail. * `peer_autonomous_vm_cluster_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the peer Autonomous VM cluster for Autonomous Data Guard. Required to enable Data Guard. +* `peer_cloud_autonomous_vm_cluster_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the peer cloud Autonomous Exadata VM Cluster. * `peer_db_unique_name` - (Optional) **Deprecated.** The `DB_UNIQUE_NAME` of the peer Autonomous Container Database in a Data Guard association is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. * `protection_mode` - (Optional) (Updatable) The protection mode of this Autonomous Data Guard association. For more information, see [Oracle Data Guard Protection Modes](http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) in the Oracle Data Guard documentation. * `service_level_agreement_type` - (Optional) The service level agreement type of the Autonomous Container Database. The default is STANDARD. For an autonomous dataguard Autonomous Container Database, the specified Autonomous Exadata Infrastructure must be associated with a remote Autonomous Exadata Infrastructure. -* `source` - (Optional) The source of the database: Use `NONE` for creating a new Autonomous Container Database. Use `BACKUP_FROM_ID` for creating a new Autonomous Container Database from a specified backup. +* `source` - (Optional) The source of the database. Use `NONE` to create a new Autonomous Container Database (ACD). Use `BACKUP_FROM_ID` to create a new ACD from a specified backup. * `standby_maintenance_buffer_in_days` - (Optional) (Updatable) The scheduling detail for the quarterly maintenance window of the standby Autonomous Container Database. This value represents the number of days before scheduled maintenance of the primary database. * `vault_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `version_preference` - (Optional) (Updatable) The next maintenance version preference. @@ -211,7 +212,7 @@ The following arguments are supported: * `failover_trigger` - (Optional) (Updatable) An optional property when incremented triggers Failover. Could be set to any integer value. * `reinstate_trigger` - (Optional) (Updatable) An optional property when incremented triggers Reinstate. Could be set to any integer value. * `switchover_trigger` - (Optional) (Updatable) An optional property when incremented triggers Switchover. Could be set to any integer value. -* `rotate_key_trigger` - (Optional) (Updatable) An optional property when flipped triggers rotation of KMS key. It is only applicable on dedicated container databases i.e. where `cloud_autonomous_vm_cluster_id` is set. + ** 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 @@ -222,10 +223,14 @@ The following attributes are exported: * `associated_backup_configuration_details` - A backup config object holds information about preferred backup destinations only. This object holds information about the associated backup destinations, such as secondary backup destinations created for local backups or remote replicated backups. * `backup_destination_attach_history` - The timestamps at which this backup destination is used as the preferred destination to host the Autonomous Container Database backups. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups and manual backups, but not long term backups. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `space_utilized_in_gbs` - The total space utilized (in GBs) by this Autonomous Container Database on this backup destination, rounded to the nearest integer. * `time_at_which_storage_details_are_updated` - The latest timestamp when the backup destination details, such as 'spaceUtilized,' are updated. * `type` - Type of the database backup destination. @@ -233,18 +238,17 @@ The following attributes are exported: * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `autonomous_exadata_infrastructure_id` - **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. * `autonomous_vm_cluster_id` - The OCID of the Autonomous VM Cluster. -* `cloud_autonomous_vm_cluster_id` - The OCID of the Cloud Autonomous VM Cluster. -* `availability_domain` - The availability domain of the Autonomous Container Database -* `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database.
For Autonomous Databases on Dedicated Exadata Infrastructure, the CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. +* `availability_domain` - The availability domain of the Autonomous Container Database. +* `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database. * `backup_config` - Backup options for the Autonomous Container Database. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -293,7 +297,7 @@ The following attributes are exported: * `time_lag_refreshed_on` - Timestamp when the lags were last calculated for a standby. * `time_last_role_changed` - The date and time when the last role change action happened. * `time_last_synced` - The date and time of the last update to the apply lag, apply rate, and transport lag values. - * `transport_lag` - The approximate number of seconds of redo data not yet available on the standby Autonomous Container Database, as computed by the reporting database. Example: `7 seconds` + * `transport_lag` - The approximate number of seconds of redo data not yet available on the standby Autonomous Container Database, as computed by the reporting database. Example: `7 seconds` * `db_name` - The Database name for the Autonomous Container Database. The name must be unique within the Cloud Autonomous VM Cluster, starting with an alphabetic character, followed by 1 to 7 alphanumeric characters. * `db_split_threshold` - The CPU value beyond which an Autonomous Database will be opened across multiple nodes. The default value of this attribute is 16 for OCPUs and 64 for ECPUs. * `db_unique_name` - **Deprecated.** The `DB_UNIQUE_NAME` value is set by Oracle Cloud Infrastructure. Do not specify a value for this parameter. Specifying a value for this field will cause Terraform operations to fail. @@ -301,7 +305,7 @@ The following attributes are exported: * `defined_tags` - 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` - The user-provided name for the Autonomous Container Database. * `distribution_affinity` - Determines whether an Autonomous Database must be opened across the maximum number of nodes or the least number of nodes. By default, Minimum nodes is selected. -* `dst_file_version` - DST Time-zone File version of the Autonomous Container Database. +* `dst_file_version` - DST Time-Zone File version of the Autonomous Container Database. * `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 of the Autonomous Container Database. * `infrastructure_type` - The infrastructure type this resource belongs to. @@ -309,11 +313,11 @@ The following attributes are exported: * `is_dst_file_update_enabled` - Indicates if an automatic DST Time Zone file update is enabled for the Autonomous Container Database. If enabled along with Release Update, patching will be done in a Non-Rolling manner. * `is_multiple_standby` - Indicates if it is multiple standby Autonomous Dataguard * `key_history_entry` - Key History Entry. - * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. - * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. - * `time_activated` - The date and time the kms key activated. - * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). -* `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store. + * `id` - The id of the Autonomous Database [Vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts) service key management history entry. + * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. + * `time_activated` - The date and time the kms key activated. + * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. +* `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. * `key_store_wallet_name` - The wallet name for Oracle Key Vault. * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. @@ -322,22 +326,23 @@ The following attributes are exported: * `lifecycle_details` - Additional information about the current lifecycle state. * `list_one_off_patches` - List of One-Off patches that has been successfully applied to Autonomous Container Database * `maintenance_window` - The scheduling details for the quarterly maintenance window. Patching and system updates take place during the maintenance window. - * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). - * `days_of_week` - Days during the week when maintenance should be performed. - * `name` - Name of the day of the week. - * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - * 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC - * `is_custom_action_timeout_enabled` - If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. - * `is_monthly_patching_enabled` - If true, enables the monthly patching option. - * `lead_time_in_weeks` - Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. - * `months` - Months during the year when maintenance should be performed. - * `name` - Name of the month of the year. - * `patching_mode` - Cloud Exadata infrastructure node patching method, either "ROLLING" or "NONROLLING". Default value is ROLLING. + * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). + * `days_of_week` - Days during the week when maintenance should be performed. + * `name` - Name of the day of the week. + * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + * `is_custom_action_timeout_enabled` - If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. + * `is_monthly_patching_enabled` - If true, enables the monthly patching option. + * `lead_time_in_weeks` - Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. + * `months` - Months during the year when maintenance should be performed. + * `name` - Name of the month of the year. + * `patching_mode` - Cloud Exadata infrastructure node patching method, either "ROLLING" or "NONROLLING". Default value is ROLLING. *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - The maintenance window scheduling preference. + * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU in the Autonomous VM Cluster. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU in the Autonomous VM Cluster. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `okv_end_point_group_name` - The OKV End Point Group name for the Autonomous Container Database. @@ -350,16 +355,7 @@ The following attributes are exported: * `allocated_storage_size_in_gbs` - The storage size of the backup destination allocated for an Autonomous Container Database to store backups on the recovery appliance, in GBs, rounded to the nearest integer. * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups. * `time_recovery_appliance_details_updated` - The time when the recovery appliance details are updated. -* `reclaimable_cpus` - For Autonomous Databases on Dedicated Exadata Infrastructure: - * These are the CPUs that continue to be included in the count of CPUs available to the Autonomous Container Database even after one of its Autonomous Database is terminated or scaled down. You can release them to the available CPUs at its parent Autonomous VM Cluster level by restarting the Autonomous Container Database. - * The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. * `reserved_cpus` - The number of CPUs reserved in an Autonomous Container Database. - * These are the CPUs that continue to be included in the count of CPUs available to the Autonomous Container Database even after one of its Autonomous Database is terminated or scaled down. You can release them to the available CPUs at its parent Autonomous VM Cluster level by restarting the Autonomous Container Database. - * The CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. -* `resource_pool_leader_id` - (Optional) (Updatable) The unique identifier for leader autonomous database OCID [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). -* `resource_pool_summary` - (Optional) (Updatable) The configuration details for resource pool - * `is_disabled` - (Optional) (Updatable) Indicates if the resource pool should be deleted for the Autonomous Database. - * `pool_size` - (Optional) (Updatable) Resource pool size. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. * `service_level_agreement_type` - The service level agreement type of the container database. The default is STANDARD. * `standby_maintenance_buffer_in_days` - The scheduling detail for the quarterly maintenance window of the standby Autonomous Container Database. This value represents the number of days before scheduled maintenance of the primary database. @@ -369,7 +365,7 @@ The following attributes are exported: * `time_of_last_backup` - The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database. * `time_snapshot_standby_revert` - The date and time the Autonomous Container Database will be reverted to Standby from Snapshot Standby. * `total_cpus` - The number of CPUs allocated to the Autonomous VM cluster. -* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). +* `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `version_preference` - The next maintenance version preference. * `vm_failover_reservation` - The percentage of CPUs reserved across nodes to support node failover. Allowed values are 0%, 25%, and 50%, with 50% being the default option. @@ -388,3 +384,4 @@ AutonomousContainerDatabases can be imported using the `id`, e.g. ``` $ terraform import oci_database_autonomous_container_database.test_autonomous_container_database "id" ``` + diff --git a/website/docs/r/database_autonomous_container_database_add_standby.html.markdown b/website/docs/r/database_autonomous_container_database_add_standby.html.markdown index ad60df7e768..42a95e291ee 100644 --- a/website/docs/r/database_autonomous_container_database_add_standby.html.markdown +++ b/website/docs/r/database_autonomous_container_database_add_standby.html.markdown @@ -32,9 +32,13 @@ resource "oci_database_autonomous_container_database_add_standby" "test_autonomo type = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_type #Optional + backup_retention_policy_on_terminate = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_backup_retention_policy_on_terminate dbrs_policy_id = oci_identity_policy.test_policy.id id = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_id internet_proxy = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_internet_proxy + is_remote = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_is_remote + is_retention_lock_enabled = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_is_retention_lock_enabled + remote_region = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_remote_region vpc_password = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_vpc_password vpc_user = var.autonomous_container_database_add_standby_peer_autonomous_container_database_backup_config_backup_destination_details_vpc_user } @@ -59,9 +63,13 @@ The following arguments are supported: * `is_automatic_failover_enabled` - (Optional) Indicates whether Automatic Failover is enabled for Autonomous Container Database Dataguard Association * `peer_autonomous_container_database_backup_config` - (Optional) Backup options for the standby Autonomous Container Database. * `backup_destination_details` - (Optional) Backup destination details. + * `backup_retention_policy_on_terminate` - (Optional) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - (Optional) Proxy URL to connect to object store. + * `is_remote` - (Optional) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Optional) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - (Optional) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - (Required) Type of the database backup destination. * `vpc_password` - (Optional) For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - (Optional) For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -82,19 +90,42 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: +* `associated_backup_configuration_details` - A backup config object holds information about preferred backup destinations only. This object holds information about the associated backup destinations, such as secondary backup destinations created for local backups or remote replicated backups. + * `backup_destination_attach_history` - The timestamps at which this backup destination is used as the preferred destination to host the Autonomous Container Database backups. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. + * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. + * `internet_proxy` - Proxy URL to connect to object store. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups and manual backups, but not long term backups. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `space_utilized_in_gbs` - The total space utilized (in GBs) by this Autonomous Container Database on this backup destination, rounded to the nearest integer. + * `time_at_which_storage_details_are_updated` - The latest timestamp when the backup destination details, such as 'spaceUtilized,' are updated. + * `type` - Type of the database backup destination. + * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. + * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `autonomous_exadata_infrastructure_id` - **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. * `autonomous_vm_cluster_id` - The OCID of the Autonomous VM Cluster. * `availability_domain` - The availability domain of the Autonomous Container Database. * `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database. * `backup_config` - Backup options for the Autonomous Container Database. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `recovery_window_in_days` - Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. If the number of specified days is 0 then there will be no backups. +* `backup_destination_properties_list` - This list describes the backup destination properties associated with the Autonomous Container Database (ACD) 's preferred backup destination. The object at a given index is associated with the destination present at the same index in the backup destination details list of the ACD Backup Configuration. + * `backup_destination_attach_history` - The timestamps at which this backup destination is used as the preferred destination to host the Autonomous Container Database backups. + * `space_utilized_in_gbs` - The total space utilized (in GBs) by this Autonomous Container Database on this backup destination, rounded to the nearest integer. + * `time_at_which_storage_details_are_updated` - The latest timestamp when the backup destination details, such as 'spaceUtilized,' are updated. * `cloud_autonomous_vm_cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cloud Autonomous Exadata VM Cluster. * `compartment_id` - The OCID of the compartment. * `compute_model` - The compute model of the Autonomous Container Database. For Autonomous Database on Dedicated Exadata Infrastructure, the CPU type (ECPUs or OCPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. ECPU compute model is the recommended model and OCPU compute model is legacy. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. @@ -177,7 +208,8 @@ The following attributes are exported: * `preference` - The maintenance window scheduling preference. * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU in the Autonomous VM Cluster. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU in the Autonomous VM Cluster. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `okv_end_point_group_name` - The OKV End Point Group name for the Autonomous Container Database. @@ -186,11 +218,16 @@ The following attributes are exported: * `provisionable_cpus` - An array of CPU values that can be used to successfully provision a single Autonomous Database. * `provisioned_cpus` - The number of CPUs provisioned in an Autonomous Container Database. * `reclaimable_cpus` - CPUs that continue to be included in the count of CPUs available to the Autonomous Container Database even after one of its Autonomous Database is terminated or scaled down. You can release them to the available CPUs at its parent Autonomous VM Cluster level by restarting the Autonomous Container Database. +* `recovery_appliance_details` - Information about the recovery appliance configuration associated with the Autonomous Container Database. + * `allocated_storage_size_in_gbs` - The storage size of the backup destination allocated for an Autonomous Container Database to store backups on the recovery appliance, in GBs, rounded to the nearest integer. + * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups. + * `time_recovery_appliance_details_updated` - The time when the recovery appliance details are updated. * `reserved_cpus` - The number of CPUs reserved in an Autonomous Container Database. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. * `service_level_agreement_type` - The service level agreement type of the container database. The default is STANDARD. * `standby_maintenance_buffer_in_days` - The scheduling detail for the quarterly maintenance window of the standby Autonomous Container Database. This value represents the number of days before scheduled maintenance of the primary database. * `state` - The current state of the Autonomous Container Database. +* `system_tags` - System 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). * `time_created` - The date and time the Autonomous Container Database was created. * `time_of_last_backup` - The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database. * `time_snapshot_standby_revert` - The date and time the Autonomous Container Database will be reverted to Standby from Snapshot Standby. diff --git a/website/docs/r/database_autonomous_container_database_dataguard_association.html.markdown b/website/docs/r/database_autonomous_container_database_dataguard_association.html.markdown index 1956db696eb..a319335a754 100644 --- a/website/docs/r/database_autonomous_container_database_dataguard_association.html.markdown +++ b/website/docs/r/database_autonomous_container_database_dataguard_association.html.markdown @@ -34,10 +34,12 @@ resource "oci_database_autonomous_container_database_dataguard_association" "tes type = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_type #Optional + backup_retention_policy_on_terminate = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_backup_retention_policy_on_terminate dbrs_policy_id = oci_identity_policy.test_policy.id id = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_id internet_proxy = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_internet_proxy is_remote = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_is_remote + is_retention_lock_enabled = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_is_retention_lock_enabled remote_region = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_remote_region vpc_password = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_vpc_password vpc_user = var.autonomous_container_database_dataguard_association_peer_autonomous_container_database_backup_config_backup_destination_details_vpc_user @@ -60,13 +62,13 @@ The following arguments are supported: * `fast_start_fail_over_lag_limit_in_seconds` - (Optional) (Updatable) The lag time for my preference based on data loss tolerance in seconds. * `peer_autonomous_container_database_backup_config` - (Optional) Backup options for the standby Autonomous Container Database. * `backup_destination_details` - (Optional) Backup destination details. + * `backup_retention_policy_on_terminate` - (Optional) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - (Optional) Proxy URL to connect to object store. - * `is_remote` - (Optional) Indicates whether the backup destination is cross-region or local region. - * `remote_region` - (Optional) The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - (Optional) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Optional) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - (Optional) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - (Required) Type of the database backup destination. * `vpc_password` - (Optional) For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - (Optional) For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. diff --git a/website/docs/r/database_autonomous_container_database_snapshot_standby.html.markdown b/website/docs/r/database_autonomous_container_database_snapshot_standby.html.markdown index 8139b702e34..128bf8c71f3 100644 --- a/website/docs/r/database_autonomous_container_database_snapshot_standby.html.markdown +++ b/website/docs/r/database_autonomous_container_database_snapshot_standby.html.markdown @@ -43,19 +43,42 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: +* `associated_backup_configuration_details` - A backup config object holds information about preferred backup destinations only. This object holds information about the associated backup destinations, such as secondary backup destinations created for local backups or remote replicated backups. + * `backup_destination_attach_history` - The timestamps at which this backup destination is used as the preferred destination to host the Autonomous Container Database backups. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. + * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. + * `internet_proxy` - Proxy URL to connect to object store. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups and manual backups, but not long term backups. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `space_utilized_in_gbs` - The total space utilized (in GBs) by this Autonomous Container Database on this backup destination, rounded to the nearest integer. + * `time_at_which_storage_details_are_updated` - The latest timestamp when the backup destination details, such as 'spaceUtilized,' are updated. + * `type` - Type of the database backup destination. + * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. + * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `autonomous_exadata_infrastructure_id` - **No longer used.** For Autonomous Database on dedicated Exadata infrastructure, the container database is created within a specified `cloudAutonomousVmCluster`. * `autonomous_vm_cluster_id` - The OCID of the Autonomous VM Cluster. * `availability_domain` - The availability domain of the Autonomous Container Database. * `available_cpus` - Sum of CPUs available on the Autonomous VM Cluster + Sum of reclaimable CPUs available in the Autonomous Container Database. * `backup_config` - Backup options for the Autonomous Container Database. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `recovery_window_in_days` - Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. If the number of specified days is 0 then there will be no backups. +* `backup_destination_properties_list` - This list describes the backup destination properties associated with the Autonomous Container Database (ACD) 's preferred backup destination. The object at a given index is associated with the destination present at the same index in the backup destination details list of the ACD Backup Configuration. + * `backup_destination_attach_history` - The timestamps at which this backup destination is used as the preferred destination to host the Autonomous Container Database backups. + * `space_utilized_in_gbs` - The total space utilized (in GBs) by this Autonomous Container Database on this backup destination, rounded to the nearest integer. + * `time_at_which_storage_details_are_updated` - The latest timestamp when the backup destination details, such as 'spaceUtilized,' are updated. * `cloud_autonomous_vm_cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cloud Autonomous Exadata VM Cluster. * `compartment_id` - The OCID of the compartment. * `compute_model` - The compute model of the Autonomous Container Database. For Autonomous Database on Dedicated Exadata Infrastructure, the CPU type (ECPUs or OCPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. ECPU compute model is the recommended model and OCPU compute model is legacy. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. @@ -138,7 +161,8 @@ The following attributes are exported: * `preference` - The maintenance window scheduling preference. * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU in the Autonomous VM Cluster. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU in the Autonomous VM Cluster. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `okv_end_point_group_name` - The OKV End Point Group name for the Autonomous Container Database. @@ -147,11 +171,16 @@ The following attributes are exported: * `provisionable_cpus` - An array of CPU values that can be used to successfully provision a single Autonomous Database. * `provisioned_cpus` - The number of CPUs provisioned in an Autonomous Container Database. * `reclaimable_cpus` - CPUs that continue to be included in the count of CPUs available to the Autonomous Container Database even after one of its Autonomous Database is terminated or scaled down. You can release them to the available CPUs at its parent Autonomous VM Cluster level by restarting the Autonomous Container Database. +* `recovery_appliance_details` - Information about the recovery appliance configuration associated with the Autonomous Container Database. + * `allocated_storage_size_in_gbs` - The storage size of the backup destination allocated for an Autonomous Container Database to store backups on the recovery appliance, in GBs, rounded to the nearest integer. + * `recovery_window_in_days` - Number of days between the current and earliest point of recoverability covered by automatic backups. + * `time_recovery_appliance_details_updated` - The time when the recovery appliance details are updated. * `reserved_cpus` - The number of CPUs reserved in an Autonomous Container Database. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. * `service_level_agreement_type` - The service level agreement type of the container database. The default is STANDARD. * `standby_maintenance_buffer_in_days` - The scheduling detail for the quarterly maintenance window of the standby Autonomous Container Database. This value represents the number of days before scheduled maintenance of the primary database. * `state` - The current state of the Autonomous Container Database. +* `system_tags` - System 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). * `time_created` - The date and time the Autonomous Container Database was created. * `time_of_last_backup` - The timestamp of last successful backup. Here NULL value represents either there are no successful backups or backups are not configured for this Autonomous Container Database. * `time_snapshot_standby_revert` - The date and time the Autonomous Container Database will be reverted to Standby from Snapshot Standby. diff --git a/website/docs/r/database_autonomous_database.html.markdown b/website/docs/r/database_autonomous_database.html.markdown index 80f327ffed1..9432d937e53 100644 --- a/website/docs/r/database_autonomous_database.html.markdown +++ b/website/docs/r/database_autonomous_database.html.markdown @@ -72,9 +72,13 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { external_id = oci_database_external.test_external.id key_arn = var.autonomous_database_encryption_key_key_arn key_name = oci_kms_key.test_key.name + key_ring = var.autonomous_database_encryption_key_key_ring kms_key_id = oci_kms_key.test_key.id + kms_rest_endpoint = var.autonomous_database_encryption_key_kms_rest_endpoint + location = var.autonomous_database_encryption_key_location okv_kms_key = var.autonomous_database_encryption_key_okv_kms_key okv_uri = var.autonomous_database_encryption_key_okv_uri + project = var.autonomous_database_encryption_key_project service_endpoint_uri = var.autonomous_database_encryption_key_service_endpoint_uri vault_id = oci_kms_vault.test_vault.id vault_uri = var.autonomous_database_encryption_key_vault_uri @@ -205,10 +209,14 @@ The following arguments are supported: * `directory_name` - (Required when provider=OKV) (Updatable) OKV wallet directory name * `external_id` - (Applicable when provider=AWS) (Updatable) AWS external ID * `key_arn` - (Required when provider=AWS) (Updatable) AWS key ARN - * `key_name` - (Required when provider=AZURE) (Updatable) Azure key name + * `key_name` - (Required when provider=AZURE | GCP) (Updatable) Azure key name + * `key_ring` - (Required when provider=GCP) (Updatable) GCP key ring * `kms_key_id` - (Required when provider=OCI) (Updatable) The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - (Applicable when provider=GCP) (Updatable) GCP kms REST API endpoint + * `location` - (Required when provider=GCP) (Updatable) GCP key ring location * `okv_kms_key` - (Required when provider=OKV) (Updatable) UUID of OKV KMS Key * `okv_uri` - (Required when provider=OKV) (Updatable) URI of OKV server + * `project` - (Required when provider=GCP) (Updatable) GCP project name * `service_endpoint_uri` - (Required when provider=AWS) (Updatable) AWS key service endpoint URI * `vault_id` - (Required when provider=OCI) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - (Required when provider=AZURE) (Updatable) Azure vault URI @@ -320,6 +328,7 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: * `actual_used_data_storage_size_in_tbs` - The current amount of storage in use for user and system data, in terabytes (TB). +* `additional_attributes` - Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. Example: `{ "gcpAccountName": "gcpName" }` * `allocated_storage_size_in_tbs` - The amount of storage currently allocated for the database tables and billed for, rounded up. When auto-scaling is not enabled, this value is equal to the `dataStorageSizeInTBs` value. You can compare this value to the `actualUsedDataStorageSizeInTBs` value to determine if a manual shrink operation is appropriate for your allocated storage. **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. @@ -417,9 +426,13 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI @@ -433,9 +446,13 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI @@ -505,7 +522,8 @@ The following attributes are exported: * `retention_period_in_days` - Retention period, in days, for long-term backups * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. * `maintenance_target_component` - The component chosen for maintenance. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. * `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. @@ -613,7 +631,7 @@ The following attributes are exported: * `time_of_last_switchover` - The timestamp of the last switchover operation for the Autonomous Database. * `time_of_next_refresh` - The date and time of next refresh. * `time_reclamation_of_free_autonomous_database` - The date and time the Always Free database will be stopped because of inactivity. If this time is reached without any database activity, the database will automatically be put into the STOPPED state. -* `time_scheduled_db_version_upgrade` - The date and time the Autonomous Database scheduled to upgrade to 23ai. Send this value along with the target db_version value to schedule the database version upgrade. After the upgrade is scheduled and before the scheduled upgrade time arrives, please keep the db_version value the same as the backend's current db_version. +* `time_scheduled_db_version_upgrade` - The date and time the Autonomous Database scheduled to upgrade to 23ai. * `time_undeleted` - The date and time the Autonomous Database was most recently undeleted. * `time_until_reconnect_clone_enabled` - The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. * `total_backup_storage_size_in_gbs` - The backup storage to the database. diff --git a/website/docs/r/database_autonomous_database_backup.html.markdown b/website/docs/r/database_autonomous_database_backup.html.markdown index 86df712bca2..e61f12b90f3 100644 --- a/website/docs/r/database_autonomous_database_backup.html.markdown +++ b/website/docs/r/database_autonomous_database_backup.html.markdown @@ -21,6 +21,21 @@ resource "oci_database_autonomous_database_backup" "test_autonomous_database_bac autonomous_database_id = oci_database_autonomous_database.test_autonomous_database.id #Optional + backup_destination_details { + #Required + type = var.autonomous_database_backup_backup_destination_details_type + + #Optional + backup_retention_policy_on_terminate = var.autonomous_database_backup_backup_destination_details_backup_retention_policy_on_terminate + dbrs_policy_id = oci_identity_policy.test_policy.id + id = var.autonomous_database_backup_backup_destination_details_id + internet_proxy = var.autonomous_database_backup_backup_destination_details_internet_proxy + is_remote = var.autonomous_database_backup_backup_destination_details_is_remote + is_retention_lock_enabled = var.autonomous_database_backup_backup_destination_details_is_retention_lock_enabled + remote_region = var.autonomous_database_backup_backup_destination_details_remote_region + vpc_password = var.autonomous_database_backup_backup_destination_details_vpc_password + vpc_user = var.autonomous_database_backup_backup_destination_details_vpc_user + } display_name = var.autonomous_database_backup_display_name is_long_term_backup = var.autonomous_database_backup_is_long_term_backup retention_period_in_days = var.autonomous_database_backup_retention_period_in_days @@ -32,6 +47,17 @@ resource "oci_database_autonomous_database_backup" "test_autonomous_database_bac The following arguments are supported: * `autonomous_database_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. +* `backup_destination_details` - (Optional) Backup destination details + * `backup_retention_policy_on_terminate` - (Optional) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. + * `dbrs_policy_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. + * `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. + * `internet_proxy` - (Optional) Proxy URL to connect to object store. + * `is_remote` - (Optional) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Optional) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - (Optional) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `type` - (Required) Type of the database backup destination. + * `vpc_password` - (Optional) For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. + * `vpc_user` - (Optional) For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. * `display_name` - (Optional) The user-friendly name for the backup. The name does not have to be unique. * `is_long_term_backup` - (Optional) Indicates whether the backup is long-term * `retention_period_in_days` - (Optional) (Updatable) Retention period, in days, for long-term backups @@ -46,12 +72,13 @@ The following attributes are exported: * `autonomous_database_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database. * `backup_destination_details` - Backup destination details + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. + * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. @@ -60,6 +87,7 @@ The following attributes are exported: * `db_version` - A valid Oracle Database version for Autonomous Database. * `display_name` - The user-friendly name for the backup. The name does not have to be unique. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. +* `infrastructure_type` - The infrastructure type this resource belongs to. * `is_automatic` - Indicates whether the backup is user-initiated or automatic. * `is_restorable` - Indicates whether the backup can be used to restore the associated Autonomous Database. * `key_store_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. @@ -67,8 +95,26 @@ The following attributes are exported: * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_version_id` - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. * `lifecycle_details` - Additional information about the current lifecycle state. +* `region` - Name of the region in which backup is taken in. * `retention_period_in_days` - Retention period, in days, for long-term backups * `size_in_tbs` - The backup size in terrabytes (TB). +* `source_database_details` - Source Autonomous Database details. + * `autonomous_container_database_customer_contacts` - Customer Contacts for the Autonomous Container Database. Setting this to an empty list removes all customer contacts. + * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. + * `autonomous_container_database_display_name` - The user-provided name for the Autonomous Container Database. + * `autonomous_container_database_dst_file_version` - DST Time-Zone File version of the Autonomous Container Database. + * `autonomous_container_database_name` - Autonomous Container Database name. + * `autonomous_database_customer_contacts` - Customer Contacts for the Autonomous database. + * `email` - The email address used by Oracle to send notifications regarding databases and infrastructure. + * `autonomous_database_name` - Autonomous Database's name. + * `autonomous_vm_cluster_display_name` - Autonomous VM cluster's user-friendly name. + * `db_workload` - The Autonomous Database workload type. The following values are valid: + * OLTP - indicates an Autonomous Transaction Processing database + * DW - indicates an Autonomous Data Warehouse database + * AJD - indicates an Autonomous JSON Database + * APEX - indicates an Autonomous Database with the Oracle APEX Application Development workload type. + + This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `state` - The current state of the backup. * `time_available_till` - Timestamp until when the backup will be available * `time_ended` - The date and time the backup completed. diff --git a/website/docs/r/database_autonomous_database_saas_admin_user.html.markdown b/website/docs/r/database_autonomous_database_saas_admin_user.html.markdown index 2f37eb9d32c..237c1291795 100644 --- a/website/docs/r/database_autonomous_database_saas_admin_user.html.markdown +++ b/website/docs/r/database_autonomous_database_saas_admin_user.html.markdown @@ -8,9 +8,7 @@ description: |- --- # oci_database_autonomous_database_saas_admin_user -This resource provides the Autonomous Database Saas Admin User resource in Oracle Cloud Infrastructure Database service. - -This operation updates SaaS administrative user configuration of the Autonomous Database. +This resource creates and enables the Autonomous Database administrative user account in Oracle Cloud Infrastructure Database service. ## Example Usage @@ -18,15 +16,11 @@ This operation updates SaaS administrative user configuration of the Autonomous resource "oci_database_autonomous_database_saas_admin_user" "test_autonomous_database_saas_admin_user" { #Required autonomous_database_id = oci_database_autonomous_database.test_autonomous_database.id + password = var.autonomous_database_saas_admin_user_password #Optional access_type = var.autonomous_database_saas_admin_user_access_type duration = var.autonomous_database_saas_admin_user_duration - is_enabled = var.autonomous_database_saas_admin_user_is_enabled - password = var.autonomous_database_saas_admin_user_password - secret_id = oci_vault_secret.test_secret.id - secret_version_number = var.autonomous_database_saas_admin_user_secret_version_number - time_saas_admin_user_enabled = var.autonomous_database_saas_admin_user_time_saas_admin_user_enabled } ``` @@ -37,11 +31,9 @@ The following arguments are supported: * `access_type` - (Optional) The access type for the SaaS administrative user. If no access type is specified, the READ_ONLY access type is used. * `autonomous_database_id` - (Required) The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). * `duration` - (Optional) How long, in hours, the SaaS administrative user will stay enabled. If no duration is specified, the default value 1 will be used. -* `is_enabled` - (Optional) Indicates if the SaaS administrative user is enabled for the Autonomous Database. -* `password` - (Optional) A strong password for SaaS administrative user. The password must be a minimum of nine (9) characters and contain a minimum of two (2) uppercase, two (2) lowercase, two (2) numbers, and two (2) special characters from _ (underscore), \# (hashtag), or - (dash). -* `secret_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [secret](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). +* `password` - (Optional) A strong password for SaaS administrative user. The password must be a minimum of nine (9) characters and contain a minimum of two (2) uppercase, two (2) lowercase, two (2) numbers, and two (2) special characters from _ (underscore), \# (hashtag), or - (dash). The password is mandatory if "secret_id" is not present. +* `secret_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [secret](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). The secret is mandatory if "password" is not present. * `secret_version_number` - (Optional) The version of the vault secret. If no version is specified, the latest version will be used. -* `time_saas_admin_user_enabled` - (Optional) The date and time the SaaS administrative user was enabled at, for the Autonomous Database. ** IMPORTANT ** @@ -52,6 +44,7 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: * `actual_used_data_storage_size_in_tbs` - The current amount of storage in use for user and system data, in terabytes (TB). +* `additional_attributes` - Additional attributes for this resource. Each attribute is a simple key-value pair with no predefined name, type, or namespace. Example: `{ "gcpAccountName": "gcpName" }` * `allocated_storage_size_in_tbs` - The amount of storage currently allocated for the database tables and billed for, rounded up. When auto-scaling is not enabled, this value is equal to the `dataStorageSizeInTBs` value. You can compare this value to the `actualUsedDataStorageSizeInTBs` value to determine if a manual shrink operation is appropriate for your allocated storage. **Note:** Auto-scaling does not automatically decrease allocated storage when data is deleted from the database. @@ -63,7 +56,6 @@ The following attributes are exported: * `auto_refresh_point_lag_in_seconds` - The time, in seconds, the data of the refreshable clone lags the primary database at the point of refresh. The minimum is 0 minutes (0 mins means refresh to the latest available timestamp). The maximum is 7 days. The lag time increases after refreshing until the next data refresh happens. * `autonomous_container_database_id` - The Autonomous Container Database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Used only by Autonomous Database on Dedicated Exadata Infrastructure. * `autonomous_maintenance_schedule_type` - The maintenance schedule type of the Autonomous Database Serverless. An EARLY maintenance schedule follows a schedule applying patches prior to the REGULAR schedule. A REGULAR maintenance schedule follows the normal cycle -* `availability_domain` - The availability domain where the Autonomous Database Serverless instance is located. * `available_upgrade_versions` - List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. * `backup_config` - Autonomous Database configuration details for storing [manual backups](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/backup-restore.html#GUID-9035DFB8-4702-4CEB-8281-C2A303820809) in the [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) service. * `manual_backup_bucket_name` - Name of [Object Storage](https://docs.cloud.oracle.com/iaas/Content/Object/Concepts/objectstorageoverview.htm) bucket to use for storing manual backups. @@ -73,11 +65,14 @@ The following attributes are exported: * `character_set` - The character set for the autonomous database. The default is AL32UTF8. Allowed values are: AL32UTF8, AR8ADOS710, AR8ADOS720, AR8APTEC715, AR8ARABICMACS, AR8ASMO8X, AR8ISO8859P6, AR8MSWIN1256, AR8MUSSAD768, AR8NAFITHA711, AR8NAFITHA721, AR8SAKHR706, AR8SAKHR707, AZ8ISO8859P9E, BG8MSWIN, BG8PC437S, BLT8CP921, BLT8ISO8859P13, BLT8MSWIN1257, BLT8PC775, BN8BSCII, CDN8PC863, CEL8ISO8859P14, CL8ISO8859P5, CL8ISOIR111, CL8KOI8R, CL8KOI8U, CL8MACCYRILLICS, CL8MSWIN1251, EE8ISO8859P2, EE8MACCES, EE8MACCROATIANS, EE8MSWIN1250, EE8PC852, EL8DEC, EL8ISO8859P7, EL8MACGREEKS, EL8MSWIN1253, EL8PC437S, EL8PC851, EL8PC869, ET8MSWIN923, HU8ABMOD, HU8CWI2, IN8ISCII, IS8PC861, IW8ISO8859P8, IW8MACHEBREWS, IW8MSWIN1255, IW8PC1507, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE, JA16VMS, KO16KSC5601, KO16KSCCS, KO16MSWIN949, LA8ISO6937, LA8PASSPORT, LT8MSWIN921, LT8PC772, LT8PC774, LV8PC1117, LV8PC8LR, LV8RST104090, N8PC865, NE8ISO8859P10, NEE8ISO8859P4, RU8BESTA, RU8PC855, RU8PC866, SE8ISO8859P3, TH8MACTHAIS, TH8TISASCII, TR8DEC, TR8MACTURKISHS, TR8MSWIN1254, TR8PC857, US7ASCII, US8PC437, UTF8, VN8MSWIN1258, VN8VN3, WE8DEC, WE8DG, WE8ISO8859P1, WE8ISO8859P15, WE8ISO8859P9, WE8MACROMAN8S, WE8MSWIN1252, WE8NCR4970, WE8NEXTSTEP, WE8PC850, WE8PC858, WE8PC860, WE8ROMAN8, ZHS16CGB231280, ZHS16GBK, ZHT16BIG5, ZHT16CCDC, ZHT16DBT, ZHT16HKSCS, ZHT16MSWIN950, ZHT32EUC, ZHT32SOPS, ZHT32TRIS +<<<<<<< HEAD * `clone_table_space_list` - A list of the source Autonomous Database's table space number(s) used to create this partial clone from the backup. * `clone_type` - The Autonomous Database clone type. +======= +>>>>>>> 13121aec084 (Added - Support for Immutable Backup and Undelete DB | ADB-D and ADB on ExaC@C) * `cluster_placement_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the cluster placement group of the Autonomous Serverless Database. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. -* `compute_count` - The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. The 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. +* `compute_count` - The compute amount (CPUs) available to the database. Minimum and maximum values depend on the compute model and whether the database is an Autonomous Database Serverless instance or an Autonomous Database on Dedicated Exadata Infrastructure. For an Autonomous Database Serverless instance, the 'ECPU' compute model requires a minimum value of one, for databases in the elastic resource pool and minimum value of two, otherwise. Required when using the `computeModel` parameter. When using `cpuCoreCount` parameter, it is an error to specify computeCount to a non-null value. Providing `computeModel` and `computeCount` is the preferred method for both OCPU and ECPU. * `compute_model` - 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. ECPU compute model is the recommended model and OCPU compute model is legacy. * `connection_strings` - The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value. * `all_connection_strings` - Returns all connection strings that can be used to connect to the Autonomous Database. For more information, please see [Predefined Database Service Names for Autonomous Transaction Processing](https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE) @@ -140,6 +135,7 @@ The following attributes are exported: * `defined_tags` - 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). * `disaster_recovery_region_type` - **Deprecated.** The disaster recovery (DR) region type of the Autonomous Database. For Autonomous Database Serverless instances, DR associations have designated primary and standby regions. These region types do not change when the database changes roles. The standby region in DR associations can be the same region as the primary region, or they can be in a remote regions. Some database administration operations may be available only in the primary region of the DR association, and cannot be performed when the database using the primary role is operating in a remote region. * `display_name` - The user-friendly name for the Autonomous Database. The name does not have to be unique. +<<<<<<< HEAD * `encryption_key` - Details of the Autonomous Database encryption key. * `arn_role` - AWS ARN role * `autonomous_database_saas_admin_user_provider` - The provider for the Autonomous Database encryption key. @@ -149,9 +145,13 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI @@ -165,28 +165,33 @@ The following attributes are exported: * `external_id` - AWS external ID * `key_arn` - AWS key ARN * `key_name` - Azure key name + * `key_ring` - GCP key ring * `kms_key_id` - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. + * `kms_rest_endpoint` - GCP kms REST API endpoint + * `location` - GCP key ring location * `okv_kms_key` - UUID of OKV KMS Key * `okv_uri` - URI of OKV server + * `project` - GCP project name * `service_endpoint_uri` - AWS key service endpoint URI * `vault_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `vault_uri` - Azure vault URI * `time_activated` - The date and time the encryption key was activated. +======= +>>>>>>> 13121aec084 (Added - Support for Immutable Backup and Undelete DB | ADB-D and ADB on ExaC@C) * `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. This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. -* `infrastructure_type` - The infrastructure type this resource belongs to. +* `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. This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. For Autonomous Database Serverless instances, `whitelistedIps` is used. * `is_auto_scaling_enabled` - Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is `TRUE`. * `is_auto_scaling_for_storage_enabled` - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is `FALSE`. -* `is_backup_retention_locked` - Indicates if the Autonomous Database is backup retention locked. * `is_data_guard_enabled` - **Deprecated.** Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure. * `is_dedicated` - True if the database uses [dedicated Exadata infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html). -* `is_dev_tier` - Autonomous Database for Developers are fixed-shape Autonomous Databases that developers can use to build and test new applications. On Serverless, these are low-cost and billed per instance, on Dedicated and Cloud@Customer there is no additional cost to create Developer databases. Developer databases come with limited resources and is not intended for large-scale testing and production deployments. When you need more compute or storage resources, you may upgrade to a full paid production database. +* `is_dev_tier` - Autonomous Database for Developers are free Autonomous Databases that developers can use to build and test new applications.With Autonomous these database instancess instances, you can try new Autonomous Database features for free and apply them to ongoing or new development projects. Developer database comes with limited resources and is, therefore, not suitable for large-scale testing and production deployments. When you need more compute or storage resources, you can transition to a paid database licensing by cloning your developer database into a regular Autonomous Database. See [Autonomous Database documentation](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/eddjo/index.html) for more details. * `is_free_tier` - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled @@ -222,7 +227,6 @@ The following attributes are exported: * `local_adg_auto_failover_max_data_loss_limit` - 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 * `local_disaster_recovery_type` - Indicates the local disaster recovery (DR) type of the Autonomous Database Serverless instance. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based DR type provides lower cost DR with a slower RTO during failover or switchover. * `local_standby_db` - Autonomous Data Guard standby database details. - * `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. * `lifecycle_details` - Additional information about the current lifecycle state. * `maintenance_target_component` - The component chosen for maintenance. @@ -237,9 +241,10 @@ The following attributes are exported: * `retention_period_in_days` - Retention period, in days, for long-term backups * `time_of_backup` - The timestamp for the long-term backup schedule. For a MONTHLY cadence, months having fewer days than the provided date will have the backup taken on the last day of that month. * `maintenance_target_component` - The component chosen for maintenance. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per ECPU or OCPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `ncharacter_set` - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. -* `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. +* `net_services_architecture` - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users. * `next_long_term_backup_time_stamp` - The date and time when the next long-term backup would be created. * `nsg_ids` - The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. @@ -294,6 +299,7 @@ The following attributes are exported: * `pool_size` - Resource pool size. * `total_compute_capacity` - Resource Pool total capacity, it's currently 4x of pool size * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. +* `enable_delete_scheduled_operations` - If omitted or set to false the provider will not delete scheduled_operations from the Autonomous Database. If set to true, provider will delete scheduled_operations from the Autonomous Database. * `scheduled_operations` - The list of scheduled operations. Consists of values such as dayOfWeek, scheduledStartTime, scheduledStopTime. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. @@ -301,11 +307,9 @@ The following attributes are exported: * `name` - Name of the day of the week. * `scheduled_start_time` - auto start time. value must be of ISO-8601 format "HH:mm" * `scheduled_stop_time` - auto stop time. value must be of ISO-8601 format "HH:mm" -* `security_attributes` - Security Attributes 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). Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "audit"}}}` * `service_console_url` - The URL of the Service Console for the Autonomous Database. * `source_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the source Autonomous Database that was cloned to create the current Autonomous Database. * `standby_db` - **Deprecated** Autonomous Data Guard standby database details. - * `availability_domain` - The availability domain of a local Autonomous Data Guard standby database of an Autonomous Database Serverless instance. * `lag_time_in_seconds` - The amount of time, in seconds, that the data of the standby database lags the data of the primary database. Can be used to determine the potential data loss in the event of a failover. * `lifecycle_details` - Additional information about the current lifecycle state. * `maintenance_target_component` - The component chosen for maintenance. @@ -337,8 +341,6 @@ The following attributes are exported: * `time_data_guard_role_changed` - The date and time the Autonomous Data Guard role was switched for the Autonomous Database. For databases that have standbys in both the primary Data Guard region and a remote Data Guard standby region, this is the latest timestamp of either the database using the "primary" role in the primary Data Guard region, or database located in the remote Data Guard standby region. * `time_deletion_of_free_autonomous_database` - The date and time the Always Free database will be automatically deleted because of inactivity. If the database is in the STOPPED state and without activity until this time, it will be deleted. * `time_disaster_recovery_role_changed` - The date and time the Disaster Recovery role was switched for the standby Autonomous Database. -* `time_earliest_available_db_version_upgrade` - The earliest(min) date and time the Autonomous Database can be scheduled to upgrade to 23ai. -* `time_latest_available_db_version_upgrade` - The max date and time the Autonomous Database can be scheduled to upgrade to 23ai. * `time_local_data_guard_enabled` - The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database. * `time_maintenance_begin` - The date and time when maintenance will begin. * `time_maintenance_end` - The date and time when maintenance will end. @@ -350,8 +352,6 @@ The following attributes are exported: * `time_of_last_switchover` - The timestamp of the last switchover operation for the Autonomous Database. * `time_of_next_refresh` - The date and time of next refresh. * `time_reclamation_of_free_autonomous_database` - The date and time the Always Free database will be stopped because of inactivity. If this time is reached without any database activity, the database will automatically be put into the STOPPED state. -* `time_scheduled_db_version_upgrade` - The date and time the Autonomous Database scheduled to upgrade to 23ai. -* `time_undeleted` - The date and time the Autonomous Database was most recently undeleted. * `time_until_reconnect_clone_enabled` - The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database. * `total_backup_storage_size_in_gbs` - The backup storage to the database. * `used_data_storage_size_in_gbs` - The storage space consumed by Autonomous Database in GBs. diff --git a/website/docs/r/database_autonomous_vm_cluster.html.markdown b/website/docs/r/database_autonomous_vm_cluster.html.markdown index bbd363540f4..42df8ac3bc5 100644 --- a/website/docs/r/database_autonomous_vm_cluster.html.markdown +++ b/website/docs/r/database_autonomous_vm_cluster.html.markdown @@ -137,7 +137,8 @@ The following attributes are exported: * `preference` - The maintenance window scheduling preference. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `max_acds_lowest_scaled_value` - The lowest value to which maximum number of ACDs can be scaled down. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of nodes in the Autonomous VM Cluster. diff --git a/website/docs/r/database_backup_destination.html.markdown b/website/docs/r/database_backup_destination.html.markdown index bca4e56ba3c..ac808ea55c2 100644 --- a/website/docs/r/database_backup_destination.html.markdown +++ b/website/docs/r/database_backup_destination.html.markdown @@ -69,6 +69,10 @@ The following attributes are exported: * `associated_databases` - List of databases associated with the backup destination. * `db_name` - The display name of the database that is associated with the backup destination. * `id` - The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `associated_long_term_backup_count` - Indicates the number of long term backups of Autonomous Databases associated with this backup destination. +* `associated_long_term_backups` - List of long term backups of Autonomous Databases associated with this backup destination.The maximum associated number of long term backup listed here would be 1024. + * `display_name` - The display name for the long term backup for the autonomous database. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `connection_string` - For a RECOVERY_APPLIANCE backup destination, the connection string for connecting to the Recovery Appliance. * `defined_tags` - 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). diff --git a/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown b/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown index aa70c7756c1..b47904566d7 100644 --- a/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown +++ b/website/docs/r/database_cloud_autonomous_vm_cluster.html.markdown @@ -171,7 +171,8 @@ The following attributes are exported: * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `max_acds_lowest_scaled_value` - The lowest value to which maximum number of ACDs can be scaled down. -* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs) enabled per OCPU or ECPU. +* `memory_per_compute_unit_in_gbs` - The amount of memory (in GBs) to be enabled per OCPU or ECPU. +* `memory_per_oracle_compute_unit_in_gbs` - The amount of memory (in GBs, rounded off to nearest integer value) enabled per ECPU or OCPU. This is deprecated. Please refer to memoryPerComputeUnitInGBs for accurate value. * `memory_size_in_gbs` - The memory allocated in GBs. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. * `node_count` - The number of database servers in the cloud VM cluster. diff --git a/website/docs/r/database_cloud_database_management.html.markdown b/website/docs/r/database_cloud_database_management.html.markdown index a0729b10f9e..e3dc139b7a1 100644 --- a/website/docs/r/database_cloud_database_management.html.markdown +++ b/website/docs/r/database_cloud_database_management.html.markdown @@ -98,13 +98,13 @@ The following attributes are exported: * `auto_full_backup_window` - Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. diff --git a/website/docs/r/database_database.html.markdown b/website/docs/r/database_database.html.markdown index f617d2b7a70..4ac83c63c09 100644 --- a/website/docs/r/database_database.html.markdown +++ b/website/docs/r/database_database.html.markdown @@ -12,7 +12,6 @@ This resource provides the Database resource in Oracle Cloud Infrastructure Data Creates a new database in the specified Database Home. If the database version is provided, it must match the version of the Database Home. Applies only to Exadata systems. -**Important:** When `auto_backup_enabled` is not present in the configuration or set to true, the `auto_backup_window` and `auto_full_backup_window` will be ignored ## Example Usage @@ -20,14 +19,13 @@ Creates a new database in the specified Database Home. If the database version i resource "oci_database_database" "test_database" { #Required database { - #Required - admin_password = var.database_database_admin_password - db_name = var.database_database_db_name #Optional + admin_password = var.database_database_admin_password backup_id = oci_database_backup.test_backup.id backup_tde_password = var.database_database_backup_tde_password character_set = var.database_database_character_set + database_admin_password = var.database_database_database_admin_password database_software_image_id = oci_database_database_software_image.test_database_software_image.id db_backup_config { @@ -40,9 +38,11 @@ resource "oci_database_database" "test_database" { backup_destination_details { #Optional + backup_retention_policy_on_terminate = var.database_database_db_backup_config_backup_destination_details_backup_retention_policy_on_terminate dbrs_policy_id = oci_identity_policy.test_policy.id id = var.database_database_db_backup_config_backup_destination_details_id is_remote = var.database_database_db_backup_config_backup_destination_details_is_remote + is_retention_lock_enabled = var.database_database_db_backup_config_backup_destination_details_is_retention_lock_enabled remote_region = var.database_database_db_backup_config_backup_destination_details_remote_region type = var.database_database_db_backup_config_backup_destination_details_type } @@ -62,8 +62,8 @@ resource "oci_database_database" "test_database" { hsm_password = var.database_database_encryption_key_location_details_hsm_password } freeform_tags = var.database_database_freeform_tags - key_store_id = oci_database_key_store.test_key_store.id is_active_data_guard_enabled = var.database_database_is_active_data_guard_enabled + key_store_id = oci_database_key_store.test_key_store.id kms_key_id = oci_kms_key.test_key.id kms_key_version_id = oci_kms_key_version.test_key_version.id ncharacter_set = var.database_database_ncharacter_set @@ -72,7 +72,6 @@ resource "oci_database_database" "test_database" { protection_mode = var.database_database_protection_mode sid_prefix = var.database_database_sid_prefix source_database_id = oci_database_database.test_database.id - source_tde_wallet_password = var.database_database_source_tde_wallet_password source_encryption_key_location_details { #Required provider_type = var.database_database_source_encryption_key_location_details_provider_type @@ -81,19 +80,21 @@ resource "oci_database_database" "test_database" { azure_encryption_key_id = oci_kms_key.test_key.id hsm_password = var.database_database_source_encryption_key_location_details_hsm_password } + storage_size_details { #Required data_storage_size_in_gb = var.database_database_storage_size_details_data_storage_size_in_gb reco_storage_size_in_gbs = var.database_database_storage_size_details_reco_storage_size_in_gbs } + source_tde_wallet_password = var.database_database_source_tde_wallet_password tde_wallet_password = var.database_database_tde_wallet_password transport_type = var.database_database_transport_type vault_id = oci_kms_vault.test_vault.id } + db_home_id = oci_database_db_home.test_db_home.id source = var.database_source #Optional - db_home_id = oci_database_db_home.test_db_home.id db_version = var.database_db_version kms_key_id = oci_kms_key.test_key.id kms_key_version_id = oci_kms_key_version.test_key_version.id @@ -124,12 +125,12 @@ The following arguments are supported: * `auto_full_backup_window` - (Applicable when source=NONE) Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - (Applicable when source=NONE) This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - (Applicable when source=NONE) Backup destination details. + * `backup_retention_policy_on_terminate` - (Applicable when source=NONE) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. - * `is_remote` - (Applicable when source=NONE) Indicates whether the backup destination is cross-region or local region. - * `remote_region` - (Applicable when source=NONE) The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - (Applicable when source=NONE) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Applicable when source=NONE) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - (Applicable when source=NONE) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - (Required when source=NONE) Type of the database backup destination. * `recovery_window_in_days` - (Applicable when source=NONE) (Updatable) Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups only. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. * `run_immediate_full_backup` - (Applicable when source=NONE) If set to true, configures automatic full backups in the local region (the region of the DB system) for the first backup run immediately. @@ -142,11 +143,10 @@ The following arguments are supported: * `encryption_key_location_details` - (Applicable when source=NONE) Types of providers supported for managing database encryption keys * `azure_encryption_key_id` - (Required when provider_type=AZURE) Provide the key OCID of a registered Azure key. * `hsm_password` - (Required when provider_type=EXTERNAL) Provide the HSM password as you would in RDBMS for External HSM. - * `provider_type` - (Required) Use 'EXTERNAL' for creating a new database or migrating a database key to an External HSM. Use 'AZURE' for creating a new database or migrating a database key to Azure. + * `provider_type` - (Required) Use 'EXTERNAL' for creating a new database or migrating a database key to an External HSM. Use 'AZURE' for creating a new database or migrating a database key to Azure. * `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"}` * `is_active_data_guard_enabled` - (Applicable when source=DATAGUARD) True if active Data Guard is enabled. * `key_store_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. - * `is_active_data_guard_enabled` - (Applicable when source=DATAGUARD) True if active Data Guard is enabled. * `kms_key_id` - (Applicable when source=NONE) The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_version_id` - (Applicable when source=NONE) The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. * `ncharacter_set` - (Applicable when source=NONE) The national character set for the database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8. @@ -158,13 +158,12 @@ The following arguments are supported: * `source_encryption_key_location_details` - (Applicable when source=DATAGUARD | DB_BACKUP) Types of providers supported for managing database encryption keys * `azure_encryption_key_id` - (Required when provider_type=AZURE) Provide the key OCID of a registered Azure key. * `hsm_password` - (Required when provider_type=EXTERNAL) Provide the HSM password as you would in RDBMS for External HSM. - * `provider_type` - (Required) Use 'EXTERNAL' for creating a new database or migrating a database key to an External HSM. Use 'AZURE' for creating a new database or migrating a database key to Azure. + * `provider_type` - (Required) Use 'EXTERNAL' for creating a new database or migrating a database key to an External HSM. Use 'AZURE' for creating a new database or migrating a database key to Azure. * `source_tde_wallet_password` - (Required when source=DATAGUARD) The TDE wallet password of the source database specified by 'sourceDatabaseId'. * `storage_size_details` - (Optional) The database storage size details. This database option is supported for the Exadata VM cluster on Exascale Infrastructure. * `data_storage_size_in_gb` - (Required) (Updatable) The DATA storage size, in gigabytes, that is applicable for the database. * `reco_storage_size_in_gbs` - (Required) (Updatable) The RECO storage size, in gigabytes, that is applicable for the database. * `tde_wallet_password` - (Applicable when source=NONE) The optional password to open the TDE wallet. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, \#, or -. - * `vault_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `transport_type` - (Required when source=DATAGUARD) The redo transport type to use for this Data Guard association. Valid values depend on the specified `protectionMode`: * MAXIMUM_AVAILABILITY - SYNC or FASTSYNC * MAXIMUM_PERFORMANCE - ASYNC @@ -174,17 +173,15 @@ The following arguments are supported: **IMPORTANT** - The only transport type currently supported by the Database service is ASYNC. * `vault_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. -* `db_home_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. +* `db_home_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Home. * `db_version` - (Optional) A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. * `kms_key_id` - (Optional) The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. -* `kms_key_migration` - (Optional) The value to migrate to the kms version from none. Can only use once by setting value to true. You can not switch back to non-kms once you created or migrated.(https://www.oracle.com/security/cloud-security/key-management/faq/) -* `kms_key_rotation` - (Optional) The value to rotate the key version of current kms_key. Just change this value will trigger the rotation. -* `kms_key_version_id` - (Optional) The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. -* `source` - (Required) The source of the database: Use `NONE` for creating a new database. Use `DB_BACKUP` for creating a new database by restoring from a backup. Use `DATAGUARD` for creating a new STANDBY database for a Data Guard setup. The default is `NONE`. -* `action_trigger` - (Optional) (Applicable when source=DATAGUARD) An optional property when incremented triggers Data Guard operations such as Failover, Switchover, Reinstate, Data Guard Configuration Update and Convert Standby Database to Standalone . Could be set to any integer value. -* `data_guard_action` - (Required when action_trigger is set) Describes the Data Guard operation to be triggered. Could be set to a string value ('Switchover', 'Failover', 'Reinstate', 'DgConfig', "ConvertToStandalone'). +* `kms_key_version_id` - (Optional) The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. +* `source` - (Required) The source of the database: Use `NONE` for creating a new database. Use `DB_BACKUP` for creating a new database by restoring from a backup. Use `DATAGUARD` for creating a new STANDBY database for a Data Guard setup.. The default is `NONE`. +* `set_key_version_trigger` - (Optional) (Updatable) An optional property when incremented triggers Set Key Version. Could be set to any integer value. + ** 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 @@ -220,7 +217,7 @@ The following attributes are exported: * `protection_mode` - The protection mode of this Data Guard. For more information, see [Oracle Data Guard Protection Modes](http://docs.oracle.com/database/122/SBYDB/oracle-data-guard-protection-modes.htm#SBYDB02000) in the Oracle Data Guard documentation. * `database_management_config` - The configuration of the Database Management service. * `management_status` - The status of the Database Management service. - * `management_type` - The Database Management type. + * `management_type` - The Database Management type. * `database_software_image_id` - The database software image [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) * `db_backup_config` - Backup Options To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies](https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm). * `auto_backup_enabled` - If set to true, configures automatic backups. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work. @@ -229,14 +226,12 @@ The following attributes are exported: * `auto_full_backup_window` - Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). - * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. - * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `recovery_window_in_days` - Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups only. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. * `run_immediate_full_backup` - If set to true, configures automatic full backups in the local region (the region of the DB system) for the first backup run immediately. diff --git a/website/docs/r/database_database_upgrade.html.markdown b/website/docs/r/database_database_upgrade.html.markdown index a88737528a5..1688882b08a 100644 --- a/website/docs/r/database_database_upgrade.html.markdown +++ b/website/docs/r/database_database_upgrade.html.markdown @@ -102,13 +102,13 @@ The following attributes are exported: * `auto_full_backup_window` - Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - Backup destination details. + * `backup_retention_policy_on_terminate` - Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `internet_proxy` - Proxy URL to connect to object store. - * `is_remote` - Indicates whether the backup destination is cross-region or local region. - * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - Type of the database backup destination. * `vpc_password` - For a RECOVERY_APPLIANCE backup destination, the password for the VPC user that is used to access the Recovery Appliance. * `vpc_user` - For a RECOVERY_APPLIANCE backup destination, the Virtual Private Catalog (VPC) user that is used to access the Recovery Appliance. diff --git a/website/docs/r/database_db_home.html.markdown b/website/docs/r/database_db_home.html.markdown index 7949d239fb8..6123fb50e3f 100644 --- a/website/docs/r/database_db_home.html.markdown +++ b/website/docs/r/database_db_home.html.markdown @@ -45,9 +45,11 @@ resource "oci_database_db_home" "test_db_home" { backup_destination_details { #Optional + backup_retention_policy_on_terminate = var.db_home_database_db_backup_config_backup_destination_details_backup_retention_policy_on_terminate dbrs_policy_id = oci_identity_policy.test_policy.id id = var.db_home_database_db_backup_config_backup_destination_details_id is_remote = var.db_home_database_db_backup_config_backup_destination_details_is_remote + is_retention_lock_enabled = var.db_home_database_db_backup_config_backup_destination_details_is_retention_lock_enabled remote_region = var.db_home_database_db_backup_config_backup_destination_details_remote_region type = var.db_home_database_db_backup_config_backup_destination_details_type } @@ -129,12 +131,12 @@ The following arguments are supported: * `auto_full_backup_window` - (Applicable when source=NONE | VM_CLUSTER_NEW) Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - (Applicable when source=NONE | VM_CLUSTER_NEW) This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - (Applicable when source=NONE | VM_CLUSTER_NEW) Backup destination details. + * `backup_retention_policy_on_terminate` - (Applicable when source=NONE | VM_CLUSTER_NEW) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - (Applicable when source=NONE | VM_CLUSTER_NEW) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - (Applicable when source=NONE | VM_CLUSTER_NEW) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. - * `is_remote` - (Applicable when source=NONE | VM_CLUSTER_NEW) Indicates whether the backup destination is cross-region or local region. - * `remote_region` - (Applicable when source=NONE | VM_CLUSTER_NEW) The name of the remote region where the remote automatic incremental backups will be stored. - - For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). + * `is_remote` - (Applicable when source=NONE | VM_CLUSTER_NEW) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Applicable when source=NONE | VM_CLUSTER_NEW) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. + * `remote_region` - (Applicable when source=NONE | VM_CLUSTER_NEW) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - (Applicable when source=NONE | VM_CLUSTER_NEW) Type of the database backup destination. Supported values: `NFS`. * `recovery_window_in_days` - (Applicable when source=NONE | VM_CLUSTER_NEW) (Updatable) Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups only. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. * `run_immediate_full_backup` - (Applicable when source=NONE | VM_CLUSTER_NEW) If set to true, configures automatic full backups in the local region (the region of the DB system) for the first backup run immediately. diff --git a/website/docs/r/database_db_system.html.markdown b/website/docs/r/database_db_system.html.markdown index 453656fd158..0a28ab8f6a4 100644 --- a/website/docs/r/database_db_system.html.markdown +++ b/website/docs/r/database_db_system.html.markdown @@ -22,7 +22,6 @@ For Exadata Cloud Service instances, support for this API will end on May 15th, Use the [CreateCloudExadataInfrastructure](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/CloudExadataInfrastructure/CreateCloudExadataInfrastructure/) and [CreateCloudVmCluster](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/CloudVmCluster/CreateCloudVmCluster/) APIs to provision a new Exadata Cloud Service instance. -**Important:** When `auto_backup_enabled` is not present in the configuration or set to true, the `auto_backup_window` and `auto_full_backup_window` will be ignored ## Example Usage @@ -54,9 +53,11 @@ resource "oci_database_db_system" "test_db_system" { backup_destination_details { #Optional + backup_retention_policy_on_terminate = var.db_system_db_home_database_db_backup_config_backup_destination_details_backup_retention_policy_on_terminate dbrs_policy_id = oci_identity_policy.test_policy.id id = var.db_system_db_home_database_db_backup_config_backup_destination_details_id is_remote = var.db_system_db_home_database_db_backup_config_backup_destination_details_is_remote + is_retention_lock_enabled = var.db_system_db_home_database_db_backup_config_backup_destination_details_is_retention_lock_enabled remote_region = var.db_system_db_home_database_db_backup_config_backup_destination_details_remote_region type = var.db_system_db_home_database_db_backup_config_backup_destination_details_type } @@ -69,8 +70,11 @@ resource "oci_database_db_system" "test_db_system" { defined_tags = var.db_system_db_home_database_defined_tags encryption_key_location_details { #Required - hsm_password = var.db_system_db_home_database_encryption_key_location_details_hsm_password provider_type = var.db_system_db_home_database_encryption_key_location_details_provider_type + + #Optional + azure_encryption_key_id = oci_kms_key.test_key.id + hsm_password = var.db_system_db_home_database_encryption_key_location_details_hsm_password } freeform_tags = var.db_system_db_home_database_freeform_tags key_store_id = oci_database_key_store.test_key_store.id @@ -82,8 +86,11 @@ resource "oci_database_db_system" "test_db_system" { sid_prefix = var.db_system_db_home_database_sid_prefix source_encryption_key_location_details { #Required - hsm_password = var.db_system_db_home_database_source_encryption_key_location_details_hsm_password provider_type = var.db_system_db_home_database_source_encryption_key_location_details_provider_type + + #Optional + azure_encryption_key_id = oci_kms_key.test_key.id + hsm_password = var.db_system_db_home_database_source_encryption_key_location_details_hsm_password } tde_wallet_password = var.db_system_db_home_database_tde_wallet_password time_stamp_for_point_in_time_recovery = var.db_system_db_home_database_time_stamp_for_point_in_time_recovery @@ -92,7 +99,6 @@ resource "oci_database_db_system" "test_db_system" { #Optional database_software_image_id = oci_database_database_software_image.test_database_software_image.id - db_unique_name = var.db_unique_name db_version = var.db_system_db_home_db_version defined_tags = var.db_system_db_home_defined_tags display_name = var.db_system_db_home_display_name @@ -155,13 +161,14 @@ resource "oci_database_db_system" "test_db_system" { } patching_mode = var.db_system_maintenance_window_details_patching_mode preference = var.db_system_maintenance_window_details_preference + skip_ru = var.db_system_maintenance_window_details_skip_ru weeks_of_month = var.db_system_maintenance_window_details_weeks_of_month } node_count = var.db_system_node_count nsg_ids = var.db_system_nsg_ids private_ip = var.db_system_private_ip - security_attributes = var.db_system_security_attributes private_ip_v6 = var.db_system_private_ip_v6 + security_attributes = var.db_system_security_attributes source = var.db_system_source source_db_system_id = oci_database_db_system.test_db_system.id sparse_diskgroup = var.db_system_sparse_diskgroup @@ -224,9 +231,11 @@ The following arguments are supported: * `auto_full_backup_window` - (Applicable when source=DB_SYSTEM | NONE) Time window selected for initiating full backup for the database system. There are twelve available two-hour time windows. If no option is selected, the value is null and a start time between 12:00 AM to 7:00 AM in the region of the database is automatically chosen. For example, if the user selects SLOT_TWO from the enum list, the automatic backup job will start in between 2:00 AM (inclusive) to 4:00 AM (exclusive). Example: `SLOT_TWO` * `backup_deletion_policy` - (Applicable when source=DB_SYSTEM | NONE) This defines when the backups will be deleted. - IMMEDIATE option keep the backup for predefined time i.e 72 hours and then delete permanently... - RETAIN will keep the backups as per the policy defined for database backups. * `backup_destination_details` - (Applicable when source=DB_SYSTEM | NONE) (Updatable) Backup destination details. + * `backup_retention_policy_on_terminate` - (Applicable when source=DB_SYSTEM | NONE) Defines the automatic and manual backup retention policy for the Autonomous Database termination. The retention policy set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. Options are 'RETAIN_PER_RETENTION_WINDOW' or 'RETAIN_FOR_72_HOURS'.The default value is 'RETAIN_FOR_72_HOURS'. * `dbrs_policy_id` - (Applicable when source=DB_SYSTEM | NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the DBRS policy used for backup. * `id` - (Applicable when source=DB_SYSTEM | NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup destination. * `is_remote` - (Applicable when source=DB_SYSTEM | NONE) Indicates whether the backup destination is cross-region or local. + * `is_retention_lock_enabled` - (Applicable when source=DB_SYSTEM | NONE) Indicates if backup retention is locked for all the database backups in the Autonomous Container Database (ACD). The retention window cannot be decreased if the backup retention lock is enabled. Once applied on the Autonomous Container Database, the retention lock cannot be removed, or the retention period cannot be decreased after a 14-day period. If the backup is a Long Term Backup and retention lock is enabled, the backup cannot be deleted and must expire. The retention lock set on the Autonomous Container Database is not applicable for cross region remote backups and backups hosted on recovery Appliance backup destination. * `remote_region` - (Applicable when source=DB_SYSTEM | NONE) The name of the remote region where the remote automatic incremental backups will be stored. For information about valid region names, see [Regions and Availability Domains](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm). * `type` - (Required when source=DB_SYSTEM | NONE) Type of the database backup destination. * `recovery_window_in_days` - (Applicable when source=DB_SYSTEM | NONE) (Updatable) Number of days between the current and the earliest point of recoverability covered by automatic backups. This value applies to automatic backups only. After a new automatic backup has been created, Oracle removes old automatic backups that are created before the window. When the value is updated, it is applied to all existing automatic backups. @@ -241,7 +250,7 @@ The following arguments are supported: * `azure_encryption_key_id` - (Required when provider_type=AZURE) Provide the key OCID of a registered Azure key. * `hsm_password` - (Required when provider_type=EXTERNAL) Provide the HSM password as you would in RDBMS for External HSM. * `provider_type` - (Required) Use 'EXTERNAL' for creating a new database or migrating a database key to an External HSM. Use 'AZURE' for creating a new database or migrating a database key to Azure. - * `freeform_tags` - (Applicable when source=DB_BACKUP | DB_SYSTEM | NONE) (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"}` + * `freeform_tags` - (Applicable when source=DB_BACKUP | DB_SYSTEM | NONE) (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"}` * `key_store_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the key store of Oracle Vault. * `kms_key_id` - (Applicable when source=NONE) The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. * `kms_key_version_id` - (Applicable when source=NONE) The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances. @@ -250,13 +259,13 @@ The following arguments are supported: * `pluggable_databases` - (Applicable when source=DATABASE | DB_BACKUP) The list of pluggable databases that needs to be restored into new database. * `sid_prefix` - (Applicable when source=DB_BACKUP | NONE) Specifies a prefix for the `Oracle SID` of the database to be created. * `source_encryption_key_location_details` - (Applicable when source=DB_BACKUP) Types of providers supported for managing database encryption keys - * `hsm_password` - (Required) Provide the HSM password as you would in RDBMS for External HSM. - * `provider_type` - (Required) Use 'EXTERNAL' for creating a new database or migrate database key with External HSM. + * `azure_encryption_key_id` - (Required when provider_type=AZURE) Provide the key OCID of a registered Azure key. + * `hsm_password` - (Required when provider_type=EXTERNAL) Provide the HSM password as you would in RDBMS for External HSM. + * `provider_type` - (Required) Use 'EXTERNAL' for creating a new database or migrating a database key to an External HSM. Use 'AZURE' for creating a new database or migrating a database key to Azure. * `tde_wallet_password` - (Applicable when source=NONE) The optional password to open the TDE wallet. The password must be at least nine characters and contain at least two uppercase, two lowercase, two numeric, and two special characters. The special characters must be _, \#, or -. * `time_stamp_for_point_in_time_recovery` - (Applicable when source=DATABASE) The point in time of the original database from which the new database is created. If not specifed, the latest backup is used to create the database. * `vault_id` - (Applicable when source=NONE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](https://docs.cloud.oracle.com/iaas/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and `secretId` are required for Customer Managed Keys. * `database_software_image_id` - (Applicable when source=DB_BACKUP | NONE) The database software image [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the image to be used to restore a database. - * `db_unique_name` - (Optional) The `DB_UNIQUE_NAME` of the Oracle Database. * `db_version` - (Required when source=NONE) A valid Oracle Database version. For a list of supported versions, use the ListDbVersions operation. This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier. @@ -292,8 +301,7 @@ The following arguments are supported: * `custom_action_timeout_in_mins` - (Applicable when source=NONE) (Updatable) Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). * `days_of_week` - (Applicable when source=NONE) (Updatable) Days during the week when maintenance should be performed. * `name` - (Required when source=NONE) (Updatable) Name of the day of the week. - * `hours_of_day` - (Applicable when source=NONE) (Updatable) The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - * 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + * `hours_of_day` - (Applicable when source=NONE) (Updatable) The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC * `is_custom_action_timeout_enabled` - (Applicable when source=NONE) (Updatable) If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. * `is_monthly_patching_enabled` - (Applicable when source=NONE) (Updatable) If true, enables the monthly patching option. * `lead_time_in_weeks` - (Applicable when source=NONE) (Updatable) Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. @@ -303,13 +311,14 @@ The following arguments are supported: *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - (Applicable when source=NONE) (Updatable) The maintenance window scheduling preference. + * `skip_ru` - (Applicable when source=NONE) (Updatable) If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - (Applicable when source=NONE) (Updatable) Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `node_count` - (Optional) The number of nodes to launch for a virtual machine DB system. Specify either 1 or 2. By default this will be set to 1. * `nsg_ids` - (Optional) (Updatable) The list of [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see [Security Rules](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/securityrules.htm). **NsgIds restrictions:** - * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. + * A network security group (NSG) is optional for Autonomous Databases with private access. The nsgIds list can be empty. * `private_ip` - (Optional) A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Supported for VM BM shape. -* `security_attributes` - (Optional) (Updatable) Security Attributes 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). Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "audit"}}}` * `private_ip_v6` - (Optional) A private IPv6 address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value and the subnet is dual stack, Oracle automatically assigns a private IPv6 address from the subnet. +* `security_attributes` - (Optional) (Updatable) Security Attributes 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). Example: `{"Oracle-ZPR": {"MaxEgressCount": {"value": "42", "mode": "audit"}}}` * `shape` - (Required) (Updatable) The shape of the DB system. The shape determines resources allocated to the DB system. * For virtual machine shapes, the number of CPU cores and memory * For bare metal and Exadata shapes, the number of CPU cores, memory, and storage @@ -382,8 +391,7 @@ The following attributes are exported: * `custom_action_timeout_in_mins` - Determines the amount of time the system will wait before the start of each database server patching operation. Custom action timeout is in minutes and valid value is between 15 to 120 (inclusive). * `days_of_week` - Days during the week when maintenance should be performed. * `name` - Name of the day of the week. - * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - * 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC + * `hours_of_day` - The window of hours during the day when maintenance should be performed. The window is a 4 hour slot. Valid values are - 0 - represents time slot 0:00 - 3:59 UTC - 4 - represents time slot 4:00 - 7:59 UTC - 8 - represents time slot 8:00 - 11:59 UTC - 12 - represents time slot 12:00 - 15:59 UTC - 16 - represents time slot 16:00 - 19:59 UTC - 20 - represents time slot 20:00 - 23:59 UTC * `is_custom_action_timeout_enabled` - If true, enables the configuration of a custom action timeout (waiting period) between database server patching operations. * `is_monthly_patching_enabled` - If true, enables the monthly patching option. * `lead_time_in_weeks` - Lead time window allows user to set a lead time to prepare for a down time. The lead time is in weeks and valid value is between 1 to 4. @@ -393,6 +401,7 @@ The following attributes are exported: *IMPORTANT*: Non-rolling infrastructure patching involves system down time. See [Oracle-Managed Infrastructure Maintenance Updates](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/examaintenance.htm#Oracle) for more information. * `preference` - The maintenance window scheduling preference. + * `skip_ru` - If true, skips the release update (RU) for the quarter. You cannot skip two consecutive quarters. An RU skip request will only be honoured if the current version of the Autonomous Container Database is supported for current quarter. * `weeks_of_month` - Weeks during the month when maintenance should be performed. Weeks start on the 1st, 8th, 15th, and 22nd days of the month, and have a duration of 7 days. Weeks start and end based on calendar dates, not days of the week. For example, to allow maintenance during the 2nd week of the month (from the 8th day to the 14th day of the month), use the value 2. Maintenance cannot be scheduled for the fifth week of months that contain more than 28 days. Note that this parameter works in conjunction with the daysOfWeek and hoursOfDay parameters to allow you to specify specific days of the week and hours that maintenance will be performed. * `memory_size_in_gbs` - Memory allocated to the DB system, in gigabytes. * `next_maintenance_run_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the next maintenance run. diff --git a/website/docs/r/database_key_store.html.markdown b/website/docs/r/database_key_store.html.markdown index 6a508352d02..73740584d8d 100644 --- a/website/docs/r/database_key_store.html.markdown +++ b/website/docs/r/database_key_store.html.markdown @@ -62,6 +62,10 @@ The following attributes are exported: * `db_name` - The name of the database that is associated with the key store. * `db_unique_name` - The unique name of the database that is associated with the key store. * `id` - The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `associated_long_term_backup_count` - Indicates the number of long term backups of Autonomous Databases associated with this backup destination. +* `associated_long_term_backups` - List of long term backups of Autonomous Databases associated with this backup destination.The maximum associated number of long term backup listed here would be 1024. + * `display_name` - The display name for the long term backup for the autonomous database. + * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Autonomous Database backup. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. * `defined_tags` - 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` - The user-friendly name for the key store. The name does not need to be unique. diff --git a/website/docs/r/fleet_software_update_fsu_collection.html.markdown b/website/docs/r/fleet_software_update_fsu_collection.html.markdown index 7a11926c744..079a802a54c 100644 --- a/website/docs/r/fleet_software_update_fsu_collection.html.markdown +++ b/website/docs/r/fleet_software_update_fsu_collection.html.markdown @@ -20,10 +20,44 @@ resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" { #Required compartment_id = var.compartment_id service_type = var.fsu_collection_service_type - source_major_version = var.fsu_collection_source_major_version type = var.fsu_collection_type #Optional + components { + #Required + component_type = var.fsu_collection_components_component_type + source_major_version = var.fsu_collection_components_source_major_version + + #Optional + fleet_discovery { + #Required + strategy = var.fsu_collection_components_fleet_discovery_strategy + + #Optional + filters { + #Required + type = var.fsu_collection_components_fleet_discovery_filters_type + + #Optional + entity_type = var.fsu_collection_components_fleet_discovery_filters_entity_type + exadata_releases = var.fsu_collection_components_fleet_discovery_filters_exadata_releases + identifiers = var.fsu_collection_components_fleet_discovery_filters_identifiers + mode = var.fsu_collection_components_fleet_discovery_filters_mode + operator = var.fsu_collection_components_fleet_discovery_filters_operator + tags { + + #Optional + key = var.fsu_collection_components_fleet_discovery_filters_tags_key + namespace = var.fsu_collection_components_fleet_discovery_filters_tags_namespace + value = var.fsu_collection_components_fleet_discovery_filters_tags_value + } + versions = var.fsu_collection_components_fleet_discovery_filters_versions + } + fsu_discovery_id = oci_fleet_software_update_fsu_discovery.test_fsu_discovery.id + query = var.fsu_collection_components_fleet_discovery_query + targets = var.fsu_collection_components_fleet_discovery_targets + } + } defined_tags = {"foo-namespace.bar-key"= "value"} display_name = var.fsu_collection_display_name fleet_discovery { @@ -37,17 +71,17 @@ resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" { #Optional entity_type = var.fsu_collection_fleet_discovery_filters_entity_type + exadata_releases = var.fsu_collection_fleet_discovery_filters_exadata_releases identifiers = var.fsu_collection_fleet_discovery_filters_identifiers mode = var.fsu_collection_fleet_discovery_filters_mode names = var.fsu_collection_fleet_discovery_filters_names operator = var.fsu_collection_fleet_discovery_filters_operator tags { - #Required - key = var.fsu_collection_fleet_discovery_filters_tags_key - value = var.fsu_collection_fleet_discovery_filters_tags_value #Optional + key = var.fsu_collection_fleet_discovery_filters_tags_key namespace = var.fsu_collection_fleet_discovery_filters_tags_namespace + value = var.fsu_collection_fleet_discovery_filters_tags_value } versions = var.fsu_collection_fleet_discovery_filters_versions } @@ -56,6 +90,7 @@ resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" { targets = var.fsu_collection_fleet_discovery_targets } freeform_tags = {"bar-key"= "value"} + source_major_version = var.fsu_collection_source_major_version } ``` @@ -63,30 +98,51 @@ resource "oci_fleet_software_update_fsu_collection" "test_fsu_collection" { The following arguments are supported: -* `compartment_id` - (Required) (Updatable) Compartment Identifier +* `compartment_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. +* `components` - (Required when type=EXADB_STACK) Details of components in an Exadata software stack. + * `component_type` - (Required) Type of component in an Exadata software stack. + * `fleet_discovery` - (Optional) Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. + * `filters` - (Required when strategy=FILTERS) Filters to perform the target discovery. + * `entity_type` - (Required when type=RESOURCE_ID) Type of resource to match in the discovery. + * `exadata_releases` - (Required when type=EXADATA_RELEASE_VERSION) List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - (Required when type=COMPARTMENT_ID | RESOURCE_ID) The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - (Applicable when strategy=FILTERS) INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. + * `operator` - (Applicable when type=DEFINED_TAG | FREEFORM_TAG | RESOURCE_ID) Type of join for each element in this filter. + * `tags` - (Required when type=DEFINED_TAG | FREEFORM_TAG) [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `key` - (Required when type=DEFINED_TAG | FREEFORM_TAG) Freeform tag key. + * `namespace` - (Required when type=DEFINED_TAG) Defined tag namespace. + * `value` - (Required when type=DEFINED_TAG | FREEFORM_TAG) Freeform tag value. + * `type` - (Required) Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - (Required when type=VERSION) List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - (Required when strategy=DISCOVERY_RESULTS) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - (Required when strategy=SEARCH_QUERY) [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - (Required) Supported fleet discovery strategies. + * `targets` - (Required when strategy=TARGET_LIST) The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. + * `source_major_version` - (Required) Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in an Exadata Fleet Update Collection. Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` -* `display_name` - (Optional) (Updatable) Exadata Fleet Update Collection Identifier. -* `fleet_discovery` - (Optional) Supported fleet discovery strategies for DB Collections. If specified on an Update Collection request, this will re-discover the targets of the Collection. +* `display_name` - (Optional) (Updatable) The user-friendly name for the Exadata Fleet Update Collection. +* `fleet_discovery` - (Applicable when type=DB | GI | GUEST_OS) Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. * `filters` - (Required when strategy=FILTERS) Filters to perform the target discovery. * `entity_type` - (Required when type=RESOURCE_ID) Type of resource to match in the discovery. - * `identifiers` - (Required when type=COMPARTMENT_ID | RESOURCE_ID) Related resource Ids to include in the discovery. All must match the specified entityType. - * `mode` - (Applicable when strategy=FILTERS) INCLUDE or EXCLUDE the filter results in the discovery for DB targets. Supported for 'FSUCOLLECTION' RESOURCE_ID filter only. + * `exadata_releases` - (Required when type=EXADATA_RELEASE_VERSION) List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - (Required when type=COMPARTMENT_ID | RESOURCE_ID) The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - (Applicable when strategy=FILTERS) INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. * `names` - (Required when type=DB_HOME_NAME | DB_NAME | DB_UNIQUE_NAME) List of Database unique names to include in the discovery. * `operator` - (Applicable when type=DEFINED_TAG | FREEFORM_TAG | RESOURCE_ID) Type of join for each element in this filter. - * `tags` - (Required when type=DEFINED_TAG | FREEFORM_TAG) Freeform tags to include in the discovery. - * `key` - (Required) Freeform tag key. + * `tags` - (Required when type=DEFINED_TAG | FREEFORM_TAG) [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `key` - (Required when type=DEFINED_TAG | FREEFORM_TAG) Freeform tag key. * `namespace` - (Required when type=DEFINED_TAG) Defined tag namespace. - * `value` - (Required) Freeform tag value. - * `type` - (Required) Type of filters supported for Database targets discovery. - * `versions` - (Required when type=VERSION) List of Versions strings to include in the discovery. - * `fsu_discovery_id` - (Required when strategy=DISCOVERY_RESULTS) OCIDs of Fleet Software Update Discovery. - * `query` - (Required when strategy=SEARCH_QUERY) Oracle Cloud Infrastructure Search Service query string. - * `strategy` - (Required) Possible fleet discovery strategies. - * `targets` - (Required when strategy=TARGET_LIST) OCIDs of target resources to include. For EXACC service type Collections only VMClusters are allowed. For EXACS service type Collections only CloudVMClusters are allowed. + * `value` - (Required when type=DEFINED_TAG | FREEFORM_TAG) Freeform tag value. + * `type` - (Required) Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - (Required when type=VERSION) List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - (Required when strategy=DISCOVERY_RESULTS) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - (Required when strategy=SEARCH_QUERY) [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - (Required) Supported fleet discovery strategies. + * `targets` - (Required when strategy=TARGET_LIST) The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. * `freeform_tags` - (Optional) (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` * `service_type` - (Required) Exadata service type for the target resource members. -* `source_major_version` - (Required) Database Major Version of targets to be included in the Exadata Fleet Update Collection. https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbVersionSummary/ListDbVersions Only Database targets that match the version specified in this value would be added to the Exadata Fleet Update Collection. -* `type` - (Required) Collection type. DB: Only Database entity type resources allowed. GI: CloudVMCluster and VMCluster entity type resources allowed. +* `source_major_version` - (Required when type=DB | GI | GUEST_OS) Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the Exadata Fleet Update Collection. Only Exadata VM Clusters whose 'systemVersion' is related to the major version will be added to the Exadata Fleet Update Collection. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) +* `type` - (Required) Collection type. DB: Only Database entity type resources allowed. GI: CloudVMCluster and VMCluster entity type resources allowed. GUEST_OS: CloudVmCluster and VmCluster entity type resources are allowed. EXADB_STACK: CloudVmCluster and VmCluster entity type resources are allowed. ** IMPORTANT ** @@ -99,32 +155,53 @@ The following attributes are exported: * `active_fsu_cycle` - Active Exadata Fleet Update Cycle resource for this Collection. Object would be null if there is no active Cycle. * `display_name` - Display name of the active Exadata Fleet Update Cycle resource. * `id` - OCID of the active Exadata Fleet Update Cycle resource. -* `compartment_id` - Compartment Identifier +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. +* `components` - Details of components in an Exadata software stack. + * `component_type` - Type of component in an Exadata software stack. + * `fleet_discovery` - Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. + * `filters` - Filters to perform the target discovery. + * `entity_type` - Type of resource to match in the discovery. + * `exadata_releases` - List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. + * `operator` - Type of join for each element in this filter. + * `tags` - [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `key` - Freeform tag key. + * `namespace` - Defined tag namespace. + * `value` - Freeform tag value. + * `type` - Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - Supported fleet discovery strategies. + * `targets` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. + * `source_major_version` - Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in an Exadata Fleet Update Collection. Major Versions of Exadata Software are demarcated by the underlying Oracle Linux OS version. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` -* `display_name` - Exadata Fleet Update Collection resource display name. -* `fleet_discovery` - Supported fleet discovery strategies for DB Collections. If specified on an Update Collection request, this will re-discover the targets of the Collection. +* `display_name` - The user-friendly name for the Exadata Fleet Update Collection. +* `fleet_discovery` - Fleet discovery strategies for a 'GUEST_OS' collection of Exadata VM Clusters. If specified for an UpdateCollection request, discovery for Exadata VM Clusters will be rerun. * `filters` - Filters to perform the target discovery. * `entity_type` - Type of resource to match in the discovery. - * `identifiers` - Related resource Ids to include in the discovery. All must match the specified entityType. - * `mode` - INCLUDE or EXCLUDE the filter results in the discovery for DB targets. Supported for 'FSUCOLLECTION' RESOURCE_ID filter only. + * `exadata_releases` - List of Exadata Release versions to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `identifiers` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of associated resources to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Specified resources must match the specified 'entityType'. FsuCollection of type 'GI' or 'GUEST_OS' can be specified. + * `mode` - INCLUDE or EXCLUDE the filter results when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. Supported only for RESOURCE_ID filter. * `names` - List of Database unique names to include in the discovery. * `operator` - Type of join for each element in this filter. - * `tags` - Freeform tags to include in the discovery. + * `tags` - [Free-form tags](https://docs.cloud.oracle.com/iaas/Content/Tagging/Concepts/understandingfreeformtags.htm) to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. * `key` - Freeform tag key. * `namespace` - Defined tag namespace. * `value` - Freeform tag value. - * `type` - Type of filters supported for Database targets discovery. - * `versions` - List of Versions strings to include in the discovery. - * `fsu_discovery_id` - OCIDs of Fleet Software Update Discovery. - * `query` - Oracle Cloud Infrastructure Search Service query string. - * `strategy` - Possible fleet discovery strategies. - * `targets` - OCIDs of target resources to include. For EXACC service type Collections only VMClusters are allowed. For EXACS service type Collections only CloudVMClusters are allowed. + * `type` - Filters supported for searching Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `versions` - List of Exadata Image (Guest OS) version strings to include when discovering Exadata VM Cluster targets for a 'GUEST_OS' collection. + * `fsu_discovery_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Discovery. + * `query` - [OCI Search Service](https://docs.cloud.oracle.com/iaas/Content/Search/Concepts/queryoverview.htm) query string. + * `strategy` - Supported fleet discovery strategies. + * `targets` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of Exadata VM Cluster targets. Only Exadata VM Cluster targets associated with the specified 'serviceType' are allowed. * `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` -* `id` - OCID identifier for the Exadata Fleet Update Collection. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection. * `last_completed_fsu_cycle_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of last completed FSU Cycle. * `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. * `service_type` - Exadata service type for the target resource members. -* `source_major_version` - Database Major Version of targets to be included in the Exadata Fleet Update Collection. https://docs.oracle.com/en-us/iaas/api/#/en/database/20160918/DbVersionSummary/ListDbVersions Only Database targets that match the version specified in this value would be added to the Exadata Fleet Update Collection. +* `source_major_version` - Major version of Exadata Image (Guest OS) release for Exadata VM Cluster targets to be included in the Exadata Fleet Update Collection. Only Exadata VM Clusters whose 'systemVersion' is related to the major version will be added to the Exadata Fleet Update Collection. For more details, refer to [Oracle document 2075007.1](https://support.oracle.com/knowledge/Oracle%20Database%20Products/2075007_1.html) * `state` - The current state of the Exadata Fleet Update Collection. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `target_count` - Number of targets that are members of this Collection. diff --git a/website/docs/r/fleet_software_update_fsu_cycle.html.markdown b/website/docs/r/fleet_software_update_fsu_cycle.html.markdown index facc5c40c0a..7dca9f3d0cf 100644 --- a/website/docs/r/fleet_software_update_fsu_cycle.html.markdown +++ b/website/docs/r/fleet_software_update_fsu_cycle.html.markdown @@ -25,6 +25,22 @@ resource "oci_fleet_software_update_fsu_cycle" "test_fsu_cycle" { type = var.fsu_cycle_goal_version_details_type #Optional + components { + #Required + component_type = var.fsu_cycle_goal_version_details_components_component_type + goal_version_details { + #Required + goal_software_image_id = oci_core_image.test_image.id + goal_type = var.fsu_cycle_goal_version_details_components_goal_version_details_goal_type + + #Optional + goal_version = var.fsu_cycle_goal_version_details_components_goal_version_details_goal_version + } + + #Optional + home_policy = var.fsu_cycle_goal_version_details_components_home_policy + new_home_prefix = var.fsu_cycle_goal_version_details_components_new_home_prefix + } home_policy = var.fsu_cycle_goal_version_details_home_policy new_home_prefix = var.fsu_cycle_goal_version_details_new_home_prefix software_image_id = oci_core_image.test_image.id @@ -68,8 +84,11 @@ resource "oci_fleet_software_update_fsu_cycle" "test_fsu_cycle" { collection_type = var.fsu_cycle_upgrade_details_collection_type #Optional + is_ignore_post_upgrade_errors = var.fsu_cycle_upgrade_details_is_ignore_post_upgrade_errors + is_ignore_prerequisites = var.fsu_cycle_upgrade_details_is_ignore_prerequisites is_recompile_invalid_objects = var.fsu_cycle_upgrade_details_is_recompile_invalid_objects is_time_zone_upgrade = var.fsu_cycle_upgrade_details_is_time_zone_upgrade + max_drain_timeout_in_seconds = var.fsu_cycle_upgrade_details_max_drain_timeout_in_seconds } } ``` @@ -86,31 +105,42 @@ The following arguments are supported: * `is_wait_for_batch_resume` - (Applicable when type=FIFTY_FIFTY) (Updatable) True to wait for customer to resume the Apply Action once the first half is done. False to automatically patch the second half. * `percentage` - (Applicable when type=SERVICE_AVAILABILITY_FACTOR) (Updatable) Percentage of availability in the service during the Patch operation. * `type` - (Optional) (Updatable) Supported batching strategies. -* `compartment_id` - (Required) (Updatable) Compartment Identifier. +* `compartment_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `diagnostics_collection` - (Optional) (Updatable) Details to configure diagnostics collection for targets affected by this Exadata Fleet Update Maintenance Cycle. * `log_collection_mode` - (Optional) (Updatable) Enable incident logs and trace collection. Allow Oracle to collect incident logs and traces to enable fault diagnosis and issue resolution according to the selected mode. -* `display_name` - (Optional) (Updatable) Exadata Fleet Update Cycle display name. +* `display_name` - (Optional) (Updatable) The user-friendly name for the Exadata Fleet Update Cycle. * `freeform_tags` - (Optional) (Updatable) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` -* `fsu_collection_id` - (Required) OCID identifier for the Collection ID the Exadata Fleet Update Cycle will be assigned to. +* `fsu_collection_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection which will be updated by the Exadata Fleet Update Cycle being created. * `goal_version_details` - (Required) (Updatable) Goal version or image details for the Exadata Fleet Update Cycle. + * `components` - (Required when type=EXADB_STACK) (Updatable) Details of goal versions for components in an Exadata software stack. + * `component_type` - (Required) (Updatable) Type of component in an Exadata software stack. + * `goal_version_details` - (Required) (Updatable) Details of goal 'GUEST_OS' software version. + * `goal_software_image_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom 'GI' software image. + * `goal_type` - (Required) (Updatable) Preference to use an Oracle released 'GI' software image or a custom 'GI' software image. + * `goal_version` - (Required when goal_type=GI_ORACLE_IMAGE | GUEST_OS_ORACLE_IMAGE) (Updatable) Goal version string matching an Oracle released 'GUEST_OS' software image. + * `home_policy` - (Applicable when component_type=GI) (Updatable) Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. + * `new_home_prefix` - (Applicable when component_type=GI) (Updatable) Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. * `home_policy` - (Optional) (Updatable) Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. * `new_home_prefix` - (Optional) (Updatable) Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. - * `software_image_id` - (Required when type=IMAGE_ID) (Updatable) Target database software image OCID. - * `type` - (Required) (Updatable) Type of goal target version specified - * `version` - (Required when type=VERSION) (Updatable) Target DB or GI version string for the Exadata Fleet Update Cycle. -* `is_ignore_missing_patches` - (Applicable when type=PATCH) (Updatable) List of patch IDs to ignore. -* `is_ignore_patches` - (Applicable when type=PATCH) (Updatable) Ignore all patches between the source and target homes during patching. -* `is_keep_placement` - (Applicable when type=PATCH) (Updatable) Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same instances before and after the move operation. -* `max_drain_timeout_in_seconds` - (Applicable when type=PATCH) (Updatable) Service drain timeout specified in seconds. + * `software_image_id` - (Required when type=IMAGE_ID) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the goal database software image. + * `type` - (Required) (Updatable) Type of goal version specified + * `version` - (Required when type=VERSION) (Updatable) Goal version string for the Exadata Fleet Update Cycle. Applicable to Database, Grid Infrastructure, or Exadata Image software updates. +* `is_ignore_missing_patches` - (Applicable when type=PATCH) (Updatable) List of identifiers of patches to ignore. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_ignore_patches` - (Applicable when type=PATCH) (Updatable) Ignore patch conflicts or missing patches between the source and goal homes. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_keep_placement` - (Applicable when type=PATCH) (Updatable) Ensure that database services are online on the same VMs before and after the maintenance update. +* `max_drain_timeout_in_seconds` - (Applicable when type=PATCH) (Updatable) Timeout for session draining for database services specified in seconds. * `stage_action_schedule` - (Optional) Scheduling related details for the Exadata Fleet Update Action during create operations. The specified time should not conflict with existing Exadata Infrastructure maintenance windows. Null scheduleDetails for Stage and Apply Actions in Exadata Fleet Update Cycle creation would not create Actions. Null scheduleDetails for CreateAction would execute the Exadata Fleet Update Action as soon as possible. * `time_to_start` - (Required) The date and time the Exadata Fleet Update Action is expected to start. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29. * `type` - (Required) Type of scheduling strategy to use for Fleet Patching Update Action execution. * `type` - (Required) (Updatable) Type of Exadata Fleet Update Cycle. * `upgrade_details` - (Applicable when type=UPGRADE) (Updatable) Details of supported upgrade options for DB or GI collection. * `collection_type` - (Required) (Updatable) Type of Exadata Fleet Update collection being upgraded. + * `is_ignore_post_upgrade_errors` - (Applicable when collection_type=GI) (Updatable) Ignore errors during post Oracle Grid Infrastructure upgrade Cluster Verification Utility (CVU) check. + * `is_ignore_prerequisites` - (Applicable when collection_type=GI) (Updatable) Ignore the Cluster Verification Utility (CVU) prerequisite checks. * `is_recompile_invalid_objects` - (Applicable when collection_type=DB) (Updatable) Enables or disables the recompilation of invalid objects. * `is_time_zone_upgrade` - (Applicable when collection_type=DB) (Updatable) Enables or disables time zone upgrade. + * `max_drain_timeout_in_seconds` - (Applicable when collection_type=DB) (Updatable) Service drain timeout specified in seconds. ** IMPORTANT ** @@ -128,30 +158,38 @@ The following attributes are exported: * `is_wait_for_batch_resume` - True to wait for customer to resume the Apply Action once the first half is done. False to automatically patch the second half. * `percentage` - Percentage of availability in the service during the Patch operation. * `type` - Supported batching strategies. -* `collection_type` - Type of Collection this Exadata Fleet Update Cycle belongs to. -* `compartment_id` - Compartment Identifier. +* `collection_type` - Type of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Compartment. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `diagnostics_collection` - Details to configure diagnostics collection for targets affected by this Exadata Fleet Update Maintenance Cycle. * `log_collection_mode` - Enable incident logs and trace collection. Allow Oracle to collect incident logs and traces to enable fault diagnosis and issue resolution according to the selected mode. -* `display_name` - Exadata Fleet Update Cycle display name. -* `executing_fsu_action_id` - OCID identifier for the Action that is currently in execution, if applicable. +* `display_name` - The user-friendly name for the Exadata Fleet Update Cycle. +* `executing_fsu_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Action that is currently in progress, if applicable. * `freeform_tags` - Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` -* `fsu_collection_id` - OCID identifier for the Collection ID the Exadata Fleet Update Cycle is assigned to. +* `fsu_collection_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Collection being updated by this Exadata Fleet Update Cycle. * `goal_version_details` - Goal version or image details for the Exadata Fleet Update Cycle. + * `components` - Details of goal versions for components in an Exadata software stack. + * `component_type` - Type of component in an Exadata software stack. + * `goal_version_details` - Details of goal 'GUEST_OS' software version. + * `goal_software_image_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom 'GI' software image. + * `goal_type` - Preference to use an Oracle released 'GI' software image or a custom 'GI' software image. + * `goal_version` - Goal version string matching an Oracle released 'GUEST_OS' software image. + * `home_policy` - Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. + * `new_home_prefix` - Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. * `home_policy` - Goal home policy to use when Staging the Goal Version during patching. CREATE_NEW: Create a new DBHome (for Database Collections) for the specified image or version. USE_EXISTING: All database targets in the same VMCluster or CloudVmCluster will be moved to a shared database home. If an existing home for the selected image or version is not found in the VM Cluster for a target database, then a new home will be created. If more than one existing home for the selected image is found, then the home with the least number of databases will be used. If multiple homes have the least number of databases, then a home will be selected at random. * `new_home_prefix` - Prefix name used for new DB home resources created as part of the Stage Action. Format: _ If not specified, a default Oracle Cloud Infrastructure DB home resource will be generated for the new DB home resources created. - * `software_image_id` - Target database software image OCID. - * `type` - Type of goal target version specified - * `version` - Target DB or GI version string for the Exadata Fleet Update Cycle. -* `id` - OCID identifier for the Exadata Fleet Update Cycle. -* `is_ignore_missing_patches` - List of identifiers of patches to ignore. -* `is_ignore_patches` - Ignore patch conflicts or missing patches between the source and goal homes. -* `is_keep_placement` - Ensure that services of administrator-managed Oracle RAC or Oracle RAC One databases are running on the same instances before and after the move operation. + * `software_image_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the goal database software image. + * `type` - Type of goal version specified + * `version` - Goal version string for the Exadata Fleet Update Cycle. Applicable to Database, Grid Infrastructure, or Exadata Image software updates. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Fleet Update Cycle. +* `is_ignore_missing_patches` - List of identifiers of patches to ignore. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_ignore_patches` - Ignore patch conflicts or missing patches between the source and goal homes. This attribute will be ignored for Exadata Image (Guest OS) maintenance update. +* `is_keep_placement` - Ensure that database services are online on the same VMs before and after the maintenance update. * `last_completed_action` - The latest Action type that was completed in the Exadata Fleet Update Cycle. No value would indicate that the Cycle has not completed any Action yet. * `last_completed_action_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest Action in the Exadata Fleet Update Cycle. * `lifecycle_details` - A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. -* `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds. -* `next_action_to_execute` - In this array all the possible actions will be listed. The first element is the suggested Action. +* `max_drain_timeout_in_seconds` - Timeout for session draining for database services specified in seconds. +* `next_action_to_execute` - All possible Exadata Fleet Update Actions will be listed. The first element is the suggested Exadata Fleet Update Action. * `time_to_start` - The date and time the Exadata Fleet Update Action is expected to start. Null if no Action has been scheduled. [RFC 3339](https://tools.ietf.org/rfc/rfc3339), section 14.29. * `type` - Type of Exadata Fleet Update Action * `rollback_cycle_state` - Current rollback cycle state if rollback maintenance cycle action has been attempted. No value would indicate that the Cycle has not run a rollback maintenance cycle action before. @@ -166,8 +204,11 @@ The following attributes are exported: * `type` - Type of Exadata Fleet Update Cycle. * `upgrade_details` - Details of supported upgrade options for DB or GI collection. * `collection_type` - Type of Exadata Fleet Update collection being upgraded. + * `is_ignore_post_upgrade_errors` - Ignore errors during post Oracle Grid Infrastructure upgrade Cluster Verification Utility (CVU) check. + * `is_ignore_prerequisites` - Ignore the Cluster Verification Utility (CVU) prerequisite checks. * `is_recompile_invalid_objects` - Enables or disables the recompilation of invalid objects. * `is_time_zone_upgrade` - Enables or disables time zone upgrade. + * `max_drain_timeout_in_seconds` - Service drain timeout specified in seconds. ## Timeouts diff --git a/website/docs/r/functions_function.html.markdown b/website/docs/r/functions_function.html.markdown index 4fa0394752f..4b2ee8f2bcf 100644 --- a/website/docs/r/functions_function.html.markdown +++ b/website/docs/r/functions_function.html.markdown @@ -24,6 +24,17 @@ resource "oci_functions_function" "test_function" { #Optional config = var.function_config defined_tags = {"Operations.CostCenter"= "42"} + detached_mode_timeout_in_seconds = var.function_detached_mode_timeout_in_seconds + failure_destination { + #Required + kind = var.function_failure_destination_kind + + #Optional + channel_id = oci_mysql_channel.test_channel.id + queue_id = oci_queue_queue.test_queue.id + stream_id = oci_streaming_stream.test_stream.id + topic_id = oci_ons_notification_topic.test_notification_topic.id + } freeform_tags = {"Department"= "Finance"} image = var.function_image image_digest = var.function_image_digest @@ -39,6 +50,16 @@ resource "oci_functions_function" "test_function" { pbf_listing_id = oci_functions_pbf_listing.test_pbf_listing.id source_type = var.function_source_details_source_type } + success_destination { + #Required + kind = var.function_success_destination_kind + + #Optional + channel_id = oci_mysql_channel.test_channel.id + queue_id = oci_queue_queue.test_queue.id + stream_id = oci_streaming_stream.test_stream.id + topic_id = oci_ons_notification_topic.test_notification_topic.id + } timeout_in_seconds = var.function_timeout_in_seconds trace_config { @@ -57,7 +78,14 @@ The following arguments are supported: The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8. * `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). Example: `{"Operations.CostCenter": "42"}` +* `detached_mode_timeout_in_seconds` - (Optional) (Updatable) Timeout for detached function invocations. Value in seconds. * `display_name` - (Required) The display name of the function. The display name must be unique within the application containing the function. Avoid entering confidential information. +* `failure_destination` - (Optional) (Updatable) An object that represents the destination to which Oracle Functions will send an invocation record with the details of the error of the failed detached function invocation. A notification is an example of a failure destination. Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` + * `channel_id` - (Applicable when kind=QUEUE) (Updatable) The ID of the channel in the queue. + * `kind` - (Required) (Updatable) The type of destination for the response to a failed detached function invocation. + * `queue_id` - (Required when kind=QUEUE) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - (Required when kind=STREAM) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - (Required when kind=NOTIFICATION) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `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"}` * `image` - (Optional) (Updatable) The qualified name of the Docker image to use in the function, including the image tag. The image should be in the Oracle Cloud Infrastructure Registry that is in the same region as the function itself. This field must be updated if image_digest is updated. Example: `phx.ocir.io/ten/functions/function:0.0.1` * `image_digest` - (Optional) (Updatable) The image digest for the version of the image that will be pulled when invoking this function. If no value is specified, the digest currently associated with the image in the Oracle Cloud Infrastructure Registry will be used. This field must be updated if image is updated. Example: `sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7` @@ -67,7 +95,13 @@ The following arguments are supported: * `strategy` - (Required) (Updatable) The strategy for provisioned concurrency to be used. * `source_details` - (Optional) The source details for the Function. The function can be created from various sources. * `pbf_listing_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the PbfListing this function is sourced from. - * `source_type` - (Required) Type of the Function Source. Possible values: PRE_BUILT_FUNCTIONS. + * `source_type` - (Required) Type of the Function Source. Possible values: PBF. +* `success_destination` - (Optional) (Updatable) An object that represents the destination to which Oracle Functions will send an invocation record with the details of the successful detached function invocation. A stream is an example of a success destination. Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` + * `channel_id` - (Applicable when kind=QUEUE) (Updatable) The ID of the channel in the queue. + * `kind` - (Required) (Updatable) The type of destination for the response to a successful detached function invocation. + * `queue_id` - (Required when kind=QUEUE) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - (Required when kind=STREAM) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - (Required when kind=NOTIFICATION) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `timeout_in_seconds` - (Optional) (Updatable) Timeout for executions of the function. Value in seconds. * `trace_config` - (Optional) (Updatable) Define the tracing configuration for a function. * `is_enabled` - (Optional) (Updatable) Define if tracing is enabled for the resource. @@ -86,7 +120,14 @@ The following attributes are exported: The maximum size for all configuration keys and values is limited to 4KB. This is measured as the sum of octets necessary to represent each key and value in UTF-8. * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `detached_mode_timeout_in_seconds` - Timeout for detached function invocations. Value in seconds. Example: `{"detachedModeTimeoutInSeconds": 900}` * `display_name` - The display name of the function. The display name is unique within the application containing the function. +* `failure_destination` - An object that represents the destination to which Oracle Functions will send an invocation record with the details of the error of the failed detached function invocation. A notification is an example of a failure destination. Example: `{"kind": "NOTIFICATION", "topicId": "topic_OCID"}` + * `channel_id` - The ID of the channel in the queue. + * `kind` - The type of destination for the response to a failed detached function invocation. + * `queue_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `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 function. * `image` - The qualified name of the Docker image to use in the function, including the image tag. The image should be in the Oracle Cloud Infrastructure Registry that is in the same region as the function itself. This field must be updated if image_digest is updated. Example: `phx.ocir.io/ten/functions/function:0.0.1` @@ -101,6 +142,12 @@ The following attributes are exported: * `pbf_listing_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the PbfListing this function is sourced from. * `source_type` - Type of the Function Source. Possible values: PRE_BUILT_FUNCTIONS. * `state` - The current state of the function. +* `success_destination` - An object that represents the destination to which Oracle Functions will send an invocation record with the details of the successful detached function invocation. A stream is an example of a success destination. Example: `{"kind": "STREAM", "streamId": "stream_OCID"}` + * `channel_id` - The ID of the channel in the queue. + * `kind` - The type of destination for the response to a successful detached function invocation. + * `queue_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the queue. + * `stream_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the stream. + * `topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the topic. * `time_created` - The time the function was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` * `time_updated` - The time the function was updated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-09-12T22:47:12.613Z` * `timeout_in_seconds` - Timeout for executions of the function. Value in seconds. diff --git a/website/docs/r/generative_ai_endpoint.html.markdown b/website/docs/r/generative_ai_endpoint.html.markdown index 28524389dba..e059d9b0fa5 100644 --- a/website/docs/r/generative_ai_endpoint.html.markdown +++ b/website/docs/r/generative_ai_endpoint.html.markdown @@ -28,11 +28,16 @@ resource "oci_generative_ai_endpoint" "test_endpoint" { content_moderation_config { #Required is_enabled = var.endpoint_content_moderation_config_is_enabled + + #Optional + mode = var.endpoint_content_moderation_config_mode + model_id = oci_generative_ai_model.test_model.id } defined_tags = {"Operations.CostCenter"= "42"} description = var.endpoint_description display_name = var.endpoint_display_name freeform_tags = {"Department"= "Finance"} + generative_ai_private_endpoint_id = oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint.id } ``` @@ -41,14 +46,17 @@ resource "oci_generative_ai_endpoint" "test_endpoint" { The following arguments are supported: * `compartment_id` - (Required) (Updatable) The compartment OCID to create the endpoint in. -* `content_moderation_config` - (Optional) (Updatable) The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses. It's recommended to use content moderation. +* `content_moderation_config` - (Optional) (Updatable) The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses. * `is_enabled` - (Required) (Updatable) Whether to enable the content moderation feature. + * `mode` - (Optional) (Updatable) Enum for the modes of operation for inference protection. + * `model_id` - (Optional) (Updatable) The OCID of the model used for the feature. * `dedicated_ai_cluster_id` - (Required) The OCID of the dedicated AI cluster on which a model will be deployed to. * `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). Example: `{"Operations.CostCenter": "42"}` * `description` - (Optional) (Updatable) An optional description of the endpoint. * `display_name` - (Optional) (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. -* `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"}` -* `model_id` - (Required) The ID of the model that's used to create this endpoint. +* `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"}` +* `generative_ai_private_endpoint_id` - (Optional) (Updatable) The OCID of the Generative AI private endpoint to which this endpoint is attached to. +* `model_id` - (Required) The OCID of the model that's used to create this endpoint. ** IMPORTANT ** @@ -59,13 +67,16 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: * `compartment_id` - The compartment OCID to create the endpoint in. -* `content_moderation_config` - The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses. It's recommended to use content moderation. +* `content_moderation_config` - The configuration details, whether to add the content moderation feature to the model. Content moderation removes toxic and biased content from responses. * `is_enabled` - Whether to enable the content moderation feature. + * `mode` - Enum for the modes of operation for inference protection. + * `model_id` - The OCID of the model used for the feature. * `dedicated_ai_cluster_id` - The OCID of the dedicated AI cluster on which the model will be deployed to. * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` * `description` - An optional description of the endpoint. * `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. * `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"}` +* `generative_ai_private_endpoint_id` - The OCID of the Generative AI private endpoint to which this endpoint is attached to. * `id` - An OCID that uniquely identifies this endpoint resource. * `lifecycle_details` - A message describing the current state of the endpoint in more detail that can provide actionable information. * `model_id` - The OCID of the model that's used to create this endpoint. diff --git a/website/docs/r/generative_ai_generative_ai_private_endpoint.html.markdown b/website/docs/r/generative_ai_generative_ai_private_endpoint.html.markdown new file mode 100644 index 00000000000..03687adab36 --- /dev/null +++ b/website/docs/r/generative_ai_generative_ai_private_endpoint.html.markdown @@ -0,0 +1,87 @@ +--- +subcategory: "Generative AI" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_generative_ai_generative_ai_private_endpoint" +sidebar_current: "docs-oci-resource-generative_ai-generative_ai_private_endpoint" +description: |- + Provides the Generative Ai Private Endpoint resource in Oracle Cloud Infrastructure Generative AI service +--- + +# oci_generative_ai_generative_ai_private_endpoint +This resource provides the Generative Ai Private Endpoint resource in Oracle Cloud Infrastructure Generative AI service. + +Creates a Generative AI private endpoint. + + +## Example Usage + +```hcl +resource "oci_generative_ai_generative_ai_private_endpoint" "test_generative_ai_private_endpoint" { + #Required + compartment_id = var.compartment_id + dns_prefix = var.generative_ai_private_endpoint_dns_prefix + subnet_id = oci_core_subnet.test_subnet.id + + #Optional + defined_tags = {"Operations.CostCenter"= "42"} + description = var.generative_ai_private_endpoint_description + display_name = var.generative_ai_private_endpoint_display_name + freeform_tags = {"Department"= "Finance"} + nsg_ids = var.generative_ai_private_endpoint_nsg_ids +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) (Updatable) The OCID of the compartment where the private endpoint is created. +* `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). Example: `{"Operations.CostCenter": "42"}` +* `description` - (Optional) (Updatable) A description of this private endpoint. +* `display_name` - (Optional) (Updatable) A user friendly name. It doesn't have to be unique. Avoid entering confidential information. +* `dns_prefix` - (Required) (Updatable) dnsPrefix of the private endpoint FQDN. +* `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"}` +* `nsg_ids` - (Optional) (Updatable) A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to. +* `subnet_id` - (Required) The OCID of the customer's subnet where the private endpoint VNIC will reside. + + +** 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 + +## Attributes Reference + +The following attributes are exported: + +* `compartment_id` - The OCID of the compartment that contains the private endpoint. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `description` - A description of this private endpoint. +* `display_name` - A user friendly name. It doesn't have to be unique. Avoid entering confidential information. +* `fqdn` - Fully qualified domain name the customer will use for access (for eg: xyz.oraclecloud.com) +* `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 of a private endpoint. +* `lifecycle_details` - The detailed messages about the lifecycle state +* `nsg_ids` - A list of the OCIDs of the network security groups that the private endpoint's VNIC belongs to. +* `previous_state` - Generative AI private endpoint. +* `private_endpoint_ip` - The private IP address (in the customer's VCN) that represents the access point for the associated endpoint service. +* `state` - The current state of the Generative AI Private Endpoint. +* `subnet_id` - The OCID of the subnet that the private endpoint belongs to. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time that the Generative AI private endpoint was created expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` +* `time_updated` - The date and time that the Generative AI private endpoint was updated expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` + +## Timeouts + +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 Generative Ai Private Endpoint + * `update` - (Defaults to 20 minutes), when updating the Generative Ai Private Endpoint + * `delete` - (Defaults to 20 minutes), when destroying the Generative Ai Private Endpoint + + +## Import + +GenerativeAiPrivateEndpoints can be imported using the `id`, e.g. + +``` +$ terraform import oci_generative_ai_generative_ai_private_endpoint.test_generative_ai_private_endpoint "id" +``` + diff --git a/website/docs/r/ocvp_cluster.html.markdown b/website/docs/r/ocvp_cluster.html.markdown index ea1688b19f6..d801ff1c512 100644 --- a/website/docs/r/ocvp_cluster.html.markdown +++ b/website/docs/r/ocvp_cluster.html.markdown @@ -45,6 +45,7 @@ resource "oci_ocvp_cluster" "test_cluster" { #Optional capacity_reservation_id = oci_ocvp_capacity_reservation.test_capacity_reservation.id + datastore_cluster_ids = var.cluster_datastore_cluster_ids datastores { #Required block_volume_ids = var.cluster_datastores_block_volume_ids @@ -70,11 +71,12 @@ The following arguments are supported: * `capacity_reservation_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. * `compute_availability_domain` - (Required) The availability domain to create the Cluster's ESXi hosts in. For multi-AD Cluster deployment, set to `multi-AD`. +* `datastore_cluster_ids` - (Optional) A list of datastore clusters. * `datastores` - (Optional) A list of datastore info for the Cluster. This value is required only when `initialHostShapeName` is a standard shape. * `block_volume_ids` - (Required) A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. * `datastore_type` - (Required) Type of the datastore. * `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). Example: `{"Operations.CostCenter": "42"}` -* `display_name` - (Optional) (Updatable) A descriptive name for the Cluster. Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. +* `display_name` - (Optional) (Updatable) A descriptive name for the Cluster. Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. * `esxi_hosts_count` - (Required) The number of ESXi hosts to create in the Cluster. You can add more hosts later (see [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost)). **Note:** If you later delete EXSi hosts from a production Cluster to make SDDC total host count less than 3, you are still billed for the 3 minimum recommended ESXi hosts. Also, you cannot add more VMware workloads to the Cluster until the SDDC again has at least 3 ESXi hosts. @@ -146,6 +148,7 @@ The following attributes are exported: * `capacity_reservation_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Cluster. * `compute_availability_domain` - The availability domain the ESXi hosts are running in. For Multi-AD Cluster, it is `multi-AD`. Example: `Uocm:PHX-AD-1`, `multi-AD` +* `datastore_cluster_ids` - A list of datastore clusters. * `datastores` - Datastores used for the Cluster. * `block_volume_ids` - A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. * `capacity` - Size of the Block Storage Volume in GB. diff --git a/website/docs/r/ocvp_datastore.html.markdown b/website/docs/r/ocvp_datastore.html.markdown new file mode 100644 index 00000000000..1f93b6165dd --- /dev/null +++ b/website/docs/r/ocvp_datastore.html.markdown @@ -0,0 +1,94 @@ +--- +subcategory: "Oracle Cloud VMware Solution" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_ocvp_datastore" +sidebar_current: "docs-oci-resource-ocvp-datastore" +description: |- + Provides the Datastore resource in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service +--- + +# oci_ocvp_datastore +This resource provides the Datastore resource in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service. + +Creates a Oracle Cloud VMware Solution Datastore. + +Use the [WorkRequest](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/WorkRequest/) operations to track the +creation of the Datastore. + + +## Example Usage + +```hcl +resource "oci_ocvp_datastore" "test_datastore" { + #Required + availability_domain = var.datastore_availability_domain + block_volume_ids = var.datastore_block_volume_ids + compartment_id = var.compartment_id + display_name = var.datastore_display_name + + #Optional + datastore_cluster_id = oci_ocvp_datastore_cluster.test_datastore_cluster.id + defined_tags = {"Operations.CostCenter"= "42"} + freeform_tags = {"Department"= "Finance"} +} +``` + +## Argument Reference + +The following arguments are supported: + +* `availability_domain` - (Required) The availability domain to create the Datastore in. +* `block_volume_ids` - (Required) The List of Block volume [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s that belong to the Datastore. +* `compartment_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to contain the Datastore. +* `datastore_cluster_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the datastore cluster that Datastore belongs to. +* `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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - (Required) (Updatable) A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `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"}` + + +** 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 + +## Attributes Reference + +The following attributes are exported: + +* `availability_domain` - The availability domain of the Datastore. +* `block_volume_details` - The list of Block Volume details that belong to the datastore. + * `attachments` - List of BlockVolumeAttachment objects containing information about attachment details + * `esxi_host_id` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi host that block volume is attached to. + * `ip_address` - The IP address of block volume attachment. + * `port` - The port of block volume attachment. + * `id` - An [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of the Block Storage Volume. + * `iqn` - An IQN of the Block Storage Volume. +* `block_volume_ids` - The List of Block volume [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s that belong to the Datastore. +* `capacity_in_gbs` - Total size of the datastore in GB. +* `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore is attached to. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Datastore. +* `datastore_cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the datastore cluster that Datastore belongs to. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `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 Datastore. +* `sddc_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore is associated with. +* `state` - The current state of the Datastore. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{orcl-cloud: {free-tier-retain: true}}` +* `time_created` - The date and time the Datastore was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the Datastore was updated, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). + +## Timeouts + +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 Datastore + * `update` - (Defaults to 20 minutes), when updating the Datastore + * `delete` - (Defaults to 20 minutes), when destroying the Datastore + + +## Import + +Datastores can be imported using the `id`, e.g. + +``` +$ terraform import oci_ocvp_datastore.test_datastore "id" +``` + diff --git a/website/docs/r/ocvp_datastore_cluster.html.markdown b/website/docs/r/ocvp_datastore_cluster.html.markdown new file mode 100644 index 00000000000..1f7514b9ff5 --- /dev/null +++ b/website/docs/r/ocvp_datastore_cluster.html.markdown @@ -0,0 +1,85 @@ +--- +subcategory: "Oracle Cloud VMware Solution" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_ocvp_datastore_cluster" +sidebar_current: "docs-oci-resource-ocvp-datastore_cluster" +description: |- + Provides the Datastore Cluster resource in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service +--- + +# oci_ocvp_datastore_cluster +This resource provides the Datastore Cluster resource in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service. + +Creates a Oracle Cloud VMware Solution Datastore Cluster. + + +## Example Usage + +```hcl +resource "oci_ocvp_datastore_cluster" "test_datastore_cluster" { + #Required + availability_domain = var.datastore_cluster_availability_domain + compartment_id = var.compartment_id + datastore_cluster_type = var.datastore_cluster_datastore_cluster_type + display_name = var.datastore_cluster_display_name + + #Optional + datastore_ids = var.datastore_cluster_datastore_ids + defined_tags = {"Operations.CostCenter"= "42"} + freeform_tags = {"Department"= "Finance"} +} +``` + +## Argument Reference + +The following arguments are supported: + +* `availability_domain` - (Required) The availability domain to create the Datastore Cluster in. +* `compartment_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to contain the Datastore Cluster. +* `datastore_cluster_type` - (Required) Type of the datastore. +* `datastore_ids` - (Optional) The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastores that belong to the Datastore Cluster. +* `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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - (Required) (Updatable) A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `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"}` + + +** 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 + +## Attributes Reference + +The following attributes are exported: + +* `availability_domain` - The availability domain of the Datastore Cluster. +* `capacity_in_gbs` - Total size of all datastores associated with the datastore cluster in GB. +* `cluster_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VMware Cluster that Datastore cluster is attached to. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Datastore. +* `datastore_cluster_type` - Type of the datastore cluster. +* `datastore_ids` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastores that belong to the Datastore Cluster +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `display_name` - A descriptive name for the Datastore Cluster. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information. +* `esxi_host_ids` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ESXi hosts to attach the datastore to. All ESXi hosts must belong to the same VMware cluster. +* `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 Datastore cluster. +* `sddc_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the SDDC that Datastore cluster is associated with. +* `state` - The current state of the Datastore Cluster. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{orcl-cloud: {free-tier-retain: true}}` +* `time_created` - The date and time the Datastore Cluster was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the Datastore Cluster was updated, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). + +## Timeouts + +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 Datastore Cluster + * `update` - (Defaults to 20 minutes), when updating the Datastore Cluster + * `delete` - (Defaults to 20 minutes), when destroying the Datastore Cluster + + +## Import + +DatastoreClusters can be imported using the `id`, e.g. + +``` +$ terraform import oci_ocvp_datastore_cluster.test_datastore_cluster "id" +``` + diff --git a/website/docs/r/ocvp_esxi_host.html.markdown b/website/docs/r/ocvp_esxi_host.html.markdown index 392ac7a7791..b3d9ea6b1e0 100644 --- a/website/docs/r/ocvp_esxi_host.html.markdown +++ b/website/docs/r/ocvp_esxi_host.html.markdown @@ -58,7 +58,7 @@ The following arguments are supported: * `compute_availability_domain` - (Optional) The availability domain to create the ESXi host in. If keep empty, for AD-specific Cluster, new ESXi host will be created in the same availability domain; for multi-AD Cluster, new ESXi host will be auto assigned to the next availability domain following evenly distribution strategy. * `current_sku` - (**Deprecated**) (Optional) The billing option currently used by the ESXi host. It is only effective during resource creation. Changes to its value after creation will be ignored. [ListSupportedSkus](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/SupportedSkuSummary/ListSupportedSkus). **Deprecated**. Please use `current_commitment` instead. * `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). Example: `{"Operations.CostCenter": "42"}` -* `display_name` - (Optional) (Updatable) A descriptive name for the ESXi host. It's changeable. Esxi Host name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the Cluster. +* `display_name` - (Optional) (Updatable) A descriptive name for the ESXi host. It's changeable. Esxi Host name requirements are 1-25 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the Cluster. If this attribute is not specified, the Cluster's `instanceDisplayNamePrefix` attribute is used to name and incrementally number the ESXi host. For example, if you're creating the fourth ESXi host in the Cluster, and `instanceDisplayNamePrefix` is `MyCluster`, the host's display name is `MyCluster-4`. @@ -87,6 +87,13 @@ The following attributes are exported: * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the Cluster. * `compute_availability_domain` - The availability domain of the ESXi host. * `compute_instance_id` - In terms of implementation, an ESXi host is a Compute instance that is configured with the chosen bundle of VMware software. The `computeInstanceId` is the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of that Compute instance. +* `datastore_attachments` - List of DatastoreAttachment objects containing information about attachment details + * `block_volume_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Block Volume that belongs to the datastore. + * `datastore_id` - The [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Datastore that ESXi host is attached to. + * `ip_address` - The IP address of datastore attachment. + * `port` - The port of datastore attachment. + * `volume_iqn` - An IQN of the Block Storage Volume. +* `datastore_cluster_ids` - A list of datastore clusters. * `current_commitment` - The billing option currently used by the ESXi host. [ListSupportedCommitments](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20230701/SupportedCommitmentSummary/ListSupportedCommitments). * `current_sku` - (**Deprecated**) The billing option currently used by the ESXi host. [ListSupportedSkus](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/SupportedSkuSummary/ListSupportedSkus). **Deprecated**. Please use `current_commitment` instead. * `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` diff --git a/website/docs/r/ocvp_sddc.html.markdown b/website/docs/r/ocvp_sddc.html.markdown index 1dc9d978fdb..ea4e5ebd8dc 100644 --- a/website/docs/r/ocvp_sddc.html.markdown +++ b/website/docs/r/ocvp_sddc.html.markdown @@ -50,6 +50,7 @@ resource "oci_ocvp_sddc" "test_sddc" { #Optional capacity_reservation_id = oci_ocvp_capacity_reservation.test_capacity_reservation.id + datastore_cluster_ids = var.sddc_initial_configuration_initial_cluster_configurations_datastore_cluster_ids datastores { #Required block_volume_ids = var.sddc_initial_configuration_initial_cluster_configurations_datastores_block_volume_ids @@ -108,10 +109,11 @@ The following arguments are supported: * `initial_cluster_configurations` - (Required) The configurations for Clusters initially created in the SDDC. * `capacity_reservation_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. * `compute_availability_domain` - (Required) The availability domain to create the Cluster's ESXi hosts in. For multi-AD Cluster deployment, set to `multi-AD`. + * `datastore_cluster_ids` - (Optional) A list of datastore clusters. * `datastores` - (Optional) A list of datastore info for the Cluster. This value is required only when `initialHostShapeName` is a standard shape. * `block_volume_ids` - (Required) A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. * `datastore_type` - (Required) Type of the datastore. - * `display_name` - (Optional) A descriptive name for the Cluster. Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. + * `display_name` - (Optional) A descriptive name for the Cluster. Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. * `esxi_hosts_count` - (Required) The number of ESXi hosts to create in the Cluster. You can add more hosts later (see [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost)). Creating a Cluster with a ESXi host count of 1 will be considered a single ESXi host Cluster. **Note:** If you later delete EXSi hosts from a production Cluster to total less than 3, you are still billed for the 3 minimum recommended ESXi hosts. Also, you cannot add more VMware workloads to the Cluster until it again has at least 3 ESXi hosts. @@ -242,10 +244,11 @@ The following attributes are exported: * `initial_cluster_configurations` - The configurations for Clusters initially created in the SDDC. * `capacity_reservation_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Capacity Reservation. * `compute_availability_domain` - The availability domain to create the Cluster's ESXi hosts in. For multi-AD Cluster deployment, set to `multi-AD`. + * `datastore_cluster_ids` - A list of datastore clusters. * `datastores` - A list of datastore info for the Cluster. This value is required only when `initialHostShapeName` is a standard shape. * `block_volume_ids` - A list of [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)s of Block Storage Volumes. * `datastore_type` - Type of the datastore. - * `display_name` - A descriptive name for the Cluster. Cluster name requirements are 1-16 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. + * `display_name` - A descriptive name for the Cluster. Cluster name requirements are 1-22 character length limit, Must start with a letter, Must be English letters, numbers, - only, No repeating hyphens, Must be unique within the region. Avoid entering confidential information. * `esxi_hosts_count` - The number of ESXi hosts to create in the Cluster. You can add more hosts later (see [CreateEsxiHost](https://docs.cloud.oracle.com/iaas/api/#/en/vmware/20200501/EsxiHost/CreateEsxiHost)). Creating a Cluster with a ESXi host count of 1 will be considered a single ESXi host Cluster. **Note:** If you later delete EXSi hosts from a production Cluster to total less than 3, you are still billed for the 3 minimum recommended ESXi hosts. Also, you cannot add more VMware workloads to the Cluster until it again has at least 3 ESXi hosts. diff --git a/website/docs/r/resource_analytics_monitored_region.html.markdown b/website/docs/r/resource_analytics_monitored_region.html.markdown new file mode 100644 index 00000000000..332346c8f86 --- /dev/null +++ b/website/docs/r/resource_analytics_monitored_region.html.markdown @@ -0,0 +1,65 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_monitored_region" +sidebar_current: "docs-oci-resource-resource_analytics-monitored_region" +description: |- + Provides the Monitored Region resource in Oracle Cloud Infrastructure Resource Analytics service +--- + +# oci_resource_analytics_monitored_region +This resource provides the Monitored Region resource in Oracle Cloud Infrastructure Resource Analytics service. + +Creates a MonitoredRegion. + + +## Example Usage + +```hcl +resource "oci_resource_analytics_monitored_region" "test_monitored_region" { + #Required + region_id = oci_identity_region.test_region.id + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `region_id` - (Required) The [Region Identifier](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm) of this MonitoredRegion. +* `resource_analytics_instance_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this MonitoredRegion. + + +** 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 + +## Attributes Reference + +The following attributes are exported: + +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the MonitoredRegion. +* `lifecycle_details` - A message that describes the current state of the MonitoredRegion in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `region_id` - The [Region Identifier](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/regions.htm) of this MonitoredRegion. +* `resource_analytics_instance_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this MonitoredRegion. +* `state` - The current state of the MonitoredRegion. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the MonitoredRegion was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the MonitoredRegion was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + +## Timeouts + +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 Monitored Region + * `update` - (Defaults to 20 minutes), when updating the Monitored Region + * `delete` - (Defaults to 20 minutes), when destroying the Monitored Region + + +## Import + +MonitoredRegions can be imported using the `id`, e.g. + +``` +$ terraform import oci_resource_analytics_monitored_region.test_monitored_region "id" +``` + diff --git a/website/docs/r/resource_analytics_resource_analytics_instance.html.markdown b/website/docs/r/resource_analytics_resource_analytics_instance.html.markdown new file mode 100644 index 00000000000..b6b92457d46 --- /dev/null +++ b/website/docs/r/resource_analytics_resource_analytics_instance.html.markdown @@ -0,0 +1,98 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_resource_analytics_instance" +sidebar_current: "docs-oci-resource-resource_analytics-resource_analytics_instance" +description: |- + Provides the Resource Analytics Instance resource in Oracle Cloud Infrastructure Resource Analytics service +--- + +# oci_resource_analytics_resource_analytics_instance +This resource provides the Resource Analytics Instance resource in Oracle Cloud Infrastructure Resource Analytics service. + +Creates a ResourceAnalyticsInstance. + + +## Example Usage + +```hcl +resource "oci_resource_analytics_resource_analytics_instance" "test_resource_analytics_instance" { + #Required + adw_admin_password { + #Required + password_type = var.resource_analytics_instance_adw_admin_password_password_type + + #Optional + password = var.resource_analytics_instance_adw_admin_password_password + secret_id = oci_vault_secret.test_secret.id + } + compartment_id = var.compartment_id + subnet_id = oci_core_subnet.test_subnet.id + + #Optional + defined_tags = {"Operations.CostCenter"= "42"} + description = var.resource_analytics_instance_description + display_name = var.resource_analytics_instance_display_name + freeform_tags = {"Department"= "Finance"} + is_mutual_tls_required = var.resource_analytics_instance_is_mutual_tls_required + license_model = var.resource_analytics_instance_license_model + nsg_ids = var.resource_analytics_instance_nsg_ids +} +``` + +## Argument Reference + +The following arguments are supported: + +* `adw_admin_password` - (Required) Details for the ADW Admin password. Password can be passed as `VaultSecretPasswordDetails` or `PlainTextPasswordDetails`. Example: `{"passwordType":"PLAIN_TEXT","password":"..."}` Example: `{"passwordType":"VAULT_SECRET","secretId":"ocid..."}` + * `password` - (Required when password_type=PLAIN_TEXT) Password for the ADW to be created in User Tenancy. The password must be between 12 and 30 characters long, and must contain at least 1 uppercase, 1 lowercase, and 1 numeric character. It cannot contain the double quote symbol (") or the username "admin", regardless of casing. + * `password_type` - (Required) Password type + * `secret_id` - (Required when password_type=VAULT_SECRET) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the vault secret to use as the ADW admin password. +* `compartment_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the ResourceAnalyticsInstance in. +* `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). Example: `{"Operations.CostCenter": "42"}` +* `description` - (Optional) (Updatable) A description of the ResourceAnalyticsInstance instance. +* `display_name` - (Optional) (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. +* `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"}` +* `is_mutual_tls_required` - (Optional) Require mutual TLS (mTLS) when authenticating connections to the ADW database. +* `license_model` - (Optional) The Oracle license model that applies to the ADW instance. +* `nsg_ids` - (Optional) List of Network Security Group [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)'s. Example: `["ocid...", "ocid..."]` +* `subnet_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet the resource is associated with. + + +** 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 + +## Attributes Reference + +The following attributes are exported: + +* `adw_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the created ADW instance. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `defined_tags` - 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). Example: `{"Operations.CostCenter": "42"}` +* `description` - A description of the ResourceAnalyticsInstance instance. +* `display_name` - A user-friendly name. Does not have to be unique, and it's changeable. +* `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 ResourceAnalyticsInstance. +* `lifecycle_details` - A message that describes the current state of the ResourceAnalyticsInstance in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `oac_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OAC enabled for the ResourceAnalyticsInstance. +* `state` - The current state of the ResourceAnalyticsInstance. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the ResourceAnalyticsInstance was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the ResourceAnalyticsInstance was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + +## Timeouts + +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 Resource Analytics Instance + * `update` - (Defaults to 20 minutes), when updating the Resource Analytics Instance + * `delete` - (Defaults to 20 minutes), when destroying the Resource Analytics Instance + + +## Import + +ResourceAnalyticsInstances can be imported using the `id`, e.g. + +``` +$ terraform import oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance "id" +``` + diff --git a/website/docs/r/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management.html.markdown b/website/docs/r/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management.html.markdown new file mode 100644 index 00000000000..d5f625f1d08 --- /dev/null +++ b/website/docs/r/resource_analytics_resource_analytics_instance_oac_on_resource_analytics_instances_management.html.markdown @@ -0,0 +1,69 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_resource_analytics_instance_oac_management" +sidebar_current: "docs-oci-resource-resource_analytics-resource_analytics_instance_oac_management" +description: |- + Provides the Resource Analytics Instance Oac Management resource in Oracle Cloud Infrastructure Resource Analytics service +--- + +# oci_resource_analytics_resource_analytics_instance_oac_management +This resource provides the Resource Analytics Instance Oac Management resource in Oracle Cloud Infrastructure Resource Analytics service. + +Attaches an OAC instance to a ResourceAnalyticsInstance. + + +## Example Usage + +```hcl +resource "oci_resource_analytics_resource_analytics_instance_oac_management" "test_resource_analytics_instance_oac_management" { + #Required + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id + enable_oac = var.enable_oac + + #Optional + attachment_details { + + #Optional + idcs_domain_id = oci_identity_domain.test_domain.id + license_model = var.resource_analytics_instance_oac_management_attachment_details_license_model + network_details { + + #Optional + subnet_id = oci_core_subnet.test_subnet.id + nsg_ids = var.resource_analytics_instance_oac_management_attachment_details_network_details_nsg_ids + } + } + attachment_type = var.resource_analytics_instance_oac_management_attachment_type +} +``` + +## Argument Reference + +The following arguments are supported: + +* `attachment_details` - (Optional) Additional details needed when attaching the OAC instance. Example: `{"idcsDomainId":"ocid...","networkDetails":{...}, ...}` + * `idcs_domain_id` - (Optional) IDCS domain [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) identifying a stripe and service administrator user. + * `license_model` - (Optional) The Oracle license model that applies to the OAC instance. + * `network_details` - (Optional) Details required when provisioning OAC on a private network. Example: `{"subnetId":"ocid...", ...}` + * `nsg_ids` - (Optional) List of Network Security Group [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)'s for the private network details. Example: `["ocid...", "ocid..."]` + * `subnet_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet for the private network details. +* `attachment_type` - (Optional) The type of attachment the OAC instance is using. +* `resource_analytics_instance_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance. +* `enable_oac` - (Required) (Updatable) A required field when set to `true` calls enable action and when set to `false` calls disable action. + + +** 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 + +## Attributes Reference + +The following attributes are exported: + + +## Timeouts + +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 Resource Analytics Instance Oac Management + * `update` - (Defaults to 20 minutes), when updating the Resource Analytics Instance Oac Management + * `delete` - (Defaults to 20 minutes), when destroying the Resource Analytics Instance Oac Management diff --git a/website/docs/r/resource_analytics_tenancy_attachment.html.markdown b/website/docs/r/resource_analytics_tenancy_attachment.html.markdown new file mode 100644 index 00000000000..1fa785c1542 --- /dev/null +++ b/website/docs/r/resource_analytics_tenancy_attachment.html.markdown @@ -0,0 +1,71 @@ +--- +subcategory: "Resource Analytics" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_resource_analytics_tenancy_attachment" +sidebar_current: "docs-oci-resource-resource_analytics-tenancy_attachment" +description: |- + Provides the Tenancy Attachment resource in Oracle Cloud Infrastructure Resource Analytics service +--- + +# oci_resource_analytics_tenancy_attachment +This resource provides the Tenancy Attachment resource in Oracle Cloud Infrastructure Resource Analytics service. + +Creates a TenancyAttachment. + + +## Example Usage + +```hcl +resource "oci_resource_analytics_tenancy_attachment" "test_tenancy_attachment" { + #Required + resource_analytics_instance_id = oci_resource_analytics_resource_analytics_instance.test_resource_analytics_instance.id + tenancy_id = oci_identity_tenancy.test_tenancy.id + + #Optional + description = var.tenancy_attachment_description +} +``` + +## Argument Reference + +The following arguments are supported: + +* `description` - (Optional) (Updatable) A description of the tenancy. +* `resource_analytics_instance_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this TenancyAttachment. +* `tenancy_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy associated with this TenancyAttachment. + + +** 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 + +## Attributes Reference + +The following attributes are exported: + +* `description` - A description of the tenancy. +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the TenancyAttachment. +* `is_reporting_tenancy` - Whether the tenancy is the tenancy used when creating Resource Analytics Instance. +* `lifecycle_details` - A message that describes the current state of the TenancyAttachment in more detail. For example, can be used to provide actionable information for a resource in the Failed state. +* `resource_analytics_instance_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ResourceAnalyticsInstance associated with this TenancyAttachment. +* `state` - The current state of the TenancyAttachment. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `tenancy_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the tenancy associated with this TenancyAttachment. +* `time_created` - The date and time the TenancyAttachment was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the TenancyAttachment was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339). Example: `2016-08-25T21:10:29.600Z` + +## Timeouts + +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 Tenancy Attachment + * `update` - (Defaults to 20 minutes), when updating the Tenancy Attachment + * `delete` - (Defaults to 20 minutes), when destroying the Tenancy Attachment + + +## Import + +TenancyAttachments can be imported using the `id`, e.g. + +``` +$ terraform import oci_resource_analytics_tenancy_attachment.test_tenancy_attachment "id" +``` + diff --git a/website/oci.erb b/website/oci.erb index b68bdd2aca5..7854cc7e947 100644 --- a/website/oci.erb +++ b/website/oci.erb @@ -5944,6 +5944,12 @@
  • oci_generative_ai_endpoints
  • +
  • + oci_generative_ai_generative_ai_private_endpoint +
  • +
  • + oci_generative_ai_generative_ai_private_endpoints +
  • oci_generative_ai_model
  • @@ -5961,6 +5967,9 @@
  • oci_generative_ai_endpoint
  • +
  • + oci_generative_ai_generative_ai_private_endpoint +
  • oci_generative_ai_model
  • @@ -8179,6 +8188,48 @@ + > + Multicloud + + > MySQL Database + > + Resource Analytics + + > Resource Manager