diff --git a/CHANGELOG.md b/CHANGELOG.md index f2e5126efc4..8c7978557bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 5.15.0 (October 04, 2023) + +### Added +- Support for [ADB-S] Elastic Resource Pools +- Support for Private Cloud at Customer +- Support for External KMS +- Support for Support FSS as transfer medium for Datapump export/import +- Support for Update Replica in MySQL Heatwave Service +- Support for Private Endpoints in Data Science Notebook Sessions +- queue API changes for queue channels +### Bug Fix +- Unset policy field from filesystem changes + ## 5.14.0 (September 26, 2023) ### Added diff --git a/examples/README.md b/examples/README.md index 87d9919e662..4a42ad5278c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -47,6 +47,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/cloudguard.zip) - compute [![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/compute.zip) +- computecloudatcustomer + [![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/computecloudatcustomer.zip) - computeinstanceagent [![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/computeinstanceagent.zip) - concepts diff --git a/examples/computecloudatcustomer/README.md b/examples/computecloudatcustomer/README.md new file mode 100644 index 00000000000..d1fc3ac4820 --- /dev/null +++ b/examples/computecloudatcustomer/README.md @@ -0,0 +1,6 @@ +# Overview +This is a Terraform configuration that creates the `computecloudatcustomer` 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/computecloudatcustomer.zip) \ No newline at end of file diff --git a/examples/computecloudatcustomer/ccc_infrastructure_example/ccc_infrastructure.tf b/examples/computecloudatcustomer/ccc_infrastructure_example/ccc_infrastructure.tf new file mode 100644 index 00000000000..1209b238e0f --- /dev/null +++ b/examples/computecloudatcustomer/ccc_infrastructure_example/ccc_infrastructure.tf @@ -0,0 +1,137 @@ +// Copyright (c) 2017, 2023, 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 "ccc_infrastructure_access_level" { + default = "RESTRICTED" +} + +variable "ccc_infrastructure_compartment_id_in_subtree" { + default = false +} + +variable "ccc_infrastructure_connection_details" { + default = "connectionDetails" +} + +variable "ccc_infrastructure_connection_state" { + default = "REJECT" +} + +variable "ccc_infrastructure_defined_tags_value" { + default = "value" +} + +variable "ccc_infrastructure_description" { + default = "Datacenter 231" +} + +variable "ccc_infrastructure_display_name" { + default = "example_cccInfrastructure" +} + +variable "ccc_infrastructure_display_name_contains" { + default = "displayNameContains" +} + +variable "ccc_infrastructure_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "ccc_infrastructure_state" { + default = "ACTIVE" +} + + + +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 +} + +resource "oci_compute_cloud_at_customer_ccc_upgrade_schedule" "test_ccc_upgrade_schedule" { +compartment_id = var.compartment_id +display_name = "example_cccUpgradeSchedule" +events { +description = "description" +schedule_event_duration = "PT49H" +schedule_event_recurrences = "FREQ=MONTHLY;INTERVAL=3;" +time_start = "2023-09-09T16:10:25Z" +} +} + +resource "oci_core_vcn" "test_vcn" { +cidr_block = "10.0.0.0/16" +compartment_id = var.compartment_id +lifecycle { +ignore_changes = ["defined_tags"] +} +} + +resource "oci_core_subnet" "test_subnet" { +cidr_block = "10.0.0.0/24" +compartment_id = var.compartment_id +lifecycle { +ignore_changes = ["defined_tags"] +} +vcn_id = oci_core_vcn.test_vcn.id +} + +variable defined_tag_namespace_name { default = "" } +resource "oci_identity_tag_namespace" "tag-namespace1" { + #Required + compartment_id = var.compartment_id + description = "example tag namespace" + name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}" + + is_retired = false + lifecycle { + ignore_changes = [] + } +} + +resource "oci_identity_tag" "tag1" { + #Required + description = "example tag" + name = "example-tag" + tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id + + is_retired = false +} + +resource "oci_compute_cloud_at_customer_ccc_infrastructure" "test_ccc_infrastructure" { + #Required + compartment_id = var.compartment_id + display_name = var.ccc_infrastructure_display_name + subnet_id = oci_core_subnet.test_subnet.id + + #Optional + ccc_upgrade_schedule_id = oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id + connection_details = var.ccc_infrastructure_connection_details + connection_state = var.ccc_infrastructure_connection_state + defined_tags = map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", var.ccc_infrastructure_defined_tags_value) + description = var.ccc_infrastructure_description + freeform_tags = var.ccc_infrastructure_freeform_tags +} + +data "oci_compute_cloud_at_customer_ccc_infrastructures" "test_ccc_infrastructures" { + + #Optional + access_level = var.ccc_infrastructure_access_level + ccc_infrastructure_id = oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure.id + compartment_id = var.compartment_id + compartment_id_in_subtree = var.ccc_infrastructure_compartment_id_in_subtree + display_name = var.ccc_infrastructure_display_name + display_name_contains = var.ccc_infrastructure_display_name_contains + state = var.ccc_infrastructure_state +} + diff --git a/examples/computecloudatcustomer/ccc_upgrade_schedule_example/ccc_upgrade_schedule.tf b/examples/computecloudatcustomer/ccc_upgrade_schedule_example/ccc_upgrade_schedule.tf new file mode 100644 index 00000000000..1f806f772a5 --- /dev/null +++ b/examples/computecloudatcustomer/ccc_upgrade_schedule_example/ccc_upgrade_schedule.tf @@ -0,0 +1,119 @@ +// Copyright (c) 2017, 2023, 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 "ccc_upgrade_schedule_access_level" { + default = "RESTRICTED" +} + +variable "ccc_upgrade_schedule_compartment_id_in_subtree" { + default = false +} + +variable "ccc_upgrade_schedule_defined_tags_value" { + default = "value" +} + +variable "ccc_upgrade_schedule_description" { + default = "Month-start upgrade window" +} + +variable "ccc_upgrade_schedule_display_name" { + default = "example_cccUpgradeSchedule" +} + +variable "ccc_upgrade_schedule_display_name_contains" { + default = "displayNameContains" +} + +variable "ccc_upgrade_schedule_events_description" { + default = "Month-start upgrade window" +} + +variable "ccc_upgrade_schedule_events_schedule_event_duration" { + default = "P2DT6H" +} + +variable "ccc_upgrade_schedule_events_schedule_event_recurrences" { + default = "FREQ=MONTHLY;INTERVAL=1;BYMONTHDAY=1" +} + +variable "ccc_upgrade_schedule_events_time_start" { + default = "2024-01-25T22:00:00Z" +} + +variable "ccc_upgrade_schedule_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "ccc_upgrade_schedule_state" { + default = "ACTIVE" +} + + + +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 +} + +variable defined_tag_namespace_name { default = "" } +resource "oci_identity_tag_namespace" "tag-namespace1" { + #Required + compartment_id = var.compartment_id + description = "example tag namespace" + name = "${var.defined_tag_namespace_name != "" ? var.defined_tag_namespace_name : "example-tag-namespace-all"}" + + is_retired = false +} + +resource "oci_identity_tag" "tag1" { + #Required + description = "example tag" + name = "example-tag" + tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id + + is_retired = false +} + +resource "oci_compute_cloud_at_customer_ccc_upgrade_schedule" "test_ccc_upgrade_schedule" { + #Required + compartment_id = var.compartment_id + display_name = var.ccc_upgrade_schedule_display_name + events { + #Required + description = var.ccc_upgrade_schedule_events_description + schedule_event_duration = var.ccc_upgrade_schedule_events_schedule_event_duration + time_start = var.ccc_upgrade_schedule_events_time_start + + #Optional + schedule_event_recurrences = var.ccc_upgrade_schedule_events_schedule_event_recurrences + } + + #Optional + defined_tags = map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", var.ccc_upgrade_schedule_defined_tags_value) + description = var.ccc_upgrade_schedule_description + freeform_tags = var.ccc_upgrade_schedule_freeform_tags +} + +data "oci_compute_cloud_at_customer_ccc_upgrade_schedules" "test_ccc_upgrade_schedules" { + + #Optional + access_level = var.ccc_upgrade_schedule_access_level + ccc_upgrade_schedule_id = oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id + compartment_id = var.compartment_id + compartment_id_in_subtree = var.ccc_upgrade_schedule_compartment_id_in_subtree + display_name = var.ccc_upgrade_schedule_display_name + display_name_contains = var.ccc_upgrade_schedule_display_name_contains + state = var.ccc_upgrade_schedule_state +} + diff --git a/examples/computecloudatcustomer/description.md b/examples/computecloudatcustomer/description.md new file mode 100644 index 00000000000..0d97c7fb42e --- /dev/null +++ b/examples/computecloudatcustomer/description.md @@ -0,0 +1,4 @@ +# Overview +This is a Terraform configuration that creates the `computecloudatcustomer` 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/databasemigration/migration/migration.tf b/examples/databasemigration/migration/migration.tf index 2737969b742..52bf6e4b56b 100644 --- a/examples/databasemigration/migration/migration.tf +++ b/examples/databasemigration/migration/migration.tf @@ -237,6 +237,9 @@ resource "oci_database_migration_migration" "test_migration" { namespace = "namespace" } } + data_transfer_medium_details_v2 { + type = "NFS" + } datapump_settings { export_directory_object { name = "test_export_dir" diff --git a/examples/datascience/notebook/main.tf b/examples/datascience/notebook/main.tf index 85fdb76de03..1639f6d1ae0 100644 --- a/examples/datascience/notebook/main.tf +++ b/examples/datascience/notebook/main.tf @@ -99,57 +99,6 @@ data "oci_datascience_notebook_sessions" "tf_notebook_sessions" { #state = var.notebook_session_state } -variable "content_disposition" { -} -variable "model_defined_tags" { -} -variable "model_description" { -} -variable "model_display_name" { -} -variable "model_freeform_tag" { -} - -resource "oci_datascience_model" "tf_model" { - #Required - artifact_content_length = var.artifact_content_length - model_artifact = "${path.root}/artifact.zip" - compartment_id = var.compartment_ocid - project_id = oci_datascience_project.tf_project.id - #Optional - #defined_tags = {"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "${var.model_defined_tags_value}"} - artifact_content_disposition = var.content_disposition - description = var.model_description - display_name = var.model_display_name -} - -data "oci_datascience_models" "tf_models" { - #Required - compartment_id = var.compartment_ocid - #Optional - #created_by = var.model_created_by - #display_name = var.model_display_name - #id = var.model_id - #project_id = oci_datascience_project.tf_project.id - #state = var.model_state -} - -resource "oci_datascience_model_provenance" "tf_model_provenance" { - #Required - model_id = oci_datascience_model.tf_model.id - #Optional - #git_branch = var.model_provenance_git_branch - #git_commit = var.model_provenance_git_commit - #repository_url = var.model_provenance_repository_url - #script_dir = var.model_provenance_script_dir - #training_script = var.model_provenance_training_script -} - -data "oci_datascience_model_provenance" "tf_model_provenance" { - #Required - model_id = oci_datascience_model.tf_model.id -} - resource "oci_core_subnet" "tf_subnet" { cidr_block = "10.0.1.0/24" compartment_id = var.compartment_ocid diff --git a/examples/kms/ekm/ExternalKey.tf b/examples/kms/ekm/ExternalKey.tf new file mode 100644 index 00000000000..05cbd29257a --- /dev/null +++ b/examples/kms/ekm/ExternalKey.tf @@ -0,0 +1,36 @@ + +variable "display_name" { + default = "ext-key-tf-example" +} + + +variable "key_key_shape_algorithm" { + default = "AES" +} + +variable "key_key_shape_length" { + default = 32 +} + +variable "external_key_id" { + default = "f3cf68ae-659c-4e9e-8be7-ee39fa9ffa3c" +} + +resource "oci_kms_key" "test_key" { + #Required + compartment_id = var.compartment_ocid + display_name = var.display_name + management_endpoint = "avsnmg6paahhm-management.kms.r1.oracleiaas.com" + protection_mode = "EXTERNAL" + + key_shape { + #Required + algorithm = var.key_key_shape_algorithm + length = var.key_key_shape_length + } + + external_key_reference { + external_key_id = var.external_key_id + } + +} \ No newline at end of file diff --git a/examples/kms/ekm/ExternalVault.tf b/examples/kms/ekm/ExternalVault.tf new file mode 100644 index 00000000000..59f04f2a40f --- /dev/null +++ b/examples/kms/ekm/ExternalVault.tf @@ -0,0 +1,42 @@ +variable "vault_display_name" { + default = "Tf-ext-vault-ex" +} + +variable "vault_type" { + default = "EXTERNAL" +} + +variable "external_vault_endpoint_url" { + default = "https://10.0.0.31/api/v1/cckm/oci/ekm/v1/vaults/af872d6e-52f2-4c6b-9694-5b4821d1b5b6" +} + +variable "client_app_id" { + default = "3977f2b65fca4c569f31142959867127" +} + +variable "client_app_secret" { + default = "d82452e5-f5e3-4363-b7a9-0d74052d1236" +} + +variable "idcs_account_name_url" { + default = "https://idcs-87920edcd339458790351b0e4d415385.identity.oraclecloud.com" +} + +variable "private_endpoint_id" { +} + +resource "oci_kms_vault" "external-vault-kms" { + compartment_id = var.compartment_ocid + display_name = var.vault_display_name + vault_type = var.vault_type + + external_key_manager_metadata { + external_vault_endpoint_url = var.external_vault_endpoint_url + private_endpoint_id = var.private_endpoint_id + oauth_metadata { + client_app_id = var.client_app_id + client_app_secret = var.client_app_secret + idcs_account_name_url = var.idcs_account_name_url + } + } +} \ No newline at end of file diff --git a/examples/kms/ekm/keyVersion.tf b/examples/kms/ekm/keyVersion.tf new file mode 100644 index 00000000000..b07dd66083c --- /dev/null +++ b/examples/kms/ekm/keyVersion.tf @@ -0,0 +1,6 @@ +resource "oci_kms_key_version" "test_key_version" { + #Required + key_id = oci_kms_key.test_key.id + management_endpoint = "avsnmg6paahhm-management.kms.r1.oracleiaas.com" + external_key_version_id = var.ext_key_version_id +} \ No newline at end of file diff --git a/examples/kms/ekm/pe.tf b/examples/kms/ekm/pe.tf new file mode 100644 index 00000000000..3a00edf1d6e --- /dev/null +++ b/examples/kms/ekm/pe.tf @@ -0,0 +1,21 @@ +variable "ekms_subnet_id" { +} + +variable "displayName" { + default = "TF-PE" +} + +variable "externalKeyManagerIp" { + default = "10.0.0.31" +} + +variable "ekms_ca_bundle" { +} + +resource "oci_kms_ekms_private_endpoint" "tf_example_pe" { + subnet_id = var.ekms_subnet_id + compartment_id = var.compartment_ocid + display_name = var.displayName + external_key_manager_ip = var.externalKeyManagerIp + ca_bundle = var.ekms_ca_bundle +} \ No newline at end of file diff --git a/examples/kms/ekm/variable.tf b/examples/kms/ekm/variable.tf new file mode 100644 index 00000000000..c892bfa3563 --- /dev/null +++ b/examples/kms/ekm/variable.tf @@ -0,0 +1,32 @@ +variable "tenancy_ocid" { +} + +variable "user_ocid" { +} + +variable "fingerprint" { +} + +variable "private_key_path" { +} + +variable "region" { +} + +variable "compartment_ocid" { +} + +variable "ext_vault" { +} + +variable "ext_key_version_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 +} \ No newline at end of file diff --git a/examples/kms/key.tf b/examples/kms/key.tf index 62525bb00d6..bf36393670c 100644 --- a/examples/kms/key.tf +++ b/examples/kms/key.tf @@ -12,38 +12,7 @@ resource "oci_kms_key" "test_key" { algorithm = var.key_key_shape_algorithm length = var.key_key_shape_length } - //If using object to restore a key use below - /*restore_from_object_store { - bucket = data.oci_objectstorage_object.key_backup_object.bucket - destination = var.destination[0] - namespace = data.oci_objectstorage_object.key_backup_object.namespace - object = data.oci_objectstorage_object.key_backup_object.object - }*/ - //If using Pre-authenticated-request to restore a key use below - /*restore_from_object_store { - destination = var.destination[1] - uri = data.oci_objectstorage_preauthrequest.key_backup_preauthenticated_request - }*/ - - //If using file stored in object storage to restore a key use below - /*restore_from_file { - //Required - restore_key_from_file_details = data.oci_objectstorage_object.key_backup_object.content - content_length = data.oci_objectstorage_object.key_backup_object.content_length - - //Optional - content_md5 = data.oci_objectstorage_object.key_backup_object.content_md5 - }*/ - - //Flip the trigger when restore operation on key needs to be performed - //restore_trigger = var.key_restore_trigger } -// Commented out key version resource to avoid failed to destroy in-use kv error -//resource "oci_kms_key_version" "test_key_version" { -// #Required -// key_id = oci_kms_key.test_key.id -// management_endpoint = data.oci_kms_vault.test_vault.management_endpoint -//} diff --git a/examples/kms/keyVersion.tf b/examples/kms/keyVersion.tf new file mode 100644 index 00000000000..d5d731aa7d4 --- /dev/null +++ b/examples/kms/keyVersion.tf @@ -0,0 +1,5 @@ +resource "oci_kms_key_version" "test_key_version" { + #Required + key_id = oci_kms_key.test_key.id + management_endpoint = data.oci_kms_vault.test_vault.management_endpoint +} \ No newline at end of file diff --git a/examples/kms/variables.tf b/examples/kms/variables.tf index fbb32430470..08f284e9f12 100644 --- a/examples/kms/variables.tf +++ b/examples/kms/variables.tf @@ -107,4 +107,3 @@ variable "key_restore_trigger" { variable "vault_restore_trigger" { default = false } - diff --git a/examples/kms/vault.tf b/examples/kms/vault.tf index ee813838778..01ad035d8b0 100644 --- a/examples/kms/vault.tf +++ b/examples/kms/vault.tf @@ -1,44 +1,9 @@ resource "oci_kms_vault" "private-vault-kms" { - //If restoring using a pre-authenticated-uri use the config below - - /*restore_from_object_store { - bucket = data.oci_objectstorage_object.vault_backup_object.bucket - destination = var.destination[0] - namespace = data.oci_objectstorage_object.vault_backup_object.namespace - object = data.oci_objectstorage_object.vault_backup_object.object - }*/ - - //If restoring using a pre-authenticated-uri use the config below - - /*restore_from_object_store { - destination = var.destination[1] - uri = data.oci_objectstorage_preauthrequest.vault_backup_preauthenticated_request - }*/ - - //If restoring using object in object storage use the config below - - /*restore_from_file { - restore_vault_from_file_details = data.oci_objectstorage_object.vault_backup_object.content - content_length = data.oci_objectstorage_object.vault_backup_object.content_length - - //Optional - content_md5 = data.oci_objectstorage_object.vault_backup_object.content_md5 - }*/ compartment_id = var.compartment_id display_name = var.vault_display_name vault_type = var.vault_type[0] - //Flip the trigger when restore operation on vault needs to be performed - //restore_trigger = var.vault_restore_trigger } -// Use oci_kms_vault_replication to create, update and delete a replica of a vault. -// Currently only support virtual private vault. - -/*resource "oci_kms_vault_replication" "test_replica" { - # Required - vault_id = data.oci_kms_vault.test_vault.id - replica_region = var.destination_region -}*/ diff --git a/examples/mysql/replica/main.tf b/examples/mysql/replica/main.tf index 4f1adc3cdc4..6548f8256de 100644 --- a/examples/mysql/replica/main.tf +++ b/examples/mysql/replica/main.tf @@ -92,10 +92,15 @@ resource "oci_mysql_replica" "test_replica" { #Optional #defined_tags = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, "value") - description = "description" - display_name = "displayName" + description = "description" + display_name = "displayName" #freeform_tags = { "bar-key" = "value" } - is_delete_protected = false + is_delete_protected = false + replica_overrides { + configuration_id = data.oci_mysql_mysql_configurations.test_mysql_configurations.configurations[0].id + mysql_version = "8.1.0" + shape_name = "MySQL.VM.Standard.E3.4.64GB" + } } data "oci_mysql_replicas" "test_replicas" { diff --git a/examples/queue/main.tf b/examples/queue/main.tf index 6fb9f0d7c88..76acfc136ef 100644 --- a/examples/queue/main.tf +++ b/examples/queue/main.tf @@ -25,13 +25,11 @@ resource "oci_queue_queue" "test_queue1" { #Optional custom_encryption_key_id = var.queue_custom_encryption_key_id # We can have dependency on the oci_kms_key and get the key id from that dead_letter_queue_delivery_count = var.queue_dead_letter_queue_delivery_count - defined_tags = { - "${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = var.queue_defined_tags_value - } freeform_tags = var.queue_freeform_tags retention_in_seconds = var.queue_retention_in_seconds timeout_in_seconds = var.queue_timeout_in_seconds visibility_in_seconds = var.queue_visibility_in_seconds + channel_consumption_limit = var.queue_channel_consumption_limit } # Purging the queue immediately after create if requried. We are using the purge queue optional parameter diff --git a/examples/queue/variables.tf b/examples/queue/variables.tf index a79f81b1399..7af3d15c990 100644 --- a/examples/queue/variables.tf +++ b/examples/queue/variables.tf @@ -44,4 +44,8 @@ variable "queue_timeout_in_seconds" { variable "queue_visibility_in_seconds" { default = 10 +} + +variable "queue_channel_consumption_limit" { + default = 10 } \ No newline at end of file diff --git a/examples/zips/adm.zip b/examples/zips/adm.zip index 91ccc580295..ed797a030d1 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 e75fafc7e52..b65d7871e97 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 b2ac1819eb7..e3ec30eb4b0 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 24328a43ef1..d43e38af618 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 ca9fa269a58..6a00b196063 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 2f4611fd723..d1e9a094d43 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 06d4bcca25d..539533876d7 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 f049d128d18..0b744bdb91a 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 9c661267410..bceed605ef2 100644 Binary files a/examples/zips/api_gateway.zip and b/examples/zips/api_gateway.zip differ diff --git a/examples/zips/apm.zip b/examples/zips/apm.zip index 659514dabc9..ce05bc5ad41 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 c887149e91d..3d3dad94cb0 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 f46bdf3bf7f..a746317f679 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 87815bfd8bf..ede7603b345 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 3de9ea90e67..aea9a9585ae 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 63ab3ad02d9..03f3ef96a98 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 19f416e6a2f..f2ac9fa176a 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 e4c2d6f4719..7a4a50b9ab7 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 97c40d59a98..caac1a52550 100644 Binary files a/examples/zips/budget.zip and b/examples/zips/budget.zip differ diff --git a/examples/zips/certificatesManagement.zip b/examples/zips/certificatesManagement.zip index 474edbb494f..52873226086 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 58f9a4e65b7..2f3aa06eb3a 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 fc525fa51da..7d5de1356e2 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 9191046686b..2d8cf2fd9db 100644 Binary files a/examples/zips/cloudguard.zip and b/examples/zips/cloudguard.zip differ diff --git a/examples/zips/compute.zip b/examples/zips/compute.zip index 46425c7d000..3c85d9750fa 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 new file mode 100644 index 00000000000..1d43a18ddf2 Binary files /dev/null and b/examples/zips/computecloudatcustomer.zip differ diff --git a/examples/zips/computeinstanceagent.zip b/examples/zips/computeinstanceagent.zip index 2575a85dabb..30dd98a29d5 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 525337919d2..10cd8b98b4d 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 e01cb672380..8363d2ccf98 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 c42d8d6b6f8..bc6ae34ce65 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 6f56e1d1291..ff7cb0504b1 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 f5012e3b7c2..873d623988d 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 bf9fae231bc..6623720cb61 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 8be1a814014..0ee67831d7d 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 9eb3b5f897e..7bf46707df6 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 407d22c4340..d4004bd4b92 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 bc5e3062c58..65494620914 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 7e4567778dc..b4382448101 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 efc2c7fde76..e796cef92f6 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 7cb42fa830e..cabe2151955 100644 Binary files a/examples/zips/datascience.zip and b/examples/zips/datascience.zip differ diff --git a/examples/zips/devops.zip b/examples/zips/devops.zip index a177126be0c..2b0a615ca60 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 ab8b7ada821..cdd6c8aa723 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 62e42ef02fb..e1dd42e3ec0 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 307f741e73a..cb93fd79c93 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 8a35fe03722..257856ffdf0 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 8bda09f2dea..22491c8209f 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 e4e2705e019..03606feae05 100644 Binary files a/examples/zips/fast_connect.zip and b/examples/zips/fast_connect.zip differ diff --git a/examples/zips/functions.zip b/examples/zips/functions.zip index c0b6e22b9a4..345ab225128 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 68f962059cd..f15d238faaf 100644 Binary files a/examples/zips/fusionapps.zip and b/examples/zips/fusionapps.zip differ diff --git a/examples/zips/goldengate.zip b/examples/zips/goldengate.zip index 4a4c9a6fbe7..adcf9016513 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 713e437749a..0dab8e9ed6c 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 5e72a42d95f..e88ae09faec 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 8872aefb6d4..6746cbc9156 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 862d8d58ab9..7568e26614d 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 846bf1d0dec..d27fc3e059d 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 4daa916f5a9..3de57a2edb0 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 04db7668a11..349dcc7d094 100644 Binary files a/examples/zips/jms.zip and b/examples/zips/jms.zip differ diff --git a/examples/zips/kms.zip b/examples/zips/kms.zip index 82c241ce045..f08a95d61a1 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 7a85cbeee6d..70d4cfeedb2 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 be2bc423cd7..e654bf5cdc2 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 3fdaf16aeff..99af00cb390 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 a29bfce8106..138741737bc 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 6f9d98d8286..9eac93461ec 100644 Binary files a/examples/zips/logging.zip and b/examples/zips/logging.zip differ diff --git a/examples/zips/management_agent.zip b/examples/zips/management_agent.zip index 82c615ddb12..1cdbd0802ba 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 5c1c7364370..03560dd8ab0 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 147aa97f1f2..da4c752131b 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 de7c5d199a1..6a37cf68aca 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 3bdb3f484e5..78700055460 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 d88a90074ef..0ac997bbc84 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 b8fe7875893..6bf5ba6e16e 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 ec846c11a25..8acee61fc39 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 fd12c3d6614..da6d24dfa67 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 4a009f62c18..bef6e0345c5 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 e90d2cf200c..3c78405d00b 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 80800fc2e92..7c6fcecf8cd 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 925f8f46e65..eb7ce3b7d6e 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 a72e4a0046c..86dac52a9a7 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 22d773f898f..6dd20f39e92 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 b4e95cf8672..8526209ee91 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 37b6384aee5..378f6168002 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 addccfa4e87..172aa5b190f 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 b160fcbb912..6b0b7e8de26 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 128a072319f..fb5f115b803 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 1ebb2118165..8f28b2bf9f2 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 5bbd2b4052b..e7c4b9496bf 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 df8b383d75b..a5c6a1313d4 100644 Binary files a/examples/zips/oracle_digital_assistant.zip and b/examples/zips/oracle_digital_assistant.zip differ diff --git a/examples/zips/osmanagement.zip b/examples/zips/osmanagement.zip index 1ed6dce4251..ee6d2c2faf4 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 9ebdd35062a..263edec5bbf 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 6d65881d3c3..91746473779 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 415ce650de8..9e5de0839d8 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 69fc4c214a8..7849c2788d8 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 02c895bd5f5..29374cd4f9f 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 8011996dd1a..b905e6c113e 100644 Binary files a/examples/zips/pic.zip and b/examples/zips/pic.zip differ diff --git a/examples/zips/queue.zip b/examples/zips/queue.zip index 1a6ba294c42..1d84f2415e0 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 c7983fd45e4..d02a272d9ee 100644 Binary files a/examples/zips/recovery.zip and b/examples/zips/recovery.zip differ diff --git a/examples/zips/resourcemanager.zip b/examples/zips/resourcemanager.zip index 643263fa7bf..39e811e0943 100644 Binary files a/examples/zips/resourcemanager.zip and b/examples/zips/resourcemanager.zip differ diff --git a/examples/zips/serviceManagerProxy.zip b/examples/zips/serviceManagerProxy.zip index 1ba8a781805..b5877565391 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 e1826375cfd..1490e4fc4ce 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 1356c28020d..62c3924524d 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 a52c3674e71..abf1a1d2762 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 f1b1bde1232..6ae0bc2752b 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 02d196fe61d..14878972750 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 5014817cf89..51525aa3e6f 100644 Binary files a/examples/zips/streaming.zip and b/examples/zips/streaming.zip differ diff --git a/examples/zips/usage_proxy.zip b/examples/zips/usage_proxy.zip index fb104d15dfb..60e3a24f3cb 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 9aeb8d80503..929fcde0f4d 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 a082bc85603..e6e6920b0f4 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 f945b24b62e..70b3fd0ffb0 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 69d15934df4..f4521154dd5 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 f99b07d7d42..dcc9f2bceaa 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 2351092b7d3..eaf685870da 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 3e6e59f6a38..3329d3d3337 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 01adeedb9e7..f3fd5b86886 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/go.mod b/go.mod index cd586b15582..ca050eb9adf 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/mitchellh/mapstructure v1.1.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect - github.com/oracle/oci-go-sdk/v65 v65.49.2 + github.com/oracle/oci-go-sdk/v65 v65.49.3 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sony/gobreaker v0.5.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect diff --git a/go.sum b/go.sum index df93e368c95..a1ef6f4f768 100644 --- a/go.sum +++ b/go.sum @@ -289,8 +289,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/oracle/oci-go-sdk/v65 v65.49.2 h1:optOfjGIVmZZMT3a/8ri/CVV1loDG0ab1p2tEpNW5ro= -github.com/oracle/oci-go-sdk/v65 v65.49.2/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.49.3 h1:HHv+XMZiBYHtoU8Ac/fURdp9v1vJPPCpIbJAWeadREw= +github.com/oracle/oci-go-sdk/v65 v65.49.3/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/internal/client/compute_cloud_at_customer_clients.go b/internal/client/compute_cloud_at_customer_clients.go new file mode 100644 index 00000000000..a7825d188d3 --- /dev/null +++ b/internal/client/compute_cloud_at_customer_clients.go @@ -0,0 +1,34 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package client + +import ( + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" +) + +func init() { + RegisterOracleClient("oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient", &OracleClient{InitClientFn: initComputecloudatcustomerComputeCloudAtCustomerClient}) +} + +func initComputecloudatcustomerComputeCloudAtCustomerClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_compute_cloud_at_customer.NewComputeCloudAtCustomerClientWithConfigurationProvider(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) ComputeCloudAtCustomerClient() *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient { + return m.GetClient("oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient").(*oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient) +} diff --git a/internal/client/kms_clients.go b/internal/client/kms_clients.go index 06e567cfbd7..0f48a34ced3 100644 --- a/internal/client/kms_clients.go +++ b/internal/client/kms_clients.go @@ -10,11 +10,32 @@ import ( ) func init() { + RegisterOracleClient("oci_kms.EkmClient", &OracleClient{InitClientFn: initKeymanagementEkmClient}) RegisterOracleClient("oci_kms.KmsCryptoClient", &OracleClient{InitClientFn: initKeymanagementKmsCryptoClient}) RegisterOracleClient("oci_kms.KmsManagementClient", &OracleClient{InitClientFn: initKeymanagementKmsManagementClient}) RegisterOracleClient("oci_kms.KmsVaultClient", &OracleClient{InitClientFn: initKeymanagementKmsVaultClient}) } +func initKeymanagementEkmClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_kms.NewEkmClientWithConfigurationProvider(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) EkmClient() *oci_kms.EkmClient { + return m.GetClient("oci_kms.EkmClient").(*oci_kms.EkmClient) +} + func initKeymanagementKmsCryptoClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { client, err := oci_kms.NewKmsCryptoClientWithConfigurationProvider(configProvider, "DUMMY_ENDPOINT") if err != nil { diff --git a/internal/globalvar/version.go b/internal/globalvar/version.go index 6a2f7fd7959..11506c185cb 100644 --- a/internal/globalvar/version.go +++ b/internal/globalvar/version.go @@ -7,8 +7,8 @@ import ( "log" ) -const Version = "5.14.0" -const ReleaseDate = "2023-09-27" +const Version = "5.15.0" +const ReleaseDate = "2023-10-04" func PrintVersion() { log.Printf("[INFO] terraform-provider-oci %s\n", Version) diff --git a/internal/integrationtest/compute_cloud_at_customer_ccc_infrastructure_test.go b/internal/integrationtest/compute_cloud_at_customer_ccc_infrastructure_test.go new file mode 100644 index 00000000000..b76c867e9b3 --- /dev/null +++ b/internal/integrationtest/compute_cloud_at_customer_ccc_infrastructure_test.go @@ -0,0 +1,375 @@ +// 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/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "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 ( + ComputeCloudAtCustomerCccInfrastructureRequiredOnlyResource = ComputeCloudAtCustomerCccInfrastructureResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccInfrastructureRepresentation) + + ComputeCloudAtCustomerCccInfrastructureResourceConfig = ComputeCloudAtCustomerCccInfrastructureResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccInfrastructureRepresentation) + + ComputeCloudAtCustomerCccInfrastructureSingularDataSourceRepresentation = map[string]interface{}{ + "ccc_infrastructure_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure.id}`}, + } + + ComputeCloudAtCustomerCccInfrastructureDataSourceRepresentation = map[string]interface{}{ + "access_level": acctest.Representation{RepType: acctest.Optional, Create: `RESTRICTED`}, + "ccc_infrastructure_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure.id}`}, + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `example_cccInfrastructure`, Update: `displayName2`}, + "display_name_contains": acctest.Representation{RepType: acctest.Optional, Create: `displayNameContains`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ComputeCloudAtCustomerCccInfrastructureDataSourceFilterRepresentation}} + ComputeCloudAtCustomerCccInfrastructureDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure.id}`}}, + } + + ComputeCloudAtCustomerCccInfrastructureRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `example_cccInfrastructure`, Update: `displayName2`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, + "ccc_upgrade_schedule_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id}`}, + "connection_details": acctest.Representation{RepType: acctest.Optional, Create: `connectionDetails`, Update: `connectionDetails2`}, + "connection_state": acctest.Representation{RepType: acctest.Optional, Create: `REJECT`, Update: `REJECT`}, + "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: `Datacenter 231`, Update: `description2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + } + + ComputeCloudAtCustomerCccInfrastructureResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure_def", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccInfrastructureRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation) + + 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: compute_cloud_at_customer/default +func TestComputeCloudAtCustomerCccInfrastructureResource_basic(t *testing.T) { + httpreplay.SetScenario("TestComputeCloudAtCustomerCccInfrastructureResource_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_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure" + // resourceNameDef := "oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure_default" + datasourceName := "data.oci_compute_cloud_at_customer_ccc_infrastructures.test_ccc_infrastructures" + singularDatasourceName := "data.oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure" + + 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+ComputeCloudAtCustomerCccInfrastructureResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Optional, acctest.Create, ComputeCloudAtCustomerCccInfrastructureRepresentation), "computecloudatcustomer", "cccInfrastructure", t) + + acctest.ResourceTest(t, testAccCheckComputeCloudAtCustomerCccInfrastructureDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + ComputeCloudAtCustomerCccInfrastructureResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccInfrastructureRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "example_cccInfrastructure"), + 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 + ComputeCloudAtCustomerCccInfrastructureResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + ComputeCloudAtCustomerCccInfrastructureResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Optional, acctest.Create, ComputeCloudAtCustomerCccInfrastructureRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "ccc_upgrade_schedule_id"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "connection_details", "connectionDetails"), + resource.TestCheckResourceAttr(resourceName, "connection_state", "REJECT"), + resource.TestCheckResourceAttr(resourceName, "description", "Datacenter 231"), + resource.TestCheckResourceAttr(resourceName, "display_name", "example_cccInfrastructure"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + 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 + }, + ), + }, + + // verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + ComputeCloudAtCustomerCccInfrastructureResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(ComputeCloudAtCustomerCccInfrastructureRepresentation, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "ccc_upgrade_schedule_id"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "connection_details", "connectionDetails"), + resource.TestCheckResourceAttr(resourceName, "connection_state", "REJECT"), + resource.TestCheckResourceAttr(resourceName, "description", "Datacenter 231"), + resource.TestCheckResourceAttr(resourceName, "display_name", "example_cccInfrastructure"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + ComputeCloudAtCustomerCccInfrastructureResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccInfrastructureRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "ccc_upgrade_schedule_id"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "connection_details", "connectionDetails2"), + resource.TestCheckResourceAttr(resourceName, "connection_state", "REJECT"), + resource.TestCheckResourceAttr(resourceName, "description", "description2"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + 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 + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructures", "test_ccc_infrastructures", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccInfrastructureDataSourceRepresentation) + + compartmentIdVariableStr + ComputeCloudAtCustomerCccInfrastructureResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccInfrastructureRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "access_level", "RESTRICTED"), + resource.TestCheckResourceAttrSet(datasourceName, "ccc_infrastructure_id"), + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "display_name_contains", "displayNameContains"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + + resource.TestCheckResourceAttr(datasourceName, "ccc_infrastructure_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "ccc_infrastructure_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_infrastructure", "test_ccc_infrastructure", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccInfrastructureSingularDataSourceRepresentation) + + compartmentIdVariableStr + ComputeCloudAtCustomerCccInfrastructureResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "ccc_infrastructure_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "connection_details", "connectionDetails2"), + resource.TestCheckResourceAttr(singularDatasourceName, "connection_state", "REJECT"), + resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_inventory.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_network_configuration.#", "1"), + // resource.TestCheckResourceAttrSet(singularDatasourceName, "provisioning_fingerprint"), + // resource.TestCheckResourceAttrSet(singularDatasourceName, "provisioning_pin"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "short_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + resource.TestCheckResourceAttr(singularDatasourceName, "upgrade_information.#", "1"), + ), + }, + // verify resource import + { + Config: config + ComputeCloudAtCustomerCccInfrastructureRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckComputeCloudAtCustomerCccInfrastructureDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).ComputeCloudAtCustomerClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_compute_cloud_at_customer_ccc_infrastructure" { + noResourceFound = false + request := oci_compute_cloud_at_customer.GetCccInfrastructureRequest{} + + tmp := rs.Primary.ID + request.CccInfrastructureId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "compute_cloud_at_customer") + + response, err := client.GetCccInfrastructure(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateDeleted): 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("ComputeCloudAtCustomerCccInfrastructure") { + resource.AddTestSweepers("ComputeCloudAtCustomerCccInfrastructure", &resource.Sweeper{ + Name: "ComputeCloudAtCustomerCccInfrastructure", + Dependencies: acctest.DependencyGraph["cccInfrastructure"], + F: sweepComputeCloudAtCustomerCccInfrastructureResource, + }) + } +} + +func sweepComputeCloudAtCustomerCccInfrastructureResource(compartment string) error { + computeCloudAtCustomerClient := acctest.GetTestClients(&schema.ResourceData{}).ComputeCloudAtCustomerClient() + cccInfrastructureIds, err := getComputeCloudAtCustomerCccInfrastructureIds(compartment) + if err != nil { + return err + } + for _, cccInfrastructureId := range cccInfrastructureIds { + if ok := acctest.SweeperDefaultResourceId[cccInfrastructureId]; !ok { + deleteCccInfrastructureRequest := oci_compute_cloud_at_customer.DeleteCccInfrastructureRequest{} + + deleteCccInfrastructureRequest.CccInfrastructureId = &cccInfrastructureId + + deleteCccInfrastructureRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "compute_cloud_at_customer") + _, error := computeCloudAtCustomerClient.DeleteCccInfrastructure(context.Background(), deleteCccInfrastructureRequest) + if error != nil { + fmt.Printf("Error deleting CccInfrastructure %s %s, It is possible that the resource is already deleted. Please verify manually \n", cccInfrastructureId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &cccInfrastructureId, ComputeCloudAtCustomerCccInfrastructureSweepWaitCondition, time.Duration(3*time.Minute), + ComputeCloudAtCustomerCccInfrastructureSweepResponseFetchOperation, "compute_cloud_at_customer", true) + } + } + return nil +} + +func getComputeCloudAtCustomerCccInfrastructureIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "CccInfrastructureId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + computeCloudAtCustomerClient := acctest.GetTestClients(&schema.ResourceData{}).ComputeCloudAtCustomerClient() + + listCccInfrastructuresRequest := oci_compute_cloud_at_customer.ListCccInfrastructuresRequest{} + listCccInfrastructuresRequest.CompartmentId = &compartmentId + listCccInfrastructuresRequest.LifecycleState = oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateActive + listCccInfrastructuresResponse, err := computeCloudAtCustomerClient.ListCccInfrastructures(context.Background(), listCccInfrastructuresRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting CccInfrastructure list for compartment id : %s , %s \n", compartmentId, err) + } + for _, cccInfrastructure := range listCccInfrastructuresResponse.Items { + id := *cccInfrastructure.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "CccInfrastructureId", id) + } + return resourceIds, nil +} + +func ComputeCloudAtCustomerCccInfrastructureSweepWaitCondition(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 cccInfrastructureResponse, ok := response.Response.(oci_compute_cloud_at_customer.GetCccInfrastructureResponse); ok { + return cccInfrastructureResponse.LifecycleState != oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateDeleted + } + return false +} + +func ComputeCloudAtCustomerCccInfrastructureSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.ComputeCloudAtCustomerClient().GetCccInfrastructure(context.Background(), oci_compute_cloud_at_customer.GetCccInfrastructureRequest{ + CccInfrastructureId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/compute_cloud_at_customer_ccc_upgrade_schedule_test.go b/internal/integrationtest/compute_cloud_at_customer_ccc_upgrade_schedule_test.go new file mode 100644 index 00000000000..5257881af5e --- /dev/null +++ b/internal/integrationtest/compute_cloud_at_customer_ccc_upgrade_schedule_test.go @@ -0,0 +1,383 @@ +// 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/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "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 ( + ComputeCloudAtCustomerCccUpgradeScheduleRequiredOnlyResource = ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation) + + ComputeCloudAtCustomerCccUpgradeScheduleResourceConfig = ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation) + + ComputeCloudAtCustomerCccUpgradeScheduleSingularDataSourceRepresentation = map[string]interface{}{ + "ccc_upgrade_schedule_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id}`}, + } + + ComputeCloudAtCustomerCccUpgradeScheduleDataSourceRepresentation = map[string]interface{}{ + "access_level": acctest.Representation{RepType: acctest.Optional, Create: `RESTRICTED`}, + "ccc_upgrade_schedule_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id}`}, + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `example_cccUpgradeSchedule`, Update: `displayName2`}, + "display_name_contains": acctest.Representation{RepType: acctest.Optional, Create: `displayNameContains`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ComputeCloudAtCustomerCccUpgradeScheduleDataSourceFilterRepresentation}} + ComputeCloudAtCustomerCccUpgradeScheduleDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id}`}}, + } + + ComputeCloudAtCustomerCccUpgradeScheduleRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `example_cccUpgradeSchedule`, Update: `displayName2`}, + "events": acctest.RepresentationGroup{RepType: acctest.Required, Group: ComputeCloudAtCustomerCccUpgradeScheduleEventsRepresentation}, + "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: `Month-start upgrade window`, Update: `description2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + } + + ComputeCloudAtCustomerCccUpgradeScheduleEventsRepresentation = map[string]interface{}{ + "description": acctest.Representation{RepType: acctest.Required, Create: `description`, Update: `description2`}, + "schedule_event_duration": acctest.Representation{RepType: acctest.Required, Create: `PT49H`, Update: `PT49H`}, + "time_start": acctest.Representation{RepType: acctest.Required, Create: `2023-09-09T16:10:25Z`, Update: `2023-09-09T16:10:25Z`}, + "schedule_event_recurrences": acctest.Representation{RepType: acctest.Required, Create: `FREQ=MONTHLY;INTERVAL=3;`, Update: `FREQ=MONTHLY;INTERVAL=3;`}, + } + + ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule_def", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation) + + DefinedTagsDependencies +) + +// issue-routing-tag: compute_cloud_at_customer/default +func TestComputeCloudAtCustomerCccUpgradeScheduleResource_basic(t *testing.T) { + httpreplay.SetScenario("TestComputeCloudAtCustomerCccUpgradeScheduleResource_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_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule" + datasourceName := "data.oci_compute_cloud_at_customer_ccc_upgrade_schedules.test_ccc_upgrade_schedules" + singularDatasourceName := "data.oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule" + + 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+ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Optional, acctest.Create, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation), "computecloudatcustomer", "cccUpgradeSchedule", t) + + acctest.ResourceTest(t, testAccCheckComputeCloudAtCustomerCccUpgradeScheduleDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "example_cccUpgradeSchedule"), + resource.TestCheckResourceAttr(resourceName, "events.#", "1"), + resource.TestCheckResourceAttr(resourceName, "events.0.description", "description"), + resource.TestCheckResourceAttr(resourceName, "events.0.schedule_event_duration", "PT49H"), + resource.TestCheckResourceAttr(resourceName, "events.0.time_start", "2023-09-09T16:10:25Z"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Optional, acctest.Create, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "Month-start upgrade window"), + resource.TestCheckResourceAttr(resourceName, "display_name", "example_cccUpgradeSchedule"), + resource.TestCheckResourceAttr(resourceName, "events.#", "1"), + resource.TestCheckResourceAttr(resourceName, "events.0.description", "description"), + resource.TestCheckResourceAttrSet(resourceName, "events.0.name"), + resource.TestCheckResourceAttr(resourceName, "events.0.schedule_event_duration", "PT49H"), + resource.TestCheckResourceAttr(resourceName, "events.0.schedule_event_recurrences", "FREQ=MONTHLY;INTERVAL=3;"), + resource.TestCheckResourceAttr(resourceName, "events.0.time_start", "2023-09-09T16:10:25Z"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + 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 Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(ComputeCloudAtCustomerCccUpgradeScheduleRepresentation, 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", "Month-start upgrade window"), + resource.TestCheckResourceAttr(resourceName, "display_name", "example_cccUpgradeSchedule"), + resource.TestCheckResourceAttr(resourceName, "events.#", "1"), + resource.TestCheckResourceAttr(resourceName, "events.0.description", "description"), + resource.TestCheckResourceAttrSet(resourceName, "events.0.name"), + resource.TestCheckResourceAttr(resourceName, "events.0.schedule_event_duration", "PT49H"), + resource.TestCheckResourceAttr(resourceName, "events.0.schedule_event_recurrences", "FREQ=MONTHLY;INTERVAL=3;"), + resource.TestCheckResourceAttr(resourceName, "events.0.time_start", "2023-09-09T16:10:25Z"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description2"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "events.#", "1"), + resource.TestCheckResourceAttr(resourceName, "events.0.description", "description2"), + resource.TestCheckResourceAttrSet(resourceName, "events.0.name"), + resource.TestCheckResourceAttr(resourceName, "events.0.schedule_event_duration", "PT49H"), + resource.TestCheckResourceAttr(resourceName, "events.0.schedule_event_recurrences", "FREQ=MONTHLY;INTERVAL=3;"), + resource.TestCheckResourceAttr(resourceName, "events.0.time_start", "2023-09-09T16:10:25Z"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + 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 + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedules", "test_ccc_upgrade_schedules", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccUpgradeScheduleDataSourceRepresentation) + + compartmentIdVariableStr + ComputeCloudAtCustomerCccUpgradeScheduleResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Optional, acctest.Update, ComputeCloudAtCustomerCccUpgradeScheduleRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "access_level", "RESTRICTED"), + resource.TestCheckResourceAttrSet(datasourceName, "ccc_upgrade_schedule_id"), + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "display_name_contains", "displayNameContains"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + + resource.TestCheckResourceAttr(datasourceName, "ccc_upgrade_schedule_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "ccc_upgrade_schedule_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_compute_cloud_at_customer_ccc_upgrade_schedule", "test_ccc_upgrade_schedule", acctest.Required, acctest.Create, ComputeCloudAtCustomerCccUpgradeScheduleSingularDataSourceRepresentation) + + compartmentIdVariableStr + ComputeCloudAtCustomerCccUpgradeScheduleResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "ccc_upgrade_schedule_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(singularDatasourceName, "events.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "events.0.description", "description2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "events.0.name"), + resource.TestCheckResourceAttr(singularDatasourceName, "events.0.schedule_event_duration", "PT49H"), + resource.TestCheckResourceAttr(singularDatasourceName, "events.0.schedule_event_recurrences", "FREQ=MONTHLY;INTERVAL=3;"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "events.0.time_start"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + // resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_ids.#", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // verify resource import + { + Config: config + ComputeCloudAtCustomerCccUpgradeScheduleRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckComputeCloudAtCustomerCccUpgradeScheduleDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).ComputeCloudAtCustomerClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_compute_cloud_at_customer_ccc_upgrade_schedule" { + noResourceFound = false + request := oci_compute_cloud_at_customer.GetCccUpgradeScheduleRequest{} + + tmp := rs.Primary.ID + request.CccUpgradeScheduleId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "compute_cloud_at_customer") + + response, err := client.GetCccUpgradeSchedule(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateDeleted): 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("ComputeCloudAtCustomerCccUpgradeSchedule") { + resource.AddTestSweepers("ComputeCloudAtCustomerCccUpgradeSchedule", &resource.Sweeper{ + Name: "ComputeCloudAtCustomerCccUpgradeSchedule", + Dependencies: acctest.DependencyGraph["cccUpgradeSchedule"], + F: sweepComputeCloudAtCustomerCccUpgradeScheduleResource, + }) + } +} + +func sweepComputeCloudAtCustomerCccUpgradeScheduleResource(compartment string) error { + computeCloudAtCustomerClient := acctest.GetTestClients(&schema.ResourceData{}).ComputeCloudAtCustomerClient() + cccUpgradeScheduleIds, err := getComputeCloudAtCustomerCccUpgradeScheduleIds(compartment) + if err != nil { + return err + } + for _, cccUpgradeScheduleId := range cccUpgradeScheduleIds { + if ok := acctest.SweeperDefaultResourceId[cccUpgradeScheduleId]; !ok { + deleteCccUpgradeScheduleRequest := oci_compute_cloud_at_customer.DeleteCccUpgradeScheduleRequest{} + + deleteCccUpgradeScheduleRequest.CccUpgradeScheduleId = &cccUpgradeScheduleId + + deleteCccUpgradeScheduleRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "compute_cloud_at_customer") + _, error := computeCloudAtCustomerClient.DeleteCccUpgradeSchedule(context.Background(), deleteCccUpgradeScheduleRequest) + if error != nil { + fmt.Printf("Error deleting CccUpgradeSchedule %s %s, It is possible that the resource is already deleted. Please verify manually \n", cccUpgradeScheduleId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &cccUpgradeScheduleId, ComputeCloudAtCustomerCccUpgradeScheduleSweepWaitCondition, time.Duration(3*time.Minute), + ComputeCloudAtCustomerCccUpgradeScheduleSweepResponseFetchOperation, "compute_cloud_at_customer", true) + } + } + return nil +} + +func getComputeCloudAtCustomerCccUpgradeScheduleIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "CccUpgradeScheduleId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + computeCloudAtCustomerClient := acctest.GetTestClients(&schema.ResourceData{}).ComputeCloudAtCustomerClient() + + listCccUpgradeSchedulesRequest := oci_compute_cloud_at_customer.ListCccUpgradeSchedulesRequest{} + listCccUpgradeSchedulesRequest.CompartmentId = &compartmentId + listCccUpgradeSchedulesRequest.LifecycleState = oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateActive + listCccUpgradeSchedulesResponse, err := computeCloudAtCustomerClient.ListCccUpgradeSchedules(context.Background(), listCccUpgradeSchedulesRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting CccUpgradeSchedule list for compartment id : %s , %s \n", compartmentId, err) + } + for _, cccUpgradeSchedule := range listCccUpgradeSchedulesResponse.Items { + id := *cccUpgradeSchedule.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "CccUpgradeScheduleId", id) + } + return resourceIds, nil +} + +func ComputeCloudAtCustomerCccUpgradeScheduleSweepWaitCondition(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 cccUpgradeScheduleResponse, ok := response.Response.(oci_compute_cloud_at_customer.GetCccUpgradeScheduleResponse); ok { + return cccUpgradeScheduleResponse.LifecycleState != oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateDeleted + } + return false +} + +func ComputeCloudAtCustomerCccUpgradeScheduleSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.ComputeCloudAtCustomerClient().GetCccUpgradeSchedule(context.Background(), oci_compute_cloud_at_customer.GetCccUpgradeScheduleRequest{ + CccUpgradeScheduleId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/database_autonomous_database_resource_test.go b/internal/integrationtest/database_autonomous_database_resource_test.go index 12582f98527..e0c0e94f178 100644 --- a/internal/integrationtest/database_autonomous_database_resource_test.go +++ b/internal/integrationtest/database_autonomous_database_resource_test.go @@ -307,6 +307,43 @@ var ( "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`, Update: `6.0`}, "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, }) + + autonomousDatabaseRepresentationRP = acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseRepresentation, []string{"cpu_core_count"}), map[string]interface{}{ + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`, Update: `6.0`}, + "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPSummaryRepresentation}, + }) + + DatabaseAutonomousDatabaseRPSummaryRepresentation = map[string]interface{}{ + "is_disabled": acctest.Representation{RepType: acctest.Required, Create: `false`, Update: `false`}, + "pool_size": acctest.Representation{RepType: acctest.Required, Create: `128`, Update: `256`}, + } + + DatabaseAutonomousDatabaseRPSummaryUpdateRepresentation = map[string]interface{}{ + "is_disabled": acctest.Representation{RepType: acctest.Required, Create: `false`, Update: `false`}, + "pool_size": acctest.Representation{RepType: acctest.Required, Create: `512`, Update: `1024`}, + } + + autonomousDatabaseRepresentationRPUpdate = acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseRepresentation, []string{"cpu_core_count"}), map[string]interface{}{ + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`, Update: `6.0`}, + "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPSummaryRepresentation}, + }) + + DatabaseAutonomousDatabaseRPDisableSummaryRepresentation = map[string]interface{}{ + "is_disabled": acctest.Representation{RepType: acctest.Required, Create: `true`, Update: `true`}, + } + DatabaseAutonomousDatabaseResourcePoolLeaderIdRepresentation = acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseRepresentation, []string{"cpu_core_count"}), map[string]interface{}{ + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `10.0`, Update: `10.0`}, + "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, + "resource_pool_leader_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_database.test_autonomous_database_leader.id}`, Update: ` `}, + "db_name": acctest.Representation{RepType: acctest.Required, Create: adbMemberName}, + }) + DatabaseAutonomousDatabaseResourcePoolLeaderIdUpdateRepresentation = acctest.RepresentationCopyWithNewProperties(acctest.RepresentationCopyWithRemovedProperties(DatabaseAutonomousDatabaseRepresentation, []string{"cpu_core_count", "admin_password"}), map[string]interface{}{ + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `10.0`, Update: `12.0`}, + "resource_pool_leader_id": acctest.Representation{RepType: acctest.Required, Update: ` `}, + "db_name": acctest.Representation{RepType: acctest.Required, Create: adbMemberName}, + }) ) // issue-routing-tag: database/dbaas-adb @@ -3610,4 +3647,204 @@ func TestDatabaseAutonomousDatabaseResource_ecpu(t *testing.T) { ), }, }) + +} +func TestDatabaseAutonomousDatabaseResource_ElasticResourcePool(t *testing.T) { + httpreplay.SetScenario("TestDatabaseAutonomousDatabaseResource_ElasticResourcePool") + 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_leader" + resourceMemberName := "oci_database_autonomous_database.test_autonomous_database_member" + + 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+DatabaseAutonomousDatabaseResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Optional, acctest.Create, autonomousDatabaseRepresentationRP), "database", "autonomousDatabase", t) + + acctest.ResourceTest(t, testAccCheckDatabaseAutonomousDatabaseDestroy, []resource.TestStep{ + //0. verify Create + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, autonomousDatabaseRepresentationRP), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "cpu_core_count", "0"), + resource.TestCheckResourceAttr(resourceName, "compute_count", "4"), + resource.TestCheckResourceAttr(resourceName, "compute_model", "ECPU"), + resource.TestCheckResourceAttr(resourceName, "db_name", adbName), + // verify computed field db_workload to be defaulted to OLTP + resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), + resource.TestCheckResourceAttrSet(resourceName, "resource_pool_summary.#"), + resource.TestCheckResourceAttrSet(resourceName, "resource_pool_summary.#"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.#", "1"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.is_disabled", "false"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.pool_size", "128"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + //1. verify resource pool size update + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, + acctest.RepresentationCopyWithNewProperties(autonomousDatabaseRepresentationRP, map[string]interface{}{ + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPSummaryUpdateRepresentation}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "cpu_core_count", "0"), + //resource.TestCheckResourceAttr(resourceName, "compute_count", "6"), + resource.TestCheckResourceAttr(resourceName, "compute_model", "ECPU"), + resource.TestCheckResourceAttr(resourceName, "db_name", adbName), + // verify computed field db_workload to be defaulted to OLTP + resource.TestCheckResourceAttr(resourceName, "db_workload", "OLTP"), + resource.TestCheckResourceAttrSet(resourceName, "resource_pool_summary.#"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.#", "1"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.is_disabled", "false"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.pool_size", "512"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + //2. verify member creation + { + + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, + acctest.RepresentationCopyWithNewProperties(autonomousDatabaseRepresentationRP, map[string]interface{}{ + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`, Update: `6.0`}, + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPSummaryRepresentation}, + })) + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_member", acctest.Required, acctest.Create, DatabaseAutonomousDatabaseResourcePoolLeaderIdRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceMemberName, "admin_password", "BEstrO0ng_#11"), + resource.TestCheckResourceAttr(resourceMemberName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceMemberName, "cpu_core_count", "0"), + resource.TestCheckResourceAttr(resourceMemberName, "compute_count", "10"), + resource.TestCheckResourceAttr(resourceMemberName, "compute_model", "ECPU"), + resource.TestCheckResourceAttr(resourceMemberName, "db_name", adbMemberName), + // verify computed field db_workload to be defaulted to OLTP + resource.TestCheckResourceAttr(resourceMemberName, "db_workload", "OLTP"), + resource.TestCheckResourceAttrSet(resourceMemberName, "resource_pool_leader_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceMemberName, "id") + return err + }, + ), + }, + //3. Member leaving a resource pool leader + { + + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, + acctest.RepresentationCopyWithNewProperties(autonomousDatabaseRepresentationRP, map[string]interface{}{ + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `4.0`, Update: `6.0`}, + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPSummaryRepresentation}, + })) + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_member", acctest.Required, acctest.Update, DatabaseAutonomousDatabaseResourcePoolLeaderIdUpdateRepresentation), + + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceMemberName, "resource_pool_leader_id"), + resource.TestCheckResourceAttr(resourceMemberName, "resource_pool_leader_id", " "), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceMemberName, "id") + if resId != resId2 { + return fmt.Errorf("resource recreated when it was supposed to be updated") + } + return err + }, + ), + }, + + //4. verify disable resource pool leader + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, + acctest.RepresentationCopyWithNewProperties(autonomousDatabaseRepresentationRPUpdate, map[string]interface{}{ + "compute_count": acctest.Representation{RepType: acctest.Required, Create: `6.0`, Update: `6.1`}, + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPDisableSummaryRepresentation}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compute_count", "6"), + resource.TestCheckResourceAttr(resourceName, "compute_model", "ECPU"), + resource.TestCheckResourceAttr(resourceName, "total_backup_storage_size_in_gbs", "1000"), + resource.TestCheckResourceAttrSet(resourceName, "resource_pool_summary.#"), + resource.TestCheckResourceAttrSet(resourceName, "resource_pool_summary.#"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.#", "1"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.is_disabled", "true"), + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + //5. verify updating adb to leader + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, + acctest.RepresentationCopyWithNewProperties(autonomousDatabaseRepresentationRPUpdate, map[string]interface{}{ + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPSummaryUpdateRepresentation}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "resource_pool_summary.#"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.#", "1"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.is_disabled", "false"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.pool_size", "512"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + //6. Modify just compute count + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, + map[string]interface{}{ + "db_name": acctest.Representation{RepType: acctest.Required, Create: adbName}, + "compute_count": acctest.Representation{RepType: acctest.Required, Create: "10"}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: compartmentId}, + }), + + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "compute_count"), + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }), + }, + //7. verify disable resource pool leader again + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousDatabaseResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_database", "test_autonomous_database_leader", acctest.Required, acctest.Create, + acctest.RepresentationCopyWithNewProperties(autonomousDatabaseRepresentationRPUpdate, map[string]interface{}{ + "resource_pool_summary": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseRPDisableSummaryRepresentation}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compute_model", "ECPU"), + resource.TestCheckResourceAttr(resourceName, "total_backup_storage_size_in_gbs", "1000"), + resource.TestCheckResourceAttrSet(resourceName, "resource_pool_summary.#"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.#", "1"), + resource.TestCheckResourceAttr(resourceName, "resource_pool_summary.0.is_disabled", "true"), + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + }) } diff --git a/internal/integrationtest/database_autonomous_database_test.go b/internal/integrationtest/database_autonomous_database_test.go index 1820f71e486..81ebab9e2d4 100644 --- a/internal/integrationtest/database_autonomous_database_test.go +++ b/internal/integrationtest/database_autonomous_database_test.go @@ -52,6 +52,7 @@ var ( adbCloneName = utils.RandomString(1, utils.CharsetWithoutDigits) + utils.RandomString(13, utils.Charset) tfStaticCompartmentId = utils.GetEnvSettingWithBlankDefault("compartment_id_for_static_resource") tfStaticCompartmentIdVariableStr = fmt.Sprintf("variable \"compartment_id_for_static_resource\" { default = \"%s\" }\n", tfStaticCompartmentId) + adbMemberName = utils.RandomString(1, utils.CharsetWithoutDigits) + utils.RandomString(13, utils.Charset) DatabaseAutonomousDatabaseRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, @@ -110,6 +111,11 @@ var ( DatabaseAutonomousDatabaseCustomerContactsRepresentation = map[string]interface{}{ "email": acctest.Representation{RepType: acctest.Optional, Create: `test@oracle.com`, Update: `test2@oracle.com`}, } + 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`}, + } + DatabaseAutonomousDatabaseScheduledOperationsRepresentation = map[string]interface{}{ "day_of_week": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseAutonomousDatabaseScheduledOperationsDayOfWeekRepresentation}, "scheduled_start_time": acctest.Representation{RepType: acctest.Optional, Create: `09:00`, Update: `10:00`}, diff --git a/internal/integrationtest/database_migration_migration_test.go b/internal/integrationtest/database_migration_migration_test.go index 0a1bca72646..0eef2ce5750 100644 --- a/internal/integrationtest/database_migration_migration_test.go +++ b/internal/integrationtest/database_migration_migration_test.go @@ -47,15 +47,16 @@ var ( DatabaseMigrationMigrationRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "source_database_connection_id": acctest.Representation{RepType: acctest.Required, Create: `${var.source_connection_id}`}, - "target_database_connection_id": acctest.Representation{RepType: acctest.Required, Create: `${var.target_connection_id}`}, "type": acctest.Representation{RepType: acctest.Required, Create: `ONLINE`}, + "data_transfer_medium_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDataTransferMediumDetailsRepresentation}, + "data_transfer_medium_details_v2": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseMigrationMigrationDataTransferMediumDetailsV2Representation}, + "datapump_settings": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseMigrationMigrationDatapumpSettingsRepresentation}, + "dump_transfer_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseMigrationMigrationDumpTransferDetailsRepresentation}, + "source_database_connection_id": acctest.Representation{RepType: acctest.Required, Create: `${var.source_connection_id}`}, + "target_database_connection_id": acctest.Representation{RepType: acctest.Required, Create: `${var.target_connection_no_autonomous_id}`}, "advisor_settings": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseMigrationMigrationAdvisorSettingsRepresentation}, "exclude_objects": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationExcludeObjectsRepresentation}, - "data_transfer_medium_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationDataTransferMediumDetailsRepresentation}, - "datapump_settings": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationDatapumpSettingsRepresentation}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `TFtestOnline1`, Update: `TFtestOnline2`}, - "dump_transfer_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDumpTransferRepresentation}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, "golden_gate_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationGoldenGateDetailsRepresentation}, "golden_gate_service_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseMigrationMigrationGoldenGateServiceDetailsRepresentation}, @@ -73,6 +74,7 @@ var ( "datapump_settings": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationDatapumpSettingsRepresentation}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `TF_ONLINE_MIG`, Update: `TF_ONLINE_MIG`}, "golden_gate_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationGoldenGateDetailsRepresentation}, + "golden_gate_service_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseMigrationMigrationGoldenGateServiceDetailsRepresentation}, "source_container_database_connection_id": acctest.Representation{RepType: acctest.Required, Create: `${var.source_connection_container_id}`}, "vault_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseMigrationMigrationVaultDetailsRepresentation}, } @@ -101,12 +103,26 @@ var ( "database_link_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDataTransferMediumDetailsDatabaseLinkDetailsRepresentation}, "object_storage_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDataTransferMediumDetailsObjectStorageDetailsRepresentation}, } + DatabaseMigrationMigrationDataTransferMediumDetailsV2Representation = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `NFS`, Update: `OBJECT_STORAGE`}, + } + DatabaseMigrationMigrationDatapumpSettingsRepresentation = map[string]interface{}{ + "data_pump_parameters": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatabaseMigrationMigrationDatapumpSettingsDataPumpParametersRepresentation}, + "export_directory_object": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDatapumpSettingsExportDirectoryObjectRepresentation}, + "import_directory_object": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDatapumpSettingsImportDirectoryObjectRepresentation}, + "job_mode": acctest.Representation{RepType: acctest.Optional, Create: `SCHEMA`, Update: `SCHEMA`}, + "metadata_remaps": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDatapumpSettingsMetadataRemapsRepresentation}, + } + DatabaseMigrationMigrationDumpTransferDetailsRepresentation = map[string]interface{}{ + "source": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationSourceHostDumpTransferDetailsRepresentation}, + "target": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationTargetHostDumpTransferDetailsRepresentation}, + } migrationDataTransferMediumDetailsRepresentationBeforeCPAT = map[string]interface{}{ "database_link_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationDataTransferMediumDetailsDatabaseLinkDetailsRepresentation}, "object_storage_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationDataTransferMediumDetailsObjectStorageDetailsRepresentation}, } migrationDatapumpSettingsRepresentation = map[string]interface{}{ - "export_directory_object": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatabaseMigrationMigrationDatapumpSettingsExportDirectoryObjectRepresentation}, + "export_directory_object": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationDatapumpSettingsExportDirectoryObjectRepresentation}, "metadata_remaps": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationDatapumpSettingsMetadataRemapsRepresentation}, } migrationDatapumpSettingsNoSshRepresentation = map[string]interface{}{ @@ -172,14 +188,22 @@ var ( "bucket": acctest.Representation{RepType: acctest.Required, Create: `${var.bucket_id}`, Update: `${var.bucket_id}`}, "namespace": acctest.Representation{RepType: acctest.Required, Create: `ax5cpn0vohdh`, Update: `ax5cpn0vohdh`}, } - migrationDatapumpSettingsDataPumpParametersRepresentation = map[string]interface{}{ + DatabaseMigrationMigrationDataTransferMediumDetailsV2ObjectStorageBucketRepresentation = map[string]interface{}{ + "bucket": acctest.Representation{RepType: acctest.Optional, Create: `${var.bucket_id}`, Update: `${var.bucket_id}`}, + "namespace": acctest.Representation{RepType: acctest.Optional, Create: `ax5cpn0vohdh`, Update: `ax5cpn0vohdh`}, + } + DatabaseMigrationMigrationDatapumpSettingsDataPumpParametersRepresentation = map[string]interface{}{ "estimate": acctest.Representation{RepType: acctest.Optional, Create: `BLOCKS`, Update: `STATISTICS`}, - "exclude_parameters": acctest.Representation{RepType: acctest.Optional, Create: []string{`excludeParameters`}, Update: []string{`excludeParameters2`}}, + "exclude_parameters": acctest.Representation{RepType: acctest.Optional, Create: [3]string{`INDEX`, `MATERIALIZED_VIEW`, `MATERIALIZED_VIEW_LOG`}, Update: [1]string{`excludeParameters2`}}, "export_parallelism_degree": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, "import_parallelism_degree": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, "is_cluster": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, "table_exists_action": acctest.Representation{RepType: acctest.Optional, Create: `TRUNCATE`, Update: `REPLACE`}, } + migrationDatapumpSettingsExportDirectoryObjectRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `test_export_dir`, Update: `test_export_dir`}, + "path": acctest.Representation{RepType: acctest.Required, Create: `/u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/log`, Update: `/u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/log`}, + } DatabaseMigrationMigrationDatapumpSettingsExportDirectoryObjectRepresentation = map[string]interface{}{ "name": acctest.Representation{RepType: acctest.Required, Create: `test_export_dir`, Update: `test_export_dir`}, "path": acctest.Representation{RepType: acctest.Required, Create: `/u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/log`, Update: `/u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/log`}, @@ -194,10 +218,11 @@ var ( "type": acctest.Representation{RepType: acctest.Required, Create: `TABLESPACE`, Update: `TABLESPACE`}, } migrationGoldenGateDetailsHubRepresentation = map[string]interface{}{ - "rest_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationGoldenGateDetailsHubRestAdminCredentialsRepresentation}, - "source_container_db_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationGoldenGateDetailsHubSourceContainerDbAdminCredentialsRepresentation}, - "source_db_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationGoldenGateDetailsHubSourceDbAdminCredentialsRepresentation}, - "target_db_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Optional, Group: migrationGoldenGateDetailsHubTargetDbAdminCredentialsRepresentation}, + "rest_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationGoldenGateDetailsHubRestAdminCredentialsRepresentation}, + + "source_container_db_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationGoldenGateDetailsHubSourceContainerDbAdminCredentialsRepresentation}, + "source_db_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationGoldenGateDetailsHubSourceDbAdminCredentialsRepresentation}, + "target_db_admin_credentials": acctest.RepresentationGroup{RepType: acctest.Required, Group: migrationGoldenGateDetailsHubTargetDbAdminCredentialsRepresentation}, "url": acctest.Representation{RepType: acctest.Required, Create: `https://138.1.36.139`, Update: `https://138.1.36.139`}, "source_microservices_deployment_name": acctest.Representation{RepType: acctest.Required, Create: `Marketplace`}, "target_microservices_deployment_name": acctest.Representation{RepType: acctest.Required, Create: `Marketplace`}, @@ -227,11 +252,11 @@ var ( "namespace": acctest.Representation{RepType: acctest.Required, Create: `namespace`, Update: `namespace2`}, } migrationGoldenGateDetailsHubRestAdminCredentialsRepresentation = map[string]interface{}{ - "password": acctest.Representation{RepType: acctest.Required, Create: `gHxc%PX0BOiAdYsG`, Update: `gHxc%PX0BOiAdYsG`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `ytW8z_.vZMwdBk0y`, Update: `ytW8z_.vZMwdBk0y`}, "username": acctest.Representation{RepType: acctest.Required, Create: `oggadmin`, Update: `oggadmin`}, } migrationGoldenGateDetailsHubSourceDbAdminCredentialsRepresentation = map[string]interface{}{ - "password": acctest.Representation{RepType: acctest.Required, Create: `DMS-pswd-2023#-sjc`, Update: `DMS-pswd-2023#-sjc`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `DMS-pswd-2023#`, Update: `DMS-pswd-2023#`}, "username": acctest.Representation{RepType: acctest.Required, Create: `ggadmin`, Update: `ggadmin`}, } DatabaseMigrationMigrationGoldenGateDetailsHubSourceContainerDbAdminCredentialsRepresentation = map[string]interface{}{ @@ -265,16 +290,16 @@ var ( "min_apply_parallelism": acctest.Representation{RepType: acctest.Required, Create: `10`, Update: `11`}, } migrationGoldenGateDetailsHubTargetDbAdminCredentialsRepresentation = map[string]interface{}{ - "password": acctest.Representation{RepType: acctest.Required, Create: `DMS-pswd-2023#-sjc`, Update: `DMS-pswd-2023#-sjc`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `DMS-pswd-2023#`, Update: `DMS-pswd-2023#`}, "username": acctest.Representation{RepType: acctest.Required, Create: `ggadmin`, Update: `ggadmin`}, } migrationGoldenGateDetailsHubSourceContainerDbAdminCredentialsRepresentation = map[string]interface{}{ - "password": acctest.Representation{RepType: acctest.Required, Create: `DMS-pswd-2023#-sjc`, Update: `DMS-pswd-2023#-sjc`}, + "password": acctest.Representation{RepType: acctest.Required, Create: `DMS-pswd-2023#`, Update: `DMS-pswd-2023#`}, "username": acctest.Representation{RepType: acctest.Required, Create: `c##ggadmin`, Update: `c##ggadmin`}, } migrationGoldenGateDetailsSettingsExtractRepresentation = map[string]interface{}{ "long_trans_duration": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, - "performance_profile": acctest.Representation{RepType: acctest.Optional, Create: `MEDIUM`, Update: `MEDIUM`}, + "performance_profile": acctest.Representation{RepType: acctest.Optional, Create: `LOW`, Update: `MEDIUM`}, } migrationGoldenGateDetailsSettingsReplicatRepresentation = map[string]interface{}{ "map_parallelism": acctest.Representation{RepType: acctest.Required, Create: `1`, Update: `0`}, @@ -297,6 +322,8 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { config := acctest.ProviderTestConfig() + //Asigning values to variables used on representations. Environment variables are taken by tf config file and used to create resources. + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) @@ -314,7 +341,6 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { databaseTargetId := utils.GetEnvSettingWithBlankDefault("target_connection_id") databaseTargetStr := fmt.Sprintf("variable \"target_connection_id\" { default = \"%s\" }\n", databaseTargetId) - databaseSourceId := utils.GetEnvSettingWithBlankDefault("database_source") databaseSourceStr := fmt.Sprintf("variable \"database_source\" { default = \"%s\" }\n", databaseSourceId) @@ -336,6 +362,9 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { databaseTargetNoAutId := utils.GetEnvSettingWithBlankDefault("target_connection_no_autonomous_id") databaseTargetNoAutStr := fmt.Sprintf("variable \"target_connection_no_autonomous_id\" { default = \"%s\" }\n", databaseTargetNoAutId) + fileStorageMountId := utils.GetEnvSettingWithBlankDefault("file_storage_mount") + fileStorageMountStr := fmt.Sprintf("variable \"file_storage_mount\" { default = \"%s\" }\n", fileStorageMountId) + sourceDBId := utils.GetEnvSettingWithBlankDefault("database_source_id") sourceDBStr := fmt.Sprintf("variable \"database_source_id\" { default = \"%s\" }\n", sourceDBId) @@ -346,10 +375,10 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { kmsVaultIdVariableStr := fmt.Sprintf("\nvariable \"kms_vault_id\" { default = \"%s\" }\n", kmsVaultId) vcnId := utils.GetEnvSettingWithBlankDefault("vcn_id") - vcnIdVariableStr := fmt.Sprintf("variable \"vcnId\" { default = \"%s\" }\n", vcnId) + vcnIdVariableStr := fmt.Sprintf("variable \"vcn_id\" { default = \"%s\" }\n", vcnId) subnetId := utils.GetEnvSettingWithBlankDefault("subnet_id") - subnetIdStr := fmt.Sprintf("variable \"subnetId\" { default = \"%s\" }\n", subnetId) + subnetIdStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnetId) kmsKeyId := utils.GetEnvSettingWithBlankDefault("kms_key_id") KmsKeyIdVariableStr := fmt.Sprintf("\nvariable \"kms_key_id\" { default = \"%s\" }\n", kmsKeyId) @@ -375,7 +404,7 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { // verify Create { - Config: config + compartmentIdVariableStr + databaseSourceStr + databaseTargetStr + kmsVaultIdVariableStr + vcnIdVariableStr + subnetIdStr + KmsKeyIdVariableStr + bucketIdVariableStr + sshKeyStr + databaseSourceContainerStr + databaseSourceFDBStr + databaseSourceContainerFDBStr + sourceDBStr + targetDBStr + databaseSourcePDBStr + //DatabaseMigrationMigrationResourceDependencies + + Config: config + compartmentIdVariableStr + databaseSourceStr + databaseTargetStr + kmsVaultIdVariableStr + vcnIdVariableStr + subnetIdStr + KmsKeyIdVariableStr + bucketIdVariableStr + sshKeyStr + databaseSourceContainerStr + databaseTargetNoSshStr + databaseSourceFDBStr + databaseSourceContainerFDBStr + sourceDBStr + targetDBStr + databaseSourcePDBStr + //DatabaseMigrationMigrationResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_migration_migration", "test_migration", acctest.Required, acctest.Create, migrationRepresentationMig), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), @@ -395,17 +424,16 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { }, // verify Create with optionals { - Config: config + compartmentIdVariableStr + databaseSourceStr + databaseTargetStr + databaseTargetNoAutStr + kmsVaultIdVariableStr + vcnIdVariableStr + subnetIdStr + KmsKeyIdVariableStr + bucketIdVariableStr + sshKeyStr + databaseSourceContainerStr + databaseSourceFDBStr + databaseSourceContainerFDBStr + sourceDBStr + targetDBStr + databaseTargetNoSshStr + databaseSourcePDBStr + databaseSourceNoSshStr + databaseSourceNoSSHDBStr + //DatabaseMigrationMigrationResourceDependencies + + Config: config + compartmentIdVariableStr + databaseSourceStr + databaseTargetStr + databaseTargetNoAutStr + kmsVaultIdVariableStr + vcnIdVariableStr + subnetIdStr + KmsKeyIdVariableStr + bucketIdVariableStr + sshKeyStr + databaseSourceContainerStr + fileStorageMountStr + databaseTargetNoSshStr + databaseSourceFDBStr + databaseSourceContainerFDBStr + sourceDBStr + targetDBStr + databaseSourcePDBStr + databaseSourceNoSshStr + databaseSourceNoSSHDBStr + //DatabaseMigrationMigrationResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_migration_migration", "test_migration", acctest.Optional, acctest.Create, DatabaseMigrationMigrationRepresentation) + DatabaseMigrationMigrationNoSshResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_migration_migration", "test_nossh_migration", acctest.Optional, acctest.Create, migrationRepresentationNoSshMig), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.database_link_details.#", "0"), - resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "data_transfer_medium_details.0.object_storage_details.0.bucket"), resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.0.namespace", "ax5cpn0vohdh"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details_v2.#", "1"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details_v2.0.type", "NFS"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.#", "1"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.0.export_directory_object.#", "1"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.0.export_directory_object.0.name", "test_export_dir"), @@ -433,23 +461,23 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { }, []string{}), resource.TestCheckResourceAttr(resourceName, "display_name", "TFtestOnline1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.password", "gHxc%PX0BOiAdYsG"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.password", "ytW8z_.vZMwdBk0y"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.username", "oggadmin"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.password", "DMS-pswd-2023#-sjc"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.password", "DMS-pswd-2023#"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttrSet(resourceName, "golden_gate_details.0.hub.0.source_microservices_deployment_name"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.password", "DMS-pswd-2023#-sjc"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.password", "DMS-pswd-2023#"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttrSet(resourceName, "golden_gate_details.0.hub.0.target_microservices_deployment_name"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.url", "https://138.1.36.139"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.acceptable_lag", "10"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.long_trans_duration", "10"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.performance_profile", "MEDIUM"), + + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.performance_profile", "LOW"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.#", "1"), @@ -457,7 +485,6 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.0.extract.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.0.extract.0.long_trans_duration", "10"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.0.extract.0.performance_profile", "LOW"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.performance_profile", "MEDIUM"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "source_container_database_connection_id"), resource.TestCheckResourceAttrSet(resourceName, "source_database_connection_id"), @@ -508,7 +535,7 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { // verify Update to the compartment (the compartment will be switched back in the next step) { - Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + databaseSourceStr + databaseTargetStr + databaseTargetNoAutStr + kmsVaultIdVariableStr + vcnIdVariableStr + subnetIdStr + KmsKeyIdVariableStr + bucketIdVariableStr + sshKeyStr + databaseSourceContainerStr + databaseSourceFDBStr + databaseSourceContainerFDBStr + sourceDBStr + targetDBStr + databaseTargetNoSshStr + databaseSourcePDBStr + databaseSourceNoSshStr + databaseSourceNoSSHDBStr + //DatabaseMigrationMigrationResourceDependencies + //DatabaseMigrationMigrationResourceDependencies + + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + databaseSourceStr + fileStorageMountStr + databaseTargetStr + databaseTargetNoAutStr + kmsVaultIdVariableStr + vcnIdVariableStr + subnetIdStr + KmsKeyIdVariableStr + bucketIdVariableStr + sshKeyStr + databaseSourceContainerStr + databaseSourceFDBStr + databaseSourceContainerFDBStr + sourceDBStr + targetDBStr + databaseTargetNoSshStr + databaseSourcePDBStr + databaseSourceNoSshStr + databaseSourceNoSSHDBStr + //DatabaseMigrationMigrationResourceDependencies + //DatabaseMigrationMigrationResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_database_migration_migration", "test_migration", acctest.Optional, acctest.Create, acctest.RepresentationCopyWithNewProperties(DatabaseMigrationMigrationRepresentation, map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, @@ -525,6 +552,10 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "data_transfer_medium_details.0.object_storage_details.0.bucket"), resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.0.namespace", "ax5cpn0vohdh"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details_v2.#", "1"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details_v2.0.type", "NFS"), + resource.TestCheckResourceAttrSet(resourceName, "data_transfer_medium_details.0.object_storage_details.0.bucket"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.0.namespace", "ax5cpn0vohdh"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.#", "1"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.0.export_directory_object.#", "1"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.0.export_directory_object.0.name", "test_export_dir"), @@ -553,21 +584,21 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "display_name", "TFtestOnline1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.password", "gHxc%PX0BOiAdYsG"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.password", "ytW8z_.vZMwdBk0y"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.username", "oggadmin"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.password", "DMS-pswd-2023#-sjc"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.password", "DMS-pswd-2023#"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttrSet(resourceName, "golden_gate_details.0.hub.0.source_microservices_deployment_name"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.password", "DMS-pswd-2023#-sjc"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.password", "DMS-pswd-2023#"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttrSet(resourceName, "golden_gate_details.0.hub.0.target_microservices_deployment_name"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.url", "https://138.1.36.139"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.acceptable_lag", "10"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.long_trans_duration", "10"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.performance_profile", "MEDIUM"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.performance_profile", "LOW"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.#", "1"), @@ -575,8 +606,6 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.0.extract.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.0.extract.0.long_trans_duration", "10"), resource.TestCheckResourceAttr(resourceName, "golden_gate_service_details.0.settings.0.extract.0.performance_profile", "LOW"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.settings.0.extract.0.performance_profile", "MEDIUM"), - resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "source_container_database_connection_id"), resource.TestCheckResourceAttrSet(resourceName, "source_database_connection_id"), @@ -619,6 +648,10 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "data_transfer_medium_details.0.object_storage_details.0.bucket"), resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.0.namespace", "ax5cpn0vohdh"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details_v2.#", "1"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details_v2.0.type", "OBJECT_STORAGE"), + resource.TestCheckResourceAttrSet(resourceName, "data_transfer_medium_details.0.object_storage_details.0.bucket"), + resource.TestCheckResourceAttr(resourceName, "data_transfer_medium_details.0.object_storage_details.0.namespace", "ax5cpn0vohdh"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.#", "1"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.0.export_directory_object.#", "1"), resource.TestCheckResourceAttr(resourceName, "datapump_settings.0.export_directory_object.0.name", "test_export_dir"), @@ -635,10 +668,12 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "dump_transfer_details.0.source.#", "1"), resource.TestCheckResourceAttr(resourceName, "dump_transfer_details.0.source.0.kind", "OCI_CLI"), resource.TestCheckResourceAttr(resourceName, "dump_transfer_details.0.source.0.oci_home", "/path/to/ociCli"), + resource.TestCheckResourceAttr(resourceName, "dump_transfer_details.0.target.#", "1"), resource.TestCheckResourceAttr(resourceName, "dump_transfer_details.0.target.0.kind", "OCI_CLI"), resource.TestCheckResourceAttr(resourceName, "dump_transfer_details.0.target.0.oci_home", "ociHome2"), resource.TestCheckResourceAttr(resourceName, "exclude_objects.#", "1"), + resource.TestCheckResourceAttr(resourceName, "exclude_objects.#", "1"), resource.TestCheckResourceAttr(resourceName, "exclude_objects.0.is_omit_excluded_table_from_replication", "true"), resource.TestCheckResourceAttr(resourceName, "exclude_objects.0.owner", "owner2"), @@ -650,14 +685,14 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "golden_gate_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.#", "1"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.password", "gHxc%PX0BOiAdYsG"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.password", "ytW8z_.vZMwdBk0y"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.rest_admin_credentials.0.username", "oggadmin"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.password", "DMS-pswd-2023#-sjc"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.password", "DMS-pswd-2023#"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttrSet(resourceName, "golden_gate_details.0.hub.0.source_microservices_deployment_name"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.password", "DMS-pswd-2023#-sjc"), + resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.password", "DMS-pswd-2023#"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttrSet(resourceName, "golden_gate_details.0.hub.0.target_microservices_deployment_name"), resource.TestCheckResourceAttr(resourceName, "golden_gate_details.0.hub.0.url", "https://138.1.36.139"), @@ -719,7 +754,7 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_database_migration_migrations", "test_migrations", acctest.Optional, acctest.Update, DatabaseMigrationmigrationDataSourceRepresentation) + compartmentIdVariableStr + compartmentIdUVariableStr + databaseSourceStr + databaseTargetStr + databaseTargetNoAutStr + kmsVaultIdVariableStr + vcnIdVariableStr + subnetIdStr + KmsKeyIdVariableStr + bucketIdVariableStr + sshKeyStr + databaseSourceContainerStr + databaseSourceFDBStr + databaseSourceContainerFDBStr + sourceDBStr + targetDBStr + databaseTargetNoSshStr + databaseSourcePDBStr + databaseSourceNoSshStr + databaseSourceNoSSHDBStr + // DatabaseMigrationMigrationResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_database_migration_migration", "test_migration", acctest.Optional, acctest.Update, migrationRepresentationMig), + acctest.GenerateResourceFromRepresentationMap("oci_database_migration_migration", "test_migration", acctest.Optional, acctest.Update, DatabaseMigrationMigrationRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), @@ -737,6 +772,20 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(singularDatasourceName, "migration_id"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(singularDatasourceName, "credentials_secret_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "data_transfer_medium_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "data_transfer_medium_details.0.object_storage_details.#", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "data_transfer_medium_details.0.object_storage_details.0.bucket"), + resource.TestCheckResourceAttr(singularDatasourceName, "data_transfer_medium_details.0.object_storage_details.0.namespace", "ax5cpn0vohdh"), + resource.TestCheckResourceAttr(singularDatasourceName, "data_transfer_medium_details_v2.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "data_transfer_medium_details_v2.0.type", "OBJECT_STORAGE"), + resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.data_pump_parameters.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.data_pump_parameters.0.estimate", "STATISTICS"), + resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.data_pump_parameters.0.export_parallelism_degree", "11"), + resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.data_pump_parameters.0.import_parallelism_degree", "11"), + resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.data_pump_parameters.0.is_cluster", "true"), + resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.data_pump_parameters.0.table_exists_action", "REPLACE"), resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.export_directory_object.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.export_directory_object.0.name", "test_export_dir"), resource.TestCheckResourceAttr(singularDatasourceName, "datapump_settings.0.export_directory_object.0.path", "/u01/app/oracle/product/19.0.0.0/dbhome_1/rdbms/log"), @@ -771,7 +820,6 @@ func TestDatabaseMigrationMigrationResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "golden_gate_details.0.hub.0.source_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttr(singularDatasourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.#", "1"), - resource.TestCheckResourceAttr(singularDatasourceName, "golden_gate_details.0.hub.0.target_db_admin_credentials.0.username", "ggadmin"), resource.TestCheckResourceAttr(singularDatasourceName, "golden_gate_details.0.hub.0.url", "https://138.1.36.139"), resource.TestCheckResourceAttr(singularDatasourceName, "golden_gate_details.0.settings.#", "1"), diff --git a/internal/integrationtest/datascience_data_science_private_endpoint_test.go b/internal/integrationtest/datascience_data_science_private_endpoint_test.go new file mode 100644 index 00000000000..a9f457f1c0f --- /dev/null +++ b/internal/integrationtest/datascience_data_science_private_endpoint_test.go @@ -0,0 +1,388 @@ +// 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/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_datascience "github.com/oracle/oci-go-sdk/v65/datascience" + + "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 ( + DataSciencePrivateEndpointRequiredOnlyResource = DataSciencePrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Required, acctest.Create, DataSciencePrivateEndpointRepresentation) + + DataSciencePrivateEndpointResourceConfig = DataSciencePrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Optional, acctest.Update, DataSciencePrivateEndpointRepresentation) + + DataSciencePrivateEndpointSingularDataSourceRepresentation = map[string]interface{}{ + "data_science_private_endpoint_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_private_endpoint.test_data_science_private_endpoint.id}`}, + } + + DataSciencePrivateEndpointDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "created_by": acctest.Representation{RepType: acctest.Optional, Create: `${var.user_id}`}, + "data_science_resource_type": acctest.Representation{RepType: acctest.Optional, Create: `NOTEBOOK_SESSION`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `pe_1234`, Update: `displayName2`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: DataSciencePrivateEndpointDataSourceFilterRepresentation}} + + DataSciencePrivateEndpointDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_datascience_private_endpoint.test_data_science_private_endpoint.id}`}}, + } + + DataSciencePrivateEndpointRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "data_science_resource_type": acctest.Representation{RepType: acctest.Required, Create: `NOTEBOOK_SESSION`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.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")}`}, + "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"}}, + "sub_domain": acctest.Representation{RepType: acctest.Optional, Create: `subDomain`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: dataSciencePrivateEndpointIgnoreRepresentation}, + } + + dataSciencePrivateEndpointIgnoreRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}}, + } + + DataSciencePrivateEndpointResourceDependencies = 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: datascience/default +func TestDatascienceDataSciencePrivateEndpointResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatascienceDataSciencePrivateEndpointResource_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) + + userId := utils.GetEnvSettingWithBlankDefault("user_ocid") + userIdVariableStr := fmt.Sprintf("variable \"user_id\" { default = \"%s\" }\n", userId) + + resourceName := "oci_datascience_private_endpoint.test_data_science_private_endpoint" + datasourceName := "data.oci_datascience_private_endpoints.test_data_science_private_endpoint" + singularDatasourceName := "data.oci_datascience_private_endpoint.test_data_science_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+DataSciencePrivateEndpointResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Optional, acctest.Create, DataSciencePrivateEndpointRepresentation), "datascience", "dataSciencePrivateEndpoint", t) + + acctest.ResourceTest(t, testAccCheckDatascienceDataSciencePrivateEndpointDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + DataSciencePrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Required, acctest.Create, DataSciencePrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "data_science_resource_type", "NOTEBOOK_SESSION"), + 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 + DataSciencePrivateEndpointResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + DataSciencePrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Optional, acctest.Create, DataSciencePrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttr(resourceName, "data_science_resource_type", "NOTEBOOK_SESSION"), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "display_name", "pe_1234"), + resource.TestCheckResourceAttrSet(resourceName, "fqdn"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "sub_domain", "subDomain"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + 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 + DataSciencePrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(DataSciencePrivateEndpointRepresentation, 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.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttr(resourceName, "data_science_resource_type", "NOTEBOOK_SESSION"), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "display_name", "pe_1234"), + resource.TestCheckResourceAttrSet(resourceName, "fqdn"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "sub_domain", "subDomain"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + 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 + DataSciencePrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Optional, acctest.Update, DataSciencePrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttr(resourceName, "data_science_resource_type", "NOTEBOOK_SESSION"), + resource.TestCheckResourceAttr(resourceName, "description", "description2"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttrSet(resourceName, "fqdn"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttr(resourceName, "sub_domain", "subDomain"), + resource.TestCheckResourceAttrSet(resourceName, "subnet_id"), + 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_datascience_private_endpoints", "test_data_science_private_endpoint", acctest.Optional, acctest.Update, DataSciencePrivateEndpointDataSourceRepresentation) + + compartmentIdVariableStr + userIdVariableStr + DataSciencePrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Optional, acctest.Update, DataSciencePrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "data_science_resource_type", "NOTEBOOK_SESSION"), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + + resource.TestCheckResourceAttr(datasourceName, "data_science_private_endpoints.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "data_science_private_endpoints.0.compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "data_science_private_endpoints.0.data_science_resource_type", "NOTEBOOK_SESSION"), + resource.TestCheckResourceAttr(datasourceName, "data_science_private_endpoints.0.display_name", "displayName2"), + resource.TestCheckResourceAttrSet(datasourceName, "data_science_private_endpoints.0.fqdn"), + resource.TestCheckResourceAttr(datasourceName, "data_science_private_endpoints.0.freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "data_science_private_endpoints.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "data_science_private_endpoints.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "data_science_private_endpoints.0.subnet_id"), + resource.TestCheckResourceAttrSet(datasourceName, "data_science_private_endpoints.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "data_science_private_endpoints.0.time_updated"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Required, acctest.Create, DataSciencePrivateEndpointSingularDataSourceRepresentation) + + compartmentIdVariableStr + DataSciencePrivateEndpointResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "data_science_private_endpoint_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + // resource.TestCheckResourceAttrSet(singularDatasourceName, "created_by"), + resource.TestCheckResourceAttr(singularDatasourceName, "data_science_resource_type", "NOTEBOOK_SESSION"), + 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, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // verify resource import + { + Config: config + DataSciencePrivateEndpointRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "sub_domain", + }, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckDatascienceDataSciencePrivateEndpointDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).DataScienceClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_datascience_private_endpoint" { + noResourceFound = false + request := oci_datascience.GetDataSciencePrivateEndpointRequest{} + + tmp := rs.Primary.ID + request.DataSciencePrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "datascience") + + response, err := client.GetDataSciencePrivateEndpoint(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateDeleted): 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("DatascienceDataSciencePrivateEndpoint") { + resource.AddTestSweepers("DatascienceDataSciencePrivateEndpoint", &resource.Sweeper{ + Name: "DatascienceDataSciencePrivateEndpoint", + Dependencies: acctest.DependencyGraph["dataSciencePrivateEndpoint"], + F: sweepDatascienceDataSciencePrivateEndpointResource, + }) + } +} + +func sweepDatascienceDataSciencePrivateEndpointResource(compartment string) error { + dataScienceClient := acctest.GetTestClients(&schema.ResourceData{}).DataScienceClient() + dataSciencePrivateEndpointIds, err := getDatascienceDataSciencePrivateEndpointIds(compartment) + if err != nil { + return err + } + for _, dataSciencePrivateEndpointId := range dataSciencePrivateEndpointIds { + if ok := acctest.SweeperDefaultResourceId[dataSciencePrivateEndpointId]; !ok { + deleteDataSciencePrivateEndpointRequest := oci_datascience.DeleteDataSciencePrivateEndpointRequest{} + + deleteDataSciencePrivateEndpointRequest.DataSciencePrivateEndpointId = &dataSciencePrivateEndpointId + + deleteDataSciencePrivateEndpointRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "datascience") + _, error := dataScienceClient.DeleteDataSciencePrivateEndpoint(context.Background(), deleteDataSciencePrivateEndpointRequest) + if error != nil { + fmt.Printf("Error deleting DataSciencePrivateEndpoint %s %s, It is possible that the resource is already deleted. Please verify manually \n", dataSciencePrivateEndpointId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &dataSciencePrivateEndpointId, DatascienceDataSciencePrivateEndpointSweepWaitCondition, time.Duration(3*time.Minute), + DatascienceDataSciencePrivateEndpointSweepResponseFetchOperation, "datascience", true) + } + } + return nil +} + +func getDatascienceDataSciencePrivateEndpointIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "DataSciencePrivateEndpointId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + dataScienceClient := acctest.GetTestClients(&schema.ResourceData{}).DataScienceClient() + + listDataSciencePrivateEndpointsRequest := oci_datascience.ListDataSciencePrivateEndpointsRequest{} + listDataSciencePrivateEndpointsRequest.CompartmentId = &compartmentId + listDataSciencePrivateEndpointsRequest.LifecycleState = oci_datascience.ListDataSciencePrivateEndpointsLifecycleStateActive + listDataSciencePrivateEndpointsResponse, err := dataScienceClient.ListDataSciencePrivateEndpoints(context.Background(), listDataSciencePrivateEndpointsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting DataSciencePrivateEndpoint list for compartment id : %s , %s \n", compartmentId, err) + } + for _, dataSciencePrivateEndpoint := range listDataSciencePrivateEndpointsResponse.Items { + id := *dataSciencePrivateEndpoint.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "DataSciencePrivateEndpointId", id) + } + return resourceIds, nil +} + +func DatascienceDataSciencePrivateEndpointSweepWaitCondition(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 dataSciencePrivateEndpointResponse, ok := response.Response.(oci_datascience.GetDataSciencePrivateEndpointResponse); ok { + return dataSciencePrivateEndpointResponse.LifecycleState != oci_datascience.DataSciencePrivateEndpointLifecycleStateDeleted + } + return false +} + +func DatascienceDataSciencePrivateEndpointSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.DataScienceClient().GetDataSciencePrivateEndpoint(context.Background(), oci_datascience.GetDataSciencePrivateEndpointRequest{ + DataSciencePrivateEndpointId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/datascience_notebook_session_test.go b/internal/integrationtest/datascience_notebook_session_test.go index 5efb84ade77..1073a9a879a 100644 --- a/internal/integrationtest/datascience_notebook_session_test.go +++ b/internal/integrationtest/datascience_notebook_session_test.go @@ -11,10 +11,10 @@ import ( "time" "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "github.com/oracle/terraform-provider-oci/internal/tfresource" "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" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -76,42 +76,26 @@ var ( } DatascienceNotebookSessionRepresentation = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_project.test_project.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")}`}, - "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, - "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "notebook_session_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionNotebookSessionConfigDetailsRepresentation}, - "notebook_session_configuration_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionNotebookSessionConfigurationDetailsRepresentation}, - "notebook_session_runtime_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionNotebookSessionRuntimeConfigDetailsRepresentation}, - "lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: definedTagsIgnoreRepresentation}, - } - notebookSessionConfigDetailsRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_project.test_project.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")}`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "notebook_session_config_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: notebookSessionNotebookSessionConfigDetailsRepresentation}, + "notebook_session_config_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: notebookSessionConfigDetailsRepresentation}, "lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: definedTagsIgnoreRepresentation}, } - notebookSessionNotebookSessionConfigDetailsRepresentation = map[string]interface{}{ + notebookSessionConfigDetailsRepresentation = map[string]interface{}{ "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `100`}, - "notebook_session_shape_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionNotebookSessionConfigDetailsNotebookSessionShapeConfigDetailsRepresentation}, - } - - notebookSessionNotebookSessionConfigurationDetailsRepresentation = map[string]interface{}{ - "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, + "notebook_session_shape_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionConfigDetailsShapeConfigDetailsRepresentation}, + "private_endpoint_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_private_endpoint.test_data_science_private_endpoint.id}`}, "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, - "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `100`}, - "notebook_session_shape_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionNotebookSessionConfigurationDetailsNotebookSessionShapeConfigDetailsRepresentation}, } notebookSessionConfigurationDetailsRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "notebook_session_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceNotebookSessionNotebookSessionConfigurationDetailsRepresentation}, + "notebook_session_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceNotebookSessionConfigurationDetailsRepresentation}, "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_project.test_project.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")}`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, @@ -119,37 +103,30 @@ var ( "lifecycle": acctest.RepresentationGroup{RepType: acctest.Optional, Group: definedTagsIgnoreRepresentation}, } - DatascienceNotebookSessionNotebookSessionConfigurationDetailsRepresentation = map[string]interface{}{ + DatascienceNotebookSessionConfigurationDetailsRepresentation = map[string]interface{}{ "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `100`}, + "private_endpoint_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_private_endpoint.test_data_science_private_endpoint.id}`}, } - notebookSessionNotebookSessionRuntimeConfigDetailsRepresentation = map[string]interface{}{ - "custom_environment_variables": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"customEnvironmentVariablesKey1": "customEnvironmentVariablesValue1"}, Update: map[string]string{"customEnvironmentVariablesKey2": "customEnvironmentVariablesValue2"}}, - "notebook_session_git_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionNotebookSessionRuntimeConfigDetailsNotebookSessionGitConfigDetailsRepresentation}, - } - notebookSessionNotebookSessionConfigDetailsNotebookSessionShapeConfigDetailsRepresentation = map[string]interface{}{ + + notebookSessionConfigDetailsShapeConfigDetailsRepresentation = map[string]interface{}{ "memory_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `1.0`}, "ocpus": acctest.Representation{RepType: acctest.Optional, Create: `1.0`}, } - notebookSessionNotebookSessionConfigurationDetailsNotebookSessionShapeConfigDetailsRepresentation = map[string]interface{}{ - "memory_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `1.0`, Update: `1.1`}, - "ocpus": acctest.Representation{RepType: acctest.Optional, Create: `1.0`, Update: `1.1`}, - } + definedTagsIgnoreRepresentation = map[string]interface{}{ - "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`, `compartment_id`}}, - } - notebookSessionNotebookSessionRuntimeConfigDetailsNotebookSessionGitConfigDetailsRepresentation = map[string]interface{}{ - "notebook_session_git_repo_config_collection": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionNotebookSessionRuntimeConfigDetailsNotebookSessionGitConfigDetailsNotebookSessionGitRepoConfigCollectionRepresentation}, - } - notebookSessionNotebookSessionRuntimeConfigDetailsNotebookSessionGitConfigDetailsNotebookSessionGitRepoConfigCollectionRepresentation = map[string]interface{}{ - "url": acctest.Representation{RepType: acctest.Required, Create: `url1`, Update: `url2`}, + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`, `compartment_id`, `lifecycle_details`, `notebook_session_configuration_details[0].notebook_session_shape_config_details`, `notebook_session_config_details[0].notebook_session_shape_config_details`, `notebook_session_runtime_config_details`}}, } - DatascienceNotebookSessionResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + + DatascienceNotebookSessionResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Required, acctest.Create, DataSciencePrivateEndpointRepresentation) + + 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_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + DefinedTagsDependencies - NotebookSessionConfigurationDetailsResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) + + NotebookSessionConfigurationDetailsResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_private_endpoint", "test_data_science_private_endpoint", acctest.Required, acctest.Create, DataSciencePrivateEndpointRepresentation) + + 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_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + DefinedTagsDependencies @@ -169,7 +146,6 @@ func TestDatascienceNotebookSessionWithConfigDetailsResource_basic(t *testing.T) compartmentIdUVariableStr := fmt.Sprintf("variable \"compartment_id_for_update\" { default = \"%s\" }\n", compartmentIdU) resourceName := "oci_datascience_notebook_session.test_notebook_session" - // datasourceName := "data.oci_datascience_notebook_sessions.test_notebook_session" singularDatasourceName := "data.oci_datascience_notebook_session.test_notebook_session" var resId, resId2 string @@ -209,7 +185,7 @@ func TestDatascienceNotebookSessionWithConfigDetailsResource_basic(t *testing.T) resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.block_storage_size_in_gbs", "100"), - resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "notebook_session_config_details.0.private_endpoint_id"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.shape", "VM.Standard2.1"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), @@ -231,7 +207,6 @@ func TestDatascienceNotebookSessionWithConfigDetailsResource_basic(t *testing.T) Config: config + compartmentIdVariableStr + DatascienceNotebookSessionResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_datascience_notebook_session", "test_notebook_session", acctest.Optional, acctest.Create, DatascienceNotebookSessionRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(resourceName, "created_by"), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), @@ -260,7 +235,7 @@ func TestDatascienceNotebookSessionWithConfigDetailsResource_basic(t *testing.T) "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, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(resourceName, "created_by"), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), @@ -268,6 +243,7 @@ func TestDatascienceNotebookSessionWithConfigDetailsResource_basic(t *testing.T) resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.block_storage_size_in_gbs", "100"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "notebook_session_config_details.0.private_endpoint_id"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.shape", "VM.Standard2.1"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), @@ -296,6 +272,7 @@ func TestDatascienceNotebookSessionWithConfigDetailsResource_basic(t *testing.T) resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.block_storage_size_in_gbs", "100"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "notebook_session_config_details.0.private_endpoint_id"), resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.shape", "VM.Standard2.1"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), @@ -417,7 +394,7 @@ func TestDatascienceNotebookSessionWithConfigurationDetailsResource_basic(t *tes "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, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(resourceName, "created_by"), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), @@ -477,6 +454,8 @@ func TestDatascienceNotebookSessionWithConfigurationDetailsResource_basic(t *tes resource.TestCheckResourceAttr(datasourceName, "notebook_sessions.0.display_name", "displayName2"), resource.TestCheckResourceAttr(datasourceName, "notebook_sessions.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "notebook_sessions.0.id"), + resource.TestCheckResourceAttr(datasourceName, "notebook_sessions.0.notebook_session_config_details.0.block_storage_size_in_gbs", "100"), + resource.TestCheckResourceAttr(datasourceName, "notebook_sessions.0.notebook_session_config_details.0.shape", "VM.Standard2.1"), resource.TestCheckResourceAttrSet(datasourceName, "notebook_sessions.0.notebook_session_url"), resource.TestCheckResourceAttrSet(datasourceName, "notebook_sessions.0.project_id"), resource.TestCheckResourceAttrSet(datasourceName, "notebook_sessions.0.state"), diff --git a/internal/integrationtest/file_storage_file_system_test.go b/internal/integrationtest/file_storage_file_system_test.go index bae91f7d3bf..0e42ea07f03 100644 --- a/internal/integrationtest/file_storage_file_system_test.go +++ b/internal/integrationtest/file_storage_file_system_test.go @@ -6,6 +6,7 @@ package integrationtest import ( "context" "fmt" + "regexp" "strconv" "testing" "time" @@ -125,6 +126,7 @@ func TestFileStorageFileSystemResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "display_name", "media-files-1"), resource.TestCheckResourceAttrSet(resourceName, "filesystem_snapshot_policy_id"), + resource.TestMatchResourceAttr(resourceName, "filesystem_snapshot_policy_id", regexp.MustCompile("ocid*")), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "kms_key_id"), @@ -157,6 +159,36 @@ func TestFileStorageFileSystemResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), resource.TestCheckResourceAttr(resourceName, "display_name", "media-files-1"), resource.TestCheckResourceAttrSet(resourceName, "filesystem_snapshot_policy_id"), + resource.TestMatchResourceAttr(resourceName, "filesystem_snapshot_policy_id", regexp.MustCompile("ocid*")), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "kms_key_id"), + resource.TestCheckResourceAttrSet(resourceName, "metered_bytes"), + resource.TestCheckResourceAttrSet(resourceName, "source_snapshot_id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + 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 + }, + ), + }, + // Detach policy from FS (policy will get attached back to FS in the next step) + { + Config: config + compartmentIdVariableStr + compartmentIdUVariableStr + FileStorageFileSystemResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_file_storage_file_system", "test_file_system2", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(FileStorageFileSystemRepresentation, map[string]interface{}{ + "filesystem_snapshot_policy_id": acctest.Representation{RepType: acctest.Optional, Create: ""}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "availability_domain"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "media-files-1"), + resource.TestCheckResourceAttr(resourceName, "filesystem_snapshot_policy_id", ""), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "kms_key_id"), @@ -176,6 +208,7 @@ func TestFileStorageFileSystemResource_basic(t *testing.T) { }, // verify updates to updatable parameters + // Includes attach policy to FS { Config: config + compartmentIdVariableStr + FileStorageFileSystemResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_file_storage_file_system", "test_file_system2", acctest.Optional, acctest.Update, FileStorageFileSystemRepresentation), @@ -184,6 +217,7 @@ func TestFileStorageFileSystemResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), resource.TestCheckResourceAttrSet(resourceName, "filesystem_snapshot_policy_id"), + resource.TestMatchResourceAttr(resourceName, "filesystem_snapshot_policy_id", regexp.MustCompile("ocid*")), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "kms_key_id"), @@ -212,6 +246,7 @@ func TestFileStorageFileSystemResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttrSet(datasourceName, "filesystem_snapshot_policy_id"), + resource.TestMatchResourceAttr(datasourceName, "filesystem_snapshot_policy_id", regexp.MustCompile("ocid*")), resource.TestCheckResourceAttrSet(datasourceName, "id"), resource.TestCheckResourceAttrSet(datasourceName, "parent_file_system_id"), resource.TestCheckResourceAttrSet(datasourceName, "source_snapshot_id"), diff --git a/internal/integrationtest/kms_ekms_private_endpoint_test.go b/internal/integrationtest/kms_ekms_private_endpoint_test.go new file mode 100644 index 00000000000..f2d2babf105 --- /dev/null +++ b/internal/integrationtest/kms_ekms_private_endpoint_test.go @@ -0,0 +1,335 @@ +// 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" + "strings" + "testing" + "time" + + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_kms "github.com/oracle/oci-go-sdk/v65/keymanagement" + + "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 ( + KmsEkmsPrivateEndpointRequiredOnlyResource = acctest.GenerateResourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Required, acctest.Create, KmsEkmsPrivateEndpointRepresentation) + + KmsEkmsPrivateEndpointResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Optional, acctest.Update, KmsEkmsPrivateEndpointRepresentation) + + KmsEkmsPrivateEndpointSingularDataSourceRepresentation = map[string]interface{}{ + "ekms_private_endpoint_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_kms_ekms_private_endpoint.test_ekms_private_endpoint.id}`}, + } + + KmsEkmsPrivateEndpointDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsEkmsPrivateEndpointDataSourceFilterRepresentation}} + KmsEkmsPrivateEndpointDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_kms_ekms_private_endpoint.test_ekms_private_endpoint.id}`}}, + } + + KmsEkmsPrivateEndpointRepresentation = map[string]interface{}{ + "ca_bundle": acctest.Representation{RepType: acctest.Required, Create: `${var.ca_bundle}`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `EKMS Private Endpoint 1`, Update: `displayName2`}, + "external_key_manager_ip": acctest.Representation{RepType: acctest.Required, Create: `10.0.0.31`}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${var.subnet_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{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + //"port": acctest.Representation{RepType: acctest.Optional, Create: `443`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangesEkmsPeRepresentation}, + } + KmsEkmsPrivateEndpointResourceDependencies = DefinedTagsDependencies + ignoreChangesEkmsPeRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`ca_bundle`, `defined_tags`, `freeform_tags`}}, + } +) + +// issue-routing-tag: kms/default +func TestKmsEkmsPrivateEndpointResource_basic(t *testing.T) { + httpreplay.SetScenario("TestKmsEkmsPrivateEndpointResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + subnet_id := utils.GetEnvSettingWithBlankDefault("ekms_subnet_id") + subnetIdVariableStr := fmt.Sprintf("variable \"subnet_id\" { default = \"%s\" }\n", subnet_id) + + ca_bundle := utils.GetEnvSettingWithBlankDefault("ekms_ca_bundle") + caBundleVariableStr := fmt.Sprintf("variable \"ca_bundle\" { default = \"%s\" }\n", ca_bundle) + + resourceName := "oci_kms_ekms_private_endpoint.test_ekms_private_endpoint" + datasourceName := "data.oci_kms_ekms_private_endpoints.test_ekms_private_endpoints" + singularDatasourceName := "data.oci_kms_ekms_private_endpoint.test_ekms_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+subnetIdVariableStr+caBundleVariableStr+KmsEkmsPrivateEndpointResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Optional, acctest.Create, KmsEkmsPrivateEndpointRepresentation), "keymanagement", "ekmsPrivateEndpoint", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + subnetIdVariableStr + caBundleVariableStr + KmsEkmsPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Required, acctest.Create, KmsEkmsPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "subnet_id", subnet_id), + resource.TestCheckResourceAttr(resourceName, "ca_bundle", strings.Replace(ca_bundle, "\\n", "\n", -1)), + resource.TestCheckResourceAttr(resourceName, "display_name", "EKMS Private Endpoint 1"), + resource.TestCheckResourceAttr(resourceName, "external_key_manager_ip", "10.0.0.31"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr, + }, + //verify Create with optionals + { + Config: config + compartmentIdVariableStr + subnetIdVariableStr + caBundleVariableStr + KmsEkmsPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Optional, acctest.Create, KmsEkmsPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "EKMS Private Endpoint 1"), + resource.TestCheckResourceAttr(resourceName, "external_key_manager_ip", "10.0.0.31"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "subnet_id", subnet_id), + resource.TestCheckResourceAttr(resourceName, "ca_bundle", strings.Replace(ca_bundle, "\\n", "\n", -1)), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "port", "443"), + 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 + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + subnetIdVariableStr + caBundleVariableStr + KmsEkmsPrivateEndpointResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Optional, acctest.Update, KmsEkmsPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "external_key_manager_ip", "10.0.0.31"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "subnet_id", subnet_id), + resource.TestCheckResourceAttr(resourceName, "ca_bundle", strings.Replace(ca_bundle, "\\n", "\n", -1)), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "port", "443"), + 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 + }, + ), + }, + // verify datasource + { + Config: config + subnetIdVariableStr + caBundleVariableStr + KmsEkmsPrivateEndpointResourceDependencies + + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_ekms_private_endpoints", "test_ekms_private_endpoints", acctest.Optional, acctest.Update, KmsEkmsPrivateEndpointDataSourceRepresentation) + + compartmentIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Optional, acctest.Update, KmsEkmsPrivateEndpointRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + + resource.TestCheckResourceAttr(datasourceName, "ekms_private_endpoints.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "ekms_private_endpoints.0.compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "ekms_private_endpoints.0.display_name", "displayName2"), + resource.TestCheckResourceAttrSet(datasourceName, "ekms_private_endpoints.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "ekms_private_endpoints.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "ekms_private_endpoints.0.subnet_id"), + resource.TestCheckResourceAttrSet(datasourceName, "ekms_private_endpoints.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "ekms_private_endpoints.0.time_updated"), + ), + }, + // verify singular datasource + { + Config: config + subnetIdVariableStr + caBundleVariableStr + KmsEkmsPrivateEndpointResourceDependencies + + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_ekms_private_endpoint", "test_ekms_private_endpoint", acctest.Required, acctest.Create, KmsEkmsPrivateEndpointSingularDataSourceRepresentation) + + compartmentIdVariableStr + KmsEkmsPrivateEndpointResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "ekms_private_endpoint_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(singularDatasourceName, "external_key_manager_ip", "10.0.0.31"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "port", "443"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "private_endpoint_ip"), + resource.TestCheckResourceAttr(resourceName, "ca_bundle", strings.Replace(ca_bundle, "\\n", "\n", -1)), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // verify resource import + { + Config: config + KmsEkmsPrivateEndpointRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckKmsEkmsPrivateEndpointDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).EkmClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_kms_ekms_private_endpoint" { + noResourceFound = false + request := oci_kms.GetEkmsPrivateEndpointRequest{} + + tmp := rs.Primary.ID + request.EkmsPrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "kms") + + response, err := client.GetEkmsPrivateEndpoint(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_kms.EkmsPrivateEndpointLifecycleStateDeleted): 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("KmsEkmsPrivateEndpoint") { + resource.AddTestSweepers("KmsEkmsPrivateEndpoint", &resource.Sweeper{ + Name: "KmsEkmsPrivateEndpoint", + Dependencies: acctest.DependencyGraph["ekmsPrivateEndpoint"], + F: sweepKmsEkmsPrivateEndpointResource, + }) + } +} + +func sweepKmsEkmsPrivateEndpointResource(compartment string) error { + ekmClient := acctest.GetTestClients(&schema.ResourceData{}).EkmClient() + ekmsPrivateEndpointIds, err := getKmsEkmsPrivateEndpointIds(compartment) + if err != nil { + return err + } + for _, ekmsPrivateEndpointId := range ekmsPrivateEndpointIds { + if ok := acctest.SweeperDefaultResourceId[ekmsPrivateEndpointId]; !ok { + deleteEkmsPrivateEndpointRequest := oci_kms.DeleteEkmsPrivateEndpointRequest{} + + deleteEkmsPrivateEndpointRequest.EkmsPrivateEndpointId = &ekmsPrivateEndpointId + + deleteEkmsPrivateEndpointRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "kms") + _, error := ekmClient.DeleteEkmsPrivateEndpoint(context.Background(), deleteEkmsPrivateEndpointRequest) + if error != nil { + fmt.Printf("Error deleting EkmsPrivateEndpoint %s %s, It is possible that the resource is already deleted. Please verify manually \n", ekmsPrivateEndpointId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &ekmsPrivateEndpointId, KmsEkmsPrivateEndpointSweepWaitCondition, time.Duration(3*time.Minute), + KmsEkmsPrivateEndpointSweepResponseFetchOperation, "kms", true) + } + } + return nil +} + +func getKmsEkmsPrivateEndpointIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "EkmsPrivateEndpointId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + ekmClient := acctest.GetTestClients(&schema.ResourceData{}).EkmClient() + + listEkmsPrivateEndpointsRequest := oci_kms.ListEkmsPrivateEndpointsRequest{} + listEkmsPrivateEndpointsRequest.CompartmentId = &compartmentId + listEkmsPrivateEndpointsResponse, err := ekmClient.ListEkmsPrivateEndpoints(context.Background(), listEkmsPrivateEndpointsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting EkmsPrivateEndpoint list for compartment id : %s , %s \n", compartmentId, err) + } + for _, ekmsPrivateEndpoint := range listEkmsPrivateEndpointsResponse.Items { + id := *ekmsPrivateEndpoint.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "EkmsPrivateEndpointId", id) + } + return resourceIds, nil +} + +func KmsEkmsPrivateEndpointSweepWaitCondition(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 ekmsPrivateEndpointResponse, ok := response.Response.(oci_kms.GetEkmsPrivateEndpointResponse); ok { + return ekmsPrivateEndpointResponse.LifecycleState != oci_kms.EkmsPrivateEndpointLifecycleStateDeleted + } + return false +} + +func KmsEkmsPrivateEndpointSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.EkmClient().GetEkmsPrivateEndpoint(context.Background(), oci_kms.GetEkmsPrivateEndpointRequest{ + EkmsPrivateEndpointId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/kms_key_test.go b/internal/integrationtest/kms_key_test.go index f83e106b2c0..cf26cf89544 100644 --- a/internal/integrationtest/kms_key_test.go +++ b/internal/integrationtest/kms_key_test.go @@ -29,11 +29,19 @@ var ( KmsKeyResourceConfig = KmsKeyResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_kms_key", "test_key", acctest.Optional, acctest.Update, KmsKeyRepresentation) + KmsExternalKeyResourceConfig = KmsExternalKeyResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key", "test_ext_key", acctest.Optional, acctest.Update, KmsExternalKeyRepresentation) + KmsKmsKeySingularDataSourceRepresentation = map[string]interface{}{ "key_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_kms_key.test_key.id}`}, "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_vault.management_endpoint}`}, } + KmsKmsExternalKeySingularDataSourceRepresentation = map[string]interface{}{ + "key_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_kms_key.test_ext_key.id}`}, + "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_ext_vault.management_endpoint}`}, + } + KmsKmsKeyDataSourceRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_vault.management_endpoint}`}, @@ -46,6 +54,18 @@ var ( "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_kms_key.test_key.id}`}}, } + KmsKmsExternalKeyDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_ext_vault.management_endpoint}`}, + "protection_mode": acctest.Representation{RepType: acctest.Optional, Create: `EXTERNAL`}, + "algorithm": acctest.Representation{RepType: acctest.Optional, Create: `AES`}, + "length": acctest.Representation{RepType: acctest.Optional, Create: `32`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsKeyExternalDataSourceFilterRepresentation}} + KmsKeyExternalDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_kms_key.test_ext_key.id}`}}, + } + deletionTime = time.Now().UTC().AddDate(0, 0, 8).Truncate(time.Millisecond) KmsKeyRepresentation = map[string]interface{}{ @@ -54,14 +74,36 @@ var ( "key_shape": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsKeyKeyShapeRepresentation}, "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_vault.management_endpoint}`}, "desired_state": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`}, - "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "protection_mode": acctest.Representation{RepType: acctest.Optional, Create: `SOFTWARE`}, - "time_of_deletion": acctest.Representation{RepType: acctest.Required, Create: deletionTime.Format(time.RFC3339Nano)}, + //"external_key_reference": acctest.RepresentationGroup{RepType: acctest.Optional, Group: KmsKeyExternalKeyReferenceRepresentation}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "protection_mode": acctest.Representation{RepType: acctest.Optional, Create: `SOFTWARE`}, + "time_of_deletion": acctest.Representation{RepType: acctest.Required, Create: deletionTime.Format(time.RFC3339Nano)}, } + + KmsExternalKeyRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `External Key C`, Update: `displayName2`}, + "key_shape": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsExternalKeyKeyShapeRepresentation}, + "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_ext_vault.management_endpoint}`}, + "desired_state": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`}, + "external_key_reference": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsKeyExternalKeyReferenceRepresentation}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "protection_mode": acctest.Representation{RepType: acctest.Required, Create: `EXTERNAL`}, + "time_of_deletion": acctest.Representation{RepType: acctest.Required, Create: deletionTime.Format(time.RFC3339Nano)}, + } + + KmsExternalKeyKeyShapeRepresentation = map[string]interface{}{ + "algorithm": acctest.Representation{RepType: acctest.Required, Create: `AES`}, + "length": acctest.Representation{RepType: acctest.Required, Create: `32`}, + } + KmsKeyKeyShapeRepresentation = map[string]interface{}{ "algorithm": acctest.Representation{RepType: acctest.Required, Create: `AES`}, "length": acctest.Representation{RepType: acctest.Required, Create: `16`}, } + KmsKeyExternalKeyReferenceRepresentation = map[string]interface{}{ + "external_key_id": acctest.Representation{RepType: acctest.Required, Create: `f3cf68ae-659c-4e9e-8be7-ee39fa9ffa3c`}, + } kmsVaultId = utils.GetEnvSettingWithBlankDefault("kms_vault_ocid") KmsVaultIdVariableStr = fmt.Sprintf("variable \"kms_vault_id\" { default = \"%s\" }\n", kmsVaultId) @@ -73,6 +115,8 @@ var ( kmsKeyCompartmentId = utils.GetEnvSettingWithBlankDefault("compartment_ocid") kmsKeyCompartmentIdVariableStr = fmt.Sprintf("variable \"kms_key_compartment_id\" { default = \"%s\" }\n", kmsKeyCompartmentId) + kmsExternalVaultId = utils.GetEnvSettingWithBlankDefault("kms_external_vault_ocid") + KmsExternalVaultIdVariableStr = fmt.Sprintf("variable \"kms_external_vault_id\" { default = \"%s\" }\n", kmsExternalVaultId) // Should deprecate use of tenancy level resources KmsKeyResourceDependencies = KmsVaultIdVariableStr + ` @@ -81,6 +125,13 @@ var ( vault_id = "${var.kms_vault_id}" } ` + KmsExternalKeyResourceDependencies = KmsExternalVaultIdVariableStr + ` + data "oci_kms_vault" "test_ext_vault" { + #Required + vault_id = "${var.kms_external_vault_id}" + } + ` + KeyResourceDependencyConfig = KmsKeyResourceDependencies + ` data "oci_kms_keys" "test_keys_dependency" { #Required @@ -132,6 +183,156 @@ var ( ` ) +func TestExternalKmsKeyResource_basic(t *testing.T) { + httpreplay.SetScenario("TestKmsExternalKeyResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_kms_key.test_ext_key" + datasourceName := "data.oci_kms_keys.test_ext_key" + singularDatasourceName := "data.oci_kms_key.test_ext_key" + + 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+KmsExternalKeyResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_kms_key", "test_ext_key", acctest.Optional, acctest.Create, KmsExternalKeyRepresentation), "keymanagement", "key", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + KmsExternalKeyResourceDependencies + DefinedTagsDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key", "test_ext_key", acctest.Required, acctest.Create, KmsExternalKeyRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "External Key C"), + resource.TestCheckResourceAttr(resourceName, "key_shape.#", "1"), + resource.TestCheckResourceAttr(resourceName, "key_shape.0.algorithm", "AES"), + resource.TestCheckResourceAttr(resourceName, "key_shape.0.length", "32"), + resource.TestCheckResourceAttr(resourceName, "external_key_reference.#", "1"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + KmsExternalKeyResourceDependencies, + }, + + { + Config: config + compartmentIdVariableStr + KmsExternalKeyResourceDependencies + DefinedTagsDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key", "test_ext_key", acctest.Optional, acctest.Create, KmsExternalKeyRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "current_key_version"), + resource.TestCheckResourceAttr(resourceName, "display_name", "External Key C"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "key_shape.#", "1"), + resource.TestCheckResourceAttr(resourceName, "key_shape.0.algorithm", "AES"), + resource.TestCheckResourceAttr(resourceName, "key_shape.0.length", "32"), + resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), + resource.TestCheckResourceAttr(resourceName, "protection_mode", "EXTERNAL"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "vault_id"), + resource.TestCheckResourceAttr(resourceName, "external_key_reference.#", "1"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + KmsExternalKeyResourceDependencies + DefinedTagsDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key", "test_ext_key", acctest.Optional, acctest.Update, KmsExternalKeyRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "current_key_version"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "key_shape.#", "1"), + resource.TestCheckResourceAttr(resourceName, "key_shape.0.algorithm", "AES"), + resource.TestCheckResourceAttr(resourceName, "key_shape.0.length", "32"), + resource.TestCheckResourceAttr(resourceName, "protection_mode", "EXTERNAL"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "vault_id"), + resource.TestCheckResourceAttr(resourceName, "external_key_reference.#", "1"), + + 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 + }, + ), + }, + + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_keys", "test_ext_key", acctest.Optional, acctest.Update, KmsKmsExternalKeyDataSourceRepresentation) + + compartmentIdVariableStr + KmsExternalKeyResourceDependencies + DefinedTagsDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key", "test_ext_key", acctest.Optional, acctest.Update, KmsExternalKeyRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "algorithm", "AES"), + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "management_endpoint"), + resource.TestCheckResourceAttr(datasourceName, "protection_mode", "EXTERNAL"), + resource.TestCheckResourceAttr(datasourceName, "length", "32"), + + resource.TestCheckResourceAttr(datasourceName, "keys.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "keys.0.compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "keys.0.display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "keys.0.freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "keys.0.id"), + resource.TestCheckResourceAttr(datasourceName, "keys.0.protection_mode", "EXTERNAL"), + resource.TestCheckResourceAttrSet(datasourceName, "keys.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "keys.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "keys.0.vault_id"), + resource.TestCheckResourceAttr(datasourceName, "external_key_reference.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_key", "test_ext_key", acctest.Required, acctest.Create, KmsKmsExternalKeySingularDataSourceRepresentation) + + compartmentIdVariableStr + KmsExternalKeyResourceConfig + DefinedTagsDependencies, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "key_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(singularDatasourceName, "current_key_version"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "is_primary"), + resource.TestCheckResourceAttr(singularDatasourceName, "key_shape.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "key_shape.0.algorithm", "AES"), + resource.TestCheckResourceAttr(singularDatasourceName, "key_shape.0.length", "32"), + resource.TestCheckResourceAttr(singularDatasourceName, "protection_mode", "EXTERNAL"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "vault_id"), + resource.TestCheckResourceAttr(datasourceName, "external_key_reference.#", "1"), + ), + }, + }) + +} + // issue-routing-tag: kms/default func TestKmsKeyResource_basic(t *testing.T) { httpreplay.SetScenario("TestKmsKeyResource_basic") @@ -277,6 +478,7 @@ func TestKmsKeyResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "keys.#", "1"), resource.TestCheckResourceAttr(datasourceName, "keys.0.compartment_id", compartmentId), resource.TestCheckResourceAttr(datasourceName, "keys.0.display_name", "displayName2"), + //resource.TestCheckResourceAttr(datasourceName, "keys.0.external_key_reference_details.#", "1"), resource.TestCheckResourceAttr(datasourceName, "keys.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "keys.0.id"), resource.TestCheckResourceAttr(datasourceName, "keys.0.protection_mode", "SOFTWARE"), @@ -331,6 +533,7 @@ func TestKmsKeyResource_basic(t *testing.T) { ImportStateVerify: true, ImportStateIdFunc: keyImportId, ImportStateVerifyIgnore: []string{ + "external_key_reference", "desired_state", "time_of_deletion", "replica_details", diff --git a/internal/integrationtest/kms_key_version_test.go b/internal/integrationtest/kms_key_version_test.go index 90ae37bf1de..e25891318f0 100644 --- a/internal/integrationtest/kms_key_version_test.go +++ b/internal/integrationtest/kms_key_version_test.go @@ -18,10 +18,13 @@ import ( ) var ( - KeyVersionRequiredOnlyResource = acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, keyVersionRepresentation) + KmsKeyVersionRequiredOnlyResource = acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, KmsKeyVersionRepresentation) KmsKeyVersionResourceConfig = KmsKeyVersionResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, keyVersionRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, KmsKeyVersionRepresentation) + + KmsExternalKeyVersionResourceConfig = KmsKeyVersionResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_ext_key_version", acctest.Required, acctest.Create, KmsExternalKeyVersionRepresentation) KmsKmsKeyVersionSingularDataSourceRepresentation = map[string]interface{}{ "key_id": acctest.Representation{RepType: acctest.Required, Create: `${lookup(data.oci_kms_keys.test_keys_dependency.keys[0], "id")}`}, @@ -29,6 +32,12 @@ var ( "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_vault.management_endpoint}`}, } + KmsKmsExternalKeyVersionSingularDataSourceRepresentation = map[string]interface{}{ + "key_id": acctest.Representation{RepType: acctest.Required, Create: `${lookup(data.oci_kms_keys.test_ext_keys_dependency.keys[0], "id")}`}, + "key_version_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_kms_key_version.test_ext_key_version.key_version_id}`}, + "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_ext_vault.management_endpoint}`}, + } + KmsKmsKeyVersionDataSourceRepresentation = map[string]interface{}{ "key_id": acctest.Representation{RepType: acctest.Required, Create: `${lookup(data.oci_kms_keys.test_keys_dependency.keys[0], "id")}`}, "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_vault.management_endpoint}`}, @@ -38,17 +47,142 @@ var ( "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_kms_key_version.test_key_version.key_version_id}`}}, } + KmsKmsExternalKeyVersionDataSourceRepresentation = map[string]interface{}{ + "key_id": acctest.Representation{RepType: acctest.Required, Create: `${lookup(data.oci_kms_keys.test_ext_keys_dependency.keys[0], "id")}`}, + "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_ext_vault.management_endpoint}`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsExternalKeyVersionDataSourceFilterRepresentation}} + KmsExternalKeyVersionDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `key_version_id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_kms_key_version.test_ext_key_version.key_version_id}`}}, + } + keyVersionDeletionTime = time.Now().UTC().AddDate(0, 0, 8).Truncate(time.Millisecond) - keyVersionRepresentation = map[string]interface{}{ - "key_id": acctest.Representation{RepType: acctest.Required, Create: `${lookup(data.oci_kms_keys.test_keys_dependency.keys[0], "id")}`}, + keyId = utils.GetEnvSettingWithBlankDefault("key_id") + keyIdVariableStr = fmt.Sprintf("variable \"key_id\" { default = \"%s\" }\n", keyId) + + KmsKeyVersionRepresentation = map[string]interface{}{ + "key_id": acctest.Representation{RepType: acctest.Required, Create: `${var.key_id}`}, "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_vault.management_endpoint}`}, "time_of_deletion": acctest.Representation{RepType: acctest.Required, Create: keyVersionDeletionTime.Format(time.RFC3339Nano)}, } + KmsExternalKeyVersionRepresentation = map[string]interface{}{ + "key_id": acctest.Representation{RepType: acctest.Required, Create: `${var.ext_key_id}`}, + "management_endpoint": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_kms_vault.test_ext_vault.management_endpoint}`}, + "time_of_deletion": acctest.Representation{RepType: acctest.Required, Create: keyVersionDeletionTime.Format(time.RFC3339Nano)}, + "external_key_version_id": acctest.Representation{RepType: acctest.Required, Create: `204026f5-9798-46da-9b9e-0c99689b599c`}, + } + + //KmsKeyVersionResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, KmsKeyVersionRepresentation) + + // KeyResourceDependencyConfig KmsKeyVersionResourceDependencies = KeyResourceDependencyConfig ) +func TestKmsExternalKeyVersionResource_basic(t *testing.T) { + httpreplay.SetScenario("TestKmsExternalKeyVersionResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + os.Setenv("disable_kms_version_delete", "true") + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + extKeyId := utils.GetEnvSettingWithBlankDefault("ext_key_id") + extKeyIdVariableStr := fmt.Sprintf("variable \"ext_key_id\" { default = \"%s\" }\n", extKeyId) + + resourceName := "oci_kms_key_version.test_ext_key_version" + datasourceName := "data.oci_kms_key_versions.test_ext_key_versions" + singularDatasourceName := "data.oci_kms_key_version.test_ext_key_version" + + // 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+KmsKeyVersionResourceDependencies+extKeyIdVariableStr+ + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_ext_key_version", acctest.Optional, acctest.Create, KmsExternalKeyVersionRepresentation), "keymanagement", "keyVersion", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + + { + Config: config + compartmentIdVariableStr + KmsKeyVersionResourceDependencies + extKeyIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_ext_key_version", acctest.Required, acctest.Create, KmsExternalKeyVersionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "key_id"), + resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), + resource.TestCheckResourceAttrSet(resourceName, "external_key_version_id"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + // delete before next Create + { + Config: config + compartmentIdVariableStr + KmsKeyVersionResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + KmsKeyVersionResourceDependencies + extKeyIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_ext_key_version", acctest.Optional, acctest.Create, KmsExternalKeyVersionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "compartment_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "key_id"), + resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "vault_id"), + resource.TestCheckResourceAttrSet(resourceName, "external_key_version_id"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_key_versions", "test_ext_key_versions", acctest.Optional, acctest.Update, KmsKmsExternalKeyVersionDataSourceRepresentation) + + compartmentIdVariableStr + KmsKeyVersionResourceDependencies + extKeyIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_ext_key_version", acctest.Optional, acctest.Update, KmsExternalKeyVersionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "key_id"), + resource.TestCheckResourceAttrSet(datasourceName, "management_endpoint"), + + resource.TestCheckResourceAttr(datasourceName, "key_versions.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.compartment_id"), + //resource.TestCheckResourceAttr(datasourceName, "key_versions.0.external_key_reference_details.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.key_version_id"), + resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.key_id"), + resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.vault_id"), + resource.TestCheckResourceAttrSet(resourceName, "external_key_version_id"), + ), + }, + + // verify singular datasource + { + Config: config + extKeyIdVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_key_version", "test_ext_key_version", acctest.Required, acctest.Create, KmsKmsExternalKeyVersionSingularDataSourceRepresentation) + + compartmentIdVariableStr + KmsExternalKeyVersionResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "key_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "key_version_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "management_endpoint"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "is_primary"), + resource.TestCheckResourceAttr(singularDatasourceName, "replica_details.#", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "key_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "vault_id"), + resource.TestCheckResourceAttrSet(resourceName, "external_key_version_id"), + ), + }, + }) +} + // issue-routing-tag: kms/default func TestKmsKeyVersionResource_basic(t *testing.T) { httpreplay.SetScenario("TestKmsKeyVersionResource_basic") @@ -59,24 +193,47 @@ func TestKmsKeyVersionResource_basic(t *testing.T) { compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) - tenancyId := utils.GetEnvSettingWithBlankDefault("tenancy_ocid") + //tenancyId := utils.GetEnvSettingWithBlankDefault("tenancy_ocid") resourceName := "oci_kms_key_version.test_key_version" datasourceName := "data.oci_kms_key_versions.test_key_versions" singularDatasourceName := "data.oci_kms_key_version.test_key_version" - // 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+compartmentIdVariableStr+KmsKeyVersionResourceDependencies+ - acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, keyVersionRepresentation), "keymanagement", "keyVersion", t) + // 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+KmsKeyVersionResourceDependencies+keyIdVariableStr+ + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Optional, acctest.Create, KmsKeyVersionRepresentation), "keymanagement", "keyVersion", t) acctest.ResourceTest(t, nil, []resource.TestStep{ // verify Create { - Config: config + compartmentIdVariableStr + KmsKeyVersionResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, keyVersionRepresentation), + Config: config + compartmentIdVariableStr + KmsKeyVersionResourceDependencies + keyIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, KmsKeyVersionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "key_id"), + resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + KmsKeyVersionResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + KmsKeyVersionResourceDependencies + keyIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Optional, acctest.Create, KmsKeyVersionRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "compartment_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "key_id"), resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "vault_id"), func(s *terraform.State) (err error) { _, err = acctest.FromInstanceState(s, resourceName, "id") @@ -89,14 +246,15 @@ func TestKmsKeyVersionResource_basic(t *testing.T) { { Config: config + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_key_versions", "test_key_versions", acctest.Optional, acctest.Update, KmsKmsKeyVersionDataSourceRepresentation) + - compartmentIdVariableStr + KmsKeyVersionResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Optional, acctest.Update, keyVersionRepresentation), + compartmentIdVariableStr + KmsKeyVersionResourceDependencies + keyIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Optional, acctest.Update, KmsKeyVersionRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(datasourceName, "key_id"), resource.TestCheckResourceAttrSet(datasourceName, "management_endpoint"), resource.TestCheckResourceAttr(datasourceName, "key_versions.#", "1"), resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.compartment_id"), + //resource.TestCheckResourceAttr(datasourceName, "key_versions.0.external_key_reference_details.#", "1"), resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.key_version_id"), resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.key_id"), resource.TestCheckResourceAttrSet(datasourceName, "key_versions.0.state"), @@ -106,14 +264,13 @@ func TestKmsKeyVersionResource_basic(t *testing.T) { }, // verify singular datasource { - Config: config + + Config: config + keyIdVariableStr + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_key_version", "test_key_version", acctest.Required, acctest.Create, KmsKmsKeyVersionSingularDataSourceRepresentation) + compartmentIdVariableStr + KmsKeyVersionResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "key_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "key_version_id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "management_endpoint"), - resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", tenancyId), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "is_primary"), resource.TestCheckResourceAttr(singularDatasourceName, "replica_details.#", "1"), @@ -125,11 +282,12 @@ func TestKmsKeyVersionResource_basic(t *testing.T) { }, // verify resource import { - Config: config + KeyVersionRequiredOnlyResource, + Config: config + KmsKeyVersionRequiredOnlyResource, ImportState: true, ImportStateVerify: true, ImportStateIdFunc: keyVersionImportId, ImportStateVerifyIgnore: []string{ + //"external_key_version_id", "management_endpoint", "time_of_deletion", "replica_details", diff --git a/internal/integrationtest/kms_vault_test.go b/internal/integrationtest/kms_vault_test.go index 7ed220d9f33..135b6cf1602 100644 --- a/internal/integrationtest/kms_vault_test.go +++ b/internal/integrationtest/kms_vault_test.go @@ -10,6 +10,8 @@ import ( "testing" "time" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/oracle/oci-go-sdk/v65/common" @@ -18,7 +20,6 @@ import ( "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/utils" ) @@ -43,21 +44,180 @@ var ( kmsVaultDeletionTime = time.Now().UTC().AddDate(0, 0, 8).Truncate(time.Millisecond) + privateEndpointId = utils.GetEnvSettingWithBlankDefault("ekms_private_endpoint_id") + privateEndpointIdVariableStr = fmt.Sprintf("variable \"private_endpoint_id\" { default = \"%s\" }\n", privateEndpointId) + + KmsVaultExternalKeyManagerMetadataRepresentation = map[string]interface{}{ + "external_vault_endpoint_url": acctest.Representation{RepType: acctest.Required, Create: `https://10.0.0.31/api/v1/cckm/oci/ekm/v1/vaults/af872d6e-52f2-4c6b-9694-5b4821d1b5b6`}, + "oauth_metadata": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsVaultExternalKeyManagerMetadataOauthMetadataRepresentation}, + "private_endpoint_id": acctest.Representation{RepType: acctest.Required, Create: `${var.private_endpoint_id}`}, + } + + KmsVaultExternalKeyManagerMetadataOauthMetadataRepresentation = map[string]interface{}{ + "client_app_id": acctest.Representation{RepType: acctest.Required, Create: `3977f2b65fca4c569f31142959867127`}, + "client_app_secret": acctest.Representation{RepType: acctest.Required, Create: `d82452e5-f5e3-4363-b7a9-0d74052d1236`}, + "idcs_account_name_url": acctest.Representation{RepType: acctest.Required, Create: `https://idcs-87920edcd339458790351b0e4d415385.identity.oraclecloud.com`}, + } + KmsVaultRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `Vault 1`, Update: `displayName2`}, - "vault_type": acctest.Representation{RepType: acctest.Required, Create: `VIRTUAL_PRIVATE`}, + "vault_type": acctest.Representation{RepType: acctest.Required, Create: `DEFAULT`}, "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"}}, "time_of_deletion": acctest.Representation{RepType: acctest.Optional, Create: deletionTime.Format(time.RFC3339Nano)}, } + KmsExternalVaultRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `External Vault 1`, Update: `displayName2`}, + "vault_type": acctest.Representation{RepType: acctest.Required, Create: `EXTERNAL`}, + "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"}}, + "time_of_deletion": acctest.Representation{RepType: acctest.Optional, Create: deletionTime.Format(time.RFC3339Nano)}, + "external_key_manager_metadata": acctest.RepresentationGroup{RepType: acctest.Required, Group: KmsVaultExternalKeyManagerMetadataRepresentation}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangesExtVaultRepresentation}, + } + + ignoreChangesExtVaultRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`, `freeform_tags`}}, + } KmsVaultResourceDependencies = DefinedTagsDependencies ) +func TestKmsExternalVaultResource_basic(t *testing.T) { + httpreplay.SetScenario("TestKmsExternalVaultResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_kms_vault.test_vault" + datasourceName := "data.oci_kms_vaults.test_vaults" + singularDatasourceName := "data.oci_kms_vault.test_vault" + + 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+ + acctest.GenerateResourceFromRepresentationMap("oci_kms_vault", "test_vault", acctest.Optional, acctest.Create, KmsExternalVaultRepresentation), "keymanagement", "vault", t) + + acctest.ResourceTest(t, testAccCheckKMSVaultDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + privateEndpointIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_vault", "test_vault", acctest.Required, acctest.Create, KmsExternalVaultRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "display_name", "External Vault 1"), + resource.TestCheckResourceAttr(resourceName, "vault_type", "EXTERNAL"), + resource.TestCheckResourceAttr(resourceName, "external_key_manager_metadata.#", "1"), + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr, + }, + + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + privateEndpointIdVariableStr + KmsVaultResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_vault", "test_vault", acctest.Optional, acctest.Create, KmsExternalVaultRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "crypto_endpoint"), + resource.TestCheckResourceAttr(resourceName, "display_name", "External Vault 1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "external_key_manager_metadata.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vault_type", "EXTERNAL"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + privateEndpointIdVariableStr + KmsVaultResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_kms_vault", "test_vault", acctest.Optional, acctest.Update, KmsExternalVaultRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "crypto_endpoint"), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttr(resourceName, "vault_type", "EXTERNAL"), + + 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_kms_vaults", "test_vaults", acctest.Optional, acctest.Update, KmsKmsVaultDataSourceRepresentation) + + compartmentIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_kms_vault", "test_vault", acctest.Optional, acctest.Update, KmsVaultRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + + resource.TestCheckResourceAttr(datasourceName, "vaults.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "vaults.0.compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.crypto_endpoint"), + resource.TestCheckResourceAttr(datasourceName, "vaults.0.display_name", "displayName2"), + resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.management_endpoint"), + resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.time_created"), + resource.TestCheckResourceAttr(datasourceName, "vaults.0.vault_type", "EXTERNAL"), + resource.TestCheckResourceAttr(resourceName, "external_key_manager_metadata.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_kms_vault", "test_vault", acctest.Required, acctest.Create, KmsKmsVaultSingularDataSourceRepresentation) + + compartmentIdVariableStr, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "vault_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(singularDatasourceName, "crypto_endpoint"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "is_primary"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "management_endpoint"), + + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttr(singularDatasourceName, "vault_type", "EXTERNAL"), + resource.TestCheckResourceAttr(resourceName, "external_key_manager_metadata.#", "1"), + ), + }, + }) +} + // issue-routing-tag: kms/default func TestKmsVaultResource_basic(t *testing.T) { - t.Skip("Skip this test till KMS provides a better way of testing this.") + //t.Skip("Skip this test till KMS provides a better way of testing this.") httpreplay.SetScenario("TestKmsVaultResource_basic") defer httpreplay.SaveScenario() @@ -87,7 +247,7 @@ func TestKmsVaultResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName, "display_name", "Vault 1"), - resource.TestCheckResourceAttr(resourceName, "vault_type", "VIRTUAL_PRIVATE"), + resource.TestCheckResourceAttr(resourceName, "vault_type", "DEFAULT"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -108,12 +268,11 @@ func TestKmsVaultResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(resourceName, "crypto_endpoint"), resource.TestCheckResourceAttr(resourceName, "display_name", "Vault 1"), - resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), - resource.TestCheckResourceAttr(resourceName, "vault_type", "VIRTUAL_PRIVATE"), + resource.TestCheckResourceAttr(resourceName, "vault_type", "DEFAULT"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") @@ -138,12 +297,11 @@ func TestKmsVaultResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), resource.TestCheckResourceAttrSet(resourceName, "crypto_endpoint"), resource.TestCheckResourceAttr(resourceName, "display_name", "Vault 1"), - resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), - resource.TestCheckResourceAttr(resourceName, "vault_type", "VIRTUAL_PRIVATE"), + resource.TestCheckResourceAttr(resourceName, "vault_type", "DEFAULT"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -163,12 +321,11 @@ func TestKmsVaultResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(resourceName, "crypto_endpoint"), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), - resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "management_endpoint"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), - resource.TestCheckResourceAttr(resourceName, "vault_type", "VIRTUAL_PRIVATE"), + resource.TestCheckResourceAttr(resourceName, "vault_type", "DEFAULT"), func(s *terraform.State) (err error) { resId2, err = acctest.FromInstanceState(s, resourceName, "id") @@ -192,12 +349,11 @@ func TestKmsVaultResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "vaults.0.compartment_id", compartmentId), resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.crypto_endpoint"), resource.TestCheckResourceAttr(datasourceName, "vaults.0.display_name", "displayName2"), - resource.TestCheckResourceAttr(datasourceName, "vaults.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.id"), resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.management_endpoint"), resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.state"), resource.TestCheckResourceAttrSet(datasourceName, "vaults.0.time_created"), - resource.TestCheckResourceAttr(datasourceName, "vaults.0.vault_type", "VIRTUAL_PRIVATE"), + resource.TestCheckResourceAttr(datasourceName, "vaults.0.vault_type", "DEFAULT"), ), }, // verify singular datasource @@ -211,15 +367,13 @@ func TestKmsVaultResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(singularDatasourceName, "crypto_endpoint"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), - resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "is_primary"), resource.TestCheckResourceAttrSet(singularDatasourceName, "management_endpoint"), - resource.TestCheckResourceAttr(singularDatasourceName, "replica_details.#", "1"), - resource.TestCheckResourceAttrSet(singularDatasourceName, "restored_from_vault_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), - resource.TestCheckResourceAttr(singularDatasourceName, "vault_type", "VIRTUAL_PRIVATE"), + resource.TestCheckResourceAttr(singularDatasourceName, "vault_type", "DEFAULT"), ), }, // verify resource import diff --git a/internal/integrationtest/mysql_replica_test.go b/internal/integrationtest/mysql_replica_test.go index a448f5cd383..69c2c9f9091 100644 --- a/internal/integrationtest/mysql_replica_test.go +++ b/internal/integrationtest/mysql_replica_test.go @@ -35,13 +35,17 @@ var ( "replica_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_mysql_replica.test_replica.id}`}, } - MysqlMysqlReplicaDataSourceRepresentation = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "db_system_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_mysql_mysql_db_system.test_mysql_db_system.id}`}, - "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, - "replica_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_mysql_replica.test_replica.id}`}, - "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, - "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: MysqlReplicaDataSourceFilterRepresentation}} + MysqlReplicaDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "configuration_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_mysql_mysql_db_system.test_mysql_db_system.configuration_id}`}, + "db_system_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_mysql_mysql_db_system.test_mysql_db_system.id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "is_up_to_date": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "replica_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_mysql_replica.test_replica.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: MysqlReplicaDataSourceFilterRepresentation}, + } + MysqlReplicaDataSourceFilterRepresentation = map[string]interface{}{ "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_mysql_replica.test_replica.id}`}}, @@ -53,8 +57,15 @@ var ( "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "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"}}, - "is_delete_protected": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "is_delete_protected": acctest.Representation{RepType: acctest.Optional, Create: `true`, Update: `false`}, "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagsChangesForMysqlReplica}, + "replica_overrides": acctest.RepresentationGroup{RepType: acctest.Optional, Group: MysqlReplicaReplicaOverridesRepresentation}, + } + + MysqlReplicaReplicaOverridesRepresentation = map[string]interface{}{ + "configuration_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_mysql_mysql_db_system.test_mysql_db_system.configuration_id}`}, + "mysql_version": acctest.Representation{RepType: acctest.Optional, Create: `8.0.34`, Update: `8.1.0`}, + "shape_name": acctest.Representation{RepType: acctest.Optional, Create: `${oci_mysql_mysql_db_system.test_mysql_db_system.shape_name}`}, } ignoreDefinedTagsChangesForMysqlReplica = map[string]interface{}{ @@ -145,10 +156,14 @@ func TestMysqlReplicaResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "ip_address"), - resource.TestCheckResourceAttr(resourceName, "is_delete_protected", "false"), + resource.TestCheckResourceAttr(resourceName, "is_delete_protected", "true"), resource.TestCheckResourceAttrSet(resourceName, "mysql_version"), resource.TestCheckResourceAttrSet(resourceName, "port"), resource.TestCheckResourceAttrSet(resourceName, "port_x"), + resource.TestCheckResourceAttr(resourceName, "replica_overrides.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "replica_overrides.0.configuration_id"), + resource.TestCheckResourceAttr(resourceName, "replica_overrides.0.mysql_version", "8.0.34"), + resource.TestCheckResourceAttrSet(resourceName, "replica_overrides.0.shape_name"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -182,6 +197,10 @@ func TestMysqlReplicaResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "mysql_version"), resource.TestCheckResourceAttrSet(resourceName, "port"), resource.TestCheckResourceAttrSet(resourceName, "port_x"), + resource.TestCheckResourceAttr(resourceName, "replica_overrides.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "replica_overrides.0.configuration_id"), + resource.TestCheckResourceAttr(resourceName, "replica_overrides.0.mysql_version", "8.1.0"), + resource.TestCheckResourceAttrSet(resourceName, "replica_overrides.0.shape_name"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -197,19 +216,22 @@ func TestMysqlReplicaResource_basic(t *testing.T) { // verify datasource { Config: config + - acctest.GenerateDataSourceFromRepresentationMap("oci_mysql_replicas", "test_replicas", acctest.Optional, acctest.Update, MysqlMysqlReplicaDataSourceRepresentation) + + acctest.GenerateDataSourceFromRepresentationMap("oci_mysql_replicas", "test_replicas", acctest.Optional, acctest.Update, MysqlReplicaDataSourceRepresentation) + compartmentIdVariableStr + MysqlReplicaResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_mysql_replica", "test_replica", acctest.Optional, acctest.Update, MysqlReplicaRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "configuration_id"), resource.TestCheckResourceAttrSet(datasourceName, "db_system_id"), resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttr(datasourceName, "is_up_to_date", "false"), resource.TestCheckResourceAttrSet(datasourceName, "replica_id"), resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), resource.TestCheckResourceAttr(datasourceName, "replicas.#", "1"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.availability_domain"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.configuration_id"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.db_system_id"), resource.TestCheckResourceAttr(datasourceName, "replicas.0.description", "description2"), resource.TestCheckResourceAttr(datasourceName, "replicas.0.display_name", "displayName2"), @@ -221,6 +243,11 @@ func TestMysqlReplicaResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.mysql_version"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.port"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.port_x"), + resource.TestCheckResourceAttr(datasourceName, "replicas.0.replica_overrides.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.replica_overrides.0.configuration_id"), + resource.TestCheckResourceAttr(datasourceName, "replicas.0.replica_overrides.0.mysql_version", "8.1.0"), + resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.replica_overrides.0.shape_name"), + resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.shape_name"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.state"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.time_created"), resource.TestCheckResourceAttrSet(datasourceName, "replicas.0.time_updated"), @@ -246,6 +273,9 @@ func TestMysqlReplicaResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "mysql_version"), resource.TestCheckResourceAttrSet(singularDatasourceName, "port"), resource.TestCheckResourceAttrSet(singularDatasourceName, "port_x"), + resource.TestCheckResourceAttr(singularDatasourceName, "replica_overrides.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "replica_overrides.0.mysql_version", "8.1.0"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "shape_name"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), diff --git a/internal/integrationtest/queue_queue_test.go b/internal/integrationtest/queue_queue_test.go index 35399c42b61..026321c1cac 100644 --- a/internal/integrationtest/queue_queue_test.go +++ b/internal/integrationtest/queue_queue_test.go @@ -53,6 +53,7 @@ var ( QueueQueueRepresentation = map[string]interface{}{ "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: `displayName`, Update: `displayName2`}, + "channel_consumption_limit": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, "custom_encryption_key_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.custom_encryption_key_id}`}, "dead_letter_queue_delivery_count": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, "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")}`}, @@ -116,6 +117,7 @@ func TestQueueQueueResource_basic(t *testing.T) { Config: config + compartmentIdVariableStr + customEncryptionKeyIdVariableStr + QueueQueueResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_queue_queue", "test_queue", acctest.Optional, acctest.Create, QueueQueueRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "channel_consumption_limit", "10"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(resourceName, "custom_encryption_key_id"), resource.TestCheckResourceAttr(resourceName, "dead_letter_queue_delivery_count", "10"), @@ -150,6 +152,7 @@ func TestQueueQueueResource_basic(t *testing.T) { "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, })), Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "channel_consumption_limit", "10"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), resource.TestCheckResourceAttrSet(resourceName, "custom_encryption_key_id"), resource.TestCheckResourceAttr(resourceName, "dead_letter_queue_delivery_count", "10"), @@ -214,6 +217,7 @@ func TestQueueQueueResource_basic(t *testing.T) { Config: config + compartmentIdVariableStr + customEncryptionKeyIdVariableStr + QueueQueueResourceDependencies + acctest.GenerateResourceFromRepresentationMap("oci_queue_queue", "test_queue", acctest.Optional, acctest.Update, QueueQueueRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "channel_consumption_limit", "11"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttrSet(resourceName, "custom_encryption_key_id"), resource.TestCheckResourceAttr(resourceName, "dead_letter_queue_delivery_count", "11"), @@ -262,6 +266,7 @@ func TestQueueQueueResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "queue_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "channel_consumption_limit", "11"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), resource.TestCheckResourceAttr(singularDatasourceName, "dead_letter_queue_delivery_count", "11"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), diff --git a/internal/provider/register_datasource.go b/internal/provider/register_datasource.go index db864ad35c9..d5f55aa5522 100644 --- a/internal/provider/register_datasource.go +++ b/internal/provider/register_datasource.go @@ -29,6 +29,7 @@ import ( tf_cloud_bridge "github.com/oracle/terraform-provider-oci/internal/service/cloud_bridge" tf_cloud_guard "github.com/oracle/terraform-provider-oci/internal/service/cloud_guard" tf_cloud_migrations "github.com/oracle/terraform-provider-oci/internal/service/cloud_migrations" + tf_compute_cloud_at_customer "github.com/oracle/terraform-provider-oci/internal/service/compute_cloud_at_customer" tf_computeinstanceagent "github.com/oracle/terraform-provider-oci/internal/service/computeinstanceagent" tf_container_instances "github.com/oracle/terraform-provider-oci/internal/service/container_instances" tf_containerengine "github.com/oracle/terraform-provider-oci/internal/service/containerengine" @@ -188,6 +189,9 @@ func init() { if common.CheckForEnabledServices("cloudmigrations") { tf_cloud_migrations.RegisterDatasource() } + if common.CheckForEnabledServices("computecloudatcustomer") { + tf_compute_cloud_at_customer.RegisterDatasource() + } if common.CheckForEnabledServices("computeinstanceagent") { tf_computeinstanceagent.RegisterDatasource() } diff --git a/internal/provider/register_resource.go b/internal/provider/register_resource.go index f953ffa38f5..178e97df709 100644 --- a/internal/provider/register_resource.go +++ b/internal/provider/register_resource.go @@ -29,6 +29,7 @@ import ( tf_cloud_bridge "github.com/oracle/terraform-provider-oci/internal/service/cloud_bridge" tf_cloud_guard "github.com/oracle/terraform-provider-oci/internal/service/cloud_guard" tf_cloud_migrations "github.com/oracle/terraform-provider-oci/internal/service/cloud_migrations" + tf_compute_cloud_at_customer "github.com/oracle/terraform-provider-oci/internal/service/compute_cloud_at_customer" tf_computeinstanceagent "github.com/oracle/terraform-provider-oci/internal/service/computeinstanceagent" tf_container_instances "github.com/oracle/terraform-provider-oci/internal/service/container_instances" tf_containerengine "github.com/oracle/terraform-provider-oci/internal/service/containerengine" @@ -188,6 +189,9 @@ func init() { if common.CheckForEnabledServices("cloudmigrations") { tf_cloud_migrations.RegisterResource() } + if common.CheckForEnabledServices("computecloudatcustomer") { + tf_compute_cloud_at_customer.RegisterResource() + } if common.CheckForEnabledServices("computeinstanceagent") { tf_computeinstanceagent.RegisterResource() } diff --git a/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructure_data_source.go b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructure_data_source.go new file mode 100644 index 00000000000..2ccea4a78bc --- /dev/null +++ b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructure_data_source.go @@ -0,0 +1,151 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ComputeCloudAtCustomerCccInfrastructureDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["ccc_infrastructure_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(ComputeCloudAtCustomerCccInfrastructureResource(), fieldMap, readSingularComputeCloudAtCustomerCccInfrastructure) +} + +func readSingularComputeCloudAtCustomerCccInfrastructure(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccInfrastructureDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.ReadResource(sync) +} + +type ComputeCloudAtCustomerCccInfrastructureDataSourceCrud struct { + D *schema.ResourceData + Client *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient + Res *oci_compute_cloud_at_customer.GetCccInfrastructureResponse +} + +func (s *ComputeCloudAtCustomerCccInfrastructureDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ComputeCloudAtCustomerCccInfrastructureDataSourceCrud) Get() error { + request := oci_compute_cloud_at_customer.GetCccInfrastructureRequest{} + + if cccInfrastructureId, ok := s.D.GetOkExists("ccc_infrastructure_id"); ok { + tmp := cccInfrastructureId.(string) + request.CccInfrastructureId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "compute_cloud_at_customer") + + response, err := s.Client.GetCccInfrastructure(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ComputeCloudAtCustomerCccInfrastructureDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.CccUpgradeScheduleId != nil { + s.D.Set("ccc_upgrade_schedule_id", *s.Res.CccUpgradeScheduleId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.ConnectionDetails != nil { + s.D.Set("connection_details", *s.Res.ConnectionDetails) + } + + s.D.Set("connection_state", s.Res.ConnectionState) + + 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) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.InfrastructureInventory != nil { + s.D.Set("infrastructure_inventory", []interface{}{CccInfrastructureInventoryToMap(s.Res.InfrastructureInventory)}) + } else { + s.D.Set("infrastructure_inventory", nil) + } + + if s.Res.InfrastructureNetworkConfiguration != nil { + s.D.Set("infrastructure_network_configuration", []interface{}{CccInfrastructureNetworkConfigurationToMap(s.Res.InfrastructureNetworkConfiguration)}) + } else { + s.D.Set("infrastructure_network_configuration", nil) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.ProvisioningFingerprint != nil { + s.D.Set("provisioning_fingerprint", *s.Res.ProvisioningFingerprint) + } + + if s.Res.ProvisioningPin != nil { + s.D.Set("provisioning_pin", *s.Res.ProvisioningPin) + } + + if s.Res.ShortName != nil { + s.D.Set("short_name", *s.Res.ShortName) + } + + 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()) + } + + if s.Res.UpgradeInformation != nil { + s.D.Set("upgrade_information", []interface{}{CccUpgradeInformationToMap(s.Res.UpgradeInformation)}) + } else { + s.D.Set("upgrade_information", nil) + } + + return nil +} diff --git a/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructure_resource.go b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructure_resource.go new file mode 100644 index 00000000000..23d5799084a --- /dev/null +++ b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructure_resource.go @@ -0,0 +1,874 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ComputeCloudAtCustomerCccInfrastructureResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createComputeCloudAtCustomerCccInfrastructure, + Read: readComputeCloudAtCustomerCccInfrastructure, + Update: updateComputeCloudAtCustomerCccInfrastructure, + Delete: deleteComputeCloudAtCustomerCccInfrastructure, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "display_name": { + Type: schema.TypeString, + Required: true, + }, + "subnet_id": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "ccc_upgrade_schedule_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "connection_details": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "connection_state": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + + // Computed + "infrastructure_inventory": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "capacity_storage_tray_count": { + Type: schema.TypeInt, + Computed: true, + }, + "compute_node_count": { + Type: schema.TypeInt, + Computed: true, + }, + "management_node_count": { + Type: schema.TypeInt, + Computed: true, + }, + "performance_storage_tray_count": { + Type: schema.TypeInt, + Computed: true, + }, + "serial_number": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "infrastructure_network_configuration": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "dns_ips": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "infrastructure_routing_dynamic": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "bgp_topology": { + Type: schema.TypeString, + Computed: true, + }, + "oracle_asn": { + Type: schema.TypeInt, + Computed: true, + }, + "peer_information": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "asn": { + Type: schema.TypeInt, + Computed: true, + }, + "ip": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + }, + }, + "infrastructure_routing_static": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "uplink_hsrp_group": { + Type: schema.TypeInt, + Computed: true, + }, + "uplink_vlan": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "management_nodes": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "hostname": { + Type: schema.TypeString, + Computed: true, + }, + "ip": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "mgmt_vip_hostname": { + Type: schema.TypeString, + Computed: true, + }, + "mgmt_vip_ip": { + Type: schema.TypeString, + Computed: true, + }, + "spine_ips": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "spine_vip": { + Type: schema.TypeString, + Computed: true, + }, + "uplink_domain": { + Type: schema.TypeString, + Computed: true, + }, + "uplink_gateway_ip": { + Type: schema.TypeString, + Computed: true, + }, + "uplink_netmask": { + Type: schema.TypeString, + Computed: true, + }, + "uplink_port_count": { + Type: schema.TypeInt, + Computed: true, + }, + "uplink_port_forward_error_correction": { + Type: schema.TypeString, + Computed: true, + }, + "uplink_port_speed_in_gbps": { + Type: schema.TypeInt, + Computed: true, + }, + "uplink_vlan_mtu": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "provisioning_fingerprint": { + Type: schema.TypeString, + Computed: true, + }, + "provisioning_pin": { + Type: schema.TypeString, + Computed: true, + }, + "short_name": { + 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, + }, + "upgrade_information": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "current_version": { + Type: schema.TypeString, + Computed: true, + }, + "is_active": { + Type: schema.TypeBool, + Computed: true, + }, + "scheduled_upgrade_duration": { + Type: schema.TypeString, + Computed: true, + }, + "time_of_scheduled_upgrade": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func createComputeCloudAtCustomerCccInfrastructure(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccInfrastructureResourceCrud{} + // d.Set("display_name", "terraform-test-infra") + // d.Set("description", "This infrastructure was created by terraform-provider") + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.CreateResource(d, sync) +} + +func readComputeCloudAtCustomerCccInfrastructure(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccInfrastructureResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.ReadResource(sync) +} + +func updateComputeCloudAtCustomerCccInfrastructure(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccInfrastructureResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteComputeCloudAtCustomerCccInfrastructure(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccInfrastructureResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type ComputeCloudAtCustomerCccInfrastructureResourceCrud struct { + tfresource.BaseCrud + Client *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient + Res *oci_compute_cloud_at_customer.CccInfrastructure + DisableNotFoundRetries bool +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) CreatedPending() []string { + return []string{} +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateActive), + string(oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateNeedsAttention), + } +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) DeletedPending() []string { + return []string{} +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateDeleted), + } +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) Create() error { + request := oci_compute_cloud_at_customer.CreateCccInfrastructureRequest{} + + if cccUpgradeScheduleId, ok := s.D.GetOkExists("ccc_upgrade_schedule_id"); ok { + tmp := cccUpgradeScheduleId.(string) + request.CccUpgradeScheduleId = &tmp + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if connectionDetails, ok := s.D.GetOkExists("connection_details"); ok { + tmp := connectionDetails.(string) + request.ConnectionDetails = &tmp + } + + if connectionState, ok := s.D.GetOkExists("connection_state"); ok { + request.ConnectionState = oci_compute_cloud_at_customer.CccInfrastructureConnectionStateEnum(connectionState.(string)) + } + + 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 subnetId, ok := s.D.GetOkExists("subnet_id"); ok { + tmp := subnetId.(string) + request.SubnetId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + response, err := s.Client.CreateCccInfrastructure(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.CccInfrastructure + return nil +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) Get() error { + request := oci_compute_cloud_at_customer.GetCccInfrastructureRequest{} + + tmp := s.D.Id() + request.CccInfrastructureId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + response, err := s.Client.GetCccInfrastructure(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.CccInfrastructure + return nil +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) 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_compute_cloud_at_customer.UpdateCccInfrastructureRequest{} + + tmp := s.D.Id() + request.CccInfrastructureId = &tmp + + if cccUpgradeScheduleId, ok := s.D.GetOkExists("ccc_upgrade_schedule_id"); ok { + tmp := cccUpgradeScheduleId.(string) + request.CccUpgradeScheduleId = &tmp + } + + if connectionDetails, ok := s.D.GetOkExists("connection_details"); ok { + tmp := connectionDetails.(string) + request.ConnectionDetails = &tmp + } + + if connectionState, ok := s.D.GetOkExists("connection_state"); ok { + request.ConnectionState = oci_compute_cloud_at_customer.CccInfrastructureConnectionStateEnum(connectionState.(string)) + } + + 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 subnetId, ok := s.D.GetOkExists("subnet_id"); ok { + tmp := subnetId.(string) + request.SubnetId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + response, err := s.Client.UpdateCccInfrastructure(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.CccInfrastructure + return nil +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) Delete() error { + request := oci_compute_cloud_at_customer.DeleteCccInfrastructureRequest{} + + tmp := s.D.Id() + request.CccInfrastructureId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + _, err := s.Client.DeleteCccInfrastructure(context.Background(), request) + return err +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) SetData() error { + if s.Res.CccUpgradeScheduleId != nil { + s.D.Set("ccc_upgrade_schedule_id", *s.Res.CccUpgradeScheduleId) + } + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.ConnectionDetails != nil { + s.D.Set("connection_details", *s.Res.ConnectionDetails) + } + + s.D.Set("connection_state", s.Res.ConnectionState) + + 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) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.InfrastructureInventory != nil { + s.D.Set("infrastructure_inventory", []interface{}{CccInfrastructureInventoryToMap(s.Res.InfrastructureInventory)}) + } else { + s.D.Set("infrastructure_inventory", nil) + } + + if s.Res.InfrastructureNetworkConfiguration != nil { + s.D.Set("infrastructure_network_configuration", []interface{}{CccInfrastructureNetworkConfigurationToMap(s.Res.InfrastructureNetworkConfiguration)}) + } else { + s.D.Set("infrastructure_network_configuration", nil) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.ProvisioningFingerprint != nil { + s.D.Set("provisioning_fingerprint", *s.Res.ProvisioningFingerprint) + } + + if s.Res.ProvisioningPin != nil { + s.D.Set("provisioning_pin", *s.Res.ProvisioningPin) + } + + if s.Res.ShortName != nil { + s.D.Set("short_name", *s.Res.ShortName) + } + + 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()) + } + + if s.Res.UpgradeInformation != nil { + s.D.Set("upgrade_information", []interface{}{CccUpgradeInformationToMap(s.Res.UpgradeInformation)}) + } else { + s.D.Set("upgrade_information", nil) + } + + return nil +} + +func CccInfrastructureInventoryToMap(obj *oci_compute_cloud_at_customer.CccInfrastructureInventory) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CapacityStorageTrayCount != nil { + result["capacity_storage_tray_count"] = int(*obj.CapacityStorageTrayCount) + } + + if obj.ComputeNodeCount != nil { + result["compute_node_count"] = int(*obj.ComputeNodeCount) + } + + if obj.ManagementNodeCount != nil { + result["management_node_count"] = int(*obj.ManagementNodeCount) + } + + if obj.PerformanceStorageTrayCount != nil { + result["performance_storage_tray_count"] = int(*obj.PerformanceStorageTrayCount) + } + + if obj.SerialNumber != nil { + result["serial_number"] = string(*obj.SerialNumber) + } + + return result +} + +func CccInfrastructureManagementNodeToMap(obj oci_compute_cloud_at_customer.CccInfrastructureManagementNode) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Hostname != nil { + result["hostname"] = string(*obj.Hostname) + } + + if obj.Ip != nil { + result["ip"] = string(*obj.Ip) + } + + return result +} + +func CccInfrastructureNetworkConfigurationToMap(obj *oci_compute_cloud_at_customer.CccInfrastructureNetworkConfiguration) map[string]interface{} { + result := map[string]interface{}{} + + result["dns_ips"] = obj.DnsIps + result["dns_ips"] = obj.DnsIps + + if obj.InfrastructureRoutingDynamic != nil { + result["infrastructure_routing_dynamic"] = []interface{}{CccInfrastructureRoutingDynamicDetailsToMap(obj.InfrastructureRoutingDynamic)} + } + + if obj.InfrastructureRoutingStatic != nil { + result["infrastructure_routing_static"] = []interface{}{CccInfrastructureRoutingStaticDetailsToMap(obj.InfrastructureRoutingStatic)} + } + + managementNodes := []interface{}{} + for _, item := range obj.ManagementNodes { + managementNodes = append(managementNodes, CccInfrastructureManagementNodeToMap(item)) + } + result["management_nodes"] = managementNodes + + if obj.MgmtVipHostname != nil { + result["mgmt_vip_hostname"] = string(*obj.MgmtVipHostname) + } + + if obj.MgmtVipIp != nil { + result["mgmt_vip_ip"] = string(*obj.MgmtVipIp) + } + + result["spine_ips"] = obj.SpineIps + result["spine_ips"] = obj.SpineIps + + if obj.SpineVip != nil { + result["spine_vip"] = string(*obj.SpineVip) + } + + if obj.UplinkDomain != nil { + result["uplink_domain"] = string(*obj.UplinkDomain) + } + + if obj.UplinkGatewayIp != nil { + result["uplink_gateway_ip"] = string(*obj.UplinkGatewayIp) + } + + if obj.UplinkNetmask != nil { + result["uplink_netmask"] = string(*obj.UplinkNetmask) + } + + if obj.UplinkPortCount != nil { + result["uplink_port_count"] = int(*obj.UplinkPortCount) + } + + result["uplink_port_forward_error_correction"] = string(obj.UplinkPortForwardErrorCorrection) + + if obj.UplinkPortSpeedInGbps != nil { + result["uplink_port_speed_in_gbps"] = int(*obj.UplinkPortSpeedInGbps) + } + + if obj.UplinkVlanMtu != nil { + result["uplink_vlan_mtu"] = int(*obj.UplinkVlanMtu) + } + + return result +} + +func CccInfrastructureRoutingDynamicDetailsToMap(obj *oci_compute_cloud_at_customer.CccInfrastructureRoutingDynamicDetails) map[string]interface{} { + result := map[string]interface{}{} + + result["bgp_topology"] = string(obj.BgpTopology) + + if obj.OracleAsn != nil { + result["oracle_asn"] = int(*obj.OracleAsn) + } + + peerInformation := []interface{}{} + for _, item := range obj.PeerInformation { + peerInformation = append(peerInformation, PeerInformationToMap(item)) + } + result["peer_information"] = peerInformation + + return result +} + +func CccInfrastructureRoutingStaticDetailsToMap(obj *oci_compute_cloud_at_customer.CccInfrastructureRoutingStaticDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.UplinkHsrpGroup != nil { + result["uplink_hsrp_group"] = int(*obj.UplinkHsrpGroup) + } + + if obj.UplinkVlan != nil { + result["uplink_vlan"] = int(*obj.UplinkVlan) + } + + return result +} + +func CccInfrastructureSummaryToMap(obj oci_compute_cloud_at_customer.CccInfrastructureSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + result["connection_state"] = string(obj.ConnectionState) + + 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 + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.ShortName != nil { + result["short_name"] = string(*obj.ShortName) + } + + 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() + } + + return result +} + +func CccUpgradeInformationToMap(obj *oci_compute_cloud_at_customer.CccUpgradeInformation) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CurrentVersion != nil { + result["current_version"] = string(*obj.CurrentVersion) + } + + if obj.IsActive != nil { + result["is_active"] = bool(*obj.IsActive) + } + + if obj.ScheduledUpgradeDuration != nil { + result["scheduled_upgrade_duration"] = string(*obj.ScheduledUpgradeDuration) + } + + if obj.TimeOfScheduledUpgrade != nil { + result["time_of_scheduled_upgrade"] = obj.TimeOfScheduledUpgrade.String() + } + + return result +} + +func PeerInformationToMap(obj oci_compute_cloud_at_customer.PeerInformation) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Asn != nil { + result["asn"] = int(*obj.Asn) + } + + if obj.Ip != nil { + result["ip"] = string(*obj.Ip) + } + + return result +} + +func (s *ComputeCloudAtCustomerCccInfrastructureResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_compute_cloud_at_customer.ChangeCccInfrastructureCompartmentRequest{} + + idTmp := s.D.Id() + changeCompartmentRequest.CccInfrastructureId = &idTmp + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + _, err := s.Client.ChangeCccInfrastructureCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + return waitErr + } + + return nil +} diff --git a/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructures_data_source.go b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructures_data_source.go new file mode 100644 index 00000000000..5e2f1f1b978 --- /dev/null +++ b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_infrastructures_data_source.go @@ -0,0 +1,170 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ComputeCloudAtCustomerCccInfrastructuresDataSource() *schema.Resource { + return &schema.Resource{ + Read: readComputeCloudAtCustomerCccInfrastructures, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "access_level": { + Type: schema.TypeString, + Optional: true, + }, + "ccc_infrastructure_id": { + Type: schema.TypeString, + Optional: true, + }, + "compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "compartment_id_in_subtree": { + Type: schema.TypeBool, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "display_name_contains": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "ccc_infrastructure_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(ComputeCloudAtCustomerCccInfrastructureResource()), + }, + }, + }, + }, + }, + } +} + +func readComputeCloudAtCustomerCccInfrastructures(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccInfrastructuresDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.ReadResource(sync) +} + +type ComputeCloudAtCustomerCccInfrastructuresDataSourceCrud struct { + D *schema.ResourceData + Client *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient + Res *oci_compute_cloud_at_customer.ListCccInfrastructuresResponse +} + +func (s *ComputeCloudAtCustomerCccInfrastructuresDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ComputeCloudAtCustomerCccInfrastructuresDataSourceCrud) Get() error { + request := oci_compute_cloud_at_customer.ListCccInfrastructuresRequest{} + + if accessLevel, ok := s.D.GetOkExists("access_level"); ok { + request.AccessLevel = oci_compute_cloud_at_customer.ListCccInfrastructuresAccessLevelEnum(accessLevel.(string)) + } + + if cccInfrastructureId, ok := s.D.GetOkExists("id"); ok { + tmp := cccInfrastructureId.(string) + request.CccInfrastructureId = &tmp + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if compartmentIdInSubtree, ok := s.D.GetOkExists("compartment_id_in_subtree"); ok { + tmp := compartmentIdInSubtree.(bool) + request.CompartmentIdInSubtree = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if displayNameContains, ok := s.D.GetOkExists("display_name_contains"); ok { + tmp := displayNameContains.(string) + request.DisplayNameContains = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "compute_cloud_at_customer") + + response, err := s.Client.ListCccInfrastructures(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListCccInfrastructures(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 *ComputeCloudAtCustomerCccInfrastructuresDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ComputeCloudAtCustomerCccInfrastructuresDataSource-", ComputeCloudAtCustomerCccInfrastructuresDataSource(), s.D)) + resources := []map[string]interface{}{} + cccInfrastructure := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, CccInfrastructureSummaryToMap(item)) + } + cccInfrastructure["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, ComputeCloudAtCustomerCccInfrastructuresDataSource().Schema["ccc_infrastructure_collection"].Elem.(*schema.Resource).Schema) + cccInfrastructure["items"] = items + } + + resources = append(resources, cccInfrastructure) + if err := s.D.Set("ccc_infrastructure_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedule_data_source.go b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedule_data_source.go new file mode 100644 index 00000000000..fcb2b157b27 --- /dev/null +++ b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedule_data_source.go @@ -0,0 +1,116 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ComputeCloudAtCustomerCccUpgradeScheduleDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["ccc_upgrade_schedule_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(ComputeCloudAtCustomerCccUpgradeScheduleResource(), fieldMap, readSingularComputeCloudAtCustomerCccUpgradeSchedule) +} + +func readSingularComputeCloudAtCustomerCccUpgradeSchedule(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccUpgradeScheduleDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.ReadResource(sync) +} + +type ComputeCloudAtCustomerCccUpgradeScheduleDataSourceCrud struct { + D *schema.ResourceData + Client *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient + Res *oci_compute_cloud_at_customer.GetCccUpgradeScheduleResponse +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleDataSourceCrud) Get() error { + request := oci_compute_cloud_at_customer.GetCccUpgradeScheduleRequest{} + + if cccUpgradeScheduleId, ok := s.D.GetOkExists("ccc_upgrade_schedule_id"); ok { + tmp := cccUpgradeScheduleId.(string) + request.CccUpgradeScheduleId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "compute_cloud_at_customer") + + response, err := s.Client.GetCccUpgradeSchedule(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + 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) + } + + events := []interface{}{} + for _, item := range s.Res.Events { + events = append(events, CccScheduleEventToMap(item)) + } + s.D.Set("events", events) + + s.D.Set("freeform_tags", s.Res.FreeformTags) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + s.D.Set("infrastructure_ids", s.Res.InfrastructureIds) + s.D.Set("infrastructure_ids", s.Res.InfrastructureIds) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + 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/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedule_resource.go b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedule_resource.go new file mode 100644 index 00000000000..e2d114187b6 --- /dev/null +++ b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedule_resource.go @@ -0,0 +1,536 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import ( + "context" + "fmt" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ComputeCloudAtCustomerCccUpgradeScheduleResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createComputeCloudAtCustomerCccUpgradeSchedule, + Read: readComputeCloudAtCustomerCccUpgradeSchedule, + Update: updateComputeCloudAtCustomerCccUpgradeSchedule, + Delete: deleteComputeCloudAtCustomerCccUpgradeSchedule, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "display_name": { + Type: schema.TypeString, + Required: true, + }, + "events": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "description": { + Type: schema.TypeString, + Required: true, + }, + "schedule_event_duration": { + Type: schema.TypeString, + Required: true, + }, + "time_start": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.TimeDiffSuppressFunction, + }, + + // Optional + "schedule_event_recurrences": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "name": { + Type: schema.TypeString, + Computed: 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, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + + // Computed + "infrastructure_ids": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "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 createComputeCloudAtCustomerCccUpgradeSchedule(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.CreateResource(d, sync) +} + +func readComputeCloudAtCustomerCccUpgradeSchedule(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.ReadResource(sync) +} + +func updateComputeCloudAtCustomerCccUpgradeSchedule(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteComputeCloudAtCustomerCccUpgradeSchedule(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud struct { + tfresource.BaseCrud + Client *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient + Res *oci_compute_cloud_at_customer.CccUpgradeSchedule + DisableNotFoundRetries bool +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) CreatedPending() []string { + return []string{} +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateActive), + string(oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateNeedsAttention), + } +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) DeletedPending() []string { + return []string{} +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateDeleted), + } +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) Create() error { + request := oci_compute_cloud_at_customer.CreateCccUpgradeScheduleRequest{} + + 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 events, ok := s.D.GetOkExists("events"); ok { + interfaces := events.([]interface{}) + tmp := make([]oci_compute_cloud_at_customer.CreateCccScheduleEvent, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "events", stateDataIndex) + converted, err := s.mapToCreateCccScheduleEvent(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("events") { + request.Events = 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, "compute_cloud_at_customer") + + response, err := s.Client.CreateCccUpgradeSchedule(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.CccUpgradeSchedule + return nil +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) Get() error { + request := oci_compute_cloud_at_customer.GetCccUpgradeScheduleRequest{} + + tmp := s.D.Id() + request.CccUpgradeScheduleId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + response, err := s.Client.GetCccUpgradeSchedule(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.CccUpgradeSchedule + return nil +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) 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_compute_cloud_at_customer.UpdateCccUpgradeScheduleRequest{} + + tmp := s.D.Id() + request.CccUpgradeScheduleId = &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 events, ok := s.D.GetOkExists("events"); ok { + interfaces := events.([]interface{}) + tmp := make([]oci_compute_cloud_at_customer.UpdateCccScheduleEvent, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "events", stateDataIndex) + converted, err := s.mapToUpdateCccScheduleEvent(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("events") { + request.Events = 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, "compute_cloud_at_customer") + + response, err := s.Client.UpdateCccUpgradeSchedule(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.CccUpgradeSchedule + return nil +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) Delete() error { + request := oci_compute_cloud_at_customer.DeleteCccUpgradeScheduleRequest{} + + tmp := s.D.Id() + request.CccUpgradeScheduleId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + _, err := s.Client.DeleteCccUpgradeSchedule(context.Background(), request) + return err +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) 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) + } + + events := []interface{}{} + for _, item := range s.Res.Events { + events = append(events, CccScheduleEventToMap(item)) + } + s.D.Set("events", events) + + s.D.Set("freeform_tags", s.Res.FreeformTags) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + s.D.Set("infrastructure_ids", s.Res.InfrastructureIds) + s.D.Set("infrastructure_ids", s.Res.InfrastructureIds) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + 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 CccUpgradeScheduleSummaryToMap(obj oci_compute_cloud_at_customer.CccUpgradeScheduleSummary) 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 + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + 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 *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) mapToCreateCccScheduleEvent(fieldKeyFormat string) (oci_compute_cloud_at_customer.CreateCccScheduleEvent, error) { + result := oci_compute_cloud_at_customer.CreateCccScheduleEvent{} + + if description, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "description")); ok { + tmp := description.(string) + result.Description = &tmp + } + + if scheduleEventDuration, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "schedule_event_duration")); ok { + tmp := scheduleEventDuration.(string) + result.ScheduleEventDuration = &tmp + } + + if scheduleEventRecurrences, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "schedule_event_recurrences")); ok { + tmp := scheduleEventRecurrences.(string) + result.ScheduleEventRecurrences = &tmp + } + + if timeStart, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "time_start")); ok { + tmp, err := time.Parse(time.RFC3339, timeStart.(string)) + if err != nil { + return result, err + } + result.TimeStart = &oci_common.SDKTime{Time: tmp} + } + + return result, nil +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) mapToUpdateCccScheduleEvent(fieldKeyFormat string) (oci_compute_cloud_at_customer.UpdateCccScheduleEvent, error) { + result := oci_compute_cloud_at_customer.UpdateCccScheduleEvent{} + + if description, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "description")); ok { + tmp := description.(string) + result.Description = &tmp + } + + if scheduleEventDuration, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "schedule_event_duration")); ok { + tmp := scheduleEventDuration.(string) + result.ScheduleEventDuration = &tmp + } + + if scheduleEventRecurrences, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "schedule_event_recurrences")); ok { + tmp := scheduleEventRecurrences.(string) + result.ScheduleEventRecurrences = &tmp + } + + if timeStart, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "time_start")); ok { + tmp, err := time.Parse(time.RFC3339, timeStart.(string)) + if err != nil { + return result, err + } + result.TimeStart = &oci_common.SDKTime{Time: tmp} + } + + return result, nil +} + +func CccScheduleEventToMap(obj oci_compute_cloud_at_customer.CccScheduleEvent) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + if obj.Name != nil { + result["name"] = string(*obj.Name) + } + + if obj.ScheduleEventDuration != nil { + result["schedule_event_duration"] = string(*obj.ScheduleEventDuration) + } + + if obj.ScheduleEventRecurrences != nil { + result["schedule_event_recurrences"] = string(*obj.ScheduleEventRecurrences) + } + + if obj.TimeStart != nil { + result["time_start"] = obj.TimeStart.Format(time.RFC3339Nano) + } + + return result +} + +func (s *ComputeCloudAtCustomerCccUpgradeScheduleResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_compute_cloud_at_customer.ChangeCccUpgradeScheduleCompartmentRequest{} + + idTmp := s.D.Id() + changeCompartmentRequest.CccUpgradeScheduleId = &idTmp + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "compute_cloud_at_customer") + + _, err := s.Client.ChangeCccUpgradeScheduleCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + if waitErr := tfresource.WaitForUpdatedState(s.D, s); waitErr != nil { + return waitErr + } + + return nil +} diff --git a/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedules_data_source.go b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedules_data_source.go new file mode 100644 index 00000000000..66b2ad95874 --- /dev/null +++ b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_ccc_upgrade_schedules_data_source.go @@ -0,0 +1,170 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ComputeCloudAtCustomerCccUpgradeSchedulesDataSource() *schema.Resource { + return &schema.Resource{ + Read: readComputeCloudAtCustomerCccUpgradeSchedules, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "access_level": { + Type: schema.TypeString, + Optional: true, + }, + "ccc_upgrade_schedule_id": { + Type: schema.TypeString, + Optional: true, + }, + "compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "compartment_id_in_subtree": { + Type: schema.TypeBool, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "display_name_contains": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "ccc_upgrade_schedule_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(ComputeCloudAtCustomerCccUpgradeScheduleResource()), + }, + }, + }, + }, + }, + } +} + +func readComputeCloudAtCustomerCccUpgradeSchedules(d *schema.ResourceData, m interface{}) error { + sync := &ComputeCloudAtCustomerCccUpgradeSchedulesDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ComputeCloudAtCustomerClient() + + return tfresource.ReadResource(sync) +} + +type ComputeCloudAtCustomerCccUpgradeSchedulesDataSourceCrud struct { + D *schema.ResourceData + Client *oci_compute_cloud_at_customer.ComputeCloudAtCustomerClient + Res *oci_compute_cloud_at_customer.ListCccUpgradeSchedulesResponse +} + +func (s *ComputeCloudAtCustomerCccUpgradeSchedulesDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ComputeCloudAtCustomerCccUpgradeSchedulesDataSourceCrud) Get() error { + request := oci_compute_cloud_at_customer.ListCccUpgradeSchedulesRequest{} + + if accessLevel, ok := s.D.GetOkExists("access_level"); ok { + request.AccessLevel = oci_compute_cloud_at_customer.ListCccUpgradeSchedulesAccessLevelEnum(accessLevel.(string)) + } + + if cccUpgradeScheduleId, ok := s.D.GetOkExists("id"); ok { + tmp := cccUpgradeScheduleId.(string) + request.CccUpgradeScheduleId = &tmp + } + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if compartmentIdInSubtree, ok := s.D.GetOkExists("compartment_id_in_subtree"); ok { + tmp := compartmentIdInSubtree.(bool) + request.CompartmentIdInSubtree = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if displayNameContains, ok := s.D.GetOkExists("display_name_contains"); ok { + tmp := displayNameContains.(string) + request.DisplayNameContains = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "compute_cloud_at_customer") + + response, err := s.Client.ListCccUpgradeSchedules(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListCccUpgradeSchedules(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 *ComputeCloudAtCustomerCccUpgradeSchedulesDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ComputeCloudAtCustomerCccUpgradeSchedulesDataSource-", ComputeCloudAtCustomerCccUpgradeSchedulesDataSource(), s.D)) + resources := []map[string]interface{}{} + cccUpgradeSchedule := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, CccUpgradeScheduleSummaryToMap(item)) + } + cccUpgradeSchedule["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, ComputeCloudAtCustomerCccUpgradeSchedulesDataSource().Schema["ccc_upgrade_schedule_collection"].Elem.(*schema.Resource).Schema) + cccUpgradeSchedule["items"] = items + } + + resources = append(resources, cccUpgradeSchedule) + if err := s.D.Set("ccc_upgrade_schedule_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_export.go b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_export.go new file mode 100644 index 00000000000..dc2ed5c35ef --- /dev/null +++ b/internal/service/compute_cloud_at_customer/compute_cloud_at_customer_export.go @@ -0,0 +1,47 @@ +package compute_cloud_at_customer + +import ( + oci_compute_cloud_at_customer "github.com/oracle/oci-go-sdk/v65/computecloudatcustomer" + + tf_export "github.com/oracle/terraform-provider-oci/internal/commonexport" +) + +func init() { + tf_export.RegisterCompartmentGraphs("compute_cloud_at_customer", computeCloudAtCustomerResourceGraph) +} + +// Custom overrides for generating composite IDs within the resource discovery framework + +// Hints for discovering and exporting this resource to configuration and state files +var exportComputeCloudAtCustomerCccUpgradeScheduleHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_compute_cloud_at_customer_ccc_upgrade_schedule", + DatasourceClass: "oci_compute_cloud_at_customer_ccc_upgrade_schedules", + DatasourceItemsAttr: "ccc_upgrade_schedule_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "ccc_upgrade_schedule", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateActive), + string(oci_compute_cloud_at_customer.CccUpgradeScheduleLifecycleStateNeedsAttention), + }, +} + +var exportComputeCloudAtCustomerCccInfrastructureHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_compute_cloud_at_customer_ccc_infrastructure", + DatasourceClass: "oci_compute_cloud_at_customer_ccc_infrastructures", + DatasourceItemsAttr: "ccc_infrastructure_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "ccc_infrastructure", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateActive), + string(oci_compute_cloud_at_customer.CccInfrastructureLifecycleStateNeedsAttention), + }, +} + +var computeCloudAtCustomerResourceGraph = tf_export.TerraformResourceGraph{ + "oci_identity_compartment": { + {TerraformResourceHints: exportComputeCloudAtCustomerCccUpgradeScheduleHints}, + {TerraformResourceHints: exportComputeCloudAtCustomerCccInfrastructureHints}, + }, +} diff --git a/internal/service/compute_cloud_at_customer/register_datasource.go b/internal/service/compute_cloud_at_customer/register_datasource.go new file mode 100644 index 00000000000..ca9b9273348 --- /dev/null +++ b/internal/service/compute_cloud_at_customer/register_datasource.go @@ -0,0 +1,13 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterDatasource() { + tfresource.RegisterDatasource("oci_compute_cloud_at_customer_ccc_infrastructure", ComputeCloudAtCustomerCccInfrastructureDataSource()) + tfresource.RegisterDatasource("oci_compute_cloud_at_customer_ccc_infrastructures", ComputeCloudAtCustomerCccInfrastructuresDataSource()) + tfresource.RegisterDatasource("oci_compute_cloud_at_customer_ccc_upgrade_schedule", ComputeCloudAtCustomerCccUpgradeScheduleDataSource()) + tfresource.RegisterDatasource("oci_compute_cloud_at_customer_ccc_upgrade_schedules", ComputeCloudAtCustomerCccUpgradeSchedulesDataSource()) +} diff --git a/internal/service/compute_cloud_at_customer/register_resource.go b/internal/service/compute_cloud_at_customer/register_resource.go new file mode 100644 index 00000000000..236eb39c7c3 --- /dev/null +++ b/internal/service/compute_cloud_at_customer/register_resource.go @@ -0,0 +1,11 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package compute_cloud_at_customer + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterResource() { + tfresource.RegisterResource("oci_compute_cloud_at_customer_ccc_infrastructure", ComputeCloudAtCustomerCccInfrastructureResource()) + tfresource.RegisterResource("oci_compute_cloud_at_customer_ccc_upgrade_schedule", ComputeCloudAtCustomerCccUpgradeScheduleResource()) +} diff --git a/internal/service/database/database_autonomous_database_data_source.go b/internal/service/database/database_autonomous_database_data_source.go index cfc14c28979..19d2596770a 100644 --- a/internal/service/database/database_autonomous_database_data_source.go +++ b/internal/service/database/database_autonomous_database_data_source.go @@ -346,6 +346,16 @@ func (s *DatabaseAutonomousDatabaseDataSourceCrud) SetData() error { s.D.Set("remote_disaster_recovery_configuration", nil) } + if s.Res.ResourcePoolLeaderId != nil { + s.D.Set("resource_pool_leader_id", *s.Res.ResourcePoolLeaderId) + } + + if s.Res.ResourcePoolSummary != nil { + s.D.Set("resource_pool_summary", []interface{}{ResourcePoolSummaryToMap(s.Res.ResourcePoolSummary)}) + } else { + s.D.Set("resource_pool_summary", nil) + } + s.D.Set("role", s.Res.Role) scheduledOperations := []interface{}{} @@ -410,6 +420,10 @@ func (s *DatabaseAutonomousDatabaseDataSourceCrud) SetData() error { s.D.Set("time_maintenance_end", s.Res.TimeMaintenanceEnd.String()) } + if s.Res.TimeOfJoiningResourcePool != nil { + s.D.Set("time_of_joining_resource_pool", s.Res.TimeOfJoiningResourcePool.String()) + } + if s.Res.TimeOfLastFailover != nil { s.D.Set("time_of_last_failover", s.Res.TimeOfLastFailover.String()) } diff --git a/internal/service/database/database_autonomous_database_resource.go b/internal/service/database/database_autonomous_database_resource.go index b0aae53ce8d..0a2cfeebe23 100644 --- a/internal/service/database/database_autonomous_database_resource.go +++ b/internal/service/database/database_autonomous_database_resource.go @@ -6,7 +6,9 @@ package database import ( "context" "fmt" + "io" "log" + "os" "strings" "time" @@ -308,6 +310,37 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Computed: true, ForceNew: true, }, + "resource_pool_leader_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "resource_pool_summary": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "is_disabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + "pool_size": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, "scheduled_operations": { Type: schema.TypeList, Optional: true, @@ -923,6 +956,10 @@ func DatabaseAutonomousDatabaseResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "time_of_joining_resource_pool": { + Type: schema.TypeString, + Computed: true, + }, "time_of_last_failover": { Type: schema.TypeString, Computed: true, @@ -1553,6 +1590,22 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) Update() error { request.RefreshableMode = oci_database.UpdateAutonomousDatabaseDetailsRefreshableModeEnum(refreshableMode.(string)) } + if resourcePoolLeaderId, ok := s.D.GetOk("resource_pool_leader_id"); ok && s.D.HasChange("resource_pool_leader_id") { + tmp := resourcePoolLeaderId.(string) + request.ResourcePoolLeaderId = &tmp + } + + if resourcePoolSummary, ok := s.D.GetOkExists("resource_pool_summary"); ok && s.D.HasChange("resource_pool_summary") { + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + request.ResourcePoolSummary = &tmp + } + } + if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok && s.D.HasChange("scheduled_operations") { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) @@ -1940,6 +1993,16 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) SetData() error { s.D.Set("remote_disaster_recovery_configuration", nil) } + if s.Res.ResourcePoolLeaderId != nil { + s.D.Set("resource_pool_leader_id", *s.Res.ResourcePoolLeaderId) + } + + if s.Res.ResourcePoolSummary != nil { + s.D.Set("resource_pool_summary", []interface{}{ResourcePoolSummaryToMap(s.Res.ResourcePoolSummary)}) + } else { + s.D.Set("resource_pool_summary", nil) + } + s.D.Set("role", s.Res.Role) scheduledOperations := []interface{}{} @@ -2004,6 +2067,10 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) SetData() error { s.D.Set("time_maintenance_end", s.Res.TimeMaintenanceEnd.String()) } + if s.Res.TimeOfJoiningResourcePool != nil { + s.D.Set("time_of_joining_resource_pool", s.Res.TimeOfJoiningResourcePool.String()) + } + if s.Res.TimeOfLastFailover != nil { s.D.Set("time_of_last_failover", s.Res.TimeOfLastFailover.String()) } @@ -2281,6 +2348,36 @@ func DisasterRecoveryConfigurationToMap(obj *oci_database.DisasterRecoveryConfig return result } +func (s *DatabaseAutonomousDatabaseResourceCrud) mapToResourcePoolSummary(fieldKeyFormat string) (oci_database.ResourcePoolSummary, error) { + result := oci_database.ResourcePoolSummary{} + + if isDisabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_disabled")); ok { + tmp := isDisabled.(bool) + result.IsDisabled = &tmp + } + + if poolSize, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "pool_size")); ok { + tmp := poolSize.(int) + result.PoolSize = &tmp + } + + return result, nil +} + +func ResourcePoolSummaryToMap(obj *oci_database.ResourcePoolSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.IsDisabled != nil { + result["is_disabled"] = bool(*obj.IsDisabled) + } + + if obj.PoolSize != nil { + result["pool_size"] = int(*obj.PoolSize) + } + + return result +} + func (s *DatabaseAutonomousDatabaseResourceCrud) mapToScheduledOperationDetails(fieldKeyFormat string) (oci_database.ScheduledOperationDetails, error) { result := oci_database.ScheduledOperationDetails{} @@ -2509,6 +2606,24 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea tmp := privateEndpointLabel.(string) details.PrivateEndpointLabel = &tmp } + + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + details.ResourcePoolLeaderId = &tmp + } + + if resourcePoolSummary, ok := s.D.GetOk("resource_pool_summary"); ok { + t := fmt.Sprintf("%s rp create", resourcePoolSummary) + _, _ = io.WriteString(os.Stdout, t) + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + details.ResourcePoolSummary = &tmp + } + } if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) @@ -2752,6 +2867,22 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea tmp := privateEndpointLabel.(string) details.PrivateEndpointLabel = &tmp } + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + details.ResourcePoolLeaderId = &tmp + } + if resourcePoolSummary, ok := s.D.GetOkExists("resource_pool_summary"); ok { + t := fmt.Sprintf("%s rp create backup", resourcePoolSummary) + _, _ = io.WriteString(os.Stdout, t) + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + details.ResourcePoolSummary = &tmp + } + } if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) @@ -2987,6 +3118,22 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea if refreshableMode, ok := s.D.GetOkExists("refreshable_mode"); ok { details.RefreshableMode = oci_database.CreateRefreshableAutonomousDatabaseCloneDetailsRefreshableModeEnum(refreshableMode.(string)) } + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + details.ResourcePoolLeaderId = &tmp + } + if resourcePoolSummary, ok := s.D.GetOkExists("resource_pool_summary"); ok { + t := fmt.Sprintf("%s rp create clone to refreshable", resourcePoolSummary) + _, _ = io.WriteString(os.Stdout, t) + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + details.ResourcePoolSummary = &tmp + } + } if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) @@ -3201,6 +3348,23 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea tmp := privateEndpointLabel.(string) details.PrivateEndpointLabel = &tmp } + + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + details.ResourcePoolLeaderId = &tmp + } + if resourcePoolSummary, ok := s.D.GetOkExists("resource_pool_summary"); ok { + t := fmt.Sprintf("%s rp create cross region DG", resourcePoolSummary) + _, _ = io.WriteString(os.Stdout, t) + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + details.ResourcePoolSummary = &tmp + } + } if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) @@ -3421,6 +3585,23 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea tmp := privateEndpointLabel.(string) details.PrivateEndpointLabel = &tmp } + + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + details.ResourcePoolLeaderId = &tmp + } + if resourcePoolSummary, ok := s.D.GetOkExists("resource_pool_summary"); ok { + t := fmt.Sprintf("%s rp create cross region disaster recovery", resourcePoolSummary) + _, _ = io.WriteString(os.Stdout, t) + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + details.ResourcePoolSummary = &tmp + } + } if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) @@ -3648,6 +3829,22 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea tmp := privateEndpointLabel.(string) details.PrivateEndpointLabel = &tmp } + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + details.ResourcePoolLeaderId = &tmp + } + if resourcePoolSummary, ok := s.D.GetOkExists("resource_pool_summary"); ok { + t := fmt.Sprintf("%s rp create database", resourcePoolSummary) + _, _ = io.WriteString(os.Stdout, t) + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + details.ResourcePoolSummary = &tmp + } + } if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) @@ -3875,6 +4072,22 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) populateTopLevelPolymorphicCrea tmp := privateEndpointLabel.(string) details.PrivateEndpointLabel = &tmp } + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + details.ResourcePoolLeaderId = &tmp + } + if resourcePoolSummary, ok := s.D.GetOkExists("resource_pool_summary"); ok { + t := fmt.Sprintf("%s rp create none", resourcePoolSummary) + _, _ = io.WriteString(os.Stdout, t) + if tmpList := resourcePoolSummary.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "resource_pool_summary", 0) + tmp, err := s.mapToResourcePoolSummary(fieldKeyFormat) + if err != nil { + return err + } + details.ResourcePoolSummary = &tmp + } + } if scheduledOperations, ok := s.D.GetOkExists("scheduled_operations"); ok { interfaces := scheduledOperations.([]interface{}) tmp := make([]oci_database.ScheduledOperationDetails, len(interfaces)) 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 148010ed68a..7af4c99af6f 100644 --- a/internal/service/database/database_autonomous_databases_clones_data_source.go +++ b/internal/service/database/database_autonomous_databases_clones_data_source.go @@ -597,6 +597,31 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { }, }, }, + "resource_pool_leader_id": { + Type: schema.TypeString, + Computed: true, + }, + "resource_pool_summary": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "is_disabled": { + Type: schema.TypeBool, + Computed: true, + }, + "pool_size": { + Type: schema.TypeInt, + Computed: true, + }, + }, + }, + }, "role": { Type: schema.TypeString, Computed: true, @@ -735,6 +760,10 @@ func DatabaseAutonomousDatabasesClonesDataSource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "time_of_joining_resource_pool": { + Type: schema.TypeString, + Computed: true, + }, "time_of_last_failover": { Type: schema.TypeString, Computed: true, @@ -1149,6 +1178,16 @@ func (s *DatabaseAutonomousDatabasesClonesDataSourceCrud) SetData() error { autonomousDatabasesClone["remote_disaster_recovery_configuration"] = nil } + if r.ResourcePoolLeaderId != nil { + autonomousDatabasesClone["resource_pool_leader_id"] = *r.ResourcePoolLeaderId + } + + if r.ResourcePoolSummary != nil { + autonomousDatabasesClone["resource_pool_summary"] = []interface{}{ResourcePoolSummaryToMap(r.ResourcePoolSummary)} + } else { + autonomousDatabasesClone["resource_pool_summary"] = nil + } + autonomousDatabasesClone["role"] = r.Role scheduledOperations := []interface{}{} @@ -1213,6 +1252,10 @@ func (s *DatabaseAutonomousDatabasesClonesDataSourceCrud) SetData() error { autonomousDatabasesClone["time_maintenance_end"] = r.TimeMaintenanceEnd.String() } + if r.TimeOfJoiningResourcePool != nil { + autonomousDatabasesClone["time_of_joining_resource_pool"] = r.TimeOfJoiningResourcePool.String() + } + if r.TimeOfLastFailover != nil { autonomousDatabasesClone["time_of_last_failover"] = r.TimeOfLastFailover.String() } diff --git a/internal/service/database/database_autonomous_databases_data_source.go b/internal/service/database/database_autonomous_databases_data_source.go index b0f927a1f20..bd1a01afb44 100644 --- a/internal/service/database/database_autonomous_databases_data_source.go +++ b/internal/service/database/database_autonomous_databases_data_source.go @@ -54,6 +54,14 @@ func DatabaseAutonomousDatabasesDataSource() *schema.Resource { Type: schema.TypeBool, Optional: true, }, + "is_resource_pool_leader": { + Type: schema.TypeBool, + Optional: true, + }, + "resource_pool_leader_id": { + Type: schema.TypeString, + Optional: true, + }, "state": { Type: schema.TypeString, Optional: true, @@ -131,6 +139,16 @@ func (s *DatabaseAutonomousDatabasesDataSourceCrud) Get() error { request.IsRefreshableClone = &tmp } + if isResourcePoolLeader, ok := s.D.GetOkExists("is_resource_pool_leader"); ok { + tmp := isResourcePoolLeader.(bool) + request.IsResourcePoolLeader = &tmp + } + + if resourcePoolLeaderId, ok := s.D.GetOkExists("resource_pool_leader_id"); ok { + tmp := resourcePoolLeaderId.(string) + request.ResourcePoolLeaderId = &tmp + } + if state, ok := s.D.GetOkExists("state"); ok { request.LifecycleState = oci_database.AutonomousDatabaseSummaryLifecycleStateEnum(state.(string)) } @@ -450,6 +468,16 @@ func (s *DatabaseAutonomousDatabasesDataSourceCrud) SetData() error { autonomousDatabase["remote_disaster_recovery_configuration"] = nil } + if r.ResourcePoolLeaderId != nil { + autonomousDatabase["resource_pool_leader_id"] = *r.ResourcePoolLeaderId + } + + if r.ResourcePoolSummary != nil { + autonomousDatabase["resource_pool_summary"] = []interface{}{ResourcePoolSummaryToMap(r.ResourcePoolSummary)} + } else { + autonomousDatabase["resource_pool_summary"] = nil + } + autonomousDatabase["role"] = r.Role scheduledOperations := []interface{}{} @@ -514,6 +542,10 @@ func (s *DatabaseAutonomousDatabasesDataSourceCrud) SetData() error { autonomousDatabase["time_maintenance_end"] = r.TimeMaintenanceEnd.String() } + if r.TimeOfJoiningResourcePool != nil { + autonomousDatabase["time_of_joining_resource_pool"] = r.TimeOfJoiningResourcePool.String() + } + if r.TimeOfLastFailover != nil { autonomousDatabase["time_of_last_failover"] = r.TimeOfLastFailover.String() } diff --git a/internal/service/database_migration/database_migration_migration_data_source.go b/internal/service/database_migration/database_migration_migration_data_source.go index 03415e0bbaa..fe9987cac51 100644 --- a/internal/service/database_migration/database_migration_migration_data_source.go +++ b/internal/service/database_migration/database_migration_migration_data_source.go @@ -90,6 +90,16 @@ func (s *DatabaseMigrationMigrationDataSourceCrud) SetData() error { s.D.Set("data_transfer_medium_details", nil) } + if s.Res.DataTransferMediumDetailsV2 != nil { + dataTransferMediumDetailsV2Array := []interface{}{} + if dataTransferMediumDetailsV2Map := DataTransferMediumDetailsV2ToMap(&s.Res.DataTransferMediumDetailsV2); dataTransferMediumDetailsV2Map != nil { + dataTransferMediumDetailsV2Array = append(dataTransferMediumDetailsV2Array, dataTransferMediumDetailsV2Map) + } + s.D.Set("data_transfer_medium_details_v2", dataTransferMediumDetailsV2Array) + } else { + s.D.Set("data_transfer_medium_details_v2", nil) + } + if s.Res.DatapumpSettings != nil { s.D.Set("datapump_settings", []interface{}{DataPumpSettingsToMap(s.Res.DatapumpSettings)}) } else { diff --git a/internal/service/database_migration/database_migration_migration_resource.go b/internal/service/database_migration/database_migration_migration_resource.go index df26a49eddd..a95c2bac421 100644 --- a/internal/service/database_migration/database_migration_migration_resource.go +++ b/internal/service/database_migration/database_migration_migration_resource.go @@ -175,6 +175,79 @@ func DatabaseMigrationMigrationResource() *schema.Resource { }, }, }, + "data_transfer_medium_details_v2": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "AWS_S3", + "DBLINK", + "NFS", + "OBJECT_STORAGE", + }, true), + }, + + // Optional + "access_key_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "object_storage_bucket": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "bucket": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "namespace": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + "region": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "secret_access_key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, "datapump_settings": { Type: schema.TypeList, Optional: true, @@ -345,6 +418,11 @@ func DatabaseMigrationMigrationResource() *schema.Resource { // Required // Optional + "shared_storage_mount_target_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "source": { Type: schema.TypeList, Optional: true, @@ -1113,6 +1191,17 @@ func (s *DatabaseMigrationMigrationResourceCrud) Create() error { } } + if dataTransferMediumDetailsV2, ok := s.D.GetOkExists("data_transfer_medium_details_v2"); ok { + if tmpList := dataTransferMediumDetailsV2.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "data_transfer_medium_details_v2", 0) + tmp, err := s.mapToDataTransferMediumDetailsV2(fieldKeyFormat) + if err != nil { + return err + } + request.DataTransferMediumDetailsV2 = tmp + } + } + if datapumpSettings, ok := s.D.GetOkExists("datapump_settings"); ok { if tmpList := datapumpSettings.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "datapump_settings", 0) @@ -1423,7 +1512,18 @@ func (s *DatabaseMigrationMigrationResourceCrud) Update() error { } } - if datapumpSettings, ok := s.D.GetOkExists("datapump_settings"); ok && s.D.HasChange("datapump_settings") { + if dataTransferMediumDetailsV2, ok := s.D.GetOkExists("data_transfer_medium_details_v2"); ok { + if tmpList := dataTransferMediumDetailsV2.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "data_transfer_medium_details_v2", 0) + tmp, err := s.mapToDataTransferMediumDetailsV2(fieldKeyFormat) + if err != nil { + return err + } + request.DataTransferMediumDetailsV2 = tmp + } + } + + if datapumpSettings, ok := s.D.GetOkExists("datapump_settings"); ok { if tmpList := datapumpSettings.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "datapump_settings", 0) tmp, err := s.mapToUpdateDataPumpSettings(fieldKeyFormat) @@ -1606,6 +1706,16 @@ func (s *DatabaseMigrationMigrationResourceCrud) SetData() error { s.D.Set("data_transfer_medium_details", nil) } + if s.Res.DataTransferMediumDetailsV2 != nil { + dataTransferMediumDetailsV2Array := []interface{}{} + if dataTransferMediumDetailsV2Map := DataTransferMediumDetailsV2ToMap(&s.Res.DataTransferMediumDetailsV2); dataTransferMediumDetailsV2Map != nil { + dataTransferMediumDetailsV2Array = append(dataTransferMediumDetailsV2Array, dataTransferMediumDetailsV2Map) + } + s.D.Set("data_transfer_medium_details_v2", dataTransferMediumDetailsV2Array) + } else { + s.D.Set("data_transfer_medium_details_v2", nil) + } + if s.Res.DatapumpSettings != nil { s.D.Set("datapump_settings", []interface{}{DataPumpSettingsToMap(s.Res.DatapumpSettings)}) } else { @@ -1735,34 +1845,6 @@ func (s *DatabaseMigrationMigrationResourceCrud) mapToUpdateAdvisorSettings(fiel return result, nil } -func (s *DatabaseMigrationMigrationResourceCrud) mapToUpdateDumpTransferDetails(fieldKeyFormat string) (oci_database_migration.UpdateDumpTransferDetails, error) { - result := oci_database_migration.UpdateDumpTransferDetails{} - - if source, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source")); ok { - if tmpList := source.([]interface{}); len(tmpList) > 0 { - fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "source"), 0) - tmp, err := s.mapToUpdateHostDumpTransferDetails(fieldKeyFormatNextLevel) - if err != nil { - return result, fmt.Errorf("unable to convert source, encountered error: %v", err) - } - result.Source = tmp - } - } - - if target, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "target")); ok { - if tmpList := target.([]interface{}); len(tmpList) > 0 { - fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "target"), 0) - tmp, err := s.mapToUpdateHostDumpTransferDetails(fieldKeyFormatNextLevel) - if err != nil { - return result, fmt.Errorf("unable to convert target, encountered error: %v", err) - } - result.Target = tmp - } - } - - return result, nil -} - func (s *DatabaseMigrationMigrationResourceCrud) mapToUpdateAdminCredentials(fieldKeyFormat string) (oci_database_migration.UpdateAdminCredentials, error) { result := oci_database_migration.UpdateAdminCredentials{} @@ -1779,22 +1861,6 @@ func (s *DatabaseMigrationMigrationResourceCrud) mapToUpdateAdminCredentials(fie return result, nil } -/*func AdminCredentialsToMap(obj *oci_database_migration.AdminCredentials) map[string]interface{} { - result := map[string]interface{}{} - - - if obj.Password != nil { - result["password"] = string(*obj.Password) - } - - - if obj.Username != nil { - result["username"] = string(*obj.Username) - } - - return result -}*/ - func (s *DatabaseMigrationMigrationResourceCrud) mapToCreateAdvisorSettings(fieldKeyFormat string) (oci_database_migration.CreateAdvisorSettings, error) { result := oci_database_migration.CreateAdvisorSettings{} @@ -2257,6 +2323,11 @@ func DirectoryObjectToMap(obj *oci_database_migration.DirectoryObject) map[strin func (s *DatabaseMigrationMigrationResourceCrud) mapToCreateDumpTransferDetails(fieldKeyFormat string) (oci_database_migration.CreateDumpTransferDetails, error) { result := oci_database_migration.CreateDumpTransferDetails{} + if sharedStorageMountTargetId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "shared_storage_mount_target_id")); ok { + tmp := sharedStorageMountTargetId.(string) + result.SharedStorageMountTargetId = &tmp + } + if source, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source")); ok { if tmpList := source.([]interface{}); len(tmpList) > 0 { fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "source"), 0) @@ -2282,9 +2353,41 @@ func (s *DatabaseMigrationMigrationResourceCrud) mapToCreateDumpTransferDetails( return result, nil } +func (s *DatabaseMigrationMigrationResourceCrud) mapToUpdateDumpTransferDetails(fieldKeyFormat string) (oci_database_migration.UpdateDumpTransferDetails, error) { + result := oci_database_migration.UpdateDumpTransferDetails{} + + if source, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source")); ok { + if tmpList := source.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "source"), 0) + tmp, err := s.mapToUpdateHostDumpTransferDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert source, encountered error: %v", err) + } + result.Source = tmp + } + } + + if target, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "target")); ok { + if tmpList := target.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "target"), 0) + tmp, err := s.mapToUpdateHostDumpTransferDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert target, encountered error: %v", err) + } + result.Target = tmp + } + } + + return result, nil +} + func DumpTransferDetailsToMap(obj *oci_database_migration.DumpTransferDetails) map[string]interface{} { result := map[string]interface{}{} + if obj.SharedStorageMountTargetId != nil { + result["shared_storage_mount_target_id"] = string(*obj.SharedStorageMountTargetId) + } + if obj.Source != nil { sourceArray := []interface{}{} if sourceMap := HostDumpTransferDetailsToMap(&obj.Source); sourceMap != nil { @@ -3126,24 +3229,6 @@ func (s *DatabaseMigrationMigrationResourceCrud) mapToUpdateVaultDetails(fieldKe return result, nil } -/*func VaultDetailsToMap(obj *oci_database_migration.VaultDetails) map[string]interface{} { - result := map[string]interface{}{} - - if obj.CompartmentId != nil { - result["compartment_id"] = string(*obj.CompartmentId) - } - - if obj.KeyId != nil { - result["key_id"] = string(*obj.KeyId) - } - - if obj.VaultId != nil { - result["vault_id"] = string(*obj.VaultId) - } - - return result -}*/ - func (s *DatabaseMigrationMigrationResourceCrud) mapToDataPumpExcludeParameters(fieldKeyFormat string) (oci_database_migration.DataPumpExcludeParametersEnum, error) { //result := make([]oci_database_migration.DataPumpExcludeParametersEnum, 3) result := oci_database_migration.DataPumpExcludeParametersIndex @@ -3182,6 +3267,121 @@ func DatabaseCredentialsToMap(obj *oci_database_migration.DatabaseCredentials) m if obj.Username != nil { result["username"] = string(*obj.Username) } + return result +} + +func (s *DatabaseMigrationMigrationResourceCrud) mapToDataTransferMediumDetailsV2(fieldKeyFormat string) (oci_database_migration.DataTransferMediumDetailsV2, error) { + var baseObject oci_database_migration.DataTransferMediumDetailsV2 + //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("AWS_S3"): + details := oci_database_migration.AwsS3DataTransferMediumDetails{} + if accessKeyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "access_key_id")); ok { + tmp := accessKeyId.(string) + details.AccessKeyId = &tmp + } + if name, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "name")); ok { + tmp := name.(string) + details.Name = &tmp + } + if region, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "region")); ok { + tmp := region.(string) + details.Region = &tmp + } + if secretAccessKey, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "secret_access_key")); ok { + tmp := secretAccessKey.(string) + details.SecretAccessKey = &tmp + } + baseObject = details + case strings.ToLower("DBLINK"): + details := oci_database_migration.DbLinkDataTransferMediumDetails{} + if name, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "name")); ok { + tmp := name.(string) + details.Name = &tmp + } + if objectStorageBucket, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "object_storage_bucket")); ok { + if tmpList := objectStorageBucket.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "object_storage_bucket"), 0) + tmp, err := s.mapToObjectStoreBucket(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert object_storage_bucket, encountered error: %v", err) + } + details.ObjectStorageBucket = &tmp + } + } + baseObject = details + case strings.ToLower("NFS"): + details := oci_database_migration.NfsDataTransferMediumDetails{} + baseObject = details + case strings.ToLower("OBJECT_STORAGE"): + details := oci_database_migration.ObjectStorageDataTransferMediumDetails{} + if objectStorageBucket, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "object_storage_bucket")); ok { + if tmpList := objectStorageBucket.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "object_storage_bucket"), 0) + tmp, err := s.mapToObjectStoreBucket(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert object_storage_bucket, encountered error: %v", err) + } + details.ObjectStorageBucket = &tmp + } + } + baseObject = details + default: + return nil, fmt.Errorf("unknown type '%v' was specified", type_) + } + return baseObject, nil +} + +func DataTransferMediumDetailsV2ToMap(obj *oci_database_migration.DataTransferMediumDetailsV2) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_database_migration.AwsS3DataTransferMediumDetails: + result["type"] = "AWS_S3" + + if v.AccessKeyId != nil { + result["access_key_id"] = string(*v.AccessKeyId) + } + + if v.Name != nil { + result["name"] = string(*v.Name) + } + + if v.Region != nil { + result["region"] = string(*v.Region) + } + + if v.SecretAccessKey != nil { + result["secret_access_key"] = string(*v.SecretAccessKey) + } + case oci_database_migration.DbLinkDataTransferMediumDetails: + result["type"] = "DBLINK" + + if v.Name != nil { + result["name"] = string(*v.Name) + } + + if v.ObjectStorageBucket != nil { + result["object_storage_bucket"] = []interface{}{ObjectStoreBucketToMap(v.ObjectStorageBucket)} + } + case oci_database_migration.NfsDataTransferMediumDetails: + result["type"] = "NFS" + case oci_database_migration.ObjectStorageDataTransferMediumDetails: + result["type"] = "OBJECT_STORAGE" + + if v.ObjectStorageBucket != nil { + result["object_storage_bucket"] = []interface{}{ObjectStoreBucketToMap(v.ObjectStorageBucket)} + } + default: + log.Printf("[WARN] Received 'type' of unknown type %v", *obj) + return nil + } return result } @@ -3354,23 +3554,21 @@ func MigrationSummaryToMap(obj oci_database_migration.MigrationSummary) map[stri return result } -/*func VaultDetailsToMap(obj *oci_database_migration.VaultDetails) map[string]interface{} { - result := map[string]interface{}{} +func (s *DatabaseMigrationMigrationResourceCrud) mapToObjectStoreBucket(fieldKeyFormat string) (oci_database_migration.ObjectStoreBucket, error) { + result := oci_database_migration.ObjectStoreBucket{} - if obj.CompartmentId != nil { - result["compartment_id"] = string(*obj.CompartmentId) - } - - if obj.KeyId != nil { - result["key_id"] = string(*obj.KeyId) + if bucket, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "bucket")); ok { + tmp := bucket.(string) + result.BucketName = &tmp } - if obj.VaultId != nil { - result["vault_id"] = string(*obj.VaultId) + if namespace, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "namespace")); ok { + tmp := namespace.(string) + result.NamespaceName = &tmp } - return result -}*/ + return result, nil +} func metadataRemapsHashCodeForSets(v interface{}) int { var buf bytes.Buffer diff --git a/internal/service/datascience/datascience_data_science_private_endpoint_data_source.go b/internal/service/datascience/datascience_data_science_private_endpoint_data_source.go new file mode 100644 index 00000000000..39d297b158f --- /dev/null +++ b/internal/service/datascience/datascience_data_science_private_endpoint_data_source.go @@ -0,0 +1,120 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package datascience + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_datascience "github.com/oracle/oci-go-sdk/v65/datascience" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DatasciencePrivateEndpointDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["data_science_private_endpoint_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(DatasciencePrivateEndpointResource(), fieldMap, readSingularDatascienceDataSciencePrivateEndpoint) +} + +func readSingularDatascienceDataSciencePrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceDataSciencePrivateEndpointDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceDataSciencePrivateEndpointDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.GetDataSciencePrivateEndpointResponse +} + +func (s *DatascienceDataSciencePrivateEndpointDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceDataSciencePrivateEndpointDataSourceCrud) Get() error { + request := oci_datascience.GetDataSciencePrivateEndpointRequest{} + + if dataSciencePrivateEndpointId, ok := s.D.GetOkExists("data_science_private_endpoint_id"); ok { + tmp := dataSciencePrivateEndpointId.(string) + request.DataSciencePrivateEndpointId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.GetDataSciencePrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *DatascienceDataSciencePrivateEndpointDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.CreatedBy != nil { + s.D.Set("created_by", *s.Res.CreatedBy) + } + + s.D.Set("data_science_resource_type", s.Res.DataScienceResourceType) + + 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) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + s.D.Set("nsg_ids", s.Res.NsgIds) + s.D.Set("nsg_ids", s.Res.NsgIds) + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SubnetId != nil { + s.D.Set("subnet_id", *s.Res.SubnetId) + } + + 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/datascience/datascience_data_science_private_endpoint_resource.go b/internal/service/datascience/datascience_data_science_private_endpoint_resource.go new file mode 100644 index 00000000000..da3fc9d3b70 --- /dev/null +++ b/internal/service/datascience/datascience_data_science_private_endpoint_resource.go @@ -0,0 +1,559 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package datascience + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_datascience "github.com/oracle/oci-go-sdk/v65/datascience" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DatasciencePrivateEndpointResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createDatascienceDataSciencePrivateEndpoint, + Read: readDatascienceDataSciencePrivateEndpoint, + Update: updateDatascienceDataSciencePrivateEndpoint, + Delete: deleteDatascienceDataSciencePrivateEndpoint, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "data_science_resource_type": { + Type: schema.TypeString, + Required: true, + ForceNew: 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, + }, + }, + "sub_domain": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + "created_by": { + Type: schema.TypeString, + Computed: true, + }, + "fqdn": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createDatascienceDataSciencePrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceDataSciencePrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.CreateResource(d, sync) +} + +func readDatascienceDataSciencePrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceDataSciencePrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +func updateDatascienceDataSciencePrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceDataSciencePrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteDatascienceDataSciencePrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceDataSciencePrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type DatascienceDataSciencePrivateEndpointResourceCrud struct { + tfresource.BaseCrud + Client *oci_datascience.DataScienceClient + Res *oci_datascience.DataSciencePrivateEndpoint + DisableNotFoundRetries bool +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) CreatedPending() []string { + return []string{ + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateCreating), + } +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateActive), + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateNeedsAttention), + } +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) DeletedPending() []string { + return []string{ + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateDeleting), + } +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateDeleted), + } +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) Create() error { + request := oci_datascience.CreateDataSciencePrivateEndpointRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if dataScienceResourceType, ok := s.D.GetOkExists("data_science_resource_type"); ok { + request.DataScienceResourceType = oci_datascience.DataScienceResourceTypeEnum(dataScienceResourceType.(string)) + } + + 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 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 subDomain, ok := s.D.GetOkExists("sub_domain"); ok { + tmp := subDomain.(string) + request.SubDomain = &tmp + } + + if subnetId, ok := s.D.GetOkExists("subnet_id"); ok { + tmp := subnetId.(string) + request.SubnetId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.CreateDataSciencePrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.DataSciencePrivateEndpoint + return nil +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) getDataSciencePrivateEndpointFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_datascience.WorkRequestResourceActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + dataSciencePrivateEndpointId, err := dataSciencePrivateEndpointWaitForWorkRequest(workId, "datascience", + 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, dataSciencePrivateEndpointId) + _, cancelErr := s.Client.CancelWorkRequest(context.Background(), + oci_datascience.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(*dataSciencePrivateEndpointId) + + return s.Get() +} + +func dataSciencePrivateEndpointWorkRequestShouldRetryFunc(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, "datascience", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_datascience.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func dataSciencePrivateEndpointWaitForWorkRequest(wId *string, entityType string, action oci_datascience.WorkRequestResourceActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_datascience.DataScienceClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "datascience") + retryPolicy.ShouldRetryOperation = dataSciencePrivateEndpointWorkRequestShouldRetryFunc(timeout) + + response := oci_datascience.GetWorkRequestResponse{} + stateConf := &resource.StateChangeConf{ + Pending: []string{ + string(oci_datascience.WorkRequestStatusInProgress), + string(oci_datascience.WorkRequestStatusAccepted), + string(oci_datascience.WorkRequestStatusCanceling), + }, + Target: []string{ + string(oci_datascience.WorkRequestStatusSucceeded), + string(oci_datascience.WorkRequestStatusFailed), + string(oci_datascience.WorkRequestStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_datascience.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_datascience.WorkRequestStatusFailed || response.Status == oci_datascience.WorkRequestStatusCanceled { + return nil, getErrorFromDatascienceDataSciencePrivateEndpointWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromDatascienceDataSciencePrivateEndpointWorkRequest(client *oci_datascience.DataScienceClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_datascience.WorkRequestResourceActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_datascience.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 *DatascienceDataSciencePrivateEndpointResourceCrud) Get() error { + request := oci_datascience.GetDataSciencePrivateEndpointRequest{} + + tmp := s.D.Id() + request.DataSciencePrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.GetDataSciencePrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.DataSciencePrivateEndpoint + return nil +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) 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_datascience.UpdateDataSciencePrivateEndpointRequest{} + + tmp := s.D.Id() + request.DataSciencePrivateEndpointId = &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 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, "datascience") + + response, err := s.Client.UpdateDataSciencePrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.DataSciencePrivateEndpoint + return nil +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) Delete() error { + request := oci_datascience.DeleteDataSciencePrivateEndpointRequest{} + + tmp := s.D.Id() + request.DataSciencePrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + _, err := s.Client.DeleteDataSciencePrivateEndpoint(context.Background(), request) + return err +} + +func (s *DatascienceDataSciencePrivateEndpointResourceCrud) SetData() error { + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.CreatedBy != nil { + s.D.Set("created_by", *s.Res.CreatedBy) + } + + s.D.Set("data_science_resource_type", s.Res.DataScienceResourceType) + + 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)) + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SubnetId != nil { + s.D.Set("subnet_id", *s.Res.SubnetId) + } + + 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 *DatascienceDataSciencePrivateEndpointResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_datascience.ChangeDataSciencePrivateEndpointCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.DataSciencePrivateEndpointId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + _, err := s.Client.ChangeDataSciencePrivateEndpointCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + getPrivateEndpointRequest := oci_datascience.GetDataSciencePrivateEndpointRequest{} + tmp := s.D.Id() + getPrivateEndpointRequest.DataSciencePrivateEndpointId = &tmp + getPrivateEndpointRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.GetDataSciencePrivateEndpoint(context.Background(), getPrivateEndpointRequest) + if err != nil { + return err + } + privateEndpoint := &response.DataSciencePrivateEndpoint + s.Res = privateEndpoint + return nil +} diff --git a/internal/service/datascience/datascience_data_science_private_endpoints_data_source.go b/internal/service/datascience/datascience_data_science_private_endpoints_data_source.go new file mode 100644 index 00000000000..221510712b4 --- /dev/null +++ b/internal/service/datascience/datascience_data_science_private_endpoints_data_source.go @@ -0,0 +1,186 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package datascience + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_datascience "github.com/oracle/oci-go-sdk/v65/datascience" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DatasciencePrivateEndpointsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readDatascienceDataSciencePrivateEndpoints, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "created_by": { + Type: schema.TypeString, + Optional: true, + }, + "data_science_resource_type": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "data_science_private_endpoints": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(DatasciencePrivateEndpointResource()), + }, + }, + } +} + +func readDatascienceDataSciencePrivateEndpoints(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceDataSciencePrivateEndpointsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceDataSciencePrivateEndpointsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.ListDataSciencePrivateEndpointsResponse +} + +func (s *DatascienceDataSciencePrivateEndpointsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceDataSciencePrivateEndpointsDataSourceCrud) Get() error { + request := oci_datascience.ListDataSciencePrivateEndpointsRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if createdBy, ok := s.D.GetOkExists("created_by"); ok { + tmp := createdBy.(string) + request.CreatedBy = &tmp + } + + if dataScienceResourceType, ok := s.D.GetOkExists("data_science_resource_type"); ok { + request.DataScienceResourceType = oci_datascience.ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum(dataScienceResourceType.(string)) + } + + 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_datascience.ListDataSciencePrivateEndpointsLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.ListDataSciencePrivateEndpoints(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListDataSciencePrivateEndpoints(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 *DatascienceDataSciencePrivateEndpointsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("DatasciencePrivateEndpointsDataSource-", DatasciencePrivateEndpointsDataSource(), s.D)) + resources := []map[string]interface{}{} + + for _, r := range s.Res.Items { + dataSciencePrivateEndpoint := map[string]interface{}{ + "compartment_id": *r.CompartmentId, + } + + if r.CreatedBy != nil { + dataSciencePrivateEndpoint["created_by"] = *r.CreatedBy + } + + dataSciencePrivateEndpoint["data_science_resource_type"] = r.DataScienceResourceType + + if r.DefinedTags != nil { + dataSciencePrivateEndpoint["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) + } + + if r.DisplayName != nil { + dataSciencePrivateEndpoint["display_name"] = *r.DisplayName + } + + if r.Fqdn != nil { + dataSciencePrivateEndpoint["fqdn"] = *r.Fqdn + } + + dataSciencePrivateEndpoint["freeform_tags"] = r.FreeformTags + + if r.Id != nil { + dataSciencePrivateEndpoint["id"] = *r.Id + } + + if r.LifecycleDetails != nil { + dataSciencePrivateEndpoint["lifecycle_details"] = *r.LifecycleDetails + } + + dataSciencePrivateEndpoint["nsg_ids"] = r.NsgIds + + dataSciencePrivateEndpoint["state"] = r.LifecycleState + + if r.SubnetId != nil { + dataSciencePrivateEndpoint["subnet_id"] = *r.SubnetId + } + + if r.TimeCreated != nil { + dataSciencePrivateEndpoint["time_created"] = r.TimeCreated.String() + } + + if r.TimeUpdated != nil { + dataSciencePrivateEndpoint["time_updated"] = r.TimeUpdated.String() + } + + resources = append(resources, dataSciencePrivateEndpoint) + } + + if f, fOk := s.D.GetOkExists("filter"); fOk { + resources = tfresource.ApplyFilters(f.(*schema.Set), resources, DatasciencePrivateEndpointsDataSource().Schema["data_science_private_endpoints"].Elem.(*schema.Resource).Schema) + } + + if err := s.D.Set("data_science_private_endpoints", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/datascience/datascience_export.go b/internal/service/datascience/datascience_export.go index 0c5edaaef11..4352239d29d 100644 --- a/internal/service/datascience/datascience_export.go +++ b/internal/service/datascience/datascience_export.go @@ -128,6 +128,18 @@ var exportDatasciencePipelineHints = &tf_export.TerraformResourceHints{ }, } +var exportDatascienceDataSciencePrivateEndpointHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_datascience_private_endpoint", + DatasourceClass: "oci_datascience_private_endpoints", + DatasourceItemsAttr: "data_science_private_endpoints", + ResourceAbbreviation: "data_science_private_endpoint", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateActive), + string(oci_datascience.DataSciencePrivateEndpointLifecycleStateNeedsAttention), + }, +} + var datascienceResourceGraph = tf_export.TerraformResourceGraph{ "oci_identity_compartment": { {TerraformResourceHints: exportDatascienceProjectHints}, @@ -140,6 +152,7 @@ var datascienceResourceGraph = tf_export.TerraformResourceGraph{ {TerraformResourceHints: exportDatasciencePipelineRunHints}, {TerraformResourceHints: exportDatascienceModelVersionSetHints}, {TerraformResourceHints: exportDatasciencePipelineHints}, + {TerraformResourceHints: exportDatascienceDataSciencePrivateEndpointHints}, }, "oci_datascience_model": { { diff --git a/internal/service/datascience/datascience_notebook_session_resource.go b/internal/service/datascience/datascience_notebook_session_resource.go index 9a91bf05857..a9f894a1cd8 100644 --- a/internal/service/datascience/datascience_notebook_session_resource.go +++ b/internal/service/datascience/datascience_notebook_session_resource.go @@ -110,6 +110,12 @@ func DatascienceNotebookSessionResource() *schema.Resource { }, }, }, + "private_endpoint_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "subnet_id": { Type: schema.TypeString, Optional: true, @@ -171,6 +177,11 @@ func DatascienceNotebookSessionResource() *schema.Resource { }, }, }, + "private_endpoint_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, // Computed }, @@ -628,6 +639,11 @@ func (s *DatascienceNotebookSessionResourceCrud) mapToNotebookSessionConfigDetai } } + if privateEndpointId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "private_endpoint_id")); ok { + tmp := privateEndpointId.(string) + result.PrivateEndpointId = &tmp + } + if shape, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "shape")); ok { tmp := shape.(string) result.Shape = &tmp @@ -652,6 +668,10 @@ func NotebookSessionConfigDetailsToMap(obj *oci_datascience.NotebookSessionConfi result["notebook_session_shape_config_details"] = []interface{}{NotebookSessionShapeConfigDetailsToMap(obj.NotebookSessionShapeConfigDetails)} } + if obj.PrivateEndpointId != nil { + result["private_endpoint_id"] = string(*obj.PrivateEndpointId) + } + if obj.Shape != nil { result["shape"] = string(*obj.Shape) } @@ -682,6 +702,11 @@ func (s *DatascienceNotebookSessionResourceCrud) mapToNotebookSessionConfigurati } } + if privateEndpointId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "private_endpoint_id")); ok { + tmp := privateEndpointId.(string) + result.PrivateEndpointId = &tmp + } + if shape, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "shape")); ok { tmp := shape.(string) result.Shape = &tmp @@ -706,6 +731,10 @@ func NotebookSessionConfigurationDetailsToMap(obj *oci_datascience.NotebookSessi result["notebook_session_shape_config_details"] = []interface{}{NotebookSessionShapeConfigDetailsToMap(obj.NotebookSessionShapeConfigDetails)} } + if obj.PrivateEndpointId != nil { + result["private_endpoint_id"] = string(*obj.PrivateEndpointId) + } + if obj.Shape != nil { result["shape"] = string(*obj.Shape) } diff --git a/internal/service/datascience/register_datasource.go b/internal/service/datascience/register_datasource.go index 9accd0ad1de..925129ca866 100644 --- a/internal/service/datascience/register_datasource.go +++ b/internal/service/datascience/register_datasource.go @@ -6,6 +6,8 @@ package datascience import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterDatasource() { + tfresource.RegisterDatasource("oci_datascience_private_endpoint", DatasciencePrivateEndpointDataSource()) + tfresource.RegisterDatasource("oci_datascience_private_endpoints", DatasciencePrivateEndpointsDataSource()) tfresource.RegisterDatasource("oci_datascience_fast_launch_job_configs", DatascienceFastLaunchJobConfigsDataSource()) tfresource.RegisterDatasource("oci_datascience_job", DatascienceJobDataSource()) tfresource.RegisterDatasource("oci_datascience_job_run", DatascienceJobRunDataSource()) diff --git a/internal/service/datascience/register_resource.go b/internal/service/datascience/register_resource.go index d9b0a38ac8f..9cdf2551a8a 100644 --- a/internal/service/datascience/register_resource.go +++ b/internal/service/datascience/register_resource.go @@ -6,6 +6,7 @@ package datascience import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterResource() { + tfresource.RegisterResource("oci_datascience_private_endpoint", DatasciencePrivateEndpointResource()) tfresource.RegisterResource("oci_datascience_job", DatascienceJobResource()) tfresource.RegisterResource("oci_datascience_job_run", DatascienceJobRunResource()) tfresource.RegisterResource("oci_datascience_model", DatascienceModelResource()) diff --git a/internal/service/file_storage/file_storage_file_system_resource.go b/internal/service/file_storage/file_storage_file_system_resource.go index 8ed8ea32ec4..4b6d464fb6e 100644 --- a/internal/service/file_storage/file_storage_file_system_resource.go +++ b/internal/service/file_storage/file_storage_file_system_resource.go @@ -54,7 +54,9 @@ func FileStorageFileSystemResource() *schema.Resource { "filesystem_snapshot_policy_id": { Type: schema.TypeString, Optional: true, - Computed: true, + // Commenting out `Computed: true` to allow unset policy in update FS operation. + // This should be ok since control-api doesn’t compute this field if it's not provided by user + // Computed: true, }, "freeform_tags": { Type: schema.TypeMap, diff --git a/internal/service/kms/kms_ekms_private_endpoint_data_source.go b/internal/service/kms/kms_ekms_private_endpoint_data_source.go new file mode 100644 index 00000000000..bd28cf45993 --- /dev/null +++ b/internal/service/kms/kms_ekms_private_endpoint_data_source.go @@ -0,0 +1,119 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package kms + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_kms "github.com/oracle/oci-go-sdk/v65/keymanagement" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func KmsEkmsPrivateEndpointDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["ekms_private_endpoint_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(KmsEkmsPrivateEndpointResource(), fieldMap, readSingularKmsEkmsPrivateEndpoint) +} + +func readSingularKmsEkmsPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &KmsEkmsPrivateEndpointDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).EkmClient() + + return tfresource.ReadResource(sync) +} + +type KmsEkmsPrivateEndpointDataSourceCrud struct { + D *schema.ResourceData + Client *oci_kms.EkmClient + Res *oci_kms.GetEkmsPrivateEndpointResponse +} + +func (s *KmsEkmsPrivateEndpointDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *KmsEkmsPrivateEndpointDataSourceCrud) Get() error { + request := oci_kms.GetEkmsPrivateEndpointRequest{} + + if ekmsPrivateEndpointId, ok := s.D.GetOkExists("ekms_private_endpoint_id"); ok { + tmp := ekmsPrivateEndpointId.(string) + request.EkmsPrivateEndpointId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "kms") + + response, err := s.Client.GetEkmsPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *KmsEkmsPrivateEndpointDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.CaBundle != nil { + s.D.Set("ca_bundle", *s.Res.CaBundle) + } + + 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.ExternalKeyManagerIp != nil { + s.D.Set("external_key_manager_ip", *s.Res.ExternalKeyManagerIp) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.Port != nil { + s.D.Set("port", *s.Res.Port) + } + + 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.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/kms/kms_ekms_private_endpoint_resource.go b/internal/service/kms/kms_ekms_private_endpoint_resource.go new file mode 100644 index 00000000000..99a3326b134 --- /dev/null +++ b/internal/service/kms/kms_ekms_private_endpoint_resource.go @@ -0,0 +1,338 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package kms + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_kms "github.com/oracle/oci-go-sdk/v65/keymanagement" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func KmsEkmsPrivateEndpointResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createKmsEkmsPrivateEndpoint, + Read: readKmsEkmsPrivateEndpoint, + Update: updateKmsEkmsPrivateEndpoint, + Delete: deleteKmsEkmsPrivateEndpoint, + Schema: map[string]*schema.Schema{ + // Required + "ca_bundle": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "compartment_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "display_name": { + Type: schema.TypeString, + Required: true, + }, + "external_key_manager_ip": { + Type: schema.TypeString, + Required: true, + ForceNew: 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, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + "port": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "private_endpoint_ip": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createKmsEkmsPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &KmsEkmsPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).EkmClient() + + return tfresource.CreateResource(d, sync) +} + +func readKmsEkmsPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &KmsEkmsPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).EkmClient() + + return tfresource.ReadResource(sync) +} + +func updateKmsEkmsPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &KmsEkmsPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).EkmClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteKmsEkmsPrivateEndpoint(d *schema.ResourceData, m interface{}) error { + sync := &KmsEkmsPrivateEndpointResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).EkmClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type KmsEkmsPrivateEndpointResourceCrud struct { + tfresource.BaseCrud + Client *oci_kms.EkmClient + Res *oci_kms.EkmsPrivateEndpoint + DisableNotFoundRetries bool +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) CreatedPending() []string { + return []string{ + string(oci_kms.EkmsPrivateEndpointLifecycleStateCreating), + } +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_kms.EkmsPrivateEndpointLifecycleStateActive), + } +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) DeletedPending() []string { + return []string{ + string(oci_kms.EkmsPrivateEndpointLifecycleStateDeleting), + } +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_kms.EkmsPrivateEndpointLifecycleStateDeleted), + } +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) Create() error { + request := oci_kms.CreateEkmsPrivateEndpointRequest{} + + if caBundle, ok := s.D.GetOkExists("ca_bundle"); ok { + tmp := caBundle.(string) + request.CaBundle = &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 externalKeyManagerIp, ok := s.D.GetOkExists("external_key_manager_ip"); ok { + tmp := externalKeyManagerIp.(string) + request.ExternalKeyManagerIp = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if port, ok := s.D.GetOkExists("port"); ok { + tmp := port.(int) + request.Port = &tmp + } + + if subnetId, ok := s.D.GetOkExists("subnet_id"); ok { + tmp := subnetId.(string) + request.SubnetId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "kms") + + response, err := s.Client.CreateEkmsPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.EkmsPrivateEndpoint + return nil +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) Get() error { + request := oci_kms.GetEkmsPrivateEndpointRequest{} + + tmp := s.D.Id() + request.EkmsPrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "kms") + + response, err := s.Client.GetEkmsPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.EkmsPrivateEndpoint + return nil +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) Update() error { + request := oci_kms.UpdateEkmsPrivateEndpointRequest{} + + 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 + } + + tmp := s.D.Id() + request.EkmsPrivateEndpointId = &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, "kms") + + response, err := s.Client.UpdateEkmsPrivateEndpoint(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.EkmsPrivateEndpoint + return nil +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) Delete() error { + request := oci_kms.DeleteEkmsPrivateEndpointRequest{} + + tmp := s.D.Id() + request.EkmsPrivateEndpointId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "kms") + + _, err := s.Client.DeleteEkmsPrivateEndpoint(context.Background(), request) + return err +} + +func (s *KmsEkmsPrivateEndpointResourceCrud) SetData() error { + if s.Res.CaBundle != nil { + s.D.Set("ca_bundle", *s.Res.CaBundle) + } + + 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.ExternalKeyManagerIp != nil { + s.D.Set("external_key_manager_ip", *s.Res.ExternalKeyManagerIp) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.Port != nil { + s.D.Set("port", *s.Res.Port) + } + + 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.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/kms/kms_ekms_private_endpoints_data_source.go b/internal/service/kms/kms_ekms_private_endpoints_data_source.go new file mode 100644 index 00000000000..4c8337664be --- /dev/null +++ b/internal/service/kms/kms_ekms_private_endpoints_data_source.go @@ -0,0 +1,137 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package kms + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_kms "github.com/oracle/oci-go-sdk/v65/keymanagement" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func KmsEkmsPrivateEndpointsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readKmsEkmsPrivateEndpoints, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "ekms_private_endpoints": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(KmsEkmsPrivateEndpointResource()), + }, + }, + } +} + +func readKmsEkmsPrivateEndpoints(d *schema.ResourceData, m interface{}) error { + sync := &KmsEkmsPrivateEndpointsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).EkmClient() + + return tfresource.ReadResource(sync) +} + +type KmsEkmsPrivateEndpointsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_kms.EkmClient + Res *oci_kms.ListEkmsPrivateEndpointsResponse +} + +func (s *KmsEkmsPrivateEndpointsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *KmsEkmsPrivateEndpointsDataSourceCrud) Get() error { + request := oci_kms.ListEkmsPrivateEndpointsRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "kms") + + response, err := s.Client.ListEkmsPrivateEndpoints(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListEkmsPrivateEndpoints(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 *KmsEkmsPrivateEndpointsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("KmsEkmsPrivateEndpointsDataSource-", KmsEkmsPrivateEndpointsDataSource(), s.D)) + resources := []map[string]interface{}{} + + for _, r := range s.Res.Items { + ekmsPrivateEndpoint := map[string]interface{}{ + "compartment_id": *r.CompartmentId, + } + + if r.DefinedTags != nil { + ekmsPrivateEndpoint["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) + } + + if r.DisplayName != nil { + ekmsPrivateEndpoint["display_name"] = *r.DisplayName + } + + ekmsPrivateEndpoint["freeform_tags"] = r.FreeformTags + ekmsPrivateEndpoint["freeform_tags"] = r.FreeformTags + + if r.Id != nil { + ekmsPrivateEndpoint["id"] = *r.Id + } + + ekmsPrivateEndpoint["state"] = r.LifecycleState + + if r.SubnetId != nil { + ekmsPrivateEndpoint["subnet_id"] = *r.SubnetId + } + + if r.TimeCreated != nil { + ekmsPrivateEndpoint["time_created"] = r.TimeCreated.String() + } + + if r.TimeUpdated != nil { + ekmsPrivateEndpoint["time_updated"] = r.TimeUpdated.String() + } + + resources = append(resources, ekmsPrivateEndpoint) + } + + if f, fOk := s.D.GetOkExists("filter"); fOk { + resources = tfresource.ApplyFilters(f.(*schema.Set), resources, KmsEkmsPrivateEndpointsDataSource().Schema["ekms_private_endpoints"].Elem.(*schema.Resource).Schema) + } + + if err := s.D.Set("ekms_private_endpoints", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/kms/kms_export.go b/internal/service/kms/kms_export.go index f2b6988ef0f..0ac0364776e 100644 --- a/internal/service/kms/kms_export.go +++ b/internal/service/kms/kms_export.go @@ -122,6 +122,17 @@ var exportKmsVerifyHints = &tf_export.TerraformResourceHints{ ResourceAbbreviation: "verify", } +var exportKmsEkmsPrivateEndpointHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_kms_ekms_private_endpoint", + DatasourceClass: "oci_kms_ekms_private_endpoints", + DatasourceItemsAttr: "ekms_private_endpoints", + ResourceAbbreviation: "ekms_private_endpoint", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_kms.EkmsPrivateEndpointLifecycleStateActive), + }, +} + var exportKmsCreateReplicaHints = &tf_export.TerraformResourceHints{ ResourceClass: "oci_kms_vault_replication", ResourceAbbreviation: "vault_replication", @@ -135,6 +146,7 @@ var exportKmsDeleteReplicaHints = &tf_export.TerraformResourceHints{ var kmsResourceGraph = tf_export.TerraformResourceGraph{ "oci_identity_compartment": { {TerraformResourceHints: exportKmsVaultHints}, + {TerraformResourceHints: exportKmsEkmsPrivateEndpointHints}, }, "oci_kms_key": { { diff --git a/internal/service/kms/kms_key_data_source.go b/internal/service/kms/kms_key_data_source.go index 88e7e4021b5..18ef1262595 100644 --- a/internal/service/kms/kms_key_data_source.go +++ b/internal/service/kms/kms_key_data_source.go @@ -97,6 +97,12 @@ func (s *KmsKeyDataSourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.ExternalKeyReferenceDetails != nil { + s.D.Set("external_key_reference_details", []interface{}{ExternalKeyReferenceDetailsToMap(s.Res.ExternalKeyReferenceDetails)}) + } else { + s.D.Set("external_key_reference_details", nil) + } + s.D.Set("freeform_tags", s.Res.FreeformTags) if s.Res.IsPrimary != nil { diff --git a/internal/service/kms/kms_key_resource.go b/internal/service/kms/kms_key_resource.go index ec33e562dab..55ff5bfc0f5 100644 --- a/internal/service/kms/kms_key_resource.go +++ b/internal/service/kms/kms_key_resource.go @@ -93,6 +93,28 @@ func KmsKeyResource() *schema.Resource { DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, Elem: schema.TypeString, }, + "external_key_reference": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "external_key_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + + // Computed + }, + }, + }, "freeform_tags": { Type: schema.TypeMap, Optional: true, @@ -200,6 +222,27 @@ func KmsKeyResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "external_key_reference_details": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "external_key_id": { + Type: schema.TypeString, + Computed: true, + }, + "external_key_version_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "is_primary": { Type: schema.TypeBool, Computed: true, @@ -424,6 +467,17 @@ func (s *KmsKeyResourceCrud) Create() error { request.DisplayName = &tmp } + if externalKeyReference, ok := s.D.GetOkExists("external_key_reference"); ok { + if tmpList := externalKeyReference.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "external_key_reference", 0) + tmp, err := s.mapToExternalKeyReference(fieldKeyFormat) + if err != nil { + return err + } + request.ExternalKeyReference = &tmp + } + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } @@ -595,6 +649,12 @@ func (s *KmsKeyResourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.ExternalKeyReferenceDetails != nil { + s.D.Set("external_key_reference_details", []interface{}{ExternalKeyReferenceDetailsToMap(s.Res.ExternalKeyReferenceDetails)}) + } else { + s.D.Set("external_key_reference_details", nil) + } + s.D.Set("freeform_tags", s.Res.FreeformTags) if s.Res.IsPrimary != nil { @@ -638,6 +698,41 @@ func (s *KmsKeyResourceCrud) SetData() error { return nil } +func (s *KmsKeyResourceCrud) mapToExternalKeyReference(fieldKeyFormat string) (oci_kms.ExternalKeyReference, error) { + result := oci_kms.ExternalKeyReference{} + + if externalKeyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "external_key_id")); ok { + tmp := externalKeyId.(string) + result.ExternalKeyId = &tmp + } + + return result, nil +} + +func ExternalKeyReferenceToMap(obj *oci_kms.ExternalKeyReference) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ExternalKeyId != nil { + result["external_key_id"] = string(*obj.ExternalKeyId) + } + + return result +} + +func ExternalKeyReferenceDetailsToMap(obj *oci_kms.ExternalKeyReferenceDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ExternalKeyId != nil { + result["external_key_id"] = string(*obj.ExternalKeyId) + } + + if obj.ExternalKeyVersionId != nil { + result["external_key_version_id"] = string(*obj.ExternalKeyVersionId) + } + + return result +} + func KeyReplicaDetailsToMap(obj *oci_kms.KeyReplicaDetails) map[string]interface{} { result := map[string]interface{}{} diff --git a/internal/service/kms/kms_key_version_data_source.go b/internal/service/kms/kms_key_version_data_source.go index 70289ecfd67..fcd6821c2e7 100644 --- a/internal/service/kms/kms_key_version_data_source.go +++ b/internal/service/kms/kms_key_version_data_source.go @@ -93,6 +93,12 @@ func (s *KmsKeyVersionDataSourceCrud) SetData() error { s.D.Set("compartment_id", *s.Res.CompartmentId) } + if s.Res.ExternalKeyReferenceDetails != nil { + s.D.Set("external_key_reference_details", []interface{}{ExternalKeyReferenceDetailsToMap(s.Res.ExternalKeyReferenceDetails)}) + } else { + s.D.Set("external_key_reference_details", nil) + } + if s.Res.IsPrimary != nil { s.D.Set("is_primary", *s.Res.IsPrimary) } diff --git a/internal/service/kms/kms_key_version_resource.go b/internal/service/kms/kms_key_version_resource.go index 42e23a54579..7a8b32cf8cb 100644 --- a/internal/service/kms/kms_key_version_resource.go +++ b/internal/service/kms/kms_key_version_resource.go @@ -48,6 +48,12 @@ func KmsKeyVersionResource() *schema.Resource { }, // Optional + "external_key_version_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "time_of_deletion": { Type: schema.TypeString, Optional: true, @@ -59,6 +65,27 @@ func KmsKeyVersionResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "external_key_reference_details": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "external_key_id": { + Type: schema.TypeString, + Computed: true, + }, + "external_key_version_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "is_primary": { Type: schema.TypeBool, Computed: true, @@ -229,6 +256,11 @@ func (s *KmsKeyVersionResourceCrud) DeletedTarget() []string { func (s *KmsKeyVersionResourceCrud) Create() error { request := oci_kms.CreateKeyVersionRequest{} + if externalKeyVersionId, ok := s.D.GetOkExists("external_key_version_id"); ok { + tmp := externalKeyVersionId.(string) + request.CreateKeyMetadataDetails.ExternalKeyVersionId = &tmp + } + if keyId, ok := s.D.GetOkExists("key_id"); ok { tmp := keyId.(string) request.KeyId = &tmp @@ -309,6 +341,12 @@ func (s *KmsKeyVersionResourceCrud) SetData() error { s.D.Set("compartment_id", *s.Res.CompartmentId) } + if s.Res.ExternalKeyReferenceDetails != nil { + s.D.Set("external_key_reference_details", []interface{}{ExternalKeyReferenceDetailsToMap(s.Res.ExternalKeyReferenceDetails)}) + } else { + s.D.Set("external_key_reference_details", nil) + } + if s.Res.IsPrimary != nil { s.D.Set("is_primary", *s.Res.IsPrimary) } diff --git a/internal/service/kms/kms_key_versions_data_source.go b/internal/service/kms/kms_key_versions_data_source.go index 91e002a500d..e4af1d6efb8 100644 --- a/internal/service/kms/kms_key_versions_data_source.go +++ b/internal/service/kms/kms_key_versions_data_source.go @@ -127,6 +127,12 @@ func (s *KmsKeyVersionsDataSourceCrud) SetData() error { keyVersion["compartment_id"] = *r.CompartmentId } + if r.ExternalKeyReferenceDetails != nil { + keyVersion["external_key_reference_details"] = []interface{}{ExternalKeyReferenceDetailsToMap(r.ExternalKeyReferenceDetails)} + } else { + keyVersion["external_key_reference_details"] = nil + } + if r.Id != nil { keyVersion["key_version_id"] = *r.Id } diff --git a/internal/service/kms/kms_keys_data_source.go b/internal/service/kms/kms_keys_data_source.go index 4a014c790cf..c6c0978dfa8 100644 --- a/internal/service/kms/kms_keys_data_source.go +++ b/internal/service/kms/kms_keys_data_source.go @@ -148,6 +148,12 @@ func (s *KmsKeysDataSourceCrud) SetData() error { key["display_name"] = *r.DisplayName } + if r.ExternalKeyReferenceDetails != nil { + key["external_key_reference_details"] = []interface{}{ExternalKeyReferenceDetailsToMap(r.ExternalKeyReferenceDetails)} + } else { + key["external_key_reference_details"] = nil + } + key["freeform_tags"] = r.FreeformTags if r.Id != nil { diff --git a/internal/service/kms/kms_vault_data_source.go b/internal/service/kms/kms_vault_data_source.go index a9596b389d8..efefa8d3561 100644 --- a/internal/service/kms/kms_vault_data_source.go +++ b/internal/service/kms/kms_vault_data_source.go @@ -82,6 +82,12 @@ func (s *KmsVaultDataSourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.ExternalKeyManagerMetadataSummary != nil { + s.D.Set("external_key_manager_metadata_summary", []interface{}{ExternalKeyManagerMetadataSummaryToMap(s.Res.ExternalKeyManagerMetadataSummary)}) + } else { + s.D.Set("external_key_manager_metadata_summary", nil) + } + s.D.Set("freeform_tags", s.Res.FreeformTags) if s.Res.IsPrimary != nil { diff --git a/internal/service/kms/kms_vault_resource.go b/internal/service/kms/kms_vault_resource.go index 77a49fdadb6..142690645e0 100644 --- a/internal/service/kms/kms_vault_resource.go +++ b/internal/service/kms/kms_vault_resource.go @@ -58,6 +58,64 @@ func KmsVaultResource() *schema.Resource { DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, Elem: schema.TypeString, }, + "external_key_manager_metadata": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "external_vault_endpoint_url": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "oauth_metadata": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "client_app_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "client_app_secret": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "idcs_account_name_url": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + + // Computed + }, + }, + }, + "private_endpoint_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + + // Computed + }, + }, + }, "freeform_tags": { Type: schema.TypeMap, Optional: true, @@ -150,6 +208,52 @@ func KmsVaultResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "external_key_manager_metadata_summary": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "external_vault_endpoint_url": { + Type: schema.TypeString, + Computed: true, + }, + "oauth_metadata_summary": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "client_app_id": { + Type: schema.TypeString, + Computed: true, + }, + "idcs_account_name_url": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "private_endpoint_id": { + Type: schema.TypeString, + Computed: true, + }, + "vendor": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "is_primary": { Type: schema.TypeBool, Computed: true, @@ -299,6 +403,17 @@ func (s *KmsVaultResourceCrud) Create() error { request.DisplayName = &tmp } + if externalKeyManagerMetadata, ok := s.D.GetOkExists("external_key_manager_metadata"); ok { + if tmpList := externalKeyManagerMetadata.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "external_key_manager_metadata", 0) + tmp, err := s.mapToExternalKeyManagerMetadata(fieldKeyFormat) + if err != nil { + return err + } + request.ExternalKeyManagerMetadata = &tmp + } + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } @@ -428,6 +543,12 @@ func (s *KmsVaultResourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.ExternalKeyManagerMetadataSummary != nil { + s.D.Set("external_key_manager_metadata_summary", []interface{}{ExternalKeyManagerMetadataSummaryToMap(s.Res.ExternalKeyManagerMetadataSummary)}) + } else { + s.D.Set("external_key_manager_metadata_summary", nil) + } + s.D.Set("freeform_tags", s.Res.FreeformTags) if s.Res.IsPrimary != nil { @@ -463,6 +584,126 @@ func (s *KmsVaultResourceCrud) SetData() error { return nil } +func (s *KmsVaultResourceCrud) mapToExternalKeyManagerMetadata(fieldKeyFormat string) (oci_kms.ExternalKeyManagerMetadata, error) { + result := oci_kms.ExternalKeyManagerMetadata{} + + if externalVaultEndpointUrl, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "external_vault_endpoint_url")); ok { + tmp := externalVaultEndpointUrl.(string) + result.ExternalVaultEndpointUrl = &tmp + } + + if oauthMetadata, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "oauth_metadata")); ok { + if tmpList := oauthMetadata.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "oauth_metadata"), 0) + tmp, err := s.mapToOauthMetadata(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert oauth_metadata, encountered error: %v", err) + } + result.OauthMetadata = &tmp + } + } + + if privateEndpointId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "private_endpoint_id")); ok { + tmp := privateEndpointId.(string) + result.PrivateEndpointId = &tmp + } + + return result, nil +} + +func ExternalKeyManagerMetadataToMap(obj *oci_kms.ExternalKeyManagerMetadata) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ExternalVaultEndpointUrl != nil { + result["external_vault_endpoint_url"] = string(*obj.ExternalVaultEndpointUrl) + } + + if obj.OauthMetadata != nil { + result["oauth_metadata"] = []interface{}{OauthMetadataToMap(obj.OauthMetadata)} + } + + if obj.PrivateEndpointId != nil { + result["private_endpoint_id"] = string(*obj.PrivateEndpointId) + } + + return result +} + +func ExternalKeyManagerMetadataSummaryToMap(obj *oci_kms.ExternalKeyManagerMetadataSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ExternalVaultEndpointUrl != nil { + result["external_vault_endpoint_url"] = string(*obj.ExternalVaultEndpointUrl) + } + + if obj.OauthMetadataSummary != nil { + result["oauth_metadata_summary"] = []interface{}{OauthMetadataSummaryToMap(obj.OauthMetadataSummary)} + } + + if obj.PrivateEndpointId != nil { + result["private_endpoint_id"] = string(*obj.PrivateEndpointId) + } + + if obj.Vendor != nil { + result["vendor"] = string(*obj.Vendor) + } + + return result +} + +func (s *KmsVaultResourceCrud) mapToOauthMetadata(fieldKeyFormat string) (oci_kms.OauthMetadata, error) { + result := oci_kms.OauthMetadata{} + + if clientAppId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "client_app_id")); ok { + tmp := clientAppId.(string) + result.ClientAppId = &tmp + } + + if clientAppSecret, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "client_app_secret")); ok { + tmp := clientAppSecret.(string) + result.ClientAppSecret = &tmp + } + + if idcsAccountNameUrl, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "idcs_account_name_url")); ok { + tmp := idcsAccountNameUrl.(string) + result.IdcsAccountNameUrl = &tmp + } + + return result, nil +} + +func OauthMetadataToMap(obj *oci_kms.OauthMetadata) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ClientAppId != nil { + result["client_app_id"] = string(*obj.ClientAppId) + } + + if obj.ClientAppSecret != nil { + result["client_app_secret"] = string(*obj.ClientAppSecret) + } + + if obj.IdcsAccountNameUrl != nil { + result["idcs_account_name_url"] = string(*obj.IdcsAccountNameUrl) + } + + return result +} + +func OauthMetadataSummaryToMap(obj *oci_kms.OauthMetadataSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ClientAppId != nil { + result["client_app_id"] = string(*obj.ClientAppId) + } + + if obj.IdcsAccountNameUrl != nil { + result["idcs_account_name_url"] = string(*obj.IdcsAccountNameUrl) + } + + return result +} + func VaultReplicaDetailsToMap(obj *oci_kms.VaultReplicaDetails) map[string]interface{} { result := map[string]interface{}{} diff --git a/internal/service/kms/kms_vaults_data_source.go b/internal/service/kms/kms_vaults_data_source.go index d55c908f189..c0ad47e8ef5 100644 --- a/internal/service/kms/kms_vaults_data_source.go +++ b/internal/service/kms/kms_vaults_data_source.go @@ -105,6 +105,12 @@ func (s *KmsVaultsDataSourceCrud) SetData() error { vault["display_name"] = *r.DisplayName } + if r.ExternalKeyManagerMetadataSummary != nil { + vault["external_key_manager_metadata_summary"] = []interface{}{ExternalKeyManagerMetadataSummaryToMap(r.ExternalKeyManagerMetadataSummary)} + } else { + vault["external_key_manager_metadata_summary"] = nil + } + vault["freeform_tags"] = r.FreeformTags if r.Id != nil { diff --git a/internal/service/kms/register_datasource.go b/internal/service/kms/register_datasource.go index c8d554fecff..ab6ac6332ff 100644 --- a/internal/service/kms/register_datasource.go +++ b/internal/service/kms/register_datasource.go @@ -6,6 +6,8 @@ package kms import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterDatasource() { + tfresource.RegisterDatasource("oci_kms_ekms_private_endpoint", KmsEkmsPrivateEndpointDataSource()) + tfresource.RegisterDatasource("oci_kms_ekms_private_endpoints", KmsEkmsPrivateEndpointsDataSource()) tfresource.RegisterDatasource("oci_kms_key", KmsKeyDataSource()) tfresource.RegisterDatasource("oci_kms_key_version", KmsKeyVersionDataSource()) tfresource.RegisterDatasource("oci_kms_key_versions", KmsKeyVersionsDataSource()) diff --git a/internal/service/kms/register_resource.go b/internal/service/kms/register_resource.go index 9a760186f9a..4d206b554dc 100644 --- a/internal/service/kms/register_resource.go +++ b/internal/service/kms/register_resource.go @@ -6,6 +6,7 @@ package kms import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterResource() { + tfresource.RegisterResource("oci_kms_ekms_private_endpoint", KmsEkmsPrivateEndpointResource()) tfresource.RegisterResource("oci_kms_encrypted_data", KmsEncryptedDataResource()) tfresource.RegisterResource("oci_kms_generated_key", KmsGeneratedKeyResource()) tfresource.RegisterResource("oci_kms_key", KmsKeyResource()) diff --git a/internal/service/mysql/mysql_replica_data_source.go b/internal/service/mysql/mysql_replica_data_source.go index 78a745be2d6..2f80dd8d790 100644 --- a/internal/service/mysql/mysql_replica_data_source.go +++ b/internal/service/mysql/mysql_replica_data_source.go @@ -74,6 +74,10 @@ func (s *MysqlReplicaDataSourceCrud) SetData() error { s.D.Set("compartment_id", *s.Res.CompartmentId) } + if s.Res.ConfigurationId != nil { + s.D.Set("configuration_id", *s.Res.ConfigurationId) + } + if s.Res.DbSystemId != nil { s.D.Set("db_system_id", *s.Res.DbSystemId) } @@ -121,6 +125,16 @@ func (s *MysqlReplicaDataSourceCrud) SetData() error { s.D.Set("port_x", *s.Res.PortX) } + if s.Res.ReplicaOverrides != nil { + s.D.Set("replica_overrides", []interface{}{ReplicaOverridesToMap(s.Res.ReplicaOverrides)}) + } else { + s.D.Set("replica_overrides", nil) + } + + if s.Res.ShapeName != nil { + s.D.Set("shape_name", *s.Res.ShapeName) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeCreated != nil { diff --git a/internal/service/mysql/mysql_replica_resource.go b/internal/service/mysql/mysql_replica_resource.go index 3c557d22fbe..817349edd5f 100644 --- a/internal/service/mysql/mysql_replica_resource.go +++ b/internal/service/mysql/mysql_replica_resource.go @@ -5,6 +5,7 @@ package mysql import ( "context" + "fmt" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -19,11 +20,15 @@ func MysqlReplicaResource() *schema.Resource { Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, - Timeouts: tfresource.DefaultTimeout, - Create: createMysqlReplica, - Read: readMysqlReplica, - Update: updateMysqlReplica, - Delete: deleteMysqlReplica, + Timeouts: &schema.ResourceTimeout{ + Create: tfresource.GetTimeoutDuration("1h"), + Update: tfresource.GetTimeoutDuration("1h"), + Delete: tfresource.GetTimeoutDuration("1h"), + }, + Create: createMysqlReplica, + Read: readMysqlReplica, + Update: updateMysqlReplica, + Delete: deleteMysqlReplica, Schema: map[string]*schema.Schema{ // Required "db_system_id": { @@ -61,6 +66,37 @@ func MysqlReplicaResource() *schema.Resource { Optional: true, Computed: true, }, + "replica_overrides": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "configuration_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "mysql_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "shape_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, // Computed "availability_domain": { @@ -71,6 +107,10 @@ func MysqlReplicaResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "configuration_id": { + Type: schema.TypeString, + Computed: true, + }, "fault_domain": { Type: schema.TypeString, Computed: true, @@ -95,6 +135,10 @@ func MysqlReplicaResource() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "shape_name": { + Type: schema.TypeString, + Computed: true, + }, "state": { Type: schema.TypeString, Computed: true, @@ -228,6 +272,17 @@ func (s *MysqlReplicaResourceCrud) Create() error { request.IsDeleteProtected = &tmp } + if replicaOverrides, ok := s.D.GetOkExists("replica_overrides"); ok { + if tmpList := replicaOverrides.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "replica_overrides", 0) + tmp, err := s.mapToReplicaOverrides(fieldKeyFormat) + if err != nil { + return err + } + request.ReplicaOverrides = &tmp + } + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "mysql") response, err := s.Client.CreateReplica(context.Background(), request) @@ -289,6 +344,17 @@ func (s *MysqlReplicaResourceCrud) Update() error { tmp := s.D.Id() request.ReplicaId = &tmp + if replicaOverrides, ok := s.D.GetOkExists("replica_overrides"); ok { + if tmpList := replicaOverrides.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "replica_overrides", 0) + tmp, err := s.mapToReplicaOverrides(fieldKeyFormat) + if err != nil { + return err + } + request.ReplicaOverrides = &tmp + } + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "mysql") _, err := s.Client.UpdateReplica(context.Background(), request) @@ -320,6 +386,10 @@ func (s *MysqlReplicaResourceCrud) SetData() error { s.D.Set("compartment_id", *s.Res.CompartmentId) } + if s.Res.ConfigurationId != nil { + s.D.Set("configuration_id", *s.Res.ConfigurationId) + } + if s.Res.DbSystemId != nil { s.D.Set("db_system_id", *s.Res.DbSystemId) } @@ -367,6 +437,16 @@ func (s *MysqlReplicaResourceCrud) SetData() error { s.D.Set("port_x", *s.Res.PortX) } + if s.Res.ReplicaOverrides != nil { + s.D.Set("replica_overrides", []interface{}{ReplicaOverridesToMap(s.Res.ReplicaOverrides)}) + } else { + s.D.Set("replica_overrides", nil) + } + + if s.Res.ShapeName != nil { + s.D.Set("shape_name", *s.Res.ShapeName) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeCreated != nil { @@ -379,3 +459,45 @@ func (s *MysqlReplicaResourceCrud) SetData() error { return nil } + +func (s *MysqlReplicaResourceCrud) mapToReplicaOverrides(fieldKeyFormat string) (oci_mysql.ReplicaOverrides, error) { + result := oci_mysql.ReplicaOverrides{} + + configurationIdField := fmt.Sprintf(fieldKeyFormat, "configuration_id") + if configurationId, ok := s.D.GetOkExists(configurationIdField); ok && s.D.HasChange(configurationIdField) { + tmp := configurationId.(string) + result.ConfigurationId = &tmp + } + + mysqlVersionField := fmt.Sprintf(fieldKeyFormat, "mysql_version") + if mysqlVersion, ok := s.D.GetOkExists(mysqlVersionField); ok && s.D.HasChange(mysqlVersionField) { + tmp := mysqlVersion.(string) + result.MysqlVersion = &tmp + } + + shapeNameField := fmt.Sprintf(fieldKeyFormat, "shape_name") + if shapeName, ok := s.D.GetOkExists(shapeNameField); ok && s.D.HasChange(shapeNameField) { + tmp := shapeName.(string) + result.ShapeName = &tmp + } + + return result, nil +} + +func ReplicaOverridesToMap(obj *oci_mysql.ReplicaOverrides) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ConfigurationId != nil { + result["configuration_id"] = string(*obj.ConfigurationId) + } + + if obj.MysqlVersion != nil { + result["mysql_version"] = string(*obj.MysqlVersion) + } + + if obj.ShapeName != nil { + result["shape_name"] = string(*obj.ShapeName) + } + + return result +} diff --git a/internal/service/mysql/mysql_replicas_data_source.go b/internal/service/mysql/mysql_replicas_data_source.go index 89573a92a6e..6ed8b635568 100644 --- a/internal/service/mysql/mysql_replicas_data_source.go +++ b/internal/service/mysql/mysql_replicas_data_source.go @@ -22,6 +22,10 @@ func MysqlReplicasDataSource() *schema.Resource { Type: schema.TypeString, Required: true, }, + "configuration_id": { + Type: schema.TypeString, + Optional: true, + }, "db_system_id": { Type: schema.TypeString, Optional: true, @@ -30,6 +34,10 @@ func MysqlReplicasDataSource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "is_up_to_date": { + Type: schema.TypeBool, + Optional: true, + }, "replica_id": { Type: schema.TypeString, Optional: true, @@ -73,6 +81,11 @@ func (s *MysqlReplicasDataSourceCrud) Get() error { request.CompartmentId = &tmp } + if configurationId, ok := s.D.GetOkExists("configuration_id"); ok { + tmp := configurationId.(string) + request.ConfigurationId = &tmp + } + if dbSystemId, ok := s.D.GetOkExists("db_system_id"); ok { tmp := dbSystemId.(string) request.DbSystemId = &tmp @@ -83,6 +96,11 @@ func (s *MysqlReplicasDataSourceCrud) Get() error { request.DisplayName = &tmp } + if isUpToDate, ok := s.D.GetOkExists("is_up_to_date"); ok { + tmp := isUpToDate.(bool) + request.IsUpToDate = &tmp + } + if replicaId, ok := s.D.GetOkExists("id"); ok { tmp := replicaId.(string) request.ReplicaId = &tmp @@ -132,6 +150,10 @@ func (s *MysqlReplicasDataSourceCrud) SetData() error { replica["availability_domain"] = *r.AvailabilityDomain } + if r.ConfigurationId != nil { + replica["configuration_id"] = *r.ConfigurationId + } + if r.DbSystemId != nil { replica["db_system_id"] = *r.DbSystemId } @@ -183,6 +205,16 @@ func (s *MysqlReplicasDataSourceCrud) SetData() error { replica["port_x"] = *r.PortX } + if r.ReplicaOverrides != nil { + replica["replica_overrides"] = []interface{}{ReplicaOverridesToMap(r.ReplicaOverrides)} + } else { + replica["replica_overrides"] = nil + } + + if r.ShapeName != nil { + replica["shape_name"] = *r.ShapeName + } + replica["state"] = r.LifecycleState if r.TimeCreated != nil { diff --git a/internal/service/queue/queue_queue_data_source.go b/internal/service/queue/queue_queue_data_source.go index 48399b085d6..98c19697466 100644 --- a/internal/service/queue/queue_queue_data_source.go +++ b/internal/service/queue/queue_queue_data_source.go @@ -66,6 +66,10 @@ func (s *QueueQueueDataSourceCrud) SetData() error { s.D.SetId(*s.Res.Id) + if s.Res.ChannelConsumptionLimit != nil { + s.D.Set("channel_consumption_limit", *s.Res.ChannelConsumptionLimit) + } + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } diff --git a/internal/service/queue/queue_queue_resource.go b/internal/service/queue/queue_queue_resource.go index bba81e8c995..3c2a0dccd65 100644 --- a/internal/service/queue/queue_queue_resource.go +++ b/internal/service/queue/queue_queue_resource.go @@ -41,6 +41,11 @@ func QueueQueueResource() *schema.Resource { }, // Optional + "channel_consumption_limit": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, "custom_encryption_key_id": { Type: schema.TypeString, Optional: true, @@ -213,6 +218,11 @@ func (s *QueueQueueResourceCrud) DeletedTarget() []string { func (s *QueueQueueResourceCrud) Create() error { request := oci_queue.CreateQueueRequest{} + if channelConsumptionLimit, ok := s.D.GetOkExists("channel_consumption_limit"); ok { + tmp := channelConsumptionLimit.(int) + request.ChannelConsumptionLimit = &tmp + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { tmp := compartmentId.(string) request.CompartmentId = &tmp @@ -432,6 +442,11 @@ func (s *QueueQueueResourceCrud) Update() error { } request := oci_queue.UpdateQueueRequest{} + if channelConsumptionLimit, ok := s.D.GetOkExists("channel_consumption_limit"); ok { + tmp := channelConsumptionLimit.(int) + request.ChannelConsumptionLimit = &tmp + } + if customEncryptionKeyId, ok := s.D.GetOkExists("custom_encryption_key_id"); ok { tmp := customEncryptionKeyId.(string) request.CustomEncryptionKeyId = &tmp @@ -504,6 +519,10 @@ func (s *QueueQueueResourceCrud) Delete() error { } func (s *QueueQueueResourceCrud) SetData() error { + if s.Res.ChannelConsumptionLimit != nil { + s.D.Set("channel_consumption_limit", *s.Res.ChannelConsumptionLimit) + } + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } @@ -567,6 +586,20 @@ func (s *QueueQueueResourceCrud) SetData() error { func (s *QueueQueueResourceCrud) PurgeQueue() error { request := oci_queue.PurgeQueueRequest{} + //This is an auto generated code for channelIds, may not be used since we wont be passing channel IDs in tests + if channelIds, ok := s.D.GetOkExists("channel_ids"); ok { + interfaces := channelIds.([]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("channel_ids") { + request.ChannelIds = tmp + } + } + if purgeType, ok := s.D.GetOkExists("purge_type"); ok { request.PurgeType, _ = oci_queue.GetMappingPurgeQueueDetailsPurgeTypeEnum(purgeType.(string)) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go index 4e289e30b3e..6042982ccd5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/eventual_consistency.go @@ -51,6 +51,7 @@ var ( {400, "RelatedResourceNotAuthorizedOrNotFound"}: true, {404, "NotAuthorizedOrNotFound"}: true, {409, "NotAuthorizedOrResourceAlreadyExists"}: true, + {409, "ResourceAlreadyExists"}: true, {400, "InsufficientServicePermissions"}: true, {400, "ResourceDisabled"}: true, } 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 bb214bada96..fdb40746954 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 = "49" - patch = "2" + patch = "3" tag = "" ) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure.go new file mode 100644 index 00000000000..4a42e96196c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure.go @@ -0,0 +1,231 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructure The Oracle Cloud Infrastructure resource representing the connection to the hardware and +// software located in a customer's data center running the Compute Cloud@Customer IaaS services. +type CccInfrastructure struct { + + // The Compute Cloud@Customer infrastructure OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The infrastructure compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is + // used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Compute Cloud@Customer infrastructure creation date and time, using an RFC3339 formatted + // datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the Compute Cloud@Customer infrastructure. + LifecycleState CccInfrastructureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The Compute Cloud@Customer infrastructure short name. + // This cannot be changed once created. The + // short name is used to refer to the infrastructure in several contexts and is unique. + ShortName *string `mandatory:"false" json:"shortName"` + + // A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // The current connection state of the infrastructure. A user can only update + // it from REQUEST to READY or from any state back to REJECT. The system automatically + // handles the REJECT to REQUEST, READY to CONNECTED, or CONNECTED to DISCONNECTED transitions. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // A message describing the current connection state in more detail. + ConnectionDetails *string `mandatory:"false" json:"connectionDetails"` + + // Schedule used for upgrades. If no schedule is associated with the infrastructure, + // it can be updated at any time. + CccUpgradeScheduleId *string `mandatory:"false" json:"cccUpgradeScheduleId"` + + // Fingerprint of a Compute Cloud@Customer infrastructure in a data center generated + // during the initial connection to this resource. The fingerprint should be verified + // by the administrator when changing the connectionState from REQUEST to READY. + ProvisioningFingerprint *string `mandatory:"false" json:"provisioningFingerprint"` + + // Code that is required for service personnel to connect a + // Compute Cloud@Customer infrastructure in a data center to this resource. + // This code will only be available when the connectionState is REJECT (usually + // at create time of the Compute Cloud@Customer infrastructure). + ProvisioningPin *string `mandatory:"false" json:"provisioningPin"` + + // Compute Cloud@Customer infrastructure updated date and time, using an RFC3339 formatted + // datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message describing the current lifecycle state in more detail. + // For example, this can be used to provide actionable information for a resource that is in + // a Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + InfrastructureInventory *CccInfrastructureInventory `mandatory:"false" json:"infrastructureInventory"` + + InfrastructureNetworkConfiguration *CccInfrastructureNetworkConfiguration `mandatory:"false" json:"infrastructureNetworkConfiguration"` + + UpgradeInformation *CccUpgradeInformation `mandatory:"false" json:"upgradeInformation"` + + // 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"` + + // 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 CccInfrastructure) 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 CccInfrastructure) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccInfrastructureLifecycleStateEnum(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(GetCccInfrastructureLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccInfrastructureConnectionStateEnum Enum with underlying type: string +type CccInfrastructureConnectionStateEnum string + +// Set of constants representing the allowable values for CccInfrastructureConnectionStateEnum +const ( + CccInfrastructureConnectionStateReject CccInfrastructureConnectionStateEnum = "REJECT" + CccInfrastructureConnectionStateRequest CccInfrastructureConnectionStateEnum = "REQUEST" + CccInfrastructureConnectionStateReady CccInfrastructureConnectionStateEnum = "READY" + CccInfrastructureConnectionStateConnected CccInfrastructureConnectionStateEnum = "CONNECTED" + CccInfrastructureConnectionStateDisconnected CccInfrastructureConnectionStateEnum = "DISCONNECTED" +) + +var mappingCccInfrastructureConnectionStateEnum = map[string]CccInfrastructureConnectionStateEnum{ + "REJECT": CccInfrastructureConnectionStateReject, + "REQUEST": CccInfrastructureConnectionStateRequest, + "READY": CccInfrastructureConnectionStateReady, + "CONNECTED": CccInfrastructureConnectionStateConnected, + "DISCONNECTED": CccInfrastructureConnectionStateDisconnected, +} + +var mappingCccInfrastructureConnectionStateEnumLowerCase = map[string]CccInfrastructureConnectionStateEnum{ + "reject": CccInfrastructureConnectionStateReject, + "request": CccInfrastructureConnectionStateRequest, + "ready": CccInfrastructureConnectionStateReady, + "connected": CccInfrastructureConnectionStateConnected, + "disconnected": CccInfrastructureConnectionStateDisconnected, +} + +// GetCccInfrastructureConnectionStateEnumValues Enumerates the set of values for CccInfrastructureConnectionStateEnum +func GetCccInfrastructureConnectionStateEnumValues() []CccInfrastructureConnectionStateEnum { + values := make([]CccInfrastructureConnectionStateEnum, 0) + for _, v := range mappingCccInfrastructureConnectionStateEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureConnectionStateEnumStringValues Enumerates the set of values in String for CccInfrastructureConnectionStateEnum +func GetCccInfrastructureConnectionStateEnumStringValues() []string { + return []string{ + "REJECT", + "REQUEST", + "READY", + "CONNECTED", + "DISCONNECTED", + } +} + +// GetMappingCccInfrastructureConnectionStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureConnectionStateEnum(val string) (CccInfrastructureConnectionStateEnum, bool) { + enum, ok := mappingCccInfrastructureConnectionStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// CccInfrastructureLifecycleStateEnum Enum with underlying type: string +type CccInfrastructureLifecycleStateEnum string + +// Set of constants representing the allowable values for CccInfrastructureLifecycleStateEnum +const ( + CccInfrastructureLifecycleStateActive CccInfrastructureLifecycleStateEnum = "ACTIVE" + CccInfrastructureLifecycleStateNeedsAttention CccInfrastructureLifecycleStateEnum = "NEEDS_ATTENTION" + CccInfrastructureLifecycleStateDeleted CccInfrastructureLifecycleStateEnum = "DELETED" + CccInfrastructureLifecycleStateFailed CccInfrastructureLifecycleStateEnum = "FAILED" +) + +var mappingCccInfrastructureLifecycleStateEnum = map[string]CccInfrastructureLifecycleStateEnum{ + "ACTIVE": CccInfrastructureLifecycleStateActive, + "NEEDS_ATTENTION": CccInfrastructureLifecycleStateNeedsAttention, + "DELETED": CccInfrastructureLifecycleStateDeleted, + "FAILED": CccInfrastructureLifecycleStateFailed, +} + +var mappingCccInfrastructureLifecycleStateEnumLowerCase = map[string]CccInfrastructureLifecycleStateEnum{ + "active": CccInfrastructureLifecycleStateActive, + "needs_attention": CccInfrastructureLifecycleStateNeedsAttention, + "deleted": CccInfrastructureLifecycleStateDeleted, + "failed": CccInfrastructureLifecycleStateFailed, +} + +// GetCccInfrastructureLifecycleStateEnumValues Enumerates the set of values for CccInfrastructureLifecycleStateEnum +func GetCccInfrastructureLifecycleStateEnumValues() []CccInfrastructureLifecycleStateEnum { + values := make([]CccInfrastructureLifecycleStateEnum, 0) + for _, v := range mappingCccInfrastructureLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureLifecycleStateEnumStringValues Enumerates the set of values in String for CccInfrastructureLifecycleStateEnum +func GetCccInfrastructureLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "NEEDS_ATTENTION", + "DELETED", + "FAILED", + } +} + +// GetMappingCccInfrastructureLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureLifecycleStateEnum(val string) (CccInfrastructureLifecycleStateEnum, bool) { + enum, ok := mappingCccInfrastructureLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_collection.go new file mode 100644 index 00000000000..a22f239e884 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureCollection Results of a Compute Cloud@Customer infrastructure search. +type CccInfrastructureCollection struct { + + // List of Compute Cloud@Customer infrastructures. + Items []CccInfrastructureSummary `mandatory:"true" json:"items"` +} + +func (m CccInfrastructureCollection) 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 CccInfrastructureCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_inventory.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_inventory.go new file mode 100644 index 00000000000..b4a62f03f00 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_inventory.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureInventory Inventory for a Compute Cloud@Customer infrastructure. This information +// cannot be updated and is from the infrastructure. The information will only be available +// after the connectionState is transitioned to CONNECTED. +type CccInfrastructureInventory struct { + + // The serial number of the Compute Cloud@Customer infrastructure rack. + SerialNumber *string `mandatory:"false" json:"serialNumber"` + + // The number of management nodes that are available and in active use + // on the Compute Cloud@Customer infrastructure rack. + ManagementNodeCount *int `mandatory:"false" json:"managementNodeCount"` + + // The number of compute nodes that are available and usable + // on the Compute Cloud@Customer infrastructure rack. There is no distinction + // of compute node type in this information. + ComputeNodeCount *int `mandatory:"false" json:"computeNodeCount"` + + // The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for capacity storage. + CapacityStorageTrayCount *int `mandatory:"false" json:"capacityStorageTrayCount"` + + // The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for performance storage. + PerformanceStorageTrayCount *int `mandatory:"false" json:"performanceStorageTrayCount"` +} + +func (m CccInfrastructureInventory) 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 CccInfrastructureInventory) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_management_node.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_management_node.go new file mode 100644 index 00000000000..5ce6f1049ed --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_management_node.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureManagementNode Information about an individual management node in a Compute Cloud@Customer infrastructure. +type CccInfrastructureManagementNode struct { + + // Address of the management node. + Ip *string `mandatory:"false" json:"ip"` + + // Hostname for interface to the management node. + Hostname *string `mandatory:"false" json:"hostname"` +} + +func (m CccInfrastructureManagementNode) 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 CccInfrastructureManagementNode) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_network_configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_network_configuration.go new file mode 100644 index 00000000000..76bc1598995 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_network_configuration.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureNetworkConfiguration Configuration information for the Compute Cloud@Customer infrastructure. This +// network configuration information cannot be updated and is retrieved from the data center. +// The information will only be available +// after the connectionState is transitioned to CONNECTED. +type CccInfrastructureNetworkConfiguration struct { + + // Information about the management nodes that are provisioned in the Compute Cloud@Customer + // infrastructure. + ManagementNodes []CccInfrastructureManagementNode `mandatory:"false" json:"managementNodes"` + + // Uplink port speed defined in gigabytes per second. + // All uplink ports must have identical speed. + UplinkPortSpeedInGbps *int `mandatory:"false" json:"uplinkPortSpeedInGbps"` + + // Number of uplink ports per spine switch. Connectivity is identical on both spine switches. + // For example, if input is two 100 gigabyte ports; then port-1 and port-2 on both spines will be configured. + UplinkPortCount *int `mandatory:"false" json:"uplinkPortCount"` + + // The virtual local area network (VLAN) maximum transmission unit (MTU) size + // for the uplink ports. + UplinkVlanMtu *int `mandatory:"false" json:"uplinkVlanMtu"` + + // Netmask of the subnet that the Compute Cloud@Customer infrastructure is + // connected to. + UplinkNetmask *string `mandatory:"false" json:"uplinkNetmask"` + + // The port forward error correction (FEC) setting for the uplink port on the + // Compute Cloud@Customer infrastructure. + UplinkPortForwardErrorCorrection CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum `mandatory:"false" json:"uplinkPortForwardErrorCorrection,omitempty"` + + // Domain name to be used as the base domain for the internal network and by + // public facing services. + UplinkDomain *string `mandatory:"false" json:"uplinkDomain"` + + // Uplink gateway in the datacenter network that the Compute Cloud@Customer + // connects to. + UplinkGatewayIp *string `mandatory:"false" json:"uplinkGatewayIp"` + + // Addresses of the network spine switches. + SpineIps []string `mandatory:"false" json:"spineIps"` + + // The spine switch public virtual IP (VIP). Traffic routed to the + // Compute Cloud@Customer infrastructure and + // and virtual cloud networks (VCNs) should have this address as next hop. + SpineVip *string `mandatory:"false" json:"spineVip"` + + // The hostname corresponding to the virtual IP (VIP) address of the management nodes. + MgmtVipHostname *string `mandatory:"false" json:"mgmtVipHostname"` + + // The IP address used as the virtual IP (VIP) address of the management nodes. + MgmtVipIp *string `mandatory:"false" json:"mgmtVipIp"` + + // The domain name system (DNS) addresses that the Compute Cloud@Customer infrastructure + // uses for the data center network. + DnsIps []string `mandatory:"false" json:"dnsIps"` + + InfrastructureRoutingStatic *CccInfrastructureRoutingStaticDetails `mandatory:"false" json:"infrastructureRoutingStatic"` + + InfrastructureRoutingDynamic *CccInfrastructureRoutingDynamicDetails `mandatory:"false" json:"infrastructureRoutingDynamic"` +} + +func (m CccInfrastructureNetworkConfiguration) 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 CccInfrastructureNetworkConfiguration) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum(string(m.UplinkPortForwardErrorCorrection)); !ok && m.UplinkPortForwardErrorCorrection != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UplinkPortForwardErrorCorrection: %s. Supported values are: %s.", m.UplinkPortForwardErrorCorrection, strings.Join(GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum Enum with underlying type: string +type CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum string + +// Set of constants representing the allowable values for CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum +const ( + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionAuto CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "AUTO" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionFireCodeFec CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "FIRE_CODE_FEC" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonConsortium16 CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "REED_SOLOMON_CONSORTIUM_16" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonFec CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "REED_SOLOMON_FEC" + CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonIeee CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = "REED_SOLOMON_IEEE" +) + +var mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum = map[string]CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum{ + "AUTO": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionAuto, + "FIRE_CODE_FEC": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionFireCodeFec, + "REED_SOLOMON_CONSORTIUM_16": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonConsortium16, + "REED_SOLOMON_FEC": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonFec, + "REED_SOLOMON_IEEE": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonIeee, +} + +var mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumLowerCase = map[string]CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum{ + "auto": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionAuto, + "fire_code_fec": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionFireCodeFec, + "reed_solomon_consortium_16": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonConsortium16, + "reed_solomon_fec": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonFec, + "reed_solomon_ieee": CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionReedSolomonIeee, +} + +// GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumValues Enumerates the set of values for CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum +func GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumValues() []CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum { + values := make([]CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum, 0) + for _, v := range mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumStringValues Enumerates the set of values in String for CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum +func GetCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumStringValues() []string { + return []string{ + "AUTO", + "FIRE_CODE_FEC", + "REED_SOLOMON_CONSORTIUM_16", + "REED_SOLOMON_FEC", + "REED_SOLOMON_IEEE", + } +} + +// GetMappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum(val string) (CccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnum, bool) { + enum, ok := mappingCccInfrastructureNetworkConfigurationUplinkPortForwardErrorCorrectionEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go new file mode 100644 index 00000000000..f7eec920d43 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_routing_dynamic_details.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureRoutingDynamicDetails Dynamic routing information for the Compute Cloud@Customer infrastructure. +type CccInfrastructureRoutingDynamicDetails struct { + + // The list of peer devices in the dynamic routing configuration. + PeerInformation []PeerInformation `mandatory:"false" json:"peerInformation"` + + // The Oracle Autonomous System Number (ASN) to control routing and exchange information + // within the dynamic routing configuration. + OracleAsn *int `mandatory:"false" json:"oracleAsn"` + + // The topology in use for the Border Gateway Protocol (BGP) configuration. + BgpTopology CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum `mandatory:"false" json:"bgpTopology,omitempty"` +} + +func (m CccInfrastructureRoutingDynamicDetails) 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 CccInfrastructureRoutingDynamicDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum(string(m.BgpTopology)); !ok && m.BgpTopology != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for BgpTopology: %s. Supported values are: %s.", m.BgpTopology, strings.Join(GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum Enum with underlying type: string +type CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum string + +// Set of constants representing the allowable values for CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum +const ( + CccInfrastructureRoutingDynamicDetailsBgpTopologyTriangle CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = "TRIANGLE" + CccInfrastructureRoutingDynamicDetailsBgpTopologySquare CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = "SQUARE" + CccInfrastructureRoutingDynamicDetailsBgpTopologyMesh CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = "MESH" +) + +var mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum = map[string]CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum{ + "TRIANGLE": CccInfrastructureRoutingDynamicDetailsBgpTopologyTriangle, + "SQUARE": CccInfrastructureRoutingDynamicDetailsBgpTopologySquare, + "MESH": CccInfrastructureRoutingDynamicDetailsBgpTopologyMesh, +} + +var mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumLowerCase = map[string]CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum{ + "triangle": CccInfrastructureRoutingDynamicDetailsBgpTopologyTriangle, + "square": CccInfrastructureRoutingDynamicDetailsBgpTopologySquare, + "mesh": CccInfrastructureRoutingDynamicDetailsBgpTopologyMesh, +} + +// GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumValues Enumerates the set of values for CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum +func GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumValues() []CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum { + values := make([]CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum, 0) + for _, v := range mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum { + values = append(values, v) + } + return values +} + +// GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumStringValues Enumerates the set of values in String for CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum +func GetCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumStringValues() []string { + return []string{ + "TRIANGLE", + "SQUARE", + "MESH", + } +} + +// GetMappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnum(val string) (CccInfrastructureRoutingDynamicDetailsBgpTopologyEnum, bool) { + enum, ok := mappingCccInfrastructureRoutingDynamicDetailsBgpTopologyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_routing_static_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_routing_static_details.go new file mode 100644 index 00000000000..f1fee10e184 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_routing_static_details.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureRoutingStaticDetails Static routing information for a rack. +type CccInfrastructureRoutingStaticDetails struct { + + // The virtual local area network (VLAN) identifier used to connect to the uplink + // (only access mode is supported). + UplinkVlan *int `mandatory:"false" json:"uplinkVlan"` + + // The uplink Hot Standby Router Protocol (HSRP) group value for the switch in the + // Compute Cloud@Customer infrastructure. + UplinkHsrpGroup *int `mandatory:"false" json:"uplinkHsrpGroup"` +} + +func (m CccInfrastructureRoutingStaticDetails) 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 CccInfrastructureRoutingStaticDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_summary.go new file mode 100644 index 00000000000..3f4038f806c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_infrastructure_summary.go @@ -0,0 +1,90 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccInfrastructureSummary Summary information about a Compute Cloud@Customer infrastructure. +type CccInfrastructureSummary struct { + + // The Compute Cloud@Customer infrastructure + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with + // the infrastructure. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is + // used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Compute Cloud@Customer infrastructure creation date and time. An RFC3339 formatted + // datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the Compute Cloud@Customer infrastructure. + LifecycleState CccInfrastructureLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The Compute Cloud@Customer infrastructure short name. This is generated at + // the time the resource is created and cannot be changed. The short name can be + // used when communicating with Oracle Service and may be used during the configuration + // of the data center network. + ShortName *string `mandatory:"false" json:"shortName"` + + // The current connection state of the infrastructure. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // 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"` + + // 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 CccInfrastructureSummary) 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 CccInfrastructureSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccInfrastructureLifecycleStateEnum(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(GetCccInfrastructureLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_schedule_event.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_schedule_event.go new file mode 100644 index 00000000000..bc5ed99fd36 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_schedule_event.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccScheduleEvent A period where upgrades may be applied to Compute Cloud@Customer infrastructures +// associated with the schedule. All upgrade windows may not be used. +type CccScheduleEvent struct { + + // Generated name associated with the event. + Name *string `mandatory:"true" json:"name"` + + // A description of the Compute Cloud@Customer upgrade schedule time block. + Description *string `mandatory:"true" json:"description"` + + // The date and time when the Compute Cloud@Customer upgrade schedule event starts, + // inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, + // this is the date that a recurrence can start being applied. + TimeStart *common.SDKTime `mandatory:"true" json:"timeStart"` + + // The duration of this block of time. The duration must be specified and be of the + // ISO-8601 format for durations. + ScheduleEventDuration *string `mandatory:"true" json:"scheduleEventDuration"` + + // Frequency of recurrence of schedule block. When this field is not included, the event + // is assumed to be a one time occurrence. The frequency field is strictly parsed and must + // conform to RFC-5545 formatting for recurrences. + ScheduleEventRecurrences *string `mandatory:"false" json:"scheduleEventRecurrences"` +} + +func (m CccScheduleEvent) 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 CccScheduleEvent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_information.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_information.go new file mode 100644 index 00000000000..4d46ef32cfc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_information.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeInformation Upgrade information that relates to a Compute Cloud@Customer infrastructure. This information +// cannot be updated. +type CccUpgradeInformation struct { + + // The current version of software installed on the Compute Cloud@Customer infrastructure. + CurrentVersion *string `mandatory:"false" json:"currentVersion"` + + // Compute Cloud@Customer infrastructure next upgrade time. The rack might have performance + // impacts during this time. + TimeOfScheduledUpgrade *common.SDKTime `mandatory:"false" json:"timeOfScheduledUpgrade"` + + // Expected duration of Compute Cloud@Customer infrastructure scheduled upgrade. The actual + // upgrade time might be longer or shorter than this duration depending on rack activity, this + // is only an estimate. + ScheduledUpgradeDuration *string `mandatory:"false" json:"scheduledUpgradeDuration"` + + // Indication that the Compute Cloud@Customer infrastructure is in the process of + // an upgrade or an upgrade activity (such as preloading upgrade images). + IsActive *bool `mandatory:"false" json:"isActive"` +} + +func (m CccUpgradeInformation) 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 CccUpgradeInformation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule.go new file mode 100644 index 00000000000..ac0cf0f0637 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule.go @@ -0,0 +1,142 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeSchedule Defines a schedule for preferred upgrade times. +type CccUpgradeSchedule struct { + + // Upgrade schedule OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the + // Compute Cloud@Customer upgrade schedule. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the upgrade schedule was created, using an RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // Lifecycle state of the resource. + LifecycleState CccUpgradeScheduleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // An optional description of the Compute Cloud@Customer upgrade schedule. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // The time the upgrade schedule was updated, using an RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message describing the current state in more detail. + // For example, the message can be used to provide actionable information for a resource in + // a Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // List of preferred times for Compute Cloud@Customer infrastructures associated with this + // schedule to be upgraded. + Events []CccScheduleEvent `mandatory:"false" json:"events"` + + // List of Compute Cloud@Customer infrastructure + // OCIDs (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) that are using this upgrade + // schedule. + InfrastructureIds []string `mandatory:"false" json:"infrastructureIds"` + + // 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"` + + // 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 CccUpgradeSchedule) 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 CccUpgradeSchedule) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccUpgradeScheduleLifecycleStateEnum(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(GetCccUpgradeScheduleLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CccUpgradeScheduleLifecycleStateEnum Enum with underlying type: string +type CccUpgradeScheduleLifecycleStateEnum string + +// Set of constants representing the allowable values for CccUpgradeScheduleLifecycleStateEnum +const ( + CccUpgradeScheduleLifecycleStateActive CccUpgradeScheduleLifecycleStateEnum = "ACTIVE" + CccUpgradeScheduleLifecycleStateNeedsAttention CccUpgradeScheduleLifecycleStateEnum = "NEEDS_ATTENTION" + CccUpgradeScheduleLifecycleStateDeleted CccUpgradeScheduleLifecycleStateEnum = "DELETED" + CccUpgradeScheduleLifecycleStateFailed CccUpgradeScheduleLifecycleStateEnum = "FAILED" +) + +var mappingCccUpgradeScheduleLifecycleStateEnum = map[string]CccUpgradeScheduleLifecycleStateEnum{ + "ACTIVE": CccUpgradeScheduleLifecycleStateActive, + "NEEDS_ATTENTION": CccUpgradeScheduleLifecycleStateNeedsAttention, + "DELETED": CccUpgradeScheduleLifecycleStateDeleted, + "FAILED": CccUpgradeScheduleLifecycleStateFailed, +} + +var mappingCccUpgradeScheduleLifecycleStateEnumLowerCase = map[string]CccUpgradeScheduleLifecycleStateEnum{ + "active": CccUpgradeScheduleLifecycleStateActive, + "needs_attention": CccUpgradeScheduleLifecycleStateNeedsAttention, + "deleted": CccUpgradeScheduleLifecycleStateDeleted, + "failed": CccUpgradeScheduleLifecycleStateFailed, +} + +// GetCccUpgradeScheduleLifecycleStateEnumValues Enumerates the set of values for CccUpgradeScheduleLifecycleStateEnum +func GetCccUpgradeScheduleLifecycleStateEnumValues() []CccUpgradeScheduleLifecycleStateEnum { + values := make([]CccUpgradeScheduleLifecycleStateEnum, 0) + for _, v := range mappingCccUpgradeScheduleLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetCccUpgradeScheduleLifecycleStateEnumStringValues Enumerates the set of values in String for CccUpgradeScheduleLifecycleStateEnum +func GetCccUpgradeScheduleLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "NEEDS_ATTENTION", + "DELETED", + "FAILED", + } +} + +// GetMappingCccUpgradeScheduleLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCccUpgradeScheduleLifecycleStateEnum(val string) (CccUpgradeScheduleLifecycleStateEnum, bool) { + enum, ok := mappingCccUpgradeScheduleLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule_collection.go new file mode 100644 index 00000000000..6ff19c89b56 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule_collection.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeScheduleCollection Results of a Compute Cloud@Customer upgrade schedule search. +// Contains the summary items and other information, +// such as metadata. +type CccUpgradeScheduleCollection struct { + + // List of Compute Cloud@Customer upgrade schedules. + Items []CccUpgradeScheduleSummary `mandatory:"true" json:"items"` +} + +func (m CccUpgradeScheduleCollection) 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 CccUpgradeScheduleCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule_summary.go new file mode 100644 index 00000000000..ce0299e48ca --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/ccc_upgrade_schedule_summary.go @@ -0,0 +1,73 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CccUpgradeScheduleSummary Basic information about a Compute Cloud@Customer schedule. This summary +// only includes high level resource information, not the schedule events. +type CccUpgradeScheduleSummary struct { + + // The upgrade schedule OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + // This cannot be changed once created. + Id *string `mandatory:"true" json:"id"` + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering any confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the + // Compute Cloud@Customer Upgrade Schedule. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The time the upgrade schedule was created. An RFC3339 formatted datetime string + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the Compute Cloud@Customer + // upgrade schedule. + LifecycleState CccUpgradeScheduleLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // 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"` + + // 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 CccUpgradeScheduleSummary) 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 CccUpgradeScheduleSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCccUpgradeScheduleLifecycleStateEnum(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(GetCccUpgradeScheduleLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go new file mode 100644 index 00000000000..93722370d2b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_infrastructure_compartment_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeCccInfrastructureCompartmentDetails Information required for the compartment change operation. +type ChangeCccInfrastructureCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment + // into which the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeCccInfrastructureCompartmentDetails) 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 ChangeCccInfrastructureCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_infrastructure_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_infrastructure_compartment_request_response.go new file mode 100644 index 00000000000..f5e9bd1ed35 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_infrastructure_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeCccInfrastructureCompartmentRequest wrapper for the ChangeCccInfrastructureCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccInfrastructureCompartment.go.html to see an example of how to use ChangeCccInfrastructureCompartmentRequest. +type ChangeCccInfrastructureCompartmentRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // Details about the compartment change operation including the destination compartment + // specified by the resource OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + ChangeCccInfrastructureCompartmentDetails `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 + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 ChangeCccInfrastructureCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeCccInfrastructureCompartmentRequest) 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 ChangeCccInfrastructureCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeCccInfrastructureCompartmentRequest) 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 ChangeCccInfrastructureCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeCccInfrastructureCompartmentResponse wrapper for the ChangeCccInfrastructureCompartment operation +type ChangeCccInfrastructureCompartmentResponse 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 ChangeCccInfrastructureCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeCccInfrastructureCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go new file mode 100644 index 00000000000..d17ff1aa7e3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeCccUpgradeScheduleCompartmentDetails Change the compartment of a Compute Cloud@Customer upgrade schedule. +type ChangeCccUpgradeScheduleCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment + // into which the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeCccUpgradeScheduleCompartmentDetails) 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 ChangeCccUpgradeScheduleCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_request_response.go new file mode 100644 index 00000000000..ba39626704b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/change_ccc_upgrade_schedule_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeCccUpgradeScheduleCompartmentRequest wrapper for the ChangeCccUpgradeScheduleCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccUpgradeScheduleCompartment.go.html to see an example of how to use ChangeCccUpgradeScheduleCompartmentRequest. +type ChangeCccUpgradeScheduleCompartmentRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // Details about the compartment change operation including the destination compartment + // specified by the resource OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + ChangeCccUpgradeScheduleCompartmentDetails `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 + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 ChangeCccUpgradeScheduleCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeCccUpgradeScheduleCompartmentRequest) 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 ChangeCccUpgradeScheduleCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeCccUpgradeScheduleCompartmentRequest) 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 ChangeCccUpgradeScheduleCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeCccUpgradeScheduleCompartmentResponse wrapper for the ChangeCccUpgradeScheduleCompartment operation +type ChangeCccUpgradeScheduleCompartmentResponse 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 ChangeCccUpgradeScheduleCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeCccUpgradeScheduleCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/computecloudatcustomer_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/computecloudatcustomer_client.go new file mode 100644 index 00000000000..3479379fb6c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/computecloudatcustomer_client.go @@ -0,0 +1,812 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ComputeCloudAtCustomerClient a client for ComputeCloudAtCustomer +type ComputeCloudAtCustomerClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewComputeCloudAtCustomerClientWithConfigurationProvider Creates a new default ComputeCloudAtCustomer client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewComputeCloudAtCustomerClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ComputeCloudAtCustomerClient, err error) { + if enabled := common.CheckForEnabledServices("computecloudatcustomer"); !enabled { + return client, fmt.Errorf("the Alloy configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local alloy_config 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 newComputeCloudAtCustomerClientFromBaseClient(baseClient, provider) +} + +// NewComputeCloudAtCustomerClientWithOboToken Creates a new default ComputeCloudAtCustomer 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 NewComputeCloudAtCustomerClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ComputeCloudAtCustomerClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newComputeCloudAtCustomerClientFromBaseClient(baseClient, configProvider) +} + +func newComputeCloudAtCustomerClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ComputeCloudAtCustomerClient, err error) { + // ComputeCloudAtCustomer service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ComputeCloudAtCustomer")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ComputeCloudAtCustomerClient{BaseClient: baseClient} + client.BasePath = "20221208" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ComputeCloudAtCustomerClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("computecloudatcustomer", "https://ccc.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ComputeCloudAtCustomerClient) 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 *ComputeCloudAtCustomerClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ChangeCccInfrastructureCompartment Moves a Compute Cloud@Customer infrastructure resource from one compartment to another. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccInfrastructureCompartment.go.html to see an example of how to use ChangeCccInfrastructureCompartment API. +// A default retry strategy applies to this operation ChangeCccInfrastructureCompartment() +func (client ComputeCloudAtCustomerClient) ChangeCccInfrastructureCompartment(ctx context.Context, request ChangeCccInfrastructureCompartmentRequest) (response ChangeCccInfrastructureCompartmentResponse, 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.changeCccInfrastructureCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeCccInfrastructureCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeCccInfrastructureCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeCccInfrastructureCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeCccInfrastructureCompartmentResponse") + } + return +} + +// changeCccInfrastructureCompartment implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) changeCccInfrastructureCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccInfrastructures/{cccInfrastructureId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeCccInfrastructureCompartmentResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/ChangeCccInfrastructureCompartment" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ChangeCccInfrastructureCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeCccUpgradeScheduleCompartment Moves a Compute Cloud@Customer upgrade schedule from one compartment to another using the +// specified OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ChangeCccUpgradeScheduleCompartment.go.html to see an example of how to use ChangeCccUpgradeScheduleCompartment API. +// A default retry strategy applies to this operation ChangeCccUpgradeScheduleCompartment() +func (client ComputeCloudAtCustomerClient) ChangeCccUpgradeScheduleCompartment(ctx context.Context, request ChangeCccUpgradeScheduleCompartmentRequest) (response ChangeCccUpgradeScheduleCompartmentResponse, 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.changeCccUpgradeScheduleCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeCccUpgradeScheduleCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeCccUpgradeScheduleCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeCccUpgradeScheduleCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeCccUpgradeScheduleCompartmentResponse") + } + return +} + +// changeCccUpgradeScheduleCompartment implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) changeCccUpgradeScheduleCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccUpgradeSchedules/{cccUpgradeScheduleId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeCccUpgradeScheduleCompartmentResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/ChangeCccUpgradeScheduleCompartment" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ChangeCccUpgradeScheduleCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateCccInfrastructure Creates a Compute Cloud@Customer infrastructure. Once created, Oracle Services +// must connect the rack in the data center to this Oracle Cloud Infrastructure resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccInfrastructure.go.html to see an example of how to use CreateCccInfrastructure API. +// A default retry strategy applies to this operation CreateCccInfrastructure() +func (client ComputeCloudAtCustomerClient) CreateCccInfrastructure(ctx context.Context, request CreateCccInfrastructureRequest) (response CreateCccInfrastructureResponse, 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.createCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCccInfrastructureResponse") + } + return +} + +// createCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) createCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccInfrastructures", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/CreateCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "CreateCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateCccUpgradeSchedule Creates a new Compute Cloud@Customer upgrade schedule. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccUpgradeSchedule.go.html to see an example of how to use CreateCccUpgradeSchedule API. +// A default retry strategy applies to this operation CreateCccUpgradeSchedule() +func (client ComputeCloudAtCustomerClient) CreateCccUpgradeSchedule(ctx context.Context, request CreateCccUpgradeScheduleRequest) (response CreateCccUpgradeScheduleResponse, 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.createCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateCccUpgradeScheduleResponse") + } + return +} + +// createCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) createCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/cccUpgradeSchedules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/CreateCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "CreateCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteCccInfrastructure Deletes a Compute Cloud@Customer infrastructure resource specified by the resource +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccInfrastructure.go.html to see an example of how to use DeleteCccInfrastructure API. +func (client ComputeCloudAtCustomerClient) DeleteCccInfrastructure(ctx context.Context, request DeleteCccInfrastructureRequest) (response DeleteCccInfrastructureResponse, 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.deleteCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCccInfrastructureResponse") + } + return +} + +// deleteCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) deleteCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/cccInfrastructures/{cccInfrastructureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/DeleteCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "DeleteCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteCccUpgradeSchedule Deletes a Compute Cloud@Customer upgrade schedule by the specified +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccUpgradeSchedule.go.html to see an example of how to use DeleteCccUpgradeSchedule API. +func (client ComputeCloudAtCustomerClient) DeleteCccUpgradeSchedule(ctx context.Context, request DeleteCccUpgradeScheduleRequest) (response DeleteCccUpgradeScheduleResponse, 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.deleteCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteCccUpgradeScheduleResponse") + } + return +} + +// deleteCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) deleteCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/cccUpgradeSchedules/{cccUpgradeScheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/DeleteCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "DeleteCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCccInfrastructure Gets a Compute Cloud@Customer infrastructure using the infrastructure +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccInfrastructure.go.html to see an example of how to use GetCccInfrastructure API. +// A default retry strategy applies to this operation GetCccInfrastructure() +func (client ComputeCloudAtCustomerClient) GetCccInfrastructure(ctx context.Context, request GetCccInfrastructureRequest) (response GetCccInfrastructureResponse, 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.getCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCccInfrastructureResponse") + } + return +} + +// getCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) getCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccInfrastructures/{cccInfrastructureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/GetCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "GetCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCccUpgradeSchedule Gets a Compute Cloud@Customer upgrade schedule by the specified +// OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccUpgradeSchedule.go.html to see an example of how to use GetCccUpgradeSchedule API. +// A default retry strategy applies to this operation GetCccUpgradeSchedule() +func (client ComputeCloudAtCustomerClient) GetCccUpgradeSchedule(ctx context.Context, request GetCccUpgradeScheduleRequest) (response GetCccUpgradeScheduleResponse, 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.getCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCccUpgradeScheduleResponse") + } + return +} + +// getCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) getCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccUpgradeSchedules/{cccUpgradeScheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/GetCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "GetCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCccInfrastructures Returns a list of Compute Cloud@Customer infrastructures. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccInfrastructures.go.html to see an example of how to use ListCccInfrastructures API. +// A default retry strategy applies to this operation ListCccInfrastructures() +func (client ComputeCloudAtCustomerClient) ListCccInfrastructures(ctx context.Context, request ListCccInfrastructuresRequest) (response ListCccInfrastructuresResponse, 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.listCccInfrastructures, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCccInfrastructuresResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCccInfrastructuresResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCccInfrastructuresResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCccInfrastructuresResponse") + } + return +} + +// listCccInfrastructures implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) listCccInfrastructures(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccInfrastructures", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCccInfrastructuresResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructureCollection/ListCccInfrastructures" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ListCccInfrastructures", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCccUpgradeSchedules Returns a list of Compute Cloud@Customer upgrade schedules. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccUpgradeSchedules.go.html to see an example of how to use ListCccUpgradeSchedules API. +// A default retry strategy applies to this operation ListCccUpgradeSchedules() +func (client ComputeCloudAtCustomerClient) ListCccUpgradeSchedules(ctx context.Context, request ListCccUpgradeSchedulesRequest) (response ListCccUpgradeSchedulesResponse, 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.listCccUpgradeSchedules, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCccUpgradeSchedulesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCccUpgradeSchedulesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCccUpgradeSchedulesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCccUpgradeSchedulesResponse") + } + return +} + +// listCccUpgradeSchedules implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) listCccUpgradeSchedules(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/cccUpgradeSchedules", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCccUpgradeSchedulesResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeScheduleCollection/ListCccUpgradeSchedules" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "ListCccUpgradeSchedules", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCccInfrastructure Updates Compute Cloud@Customer infrastructure resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccInfrastructure.go.html to see an example of how to use UpdateCccInfrastructure API. +func (client ComputeCloudAtCustomerClient) UpdateCccInfrastructure(ctx context.Context, request UpdateCccInfrastructureRequest) (response UpdateCccInfrastructureResponse, 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.updateCccInfrastructure, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateCccInfrastructureResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateCccInfrastructureResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateCccInfrastructureResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCccInfrastructureResponse") + } + return +} + +// updateCccInfrastructure implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) updateCccInfrastructure(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/cccInfrastructures/{cccInfrastructureId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateCccInfrastructureResponse + 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/compute-cloud-at-customer/20221208/CccInfrastructure/UpdateCccInfrastructure" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "UpdateCccInfrastructure", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateCccUpgradeSchedule Updates the Compute Cloud@Customer upgrade schedule. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccUpgradeSchedule.go.html to see an example of how to use UpdateCccUpgradeSchedule API. +func (client ComputeCloudAtCustomerClient) UpdateCccUpgradeSchedule(ctx context.Context, request UpdateCccUpgradeScheduleRequest) (response UpdateCccUpgradeScheduleResponse, 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.updateCccUpgradeSchedule, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateCccUpgradeScheduleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateCccUpgradeScheduleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateCccUpgradeScheduleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateCccUpgradeScheduleResponse") + } + return +} + +// updateCccUpgradeSchedule implements the OCIOperation interface (enables retrying operations) +func (client ComputeCloudAtCustomerClient) updateCccUpgradeSchedule(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/cccUpgradeSchedules/{cccUpgradeScheduleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateCccUpgradeScheduleResponse + 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/compute-cloud-at-customer/20221208/CccUpgradeSchedule/UpdateCccUpgradeSchedule" + err = common.PostProcessServiceError(err, "ComputeCloudAtCustomer", "UpdateCccUpgradeSchedule", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_infrastructure_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_infrastructure_details.go new file mode 100644 index 00000000000..404d58726c8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_infrastructure_details.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCccInfrastructureDetails The configuration details for creating Compute Cloud@Customer infrastructure. +type CreateCccInfrastructureDetails struct { + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with + // the infrastructure. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Identifier for network subnet that will be used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // The current connection state of the Compute Cloud@Customer infrastructure. This value + // will default to REJECT if the value is not provided. The only valid value at creation + // time is REJECT. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // A message describing the current connection state in more detail. + ConnectionDetails *string `mandatory:"false" json:"connectionDetails"` + + // Schedule used for upgrades. If no schedule is associated with the infrastructure, + // it can be upgraded at any time. + CccUpgradeScheduleId *string `mandatory:"false" json:"cccUpgradeScheduleId"` + + // 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"` +} + +func (m CreateCccInfrastructureDetails) 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 CreateCccInfrastructureDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_infrastructure_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_infrastructure_request_response.go new file mode 100644 index 00000000000..330dae44288 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_infrastructure_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateCccInfrastructureRequest wrapper for the CreateCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccInfrastructure.go.html to see an example of how to use CreateCccInfrastructureRequest. +type CreateCccInfrastructureRequest struct { + + // Details for the new CccInfrastructure. + CreateCccInfrastructureDetails `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 + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 CreateCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateCccInfrastructureRequest) 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 CreateCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCccInfrastructureRequest) 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 CreateCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateCccInfrastructureResponse wrapper for the CreateCccInfrastructure operation +type CreateCccInfrastructureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccInfrastructure instance + CccInfrastructure `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 CreateCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_schedule_event.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_schedule_event.go new file mode 100644 index 00000000000..cb4f8acbe16 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_schedule_event.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCccScheduleEvent A period where upgrades may be applied to Compute Cloud@Customer infrastructures +// associated with the schedule. All upgrade windows may not be used. +type CreateCccScheduleEvent struct { + + // A description of the Compute Cloud@Customer upgrade schedule time block. + Description *string `mandatory:"true" json:"description"` + + // The date and time when the Compute Cloud@Customer upgrade schedule event starts, + // inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, + // this is the date that a recurrence can start being applied. + TimeStart *common.SDKTime `mandatory:"true" json:"timeStart"` + + // The duration of this block of time. The duration must be specified and be of the + // ISO-8601 format for durations. + ScheduleEventDuration *string `mandatory:"true" json:"scheduleEventDuration"` + + // Frequency of recurrence of schedule block. When this field is not included, the event + // is assumed to be a one time occurrence. The frequency field is strictly parsed and must + // conform to RFC-5545 formatting for recurrences. + ScheduleEventRecurrences *string `mandatory:"false" json:"scheduleEventRecurrences"` +} + +func (m CreateCccScheduleEvent) 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 CreateCccScheduleEvent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_upgrade_schedule_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_upgrade_schedule_details.go new file mode 100644 index 00000000000..bf77c113894 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_upgrade_schedule_details.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateCccUpgradeScheduleDetails Defines a schedule for times when automated Compute Cloud@Customer upgrades are preferred. +// A created upgrade schedule must supply events with a minimum frequency and duration or +// the schedule will be rejected. Upgrades may impact performance of +// Compute Cloud@Customer infrastructures when they are being applied. +type CreateCccUpgradeScheduleDetails struct { + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Compartment OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the + // Compute Cloud@Customer Upgrade Schedule. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // List of preferred times for Compute Cloud@Customer infrastructure to be upgraded. + Events []CreateCccScheduleEvent `mandatory:"true" json:"events"` + + // An optional description of the Compute Cloud@Customer upgrade schedule. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // 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"` +} + +func (m CreateCccUpgradeScheduleDetails) 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 CreateCccUpgradeScheduleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_upgrade_schedule_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_upgrade_schedule_request_response.go new file mode 100644 index 00000000000..07628d58e8c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/create_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateCccUpgradeScheduleRequest wrapper for the CreateCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/CreateCccUpgradeSchedule.go.html to see an example of how to use CreateCccUpgradeScheduleRequest. +type CreateCccUpgradeScheduleRequest struct { + + // Details for the new CCC Upgrade Schedule. + CreateCccUpgradeScheduleDetails `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 + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 CreateCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateCccUpgradeScheduleRequest) 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 CreateCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateCccUpgradeScheduleRequest) 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 CreateCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateCccUpgradeScheduleResponse wrapper for the CreateCccUpgradeSchedule operation +type CreateCccUpgradeScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccUpgradeSchedule instance + CccUpgradeSchedule `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 CreateCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/delete_ccc_infrastructure_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/delete_ccc_infrastructure_request_response.go new file mode 100644 index 00000000000..520599cff45 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/delete_ccc_infrastructure_request_response.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteCccInfrastructureRequest wrapper for the DeleteCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccInfrastructure.go.html to see an example of how to use DeleteCccInfrastructureRequest. +type DeleteCccInfrastructureRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // 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"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 DeleteCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCccInfrastructureRequest) 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 DeleteCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCccInfrastructureRequest) 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 DeleteCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteCccInfrastructureResponse wrapper for the DeleteCccInfrastructure operation +type DeleteCccInfrastructureResponse 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 DeleteCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/delete_ccc_upgrade_schedule_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/delete_ccc_upgrade_schedule_request_response.go new file mode 100644 index 00000000000..e5880c6f192 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/delete_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteCccUpgradeScheduleRequest wrapper for the DeleteCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/DeleteCccUpgradeSchedule.go.html to see an example of how to use DeleteCccUpgradeScheduleRequest. +type DeleteCccUpgradeScheduleRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // 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"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 DeleteCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteCccUpgradeScheduleRequest) 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 DeleteCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteCccUpgradeScheduleRequest) 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 DeleteCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteCccUpgradeScheduleResponse wrapper for the DeleteCccUpgradeSchedule operation +type DeleteCccUpgradeScheduleResponse 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 DeleteCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/get_ccc_infrastructure_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/get_ccc_infrastructure_request_response.go new file mode 100644 index 00000000000..b0cb0e7328f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/get_ccc_infrastructure_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCccInfrastructureRequest wrapper for the GetCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccInfrastructure.go.html to see an example of how to use GetCccInfrastructureRequest. +type GetCccInfrastructureRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 GetCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCccInfrastructureRequest) 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 GetCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCccInfrastructureRequest) 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 GetCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCccInfrastructureResponse wrapper for the GetCccInfrastructure operation +type GetCccInfrastructureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccInfrastructure instance + CccInfrastructure `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 GetCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/get_ccc_upgrade_schedule_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/get_ccc_upgrade_schedule_request_response.go new file mode 100644 index 00000000000..8fe59f227ab --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/get_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCccUpgradeScheduleRequest wrapper for the GetCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/GetCccUpgradeSchedule.go.html to see an example of how to use GetCccUpgradeScheduleRequest. +type GetCccUpgradeScheduleRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 GetCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCccUpgradeScheduleRequest) 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 GetCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCccUpgradeScheduleRequest) 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 GetCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCccUpgradeScheduleResponse wrapper for the GetCccUpgradeSchedule operation +type GetCccUpgradeScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccUpgradeSchedule instance + CccUpgradeSchedule `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 GetCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/list_ccc_infrastructures_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/list_ccc_infrastructures_request_response.go new file mode 100644 index 00000000000..f478f360865 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/list_ccc_infrastructures_request_response.go @@ -0,0 +1,276 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCccInfrastructuresRequest wrapper for the ListCccInfrastructures operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccInfrastructures.go.html to see an example of how to use ListCccInfrastructuresRequest. +type ListCccInfrastructuresRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to + // list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Default is false. + // When set to true, the hierarchy of compartments is traversed and all compartments and + // sub-compartments in the tenancy are returned. Depends on the 'accessLevel' setting. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. + // Setting this to ACCESSIBLE returns only those compartments for which the + // user has INSPECT permissions directly or indirectly (permissions can be on a + // resource in a subcompartment). When set to RESTRICTED permissions are checked and no + // partial results are displayed. + AccessLevel ListCccInfrastructuresAccessLevelEnum `mandatory:"false" contributesTo:"query" name:"accessLevel" omitEmpty:"true"` + + // A filter used to return only resources that match the given lifecycleState. + LifecycleState CccInfrastructureLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only resources whose display name contains the substring. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"false" contributesTo:"query" name:"cccInfrastructureId"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListCccInfrastructuresSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. + SortBy ListCccInfrastructuresSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 ListCccInfrastructuresRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCccInfrastructuresRequest) 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 ListCccInfrastructuresRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCccInfrastructuresRequest) 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 ListCccInfrastructuresRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCccInfrastructuresAccessLevelEnum(string(request.AccessLevel)); !ok && request.AccessLevel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AccessLevel: %s. Supported values are: %s.", request.AccessLevel, strings.Join(GetListCccInfrastructuresAccessLevelEnumStringValues(), ","))) + } + if _, ok := GetMappingCccInfrastructureLifecycleStateEnum(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(GetCccInfrastructureLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccInfrastructuresSortOrderEnum(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(GetListCccInfrastructuresSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccInfrastructuresSortByEnum(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(GetListCccInfrastructuresSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCccInfrastructuresResponse wrapper for the ListCccInfrastructures operation +type ListCccInfrastructuresResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CccInfrastructureCollection instances + CccInfrastructureCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` +} + +func (response ListCccInfrastructuresResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCccInfrastructuresResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCccInfrastructuresAccessLevelEnum Enum with underlying type: string +type ListCccInfrastructuresAccessLevelEnum string + +// Set of constants representing the allowable values for ListCccInfrastructuresAccessLevelEnum +const ( + ListCccInfrastructuresAccessLevelRestricted ListCccInfrastructuresAccessLevelEnum = "RESTRICTED" + ListCccInfrastructuresAccessLevelAccessible ListCccInfrastructuresAccessLevelEnum = "ACCESSIBLE" +) + +var mappingListCccInfrastructuresAccessLevelEnum = map[string]ListCccInfrastructuresAccessLevelEnum{ + "RESTRICTED": ListCccInfrastructuresAccessLevelRestricted, + "ACCESSIBLE": ListCccInfrastructuresAccessLevelAccessible, +} + +var mappingListCccInfrastructuresAccessLevelEnumLowerCase = map[string]ListCccInfrastructuresAccessLevelEnum{ + "restricted": ListCccInfrastructuresAccessLevelRestricted, + "accessible": ListCccInfrastructuresAccessLevelAccessible, +} + +// GetListCccInfrastructuresAccessLevelEnumValues Enumerates the set of values for ListCccInfrastructuresAccessLevelEnum +func GetListCccInfrastructuresAccessLevelEnumValues() []ListCccInfrastructuresAccessLevelEnum { + values := make([]ListCccInfrastructuresAccessLevelEnum, 0) + for _, v := range mappingListCccInfrastructuresAccessLevelEnum { + values = append(values, v) + } + return values +} + +// GetListCccInfrastructuresAccessLevelEnumStringValues Enumerates the set of values in String for ListCccInfrastructuresAccessLevelEnum +func GetListCccInfrastructuresAccessLevelEnumStringValues() []string { + return []string{ + "RESTRICTED", + "ACCESSIBLE", + } +} + +// GetMappingListCccInfrastructuresAccessLevelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccInfrastructuresAccessLevelEnum(val string) (ListCccInfrastructuresAccessLevelEnum, bool) { + enum, ok := mappingListCccInfrastructuresAccessLevelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccInfrastructuresSortOrderEnum Enum with underlying type: string +type ListCccInfrastructuresSortOrderEnum string + +// Set of constants representing the allowable values for ListCccInfrastructuresSortOrderEnum +const ( + ListCccInfrastructuresSortOrderAsc ListCccInfrastructuresSortOrderEnum = "ASC" + ListCccInfrastructuresSortOrderDesc ListCccInfrastructuresSortOrderEnum = "DESC" +) + +var mappingListCccInfrastructuresSortOrderEnum = map[string]ListCccInfrastructuresSortOrderEnum{ + "ASC": ListCccInfrastructuresSortOrderAsc, + "DESC": ListCccInfrastructuresSortOrderDesc, +} + +var mappingListCccInfrastructuresSortOrderEnumLowerCase = map[string]ListCccInfrastructuresSortOrderEnum{ + "asc": ListCccInfrastructuresSortOrderAsc, + "desc": ListCccInfrastructuresSortOrderDesc, +} + +// GetListCccInfrastructuresSortOrderEnumValues Enumerates the set of values for ListCccInfrastructuresSortOrderEnum +func GetListCccInfrastructuresSortOrderEnumValues() []ListCccInfrastructuresSortOrderEnum { + values := make([]ListCccInfrastructuresSortOrderEnum, 0) + for _, v := range mappingListCccInfrastructuresSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCccInfrastructuresSortOrderEnumStringValues Enumerates the set of values in String for ListCccInfrastructuresSortOrderEnum +func GetListCccInfrastructuresSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCccInfrastructuresSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccInfrastructuresSortOrderEnum(val string) (ListCccInfrastructuresSortOrderEnum, bool) { + enum, ok := mappingListCccInfrastructuresSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccInfrastructuresSortByEnum Enum with underlying type: string +type ListCccInfrastructuresSortByEnum string + +// Set of constants representing the allowable values for ListCccInfrastructuresSortByEnum +const ( + ListCccInfrastructuresSortByTimecreated ListCccInfrastructuresSortByEnum = "timeCreated" + ListCccInfrastructuresSortByDisplayname ListCccInfrastructuresSortByEnum = "displayName" +) + +var mappingListCccInfrastructuresSortByEnum = map[string]ListCccInfrastructuresSortByEnum{ + "timeCreated": ListCccInfrastructuresSortByTimecreated, + "displayName": ListCccInfrastructuresSortByDisplayname, +} + +var mappingListCccInfrastructuresSortByEnumLowerCase = map[string]ListCccInfrastructuresSortByEnum{ + "timecreated": ListCccInfrastructuresSortByTimecreated, + "displayname": ListCccInfrastructuresSortByDisplayname, +} + +// GetListCccInfrastructuresSortByEnumValues Enumerates the set of values for ListCccInfrastructuresSortByEnum +func GetListCccInfrastructuresSortByEnumValues() []ListCccInfrastructuresSortByEnum { + values := make([]ListCccInfrastructuresSortByEnum, 0) + for _, v := range mappingListCccInfrastructuresSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCccInfrastructuresSortByEnumStringValues Enumerates the set of values in String for ListCccInfrastructuresSortByEnum +func GetListCccInfrastructuresSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListCccInfrastructuresSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccInfrastructuresSortByEnum(val string) (ListCccInfrastructuresSortByEnum, bool) { + enum, ok := mappingListCccInfrastructuresSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/list_ccc_upgrade_schedules_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/list_ccc_upgrade_schedules_request_response.go new file mode 100644 index 00000000000..61e09345532 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/list_ccc_upgrade_schedules_request_response.go @@ -0,0 +1,276 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCccUpgradeSchedulesRequest wrapper for the ListCccUpgradeSchedules operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/ListCccUpgradeSchedules.go.html to see an example of how to use ListCccUpgradeSchedulesRequest. +type ListCccUpgradeSchedulesRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"false" contributesTo:"query" name:"cccUpgradeScheduleId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to + // list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Default is false. + // When set to true, the hierarchy of compartments is traversed and all compartments and + // sub-compartments in the tenancy are returned. Depends on the 'accessLevel' setting. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. + // Setting this to ACCESSIBLE returns only those compartments for which the + // user has INSPECT permissions directly or indirectly (permissions can be on a + // resource in a subcompartment). When set to RESTRICTED permissions are checked and no + // partial results are displayed. + AccessLevel ListCccUpgradeSchedulesAccessLevelEnum `mandatory:"false" contributesTo:"query" name:"accessLevel" omitEmpty:"true"` + + // A filter to return resources only when their lifecycleState matches the given lifecycleState. + LifecycleState CccUpgradeScheduleLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the entire display name given. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return only resources whose display name contains the substring. + DisplayNameContains *string `mandatory:"false" contributesTo:"query" name:"displayNameContains"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // A token representing the position at which to start retrieving results. This must come from the `opc-next-page` header field of a previous response. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either 'ASC' or 'DESC'. + SortOrder ListCccUpgradeSchedulesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. + SortBy ListCccUpgradeSchedulesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 ListCccUpgradeSchedulesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCccUpgradeSchedulesRequest) 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 ListCccUpgradeSchedulesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCccUpgradeSchedulesRequest) 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 ListCccUpgradeSchedulesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCccUpgradeSchedulesAccessLevelEnum(string(request.AccessLevel)); !ok && request.AccessLevel != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AccessLevel: %s. Supported values are: %s.", request.AccessLevel, strings.Join(GetListCccUpgradeSchedulesAccessLevelEnumStringValues(), ","))) + } + if _, ok := GetMappingCccUpgradeScheduleLifecycleStateEnum(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(GetCccUpgradeScheduleLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccUpgradeSchedulesSortOrderEnum(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(GetListCccUpgradeSchedulesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListCccUpgradeSchedulesSortByEnum(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(GetListCccUpgradeSchedulesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCccUpgradeSchedulesResponse wrapper for the ListCccUpgradeSchedules operation +type ListCccUpgradeSchedulesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of CccUpgradeScheduleCollection instances + CccUpgradeScheduleCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` +} + +func (response ListCccUpgradeSchedulesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCccUpgradeSchedulesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCccUpgradeSchedulesAccessLevelEnum Enum with underlying type: string +type ListCccUpgradeSchedulesAccessLevelEnum string + +// Set of constants representing the allowable values for ListCccUpgradeSchedulesAccessLevelEnum +const ( + ListCccUpgradeSchedulesAccessLevelRestricted ListCccUpgradeSchedulesAccessLevelEnum = "RESTRICTED" + ListCccUpgradeSchedulesAccessLevelAccessible ListCccUpgradeSchedulesAccessLevelEnum = "ACCESSIBLE" +) + +var mappingListCccUpgradeSchedulesAccessLevelEnum = map[string]ListCccUpgradeSchedulesAccessLevelEnum{ + "RESTRICTED": ListCccUpgradeSchedulesAccessLevelRestricted, + "ACCESSIBLE": ListCccUpgradeSchedulesAccessLevelAccessible, +} + +var mappingListCccUpgradeSchedulesAccessLevelEnumLowerCase = map[string]ListCccUpgradeSchedulesAccessLevelEnum{ + "restricted": ListCccUpgradeSchedulesAccessLevelRestricted, + "accessible": ListCccUpgradeSchedulesAccessLevelAccessible, +} + +// GetListCccUpgradeSchedulesAccessLevelEnumValues Enumerates the set of values for ListCccUpgradeSchedulesAccessLevelEnum +func GetListCccUpgradeSchedulesAccessLevelEnumValues() []ListCccUpgradeSchedulesAccessLevelEnum { + values := make([]ListCccUpgradeSchedulesAccessLevelEnum, 0) + for _, v := range mappingListCccUpgradeSchedulesAccessLevelEnum { + values = append(values, v) + } + return values +} + +// GetListCccUpgradeSchedulesAccessLevelEnumStringValues Enumerates the set of values in String for ListCccUpgradeSchedulesAccessLevelEnum +func GetListCccUpgradeSchedulesAccessLevelEnumStringValues() []string { + return []string{ + "RESTRICTED", + "ACCESSIBLE", + } +} + +// GetMappingListCccUpgradeSchedulesAccessLevelEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccUpgradeSchedulesAccessLevelEnum(val string) (ListCccUpgradeSchedulesAccessLevelEnum, bool) { + enum, ok := mappingListCccUpgradeSchedulesAccessLevelEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccUpgradeSchedulesSortOrderEnum Enum with underlying type: string +type ListCccUpgradeSchedulesSortOrderEnum string + +// Set of constants representing the allowable values for ListCccUpgradeSchedulesSortOrderEnum +const ( + ListCccUpgradeSchedulesSortOrderAsc ListCccUpgradeSchedulesSortOrderEnum = "ASC" + ListCccUpgradeSchedulesSortOrderDesc ListCccUpgradeSchedulesSortOrderEnum = "DESC" +) + +var mappingListCccUpgradeSchedulesSortOrderEnum = map[string]ListCccUpgradeSchedulesSortOrderEnum{ + "ASC": ListCccUpgradeSchedulesSortOrderAsc, + "DESC": ListCccUpgradeSchedulesSortOrderDesc, +} + +var mappingListCccUpgradeSchedulesSortOrderEnumLowerCase = map[string]ListCccUpgradeSchedulesSortOrderEnum{ + "asc": ListCccUpgradeSchedulesSortOrderAsc, + "desc": ListCccUpgradeSchedulesSortOrderDesc, +} + +// GetListCccUpgradeSchedulesSortOrderEnumValues Enumerates the set of values for ListCccUpgradeSchedulesSortOrderEnum +func GetListCccUpgradeSchedulesSortOrderEnumValues() []ListCccUpgradeSchedulesSortOrderEnum { + values := make([]ListCccUpgradeSchedulesSortOrderEnum, 0) + for _, v := range mappingListCccUpgradeSchedulesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCccUpgradeSchedulesSortOrderEnumStringValues Enumerates the set of values in String for ListCccUpgradeSchedulesSortOrderEnum +func GetListCccUpgradeSchedulesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCccUpgradeSchedulesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccUpgradeSchedulesSortOrderEnum(val string) (ListCccUpgradeSchedulesSortOrderEnum, bool) { + enum, ok := mappingListCccUpgradeSchedulesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCccUpgradeSchedulesSortByEnum Enum with underlying type: string +type ListCccUpgradeSchedulesSortByEnum string + +// Set of constants representing the allowable values for ListCccUpgradeSchedulesSortByEnum +const ( + ListCccUpgradeSchedulesSortByTimecreated ListCccUpgradeSchedulesSortByEnum = "timeCreated" + ListCccUpgradeSchedulesSortByDisplayname ListCccUpgradeSchedulesSortByEnum = "displayName" +) + +var mappingListCccUpgradeSchedulesSortByEnum = map[string]ListCccUpgradeSchedulesSortByEnum{ + "timeCreated": ListCccUpgradeSchedulesSortByTimecreated, + "displayName": ListCccUpgradeSchedulesSortByDisplayname, +} + +var mappingListCccUpgradeSchedulesSortByEnumLowerCase = map[string]ListCccUpgradeSchedulesSortByEnum{ + "timecreated": ListCccUpgradeSchedulesSortByTimecreated, + "displayname": ListCccUpgradeSchedulesSortByDisplayname, +} + +// GetListCccUpgradeSchedulesSortByEnumValues Enumerates the set of values for ListCccUpgradeSchedulesSortByEnum +func GetListCccUpgradeSchedulesSortByEnumValues() []ListCccUpgradeSchedulesSortByEnum { + values := make([]ListCccUpgradeSchedulesSortByEnum, 0) + for _, v := range mappingListCccUpgradeSchedulesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCccUpgradeSchedulesSortByEnumStringValues Enumerates the set of values in String for ListCccUpgradeSchedulesSortByEnum +func GetListCccUpgradeSchedulesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListCccUpgradeSchedulesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCccUpgradeSchedulesSortByEnum(val string) (ListCccUpgradeSchedulesSortByEnum, bool) { + enum, ok := mappingListCccUpgradeSchedulesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/peer_information.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/peer_information.go new file mode 100644 index 00000000000..1737ec6a2b9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/peer_information.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PeerInformation Routing information for peer nodes using the Border Gateway Protocol (BGP). +type PeerInformation struct { + + // The Autonomous System Number (ASN) of the peer network. + Asn *int `mandatory:"false" json:"asn"` + + // Neighbor Border Gateway Protocal (BGP) IP address. + // The IP address usually refers to the customer data center router. + Ip *string `mandatory:"false" json:"ip"` +} + +func (m PeerInformation) 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 PeerInformation) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/sort_order.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/sort_order.go new file mode 100644 index 00000000000..475c9d04e2b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/sort_order.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +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/computecloudatcustomer/update_ccc_infrastructure_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_infrastructure_details.go new file mode 100644 index 00000000000..d3c92236b73 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_infrastructure_details.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateCccInfrastructureDetails Updates Compute Cloud@Customer infrastructure configuration details. +type UpdateCccInfrastructureDetails struct { + + // The name that will be used to display the Compute Cloud@Customer infrastructure + // in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is + // used to communicate with Compute Cloud@Customer infrastructure. + SubnetId *string `mandatory:"false" json:"subnetId"` + + // An updated connection state of the Compute Cloud@Customer infrastructure. + ConnectionState CccInfrastructureConnectionStateEnum `mandatory:"false" json:"connectionState,omitempty"` + + // A message describing the current connection state in more detail. + ConnectionDetails *string `mandatory:"false" json:"connectionDetails"` + + // Schedule used for upgrades. If no schedule is associated with the infrastructure, + // it can be updated at any time. + CccUpgradeScheduleId *string `mandatory:"false" json:"cccUpgradeScheduleId"` + + // 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"` +} + +func (m UpdateCccInfrastructureDetails) 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 UpdateCccInfrastructureDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingCccInfrastructureConnectionStateEnum(string(m.ConnectionState)); !ok && m.ConnectionState != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConnectionState: %s. Supported values are: %s.", m.ConnectionState, strings.Join(GetCccInfrastructureConnectionStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_infrastructure_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_infrastructure_request_response.go new file mode 100644 index 00000000000..1e4ecc913b0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_infrastructure_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateCccInfrastructureRequest wrapper for the UpdateCccInfrastructure operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccInfrastructure.go.html to see an example of how to use UpdateCccInfrastructureRequest. +type UpdateCccInfrastructureRequest struct { + + // An OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a + // Compute Cloud@Customer Infrastructure. + CccInfrastructureId *string `mandatory:"true" contributesTo:"path" name:"cccInfrastructureId"` + + // The information to be updated. + UpdateCccInfrastructureDetails `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"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 UpdateCccInfrastructureRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateCccInfrastructureRequest) 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 UpdateCccInfrastructureRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCccInfrastructureRequest) 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 UpdateCccInfrastructureRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateCccInfrastructureResponse wrapper for the UpdateCccInfrastructure operation +type UpdateCccInfrastructureResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccInfrastructure instance + CccInfrastructure `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 UpdateCccInfrastructureResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCccInfrastructureResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_schedule_event.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_schedule_event.go new file mode 100644 index 00000000000..00b70cbc5a6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_schedule_event.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateCccScheduleEvent A period where upgrades may be applied to Compute Cloud@Customer infrastructures +// associated with the schedule. All upgrade windows may not be used. +type UpdateCccScheduleEvent struct { + + // A description of the Compute Cloud@Customer upgrade schedule time block. + Description *string `mandatory:"true" json:"description"` + + // The date and time when the Compute Cloud@Customer upgrade schedule event starts, + // inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, + // this is the date that a recurrence can start being applied. + TimeStart *common.SDKTime `mandatory:"true" json:"timeStart"` + + // The duration of this block of time. The duration must be specified and be of the + // ISO-8601 format for durations. + ScheduleEventDuration *string `mandatory:"true" json:"scheduleEventDuration"` + + // Frequency of recurrence of schedule block. When this field is not included, the event + // is assumed to be a one time occurrence. The frequency field is strictly parsed and must + // conform to RFC-5545 formatting for recurrences. + ScheduleEventRecurrences *string `mandatory:"false" json:"scheduleEventRecurrences"` +} + +func (m UpdateCccScheduleEvent) 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 UpdateCccScheduleEvent) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_upgrade_schedule_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_upgrade_schedule_details.go new file mode 100644 index 00000000000..dba5fd4ac94 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_upgrade_schedule_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Compute Cloud@Customer API +// +// Use the Compute Cloud@Customer API to manage Compute Cloud@Customer Infrastructure deployments +// and scheduled upgrades. For more information see +// Compute Cloud@Customer documentation (https://docs.cloud.oracle.com/iaas/Content/compute-cloud-at-customer/home.htm). +// + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateCccUpgradeScheduleDetails Updates the schedule details, all schedule information must be entered, similar to an +// initial schedule create. Include all events in the update. +type UpdateCccUpgradeScheduleDetails struct { + + // Compute Cloud@Customer upgrade schedule display name. + // Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // An optional description of the Compute Cloud@Customer upgrade schedule. + // Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // List of preferred times for a Compute Cloud@Customer infrastructure to be upgraded. + Events []UpdateCccScheduleEvent `mandatory:"false" json:"events"` + + // 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"` +} + +func (m UpdateCccUpgradeScheduleDetails) 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 UpdateCccUpgradeScheduleDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_upgrade_schedule_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_upgrade_schedule_request_response.go new file mode 100644 index 00000000000..b0cdfe0442c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/computecloudatcustomer/update_ccc_upgrade_schedule_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package computecloudatcustomer + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateCccUpgradeScheduleRequest wrapper for the UpdateCccUpgradeSchedule operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/computecloudatcustomer/UpdateCccUpgradeSchedule.go.html to see an example of how to use UpdateCccUpgradeScheduleRequest. +type UpdateCccUpgradeScheduleRequest struct { + + // Compute Cloud@Customer upgrade schedule + // OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + CccUpgradeScheduleId *string `mandatory:"true" contributesTo:"path" name:"cccUpgradeScheduleId"` + + // The information to be updated in the Compute Cloud@Customer upgrade schedule. + UpdateCccUpgradeScheduleDetails `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"` + + // The client request OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for tracing. + 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 UpdateCccUpgradeScheduleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateCccUpgradeScheduleRequest) 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 UpdateCccUpgradeScheduleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateCccUpgradeScheduleRequest) 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 UpdateCccUpgradeScheduleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateCccUpgradeScheduleResponse wrapper for the UpdateCccUpgradeSchedule operation +type UpdateCccUpgradeScheduleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CccUpgradeSchedule instance + CccUpgradeSchedule `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 UpdateCccUpgradeScheduleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateCccUpgradeScheduleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} 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 a18766150f6..c5fea49a8b8 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 @@ -357,6 +357,14 @@ type AutonomousDatabase struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The time the member joined the resource pool. + TimeOfJoiningResourcePool *common.SDKTime `mandatory:"false" json:"timeOfJoiningResourcePool"` + + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // Indicates if the refreshable clone can be reconnected to its source database. IsReconnectCloneEnabled *bool `mandatory:"false" json:"isReconnectCloneEnabled"` 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 acc2568af7a..0ccc91faf70 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 @@ -358,6 +358,14 @@ type AutonomousDatabaseSummary struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The time the member joined the resource pool. + TimeOfJoiningResourcePool *common.SDKTime `mandatory:"false" json:"timeOfJoiningResourcePool"` + + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // Indicates if the refreshable clone can be reconnected to its source database. IsReconnectCloneEnabled *bool `mandatory:"false" json:"isReconnectCloneEnabled"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go index f4f7dc0dd90..f10721deacf 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_base.go @@ -208,6 +208,11 @@ type CreateAutonomousDatabaseBase interface { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. GetIsMtlsConnectionRequired() *bool + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + GetResourcePoolLeaderId() *string + + GetResourcePoolSummary() *ResourcePoolSummary + // 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 GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum @@ -276,6 +281,8 @@ type createautonomousdatabasebase struct { DbVersion *string `mandatory:"false" json:"dbVersion"` CustomerContacts []CustomerContact `mandatory:"false" json:"customerContacts"` IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` AutonomousMaintenanceScheduleType CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum `mandatory:"false" json:"autonomousMaintenanceScheduleType,omitempty"` ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` IsAutoScalingForStorageEnabled *bool `mandatory:"false" json:"isAutoScalingForStorageEnabled"` @@ -337,6 +344,8 @@ func (m *createautonomousdatabasebase) UnmarshalJSON(data []byte) error { m.DbVersion = s.Model.DbVersion m.CustomerContacts = s.Model.CustomerContacts m.IsMtlsConnectionRequired = s.Model.IsMtlsConnectionRequired + m.ResourcePoolLeaderId = s.Model.ResourcePoolLeaderId + m.ResourcePoolSummary = s.Model.ResourcePoolSummary m.AutonomousMaintenanceScheduleType = s.Model.AutonomousMaintenanceScheduleType m.ScheduledOperations = s.Model.ScheduledOperations m.IsAutoScalingForStorageEnabled = s.Model.IsAutoScalingForStorageEnabled @@ -578,6 +587,16 @@ func (m createautonomousdatabasebase) GetIsMtlsConnectionRequired() *bool { return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m createautonomousdatabasebase) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m createautonomousdatabasebase) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m createautonomousdatabasebase) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go index 89590bec30f..c31199135ca 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_clone_details.go @@ -188,6 +188,11 @@ type CreateAutonomousDatabaseCloneDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` @@ -428,6 +433,16 @@ func (m CreateAutonomousDatabaseCloneDetails) GetIsMtlsConnectionRequired() *boo return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m CreateAutonomousDatabaseCloneDetails) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m CreateAutonomousDatabaseCloneDetails) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m CreateAutonomousDatabaseCloneDetails) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go index 61f5899a674..94ddf95fa7d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_details.go @@ -185,6 +185,11 @@ type CreateAutonomousDatabaseDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` @@ -422,6 +427,16 @@ func (m CreateAutonomousDatabaseDetails) GetIsMtlsConnectionRequired() *bool { return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m CreateAutonomousDatabaseDetails) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m CreateAutonomousDatabaseDetails) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m CreateAutonomousDatabaseDetails) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go index afb757e6035..1c97cabb5e6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_details.go @@ -188,6 +188,11 @@ type CreateAutonomousDatabaseFromBackupDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` @@ -428,6 +433,16 @@ func (m CreateAutonomousDatabaseFromBackupDetails) GetIsMtlsConnectionRequired() return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m CreateAutonomousDatabaseFromBackupDetails) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m CreateAutonomousDatabaseFromBackupDetails) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m CreateAutonomousDatabaseFromBackupDetails) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go index 546cf8cba48..ebb335bc1f4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_autonomous_database_from_backup_timestamp_details.go @@ -188,6 +188,11 @@ type CreateAutonomousDatabaseFromBackupTimestampDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` @@ -434,6 +439,16 @@ func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetIsMtlsConnectionR return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m CreateAutonomousDatabaseFromBackupTimestampDetails) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go index c341ed5c7fc..95767ecb563 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_autonomous_database_data_guard_details.go @@ -235,6 +235,11 @@ type CreateCrossRegionAutonomousDatabaseDataGuardDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` @@ -472,6 +477,16 @@ func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetIsMtlsConnection return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m CreateCrossRegionAutonomousDatabaseDataGuardDetails) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go index 13ebf127493..87cb074d90d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_cross_region_disaster_recovery_details.go @@ -234,6 +234,11 @@ type CreateCrossRegionDisasterRecoveryDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` @@ -476,6 +481,16 @@ func (m CreateCrossRegionDisasterRecoveryDetails) GetIsMtlsConnectionRequired() return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m CreateCrossRegionDisasterRecoveryDetails) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m CreateCrossRegionDisasterRecoveryDetails) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m CreateCrossRegionDisasterRecoveryDetails) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go index c3b447835f6..ccd8d0a1295 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/create_refreshable_autonomous_database_clone_details.go @@ -188,6 +188,11 @@ type CreateRefreshableAutonomousDatabaseCloneDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` @@ -428,6 +433,16 @@ func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetIsMtlsConnectionRequ return m.IsMtlsConnectionRequired } +// GetResourcePoolLeaderId returns ResourcePoolLeaderId +func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetResourcePoolLeaderId() *string { + return m.ResourcePoolLeaderId +} + +// GetResourcePoolSummary returns ResourcePoolSummary +func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetResourcePoolSummary() *ResourcePoolSummary { + return m.ResourcePoolSummary +} + // GetAutonomousMaintenanceScheduleType returns AutonomousMaintenanceScheduleType func (m CreateRefreshableAutonomousDatabaseCloneDetails) GetAutonomousMaintenanceScheduleType() CreateAutonomousDatabaseBaseAutonomousMaintenanceScheduleTypeEnum { return m.AutonomousMaintenanceScheduleType diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go index 2ef75315373..b54afd9f4bc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/database_client.go @@ -14926,6 +14926,68 @@ func (client DatabaseClient) resizeVmClusterNetwork(ctx context.Context, request return response, err } +// ResourcePoolShapes Lists available resource pools shapes. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ResourcePoolShapes.go.html to see an example of how to use ResourcePoolShapes API. +func (client DatabaseClient) ResourcePoolShapes(ctx context.Context, request ResourcePoolShapesRequest) (response ResourcePoolShapesResponse, err error) { + var ociResponse common.OCIResponse + policy := common.NoRetryPolicy() + 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.resourcePoolShapes, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ResourcePoolShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ResourcePoolShapesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ResourcePoolShapesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ResourcePoolShapesResponse") + } + return +} + +// resourcePoolShapes implements the OCIOperation interface (enables retrying operations) +func (client DatabaseClient) resourcePoolShapes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/autonomousDatabases/actions/listResourcePoolShapes", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ResourcePoolShapesResponse + 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/database/20160918/AutonomousDatabase/ResourcePoolShapes" + err = common.PostProcessServiceError(err, "Database", "ResourcePoolShapes", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // RestartAutonomousContainerDatabase Rolling restarts the specified Autonomous Container Database. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/list_autonomous_databases_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/list_autonomous_databases_request_response.go index bd7c50dfe39..7ee119cf542 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/list_autonomous_databases_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/list_autonomous_databases_request_response.go @@ -66,6 +66,12 @@ type ListAutonomousDatabasesRequest struct { // A filter to return only resources that have Data Guard enabled. IsDataGuardEnabled *bool `mandatory:"false" contributesTo:"query" name:"isDataGuardEnabled"` + // Filter if the resource is the resource pool leader. A value of `true` returns only resource pool leader. + IsResourcePoolLeader *bool `mandatory:"false" contributesTo:"query" name:"isResourcePoolLeader"` + + // The database OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the resourcepool Leader Autonomous Database. + ResourcePoolLeaderId *string `mandatory:"false" contributesTo:"query" name:"resourcePoolLeaderId"` + // 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 diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shape_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shape_collection.go new file mode 100644 index 00000000000..2f7ebcf98cf --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shape_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourcePoolShapeCollection Results of an Autonomous Database resouce pool shape collection that contains ResourcePoolShapeSummary items. +type ResourcePoolShapeCollection struct { + + // List of Autonomous Database resource pools Shapes. + Items []ResourcePoolShapeSummary `mandatory:"false" json:"items"` +} + +func (m ResourcePoolShapeCollection) 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 ResourcePoolShapeCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shape_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shape_summary.go new file mode 100644 index 00000000000..a8912830bce --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shape_summary.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourcePoolShapeSummary An Autonomous Database Resource Pool. This object provides all the information related to the resource pool. +type ResourcePoolShapeSummary struct { + + // Predefined shape of the resource pool. + Shape *int `mandatory:"true" json:"shape"` +} + +func (m ResourcePoolShapeSummary) 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 ResourcePoolShapeSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shapes_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shapes_request_response.go new file mode 100644 index 00000000000..2cf5cbe4916 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_shapes_request_response.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ResourcePoolShapesRequest wrapper for the ResourcePoolShapes operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/database/ResourcePoolShapes.go.html to see an example of how to use ResourcePoolShapesRequest. +type ResourcePoolShapesRequest struct { + + // 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"` + + // The maximum number of items to return per page. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The pagination token to continue listing from. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Unique identifier for the request. + 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 ResourcePoolShapesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ResourcePoolShapesRequest) 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 ResourcePoolShapesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ResourcePoolShapesRequest) 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 ResourcePoolShapesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourcePoolShapesResponse wrapper for the ResourcePoolShapes operation +type ResourcePoolShapesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ResourcePoolShapeCollection instances + ResourcePoolShapeCollection `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 optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then there are additional items still to get. Include this value as the `page` parameter for the + // subsequent GET request. For information about pagination, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ResourcePoolShapesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ResourcePoolShapesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_summary.go new file mode 100644 index 00000000000..e06c1f3326a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/resource_pool_summary.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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.cloud.oracle.com/iaas/Content/Database/Concepts/databaseoverview.htm). +// + +package database + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourcePoolSummary The configuration details for resource pool +type ResourcePoolSummary struct { + + // Resource pool size. + PoolSize *int `mandatory:"false" json:"poolSize"` + + // Indicates if the resource pool should be deleted for the Autonomous Database. + IsDisabled *bool `mandatory:"false" json:"isDisabled"` +} + +func (m ResourcePoolSummary) 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 ResourcePoolSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go index 870c0953e95..3dacaf6b75d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/database/update_autonomous_database_details.go @@ -219,6 +219,11 @@ type UpdateAutonomousDatabaseDetails struct { // How do I make this change? Using either OCI SDKs or command line tools, update your custom scripts to explicitly set the isMTLSConnectionRequired attribute to true. IsMtlsConnectionRequired *bool `mandatory:"false" json:"isMtlsConnectionRequired"` + // The unique identifier for leader autonomous database OCID OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). + ResourcePoolLeaderId *string `mandatory:"false" json:"resourcePoolLeaderId"` + + ResourcePoolSummary *ResourcePoolSummary `mandatory:"false" json:"resourcePoolSummary"` + // The list of scheduled operations. // 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. ScheduledOperations []ScheduledOperationDetails `mandatory:"false" json:"scheduledOperations"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/aws_s3_data_transfer_medium_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/aws_s3_data_transfer_medium_details.go new file mode 100644 index 00000000000..7c0cf615449 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/aws_s3_data_transfer_medium_details.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Migration API +// +// Use the Oracle Cloud Infrastructure Database Migration APIs to perform database migration operations. +// + +package databasemigration + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AwsS3DataTransferMediumDetails AWS S3 bucket details used for source Connection resources with RDS_ORACLE type. +// Only supported for source Connection resources with RDS_ORACLE type. +type AwsS3DataTransferMediumDetails struct { + + // S3 bucket name. + Name *string `mandatory:"false" json:"name"` + + // AWS region code where the S3 bucket is located. + // Region code should match the documented available regions: + // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions + Region *string `mandatory:"false" json:"region"` + + // AWS access key credentials identifier + // Details: https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys + AccessKeyId *string `mandatory:"false" json:"accessKeyId"` + + // AWS secret access key credentials + // Details: https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys + SecretAccessKey *string `mandatory:"false" json:"secretAccessKey"` +} + +func (m AwsS3DataTransferMediumDetails) 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 AwsS3DataTransferMediumDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m AwsS3DataTransferMediumDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAwsS3DataTransferMediumDetails AwsS3DataTransferMediumDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeAwsS3DataTransferMediumDetails + }{ + "AWS_S3", + (MarshalTypeAwsS3DataTransferMediumDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_dump_transfer_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_dump_transfer_details.go index 62b5e52c6e1..e505b18c40a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_dump_transfer_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_dump_transfer_details.go @@ -21,6 +21,9 @@ type CreateDumpTransferDetails struct { Source CreateHostDumpTransferDetails `mandatory:"false" json:"source"` Target CreateHostDumpTransferDetails `mandatory:"false" json:"target"` + + // OCID of the shared storage mount target + SharedStorageMountTargetId *string `mandatory:"false" json:"sharedStorageMountTargetId"` } func (m CreateDumpTransferDetails) String() string { @@ -42,8 +45,9 @@ func (m CreateDumpTransferDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *CreateDumpTransferDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Source createhostdumptransferdetails `json:"source"` - Target createhostdumptransferdetails `json:"target"` + Source createhostdumptransferdetails `json:"source"` + Target createhostdumptransferdetails `json:"target"` + SharedStorageMountTargetId *string `json:"sharedStorageMountTargetId"` }{} e = json.Unmarshal(data, &model) @@ -71,5 +75,7 @@ func (m *CreateDumpTransferDetails) UnmarshalJSON(data []byte) (e error) { m.Target = nil } + m.SharedStorageMountTargetId = model.SharedStorageMountTargetId + return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_migration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_migration_details.go index 481ea2b9b14..97c25f3fa4c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_migration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/create_migration_details.go @@ -10,6 +10,7 @@ package databasemigration import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -40,6 +41,8 @@ type CreateMigrationDetails struct { // Only Connections of type Non-Autonomous can be used as source container databases. SourceContainerDatabaseConnectionId *string `mandatory:"false" json:"sourceContainerDatabaseConnectionId"` + DataTransferMediumDetailsV2 DataTransferMediumDetailsV2 `mandatory:"false" json:"dataTransferMediumDetailsV2"` + DataTransferMediumDetails *CreateDataTransferMediumDetails `mandatory:"false" json:"dataTransferMediumDetails"` DumpTransferDetails *CreateDumpTransferDetails `mandatory:"false" json:"dumpTransferDetails"` @@ -90,3 +93,84 @@ func (m CreateMigrationDetails) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *CreateMigrationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + AgentId *string `json:"agentId"` + SourceContainerDatabaseConnectionId *string `json:"sourceContainerDatabaseConnectionId"` + DataTransferMediumDetailsV2 datatransfermediumdetailsv2 `json:"dataTransferMediumDetailsV2"` + DataTransferMediumDetails *CreateDataTransferMediumDetails `json:"dataTransferMediumDetails"` + DumpTransferDetails *CreateDumpTransferDetails `json:"dumpTransferDetails"` + DatapumpSettings *CreateDataPumpSettings `json:"datapumpSettings"` + AdvisorSettings *CreateAdvisorSettings `json:"advisorSettings"` + ExcludeObjects []DatabaseObject `json:"excludeObjects"` + IncludeObjects []DatabaseObject `json:"includeObjects"` + CsvText *string `json:"csvText"` + GoldenGateDetails *CreateGoldenGateDetails `json:"goldenGateDetails"` + GoldenGateServiceDetails *CreateGoldenGateServiceDetails `json:"goldenGateServiceDetails"` + VaultDetails *CreateVaultDetails `json:"vaultDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Type MigrationTypesEnum `json:"type"` + CompartmentId *string `json:"compartmentId"` + SourceDatabaseConnectionId *string `json:"sourceDatabaseConnectionId"` + TargetDatabaseConnectionId *string `json:"targetDatabaseConnectionId"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.AgentId = model.AgentId + + m.SourceContainerDatabaseConnectionId = model.SourceContainerDatabaseConnectionId + + nn, e = model.DataTransferMediumDetailsV2.UnmarshalPolymorphicJSON(model.DataTransferMediumDetailsV2.JsonData) + if e != nil { + return + } + if nn != nil { + m.DataTransferMediumDetailsV2 = nn.(DataTransferMediumDetailsV2) + } else { + m.DataTransferMediumDetailsV2 = nil + } + + m.DataTransferMediumDetails = model.DataTransferMediumDetails + + m.DumpTransferDetails = model.DumpTransferDetails + + m.DatapumpSettings = model.DatapumpSettings + + m.AdvisorSettings = model.AdvisorSettings + + m.ExcludeObjects = make([]DatabaseObject, len(model.ExcludeObjects)) + copy(m.ExcludeObjects, model.ExcludeObjects) + m.IncludeObjects = make([]DatabaseObject, len(model.IncludeObjects)) + copy(m.IncludeObjects, model.IncludeObjects) + m.CsvText = model.CsvText + + m.GoldenGateDetails = model.GoldenGateDetails + + m.GoldenGateServiceDetails = model.GoldenGateServiceDetails + + m.VaultDetails = model.VaultDetails + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.Type = model.Type + + m.CompartmentId = model.CompartmentId + + m.SourceDatabaseConnectionId = model.SourceDatabaseConnectionId + + m.TargetDatabaseConnectionId = model.TargetDatabaseConnectionId + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/data_transfer_medium_details_v2.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/data_transfer_medium_details_v2.go new file mode 100644 index 00000000000..66e8cd3eaa6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/data_transfer_medium_details_v2.go @@ -0,0 +1,139 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Migration API +// +// Use the Oracle Cloud Infrastructure Database Migration APIs to perform database migration operations. +// + +package databasemigration + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataTransferMediumDetailsV2 Optional additional properties for dump transfer in source or target host. Default kind is CURL +type DataTransferMediumDetailsV2 interface { +} + +type datatransfermediumdetailsv2 struct { + JsonData []byte + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *datatransfermediumdetailsv2) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerdatatransfermediumdetailsv2 datatransfermediumdetailsv2 + s := struct { + Model Unmarshalerdatatransfermediumdetailsv2 + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *datatransfermediumdetailsv2) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "NFS": + mm := NfsDataTransferMediumDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "OBJECT_STORAGE": + mm := ObjectStorageDataTransferMediumDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "DBLINK": + mm := DbLinkDataTransferMediumDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "AWS_S3": + mm := AwsS3DataTransferMediumDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for DataTransferMediumDetailsV2: %s.", m.Type) + return *m, nil + } +} + +func (m datatransfermediumdetailsv2) 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 datatransfermediumdetailsv2) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DataTransferMediumDetailsV2TypeEnum Enum with underlying type: string +type DataTransferMediumDetailsV2TypeEnum string + +// Set of constants representing the allowable values for DataTransferMediumDetailsV2TypeEnum +const ( + DataTransferMediumDetailsV2TypeDblink DataTransferMediumDetailsV2TypeEnum = "DBLINK" + DataTransferMediumDetailsV2TypeObjectStorage DataTransferMediumDetailsV2TypeEnum = "OBJECT_STORAGE" + DataTransferMediumDetailsV2TypeAwsS3 DataTransferMediumDetailsV2TypeEnum = "AWS_S3" + DataTransferMediumDetailsV2TypeNfs DataTransferMediumDetailsV2TypeEnum = "NFS" +) + +var mappingDataTransferMediumDetailsV2TypeEnum = map[string]DataTransferMediumDetailsV2TypeEnum{ + "DBLINK": DataTransferMediumDetailsV2TypeDblink, + "OBJECT_STORAGE": DataTransferMediumDetailsV2TypeObjectStorage, + "AWS_S3": DataTransferMediumDetailsV2TypeAwsS3, + "NFS": DataTransferMediumDetailsV2TypeNfs, +} + +var mappingDataTransferMediumDetailsV2TypeEnumLowerCase = map[string]DataTransferMediumDetailsV2TypeEnum{ + "dblink": DataTransferMediumDetailsV2TypeDblink, + "object_storage": DataTransferMediumDetailsV2TypeObjectStorage, + "aws_s3": DataTransferMediumDetailsV2TypeAwsS3, + "nfs": DataTransferMediumDetailsV2TypeNfs, +} + +// GetDataTransferMediumDetailsV2TypeEnumValues Enumerates the set of values for DataTransferMediumDetailsV2TypeEnum +func GetDataTransferMediumDetailsV2TypeEnumValues() []DataTransferMediumDetailsV2TypeEnum { + values := make([]DataTransferMediumDetailsV2TypeEnum, 0) + for _, v := range mappingDataTransferMediumDetailsV2TypeEnum { + values = append(values, v) + } + return values +} + +// GetDataTransferMediumDetailsV2TypeEnumStringValues Enumerates the set of values in String for DataTransferMediumDetailsV2TypeEnum +func GetDataTransferMediumDetailsV2TypeEnumStringValues() []string { + return []string{ + "DBLINK", + "OBJECT_STORAGE", + "AWS_S3", + "NFS", + } +} + +// GetMappingDataTransferMediumDetailsV2TypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDataTransferMediumDetailsV2TypeEnum(val string) (DataTransferMediumDetailsV2TypeEnum, bool) { + enum, ok := mappingDataTransferMediumDetailsV2TypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/db_link_data_transfer_medium_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/db_link_data_transfer_medium_details.go new file mode 100644 index 00000000000..a987f3eb7e9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/db_link_data_transfer_medium_details.go @@ -0,0 +1,55 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Migration API +// +// Use the Oracle Cloud Infrastructure Database Migration APIs to perform database migration operations. +// + +package databasemigration + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DbLinkDataTransferMediumDetails Optional details for creating a network database link from OCI database to on-premise database. +type DbLinkDataTransferMediumDetails struct { + ObjectStorageBucket *ObjectStoreBucket `mandatory:"false" json:"objectStorageBucket"` + + // Name of database link from OCI database to on-premise database. ODMS will create link, if the link does not already exist. + Name *string `mandatory:"false" json:"name"` +} + +func (m DbLinkDataTransferMediumDetails) 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 DbLinkDataTransferMediumDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m DbLinkDataTransferMediumDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeDbLinkDataTransferMediumDetails DbLinkDataTransferMediumDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeDbLinkDataTransferMediumDetails + }{ + "DBLINK", + (MarshalTypeDbLinkDataTransferMediumDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/dump_transfer_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/dump_transfer_details.go index 7476e23b1e7..1dda7cc8d9b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/dump_transfer_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/dump_transfer_details.go @@ -21,6 +21,9 @@ type DumpTransferDetails struct { Source HostDumpTransferDetails `mandatory:"false" json:"source"` Target HostDumpTransferDetails `mandatory:"false" json:"target"` + + // OCID of the shared storage mount target + SharedStorageMountTargetId *string `mandatory:"false" json:"sharedStorageMountTargetId"` } func (m DumpTransferDetails) String() string { @@ -42,8 +45,9 @@ func (m DumpTransferDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *DumpTransferDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Source hostdumptransferdetails `json:"source"` - Target hostdumptransferdetails `json:"target"` + Source hostdumptransferdetails `json:"source"` + Target hostdumptransferdetails `json:"target"` + SharedStorageMountTargetId *string `json:"sharedStorageMountTargetId"` }{} e = json.Unmarshal(data, &model) @@ -71,5 +75,7 @@ func (m *DumpTransferDetails) UnmarshalJSON(data []byte) (e error) { m.Target = nil } + m.SharedStorageMountTargetId = model.SharedStorageMountTargetId + return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/migration.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/migration.go index b59bc1e389d..ff89f96bac3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/migration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/migration.go @@ -10,6 +10,7 @@ package databasemigration import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -58,6 +59,8 @@ type Migration struct { // OCID of the current ODMS Job in execution for the Migration, if any. ExecutingJobId *string `mandatory:"false" json:"executingJobId"` + DataTransferMediumDetailsV2 DataTransferMediumDetailsV2 `mandatory:"false" json:"dataTransferMediumDetailsV2"` + DataTransferMediumDetails *DataTransferMediumDetails `mandatory:"false" json:"dataTransferMediumDetails"` DumpTransferDetails *DumpTransferDetails `mandatory:"false" json:"dumpTransferDetails"` @@ -128,3 +131,111 @@ func (m Migration) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *Migration) UnmarshalJSON(data []byte) (e error) { + model := struct { + WaitAfter OdmsJobPhasesEnum `json:"waitAfter"` + AgentId *string `json:"agentId"` + CredentialsSecretId *string `json:"credentialsSecretId"` + SourceContainerDatabaseConnectionId *string `json:"sourceContainerDatabaseConnectionId"` + ExecutingJobId *string `json:"executingJobId"` + DataTransferMediumDetailsV2 datatransfermediumdetailsv2 `json:"dataTransferMediumDetailsV2"` + DataTransferMediumDetails *DataTransferMediumDetails `json:"dataTransferMediumDetails"` + DumpTransferDetails *DumpTransferDetails `json:"dumpTransferDetails"` + DatapumpSettings *DataPumpSettings `json:"datapumpSettings"` + AdvisorSettings *AdvisorSettings `json:"advisorSettings"` + ExcludeObjects []DatabaseObject `json:"excludeObjects"` + IncludeObjects []DatabaseObject `json:"includeObjects"` + GoldenGateServiceDetails *GoldenGateServiceDetails `json:"goldenGateServiceDetails"` + GoldenGateDetails *GoldenGateDetails `json:"goldenGateDetails"` + VaultDetails *VaultDetails `json:"vaultDetails"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + TimeLastMigration *common.SDKTime `json:"timeLastMigration"` + LifecycleDetails MigrationStatusEnum `json:"lifecycleDetails"` + 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"` + CompartmentId *string `json:"compartmentId"` + Type MigrationTypesEnum `json:"type"` + SourceDatabaseConnectionId *string `json:"sourceDatabaseConnectionId"` + TargetDatabaseConnectionId *string `json:"targetDatabaseConnectionId"` + TimeCreated *common.SDKTime `json:"timeCreated"` + LifecycleState MigrationLifecycleStatesEnum `json:"lifecycleState"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.WaitAfter = model.WaitAfter + + m.AgentId = model.AgentId + + m.CredentialsSecretId = model.CredentialsSecretId + + m.SourceContainerDatabaseConnectionId = model.SourceContainerDatabaseConnectionId + + m.ExecutingJobId = model.ExecutingJobId + + nn, e = model.DataTransferMediumDetailsV2.UnmarshalPolymorphicJSON(model.DataTransferMediumDetailsV2.JsonData) + if e != nil { + return + } + if nn != nil { + m.DataTransferMediumDetailsV2 = nn.(DataTransferMediumDetailsV2) + } else { + m.DataTransferMediumDetailsV2 = nil + } + + m.DataTransferMediumDetails = model.DataTransferMediumDetails + + m.DumpTransferDetails = model.DumpTransferDetails + + m.DatapumpSettings = model.DatapumpSettings + + m.AdvisorSettings = model.AdvisorSettings + + m.ExcludeObjects = make([]DatabaseObject, len(model.ExcludeObjects)) + copy(m.ExcludeObjects, model.ExcludeObjects) + m.IncludeObjects = make([]DatabaseObject, len(model.IncludeObjects)) + copy(m.IncludeObjects, model.IncludeObjects) + m.GoldenGateServiceDetails = model.GoldenGateServiceDetails + + m.GoldenGateDetails = model.GoldenGateDetails + + m.VaultDetails = model.VaultDetails + + m.TimeUpdated = model.TimeUpdated + + m.TimeLastMigration = model.TimeLastMigration + + m.LifecycleDetails = model.LifecycleDetails + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.Id = model.Id + + m.DisplayName = model.DisplayName + + m.CompartmentId = model.CompartmentId + + m.Type = model.Type + + m.SourceDatabaseConnectionId = model.SourceDatabaseConnectionId + + m.TargetDatabaseConnectionId = model.TargetDatabaseConnectionId + + m.TimeCreated = model.TimeCreated + + m.LifecycleState = model.LifecycleState + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/nfs_data_transfer_medium_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/nfs_data_transfer_medium_details.go new file mode 100644 index 00000000000..9b112e503be --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/nfs_data_transfer_medium_details.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Migration API +// +// Use the Oracle Cloud Infrastructure Database Migration APIs to perform database migration operations. +// + +package databasemigration + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NfsDataTransferMediumDetails OCI Object Storage bucket will be used to store Data Pump dump files for the migration. +type NfsDataTransferMediumDetails struct { +} + +func (m NfsDataTransferMediumDetails) 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 NfsDataTransferMediumDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m NfsDataTransferMediumDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeNfsDataTransferMediumDetails NfsDataTransferMediumDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeNfsDataTransferMediumDetails + }{ + "NFS", + (MarshalTypeNfsDataTransferMediumDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/object_storage_data_transfer_medium_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/object_storage_data_transfer_medium_details.go new file mode 100644 index 00000000000..ebe0c8160ca --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/object_storage_data_transfer_medium_details.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Database Migration API +// +// Use the Oracle Cloud Infrastructure Database Migration APIs to perform database migration operations. +// + +package databasemigration + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ObjectStorageDataTransferMediumDetails OCI Object Storage bucket will be used to store Data Pump dump files for the migration. +type ObjectStorageDataTransferMediumDetails struct { + ObjectStorageBucket *ObjectStoreBucket `mandatory:"false" json:"objectStorageBucket"` +} + +func (m ObjectStorageDataTransferMediumDetails) 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 ObjectStorageDataTransferMediumDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m ObjectStorageDataTransferMediumDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeObjectStorageDataTransferMediumDetails ObjectStorageDataTransferMediumDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeObjectStorageDataTransferMediumDetails + }{ + "OBJECT_STORAGE", + (MarshalTypeObjectStorageDataTransferMediumDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_dump_transfer_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_dump_transfer_details.go index 6e9a4ec46c7..412022a8ff1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_dump_transfer_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_dump_transfer_details.go @@ -21,6 +21,9 @@ type UpdateDumpTransferDetails struct { Source UpdateHostDumpTransferDetails `mandatory:"false" json:"source"` Target UpdateHostDumpTransferDetails `mandatory:"false" json:"target"` + + // OCID of the shared storage mount target + SharedStorageMountTargetId *string `mandatory:"false" json:"sharedStorageMountTargetId"` } func (m UpdateDumpTransferDetails) String() string { @@ -42,8 +45,9 @@ func (m UpdateDumpTransferDetails) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *UpdateDumpTransferDetails) UnmarshalJSON(data []byte) (e error) { model := struct { - Source updatehostdumptransferdetails `json:"source"` - Target updatehostdumptransferdetails `json:"target"` + Source updatehostdumptransferdetails `json:"source"` + Target updatehostdumptransferdetails `json:"target"` + SharedStorageMountTargetId *string `json:"sharedStorageMountTargetId"` }{} e = json.Unmarshal(data, &model) @@ -71,5 +75,7 @@ func (m *UpdateDumpTransferDetails) UnmarshalJSON(data []byte) (e error) { m.Target = nil } + m.SharedStorageMountTargetId = model.SharedStorageMountTargetId + return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_migration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_migration_details.go index 34580498a50..1536bf14844 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_migration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/databasemigration/update_migration_details.go @@ -10,6 +10,7 @@ package databasemigration import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -38,6 +39,8 @@ type UpdateMigrationDetails struct { // The OCID of the Target Database Connection. TargetDatabaseConnectionId *string `mandatory:"false" json:"targetDatabaseConnectionId"` + DataTransferMediumDetailsV2 DataTransferMediumDetailsV2 `mandatory:"false" json:"dataTransferMediumDetailsV2"` + DataTransferMediumDetails *UpdateDataTransferMediumDetails `mandatory:"false" json:"dataTransferMediumDetails"` DumpTransferDetails *UpdateDumpTransferDetails `mandatory:"false" json:"dumpTransferDetails"` @@ -87,3 +90,78 @@ func (m UpdateMigrationDetails) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *UpdateMigrationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Type MigrationTypesEnum `json:"type"` + DisplayName *string `json:"displayName"` + AgentId *string `json:"agentId"` + SourceDatabaseConnectionId *string `json:"sourceDatabaseConnectionId"` + SourceContainerDatabaseConnectionId *string `json:"sourceContainerDatabaseConnectionId"` + TargetDatabaseConnectionId *string `json:"targetDatabaseConnectionId"` + DataTransferMediumDetailsV2 datatransfermediumdetailsv2 `json:"dataTransferMediumDetailsV2"` + DataTransferMediumDetails *UpdateDataTransferMediumDetails `json:"dataTransferMediumDetails"` + DumpTransferDetails *UpdateDumpTransferDetails `json:"dumpTransferDetails"` + DatapumpSettings *UpdateDataPumpSettings `json:"datapumpSettings"` + AdvisorSettings *UpdateAdvisorSettings `json:"advisorSettings"` + ExcludeObjects []DatabaseObject `json:"excludeObjects"` + IncludeObjects []DatabaseObject `json:"includeObjects"` + GoldenGateServiceDetails *UpdateGoldenGateServiceDetails `json:"goldenGateServiceDetails"` + GoldenGateDetails *UpdateGoldenGateDetails `json:"goldenGateDetails"` + VaultDetails *UpdateVaultDetails `json:"vaultDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Type = model.Type + + m.DisplayName = model.DisplayName + + m.AgentId = model.AgentId + + m.SourceDatabaseConnectionId = model.SourceDatabaseConnectionId + + m.SourceContainerDatabaseConnectionId = model.SourceContainerDatabaseConnectionId + + m.TargetDatabaseConnectionId = model.TargetDatabaseConnectionId + + nn, e = model.DataTransferMediumDetailsV2.UnmarshalPolymorphicJSON(model.DataTransferMediumDetailsV2.JsonData) + if e != nil { + return + } + if nn != nil { + m.DataTransferMediumDetailsV2 = nn.(DataTransferMediumDetailsV2) + } else { + m.DataTransferMediumDetailsV2 = nil + } + + m.DataTransferMediumDetails = model.DataTransferMediumDetails + + m.DumpTransferDetails = model.DumpTransferDetails + + m.DatapumpSettings = model.DatapumpSettings + + m.AdvisorSettings = model.AdvisorSettings + + m.ExcludeObjects = make([]DatabaseObject, len(model.ExcludeObjects)) + copy(m.ExcludeObjects, model.ExcludeObjects) + m.IncludeObjects = make([]DatabaseObject, len(model.IncludeObjects)) + copy(m.IncludeObjects, model.IncludeObjects) + m.GoldenGateServiceDetails = model.GoldenGateServiceDetails + + m.GoldenGateDetails = model.GoldenGateDetails + + m.VaultDetails = model.VaultDetails + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_data_science_private_endpoint_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_data_science_private_endpoint_compartment_details.go new file mode 100644 index 00000000000..00075e6593d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_data_science_private_endpoint_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeDataSciencePrivateEndpointCompartmentDetails The details required to change a private endpoint compartment. +type ChangeDataSciencePrivateEndpointCompartmentDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create private endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeDataSciencePrivateEndpointCompartmentDetails) 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 ChangeDataSciencePrivateEndpointCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_data_science_private_endpoint_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_data_science_private_endpoint_compartment_request_response.go new file mode 100644 index 00000000000..e943e7a5890 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_data_science_private_endpoint_compartment_request_response.go @@ -0,0 +1,104 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeDataSciencePrivateEndpointCompartmentRequest wrapper for the ChangeDataSciencePrivateEndpointCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ChangeDataSciencePrivateEndpointCompartment.go.html to see an example of how to use ChangeDataSciencePrivateEndpointCompartmentRequest. +type ChangeDataSciencePrivateEndpointCompartmentRequest struct { + + // The unique ID for a Data Science private endpoint. + DataSciencePrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"dataSciencePrivateEndpointId"` + + // Details for changing a private endpoint's compartment. + ChangeDataSciencePrivateEndpointCompartmentDetails `contributesTo:"body"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then provide the request ID. + 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 is 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 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 ChangeDataSciencePrivateEndpointCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeDataSciencePrivateEndpointCompartmentRequest) 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 ChangeDataSciencePrivateEndpointCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeDataSciencePrivateEndpointCompartmentRequest) 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 ChangeDataSciencePrivateEndpointCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeDataSciencePrivateEndpointCompartmentResponse wrapper for the ChangeDataSciencePrivateEndpointCompartment operation +type ChangeDataSciencePrivateEndpointCompartmentResponse 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, then provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/identifiers.htm) of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) + // with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response ChangeDataSciencePrivateEndpointCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeDataSciencePrivateEndpointCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_data_science_private_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_data_science_private_endpoint_details.go new file mode 100644 index 00000000000..f5ab3c9fc44 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_data_science_private_endpoint_details.go @@ -0,0 +1,68 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateDataSciencePrivateEndpointDetails The details required to create a Data Science private endpoint. +type CreateDataSciencePrivateEndpointDetails struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID of the subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Data Science resource type. + DataScienceResourceType DataScienceResourceTypeEnum `mandatory:"true" json:"dataScienceResourceType"` + + // 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"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.cloud.oracle.com/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. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // An array of network security group OCIDs. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // Subdomain for a private endpoint FQDN. + SubDomain *string `mandatory:"false" json:"subDomain"` +} + +func (m CreateDataSciencePrivateEndpointDetails) 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 CreateDataSciencePrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDataScienceResourceTypeEnum(string(m.DataScienceResourceType)); !ok && m.DataScienceResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataScienceResourceType: %s. Supported values are: %s.", m.DataScienceResourceType, strings.Join(GetDataScienceResourceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_data_science_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_data_science_private_endpoint_request_response.go new file mode 100644 index 00000000000..0ebbfb149a7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_data_science_private_endpoint_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateDataSciencePrivateEndpointRequest wrapper for the CreateDataSciencePrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateDataSciencePrivateEndpoint.go.html to see an example of how to use CreateDataSciencePrivateEndpointRequest. +type CreateDataSciencePrivateEndpointRequest struct { + + // The parameters required to create a private endpoint. + CreateDataSciencePrivateEndpointDetails `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 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, then 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 CreateDataSciencePrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateDataSciencePrivateEndpointRequest) 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 CreateDataSciencePrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateDataSciencePrivateEndpointRequest) 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 CreateDataSciencePrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateDataSciencePrivateEndpointResponse wrapper for the CreateDataSciencePrivateEndpoint operation +type CreateDataSciencePrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DataSciencePrivateEndpoint instance + DataSciencePrivateEndpoint `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#eleven). + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle assigned identifier for the request. If you need to contact + // Oracle about a particular request, then provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/identifiers.htm) of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) + // with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // The URI that identifies the entity described in the response body. + Location *string `presentIn:"header" name:"location"` +} + +func (response CreateDataSciencePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateDataSciencePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint.go new file mode 100644 index 00000000000..fa60cc7dc92 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint.go @@ -0,0 +1,91 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataSciencePrivateEndpoint Data Science private endpoint. +type DataSciencePrivateEndpoint struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create private endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // A user friendly name. It doesn't have to be unique. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // The OCID of a private endpoint. + Id *string `mandatory:"true" json:"id"` + + // State of the Data Science private endpoint. + LifecycleState DataSciencePrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user that created the private endpoint. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // The OCID of a subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // The date and time that the Data Science 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 Data Science 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 description. Avoid entering confidential information. + Description *string `mandatory:"false" json:"description"` + + // Details of the state of Data Science private endpoint. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // An array of network security group OCIDs. + NsgIds []string `mandatory:"false" json:"nsgIds"` + + // Accesing the Data Science resource using FQDN. + Fqdn *string `mandatory:"false" json:"fqdn"` + + // Data Science resource type. + DataScienceResourceType DataScienceResourceTypeEnum `mandatory:"false" json:"dataScienceResourceType,omitempty"` +} + +func (m DataSciencePrivateEndpoint) 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 DataSciencePrivateEndpoint) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDataSciencePrivateEndpointLifecycleStateEnum(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(GetDataSciencePrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + + if _, ok := GetMappingDataScienceResourceTypeEnum(string(m.DataScienceResourceType)); !ok && m.DataScienceResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataScienceResourceType: %s. Supported values are: %s.", m.DataScienceResourceType, strings.Join(GetDataScienceResourceTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint_lifecycle_state.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint_lifecycle_state.go new file mode 100644 index 00000000000..c197bc028ff --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint_lifecycle_state.go @@ -0,0 +1,76 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "strings" +) + +// DataSciencePrivateEndpointLifecycleStateEnum Enum with underlying type: string +type DataSciencePrivateEndpointLifecycleStateEnum string + +// Set of constants representing the allowable values for DataSciencePrivateEndpointLifecycleStateEnum +const ( + DataSciencePrivateEndpointLifecycleStateCreating DataSciencePrivateEndpointLifecycleStateEnum = "CREATING" + DataSciencePrivateEndpointLifecycleStateActive DataSciencePrivateEndpointLifecycleStateEnum = "ACTIVE" + DataSciencePrivateEndpointLifecycleStateUpdating DataSciencePrivateEndpointLifecycleStateEnum = "UPDATING" + DataSciencePrivateEndpointLifecycleStateDeleting DataSciencePrivateEndpointLifecycleStateEnum = "DELETING" + DataSciencePrivateEndpointLifecycleStateDeleted DataSciencePrivateEndpointLifecycleStateEnum = "DELETED" + DataSciencePrivateEndpointLifecycleStateFailed DataSciencePrivateEndpointLifecycleStateEnum = "FAILED" + DataSciencePrivateEndpointLifecycleStateNeedsAttention DataSciencePrivateEndpointLifecycleStateEnum = "NEEDS_ATTENTION" +) + +var mappingDataSciencePrivateEndpointLifecycleStateEnum = map[string]DataSciencePrivateEndpointLifecycleStateEnum{ + "CREATING": DataSciencePrivateEndpointLifecycleStateCreating, + "ACTIVE": DataSciencePrivateEndpointLifecycleStateActive, + "UPDATING": DataSciencePrivateEndpointLifecycleStateUpdating, + "DELETING": DataSciencePrivateEndpointLifecycleStateDeleting, + "DELETED": DataSciencePrivateEndpointLifecycleStateDeleted, + "FAILED": DataSciencePrivateEndpointLifecycleStateFailed, + "NEEDS_ATTENTION": DataSciencePrivateEndpointLifecycleStateNeedsAttention, +} + +var mappingDataSciencePrivateEndpointLifecycleStateEnumLowerCase = map[string]DataSciencePrivateEndpointLifecycleStateEnum{ + "creating": DataSciencePrivateEndpointLifecycleStateCreating, + "active": DataSciencePrivateEndpointLifecycleStateActive, + "updating": DataSciencePrivateEndpointLifecycleStateUpdating, + "deleting": DataSciencePrivateEndpointLifecycleStateDeleting, + "deleted": DataSciencePrivateEndpointLifecycleStateDeleted, + "failed": DataSciencePrivateEndpointLifecycleStateFailed, + "needs_attention": DataSciencePrivateEndpointLifecycleStateNeedsAttention, +} + +// GetDataSciencePrivateEndpointLifecycleStateEnumValues Enumerates the set of values for DataSciencePrivateEndpointLifecycleStateEnum +func GetDataSciencePrivateEndpointLifecycleStateEnumValues() []DataSciencePrivateEndpointLifecycleStateEnum { + values := make([]DataSciencePrivateEndpointLifecycleStateEnum, 0) + for _, v := range mappingDataSciencePrivateEndpointLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetDataSciencePrivateEndpointLifecycleStateEnumStringValues Enumerates the set of values in String for DataSciencePrivateEndpointLifecycleStateEnum +func GetDataSciencePrivateEndpointLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + "NEEDS_ATTENTION", + } +} + +// GetMappingDataSciencePrivateEndpointLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDataSciencePrivateEndpointLifecycleStateEnum(val string) (DataSciencePrivateEndpointLifecycleStateEnum, bool) { + enum, ok := mappingDataSciencePrivateEndpointLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint_summary.go new file mode 100644 index 00000000000..12714435960 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_private_endpoint_summary.go @@ -0,0 +1,88 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// DataSciencePrivateEndpointSummary List of Data Science private endpoints. +type DataSciencePrivateEndpointSummary struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create private Endpoint. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"` + + // A user friendly name. It doesn't have to be unique. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"true" json:"freeformTags"` + + // The OCID of a private endpoint. + Id *string `mandatory:"true" json:"id"` + + // State of a private endpoint. + LifecycleState DataSciencePrivateEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Details of the state of a private endpoint. + LifecycleDetails *string `mandatory:"true" json:"lifecycleDetails"` + + // Data Science resource type. + DataScienceResourceType DataScienceResourceTypeEnum `mandatory:"true" json:"dataScienceResourceType"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user that created the private endpoint. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // The OCID of a subnet. + SubnetId *string `mandatory:"true" json:"subnetId"` + + // Accesing Data Science resource using FQDN. + Fqdn *string `mandatory:"true" json:"fqdn"` + + // The date and time that the Data Science 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 Data Science 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"` + + // An array of network security group OCIDs. + NsgIds []string `mandatory:"false" json:"nsgIds"` +} + +func (m DataSciencePrivateEndpointSummary) 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 DataSciencePrivateEndpointSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingDataSciencePrivateEndpointLifecycleStateEnum(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(GetDataSciencePrivateEndpointLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingDataScienceResourceTypeEnum(string(m.DataScienceResourceType)); !ok && m.DataScienceResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataScienceResourceType: %s. Supported values are: %s.", m.DataScienceResourceType, strings.Join(GetDataScienceResourceTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_resource_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_resource_type.go new file mode 100644 index 00000000000..ab208d95acc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/data_science_resource_type.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "strings" +) + +// DataScienceResourceTypeEnum Enum with underlying type: string +type DataScienceResourceTypeEnum string + +// Set of constants representing the allowable values for DataScienceResourceTypeEnum +const ( + DataScienceResourceTypeNotebookSession DataScienceResourceTypeEnum = "NOTEBOOK_SESSION" +) + +var mappingDataScienceResourceTypeEnum = map[string]DataScienceResourceTypeEnum{ + "NOTEBOOK_SESSION": DataScienceResourceTypeNotebookSession, +} + +var mappingDataScienceResourceTypeEnumLowerCase = map[string]DataScienceResourceTypeEnum{ + "notebook_session": DataScienceResourceTypeNotebookSession, +} + +// GetDataScienceResourceTypeEnumValues Enumerates the set of values for DataScienceResourceTypeEnum +func GetDataScienceResourceTypeEnumValues() []DataScienceResourceTypeEnum { + values := make([]DataScienceResourceTypeEnum, 0) + for _, v := range mappingDataScienceResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetDataScienceResourceTypeEnumStringValues Enumerates the set of values in String for DataScienceResourceTypeEnum +func GetDataScienceResourceTypeEnumStringValues() []string { + return []string{ + "NOTEBOOK_SESSION", + } +} + +// GetMappingDataScienceResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingDataScienceResourceTypeEnum(val string) (DataScienceResourceTypeEnum, bool) { + enum, ok := mappingDataScienceResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/datascience_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/datascience_client.go index 0e190c01243..9a321db95f6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/datascience_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/datascience_client.go @@ -441,6 +441,69 @@ func (client DataScienceClient) cancelWorkRequest(ctx context.Context, request c return response, err } +// ChangeDataSciencePrivateEndpointCompartment Moves a private endpoint into a different compartment. When provided, If-Match is checked against ETag values of the resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ChangeDataSciencePrivateEndpointCompartment.go.html to see an example of how to use ChangeDataSciencePrivateEndpointCompartment API. +// A default retry strategy applies to this operation ChangeDataSciencePrivateEndpointCompartment() +func (client DataScienceClient) ChangeDataSciencePrivateEndpointCompartment(ctx context.Context, request ChangeDataSciencePrivateEndpointCompartmentRequest) (response ChangeDataSciencePrivateEndpointCompartmentResponse, 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.changeDataSciencePrivateEndpointCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeDataSciencePrivateEndpointCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeDataSciencePrivateEndpointCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeDataSciencePrivateEndpointCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeDataSciencePrivateEndpointCompartmentResponse") + } + return +} + +// changeDataSciencePrivateEndpointCompartment implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) changeDataSciencePrivateEndpointCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dataSciencePrivateEndpoints/{dataSciencePrivateEndpointId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeDataSciencePrivateEndpointCompartmentResponse + 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/data-science/20190101/DataSciencePrivateEndpoint/ChangeDataSciencePrivateEndpointCompartment" + err = common.PostProcessServiceError(err, "DataScience", "ChangeDataSciencePrivateEndpointCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeJobCompartment Changes a job's compartment // // # See also @@ -979,6 +1042,69 @@ func (client DataScienceClient) changeProjectCompartment(ctx context.Context, re return response, err } +// CreateDataSciencePrivateEndpoint Creates a Data Science private endpoint to be used by a Data Science resource. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateDataSciencePrivateEndpoint.go.html to see an example of how to use CreateDataSciencePrivateEndpoint API. +// A default retry strategy applies to this operation CreateDataSciencePrivateEndpoint() +func (client DataScienceClient) CreateDataSciencePrivateEndpoint(ctx context.Context, request CreateDataSciencePrivateEndpointRequest) (response CreateDataSciencePrivateEndpointResponse, 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.createDataSciencePrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateDataSciencePrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateDataSciencePrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateDataSciencePrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateDataSciencePrivateEndpointResponse") + } + return +} + +// createDataSciencePrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createDataSciencePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/dataSciencePrivateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateDataSciencePrivateEndpointResponse + 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, "DataScience", "CreateDataSciencePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateJob Creates a job. // // # See also @@ -1998,6 +2124,63 @@ func (client DataScienceClient) deactivateNotebookSession(ctx context.Context, r return response, err } +// DeleteDataSciencePrivateEndpoint Deletes a private endpoint using `privateEndpointId`. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteDataSciencePrivateEndpoint.go.html to see an example of how to use DeleteDataSciencePrivateEndpoint API. +func (client DataScienceClient) DeleteDataSciencePrivateEndpoint(ctx context.Context, request DeleteDataSciencePrivateEndpointRequest) (response DeleteDataSciencePrivateEndpointResponse, 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.deleteDataSciencePrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteDataSciencePrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteDataSciencePrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteDataSciencePrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteDataSciencePrivateEndpointResponse") + } + return +} + +// deleteDataSciencePrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) deleteDataSciencePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/dataSciencePrivateEndpoints/{dataSciencePrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteDataSciencePrivateEndpointResponse + 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/data-science/20190101/DataSciencePrivateEndpoint/DeleteDataSciencePrivateEndpoint" + err = common.PostProcessServiceError(err, "DataScience", "DeleteDataSciencePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteJob Deletes a job. // // # See also @@ -2581,6 +2764,64 @@ func (client DataScienceClient) exportModelArtifact(ctx context.Context, request return response, err } +// GetDataSciencePrivateEndpoint Retrieves an private endpoint using a `privateEndpointId`. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetDataSciencePrivateEndpoint.go.html to see an example of how to use GetDataSciencePrivateEndpoint API. +// A default retry strategy applies to this operation GetDataSciencePrivateEndpoint() +func (client DataScienceClient) GetDataSciencePrivateEndpoint(ctx context.Context, request GetDataSciencePrivateEndpointRequest) (response GetDataSciencePrivateEndpointResponse, 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.getDataSciencePrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetDataSciencePrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetDataSciencePrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetDataSciencePrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetDataSciencePrivateEndpointResponse") + } + return +} + +// getDataSciencePrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) getDataSciencePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dataSciencePrivateEndpoints/{dataSciencePrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetDataSciencePrivateEndpointResponse + 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/data-science/20190101/DataSciencePrivateEndpoint/GetDataSciencePrivateEndpoint" + err = common.PostProcessServiceError(err, "DataScience", "GetDataSciencePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetJob Gets a job. // // # See also @@ -3631,6 +3872,64 @@ func (client DataScienceClient) importModelArtifact(ctx context.Context, request return response, err } +// ListDataSciencePrivateEndpoints Lists all Data Science private endpoints in the specified compartment. The query must include compartmentId. The query can also include one other parameter. If the query doesn't include compartmentId, or includes compartmentId with two or more other parameters, then an error is returned. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListDataSciencePrivateEndpoints.go.html to see an example of how to use ListDataSciencePrivateEndpoints API. +// A default retry strategy applies to this operation ListDataSciencePrivateEndpoints() +func (client DataScienceClient) ListDataSciencePrivateEndpoints(ctx context.Context, request ListDataSciencePrivateEndpointsRequest) (response ListDataSciencePrivateEndpointsResponse, 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.listDataSciencePrivateEndpoints, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListDataSciencePrivateEndpointsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListDataSciencePrivateEndpointsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListDataSciencePrivateEndpointsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListDataSciencePrivateEndpointsResponse") + } + return +} + +// listDataSciencePrivateEndpoints implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listDataSciencePrivateEndpoints(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/dataSciencePrivateEndpoints", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListDataSciencePrivateEndpointsResponse + 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/data-science/20190101/DataSciencePrivateEndpoint/ListDataSciencePrivateEndpoints" + err = common.PostProcessServiceError(err, "DataScience", "ListDataSciencePrivateEndpoints", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListFastLaunchJobConfigs List fast launch capable job configs in the specified compartment. // // # See also @@ -4559,6 +4858,65 @@ func (client DataScienceClient) listWorkRequests(ctx context.Context, request co return response, err } +// UpdateDataSciencePrivateEndpoint Updates a private endpoint using a `privateEndpointId`. If changes to a private endpoint match +// a previously defined private endpoint, then a 409 status code is returned. This indicates +// that a conflict has been detected. +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/UpdateDataSciencePrivateEndpoint.go.html to see an example of how to use UpdateDataSciencePrivateEndpoint API. +func (client DataScienceClient) UpdateDataSciencePrivateEndpoint(ctx context.Context, request UpdateDataSciencePrivateEndpointRequest) (response UpdateDataSciencePrivateEndpointResponse, 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.updateDataSciencePrivateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateDataSciencePrivateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateDataSciencePrivateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateDataSciencePrivateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateDataSciencePrivateEndpointResponse") + } + return +} + +// updateDataSciencePrivateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) updateDataSciencePrivateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/dataSciencePrivateEndpoints/{dataSciencePrivateEndpointId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateDataSciencePrivateEndpointResponse + 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/data-science/20190101/DataSciencePrivateEndpoint/UpdateDataSciencePrivateEndpoint" + err = common.PostProcessServiceError(err, "DataScience", "UpdateDataSciencePrivateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateJob Updates a job. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_data_science_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_data_science_private_endpoint_request_response.go new file mode 100644 index 00000000000..cc38afc3d0a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_data_science_private_endpoint_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteDataSciencePrivateEndpointRequest wrapper for the DeleteDataSciencePrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteDataSciencePrivateEndpoint.go.html to see an example of how to use DeleteDataSciencePrivateEndpointRequest. +type DeleteDataSciencePrivateEndpointRequest struct { + + // The unique ID for a Data Science private endpoint. + DataSciencePrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"dataSciencePrivateEndpointId"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then provide the request ID. + 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 is 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 DeleteDataSciencePrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteDataSciencePrivateEndpointRequest) 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 DeleteDataSciencePrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteDataSciencePrivateEndpointRequest) 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 DeleteDataSciencePrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteDataSciencePrivateEndpointResponse wrapper for the DeleteDataSciencePrivateEndpoint operation +type DeleteDataSciencePrivateEndpointResponse 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, then provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/identifiers.htm) of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) + // with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response DeleteDataSciencePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteDataSciencePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_data_science_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_data_science_private_endpoint_request_response.go new file mode 100644 index 00000000000..49f1e4f9c4d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_data_science_private_endpoint_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetDataSciencePrivateEndpointRequest wrapper for the GetDataSciencePrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetDataSciencePrivateEndpoint.go.html to see an example of how to use GetDataSciencePrivateEndpointRequest. +type GetDataSciencePrivateEndpointRequest struct { + + // The unique ID for a Data Science private endpoint. + DataSciencePrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"dataSciencePrivateEndpointId"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then 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 GetDataSciencePrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetDataSciencePrivateEndpointRequest) 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 GetDataSciencePrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetDataSciencePrivateEndpointRequest) 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 GetDataSciencePrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetDataSciencePrivateEndpointResponse wrapper for the GetDataSciencePrivateEndpoint operation +type GetDataSciencePrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DataSciencePrivateEndpoint instance + DataSciencePrivateEndpoint `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#eleven). + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle assigned identifier for the request. If you need to contact + // Oracle about a particular request, then provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetDataSciencePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetDataSciencePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_data_science_private_endpoints_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_data_science_private_endpoints_request_response.go new file mode 100644 index 00000000000..af76a2589b7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_data_science_private_endpoints_request_response.go @@ -0,0 +1,318 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListDataSciencePrivateEndpointsRequest wrapper for the ListDataSciencePrivateEndpoints operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListDataSciencePrivateEndpoints.go.html to see an example of how to use ListDataSciencePrivateEndpointsRequest. +type ListDataSciencePrivateEndpointsRequest struct { + + // Filter results by the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + // Example: `500` + 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. + // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The lifecycle state of the private endpoint. + LifecycleState ListDataSciencePrivateEndpointsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // The field used to sort the results. Multiple fields aren't supported. + SortBy ListDataSciencePrivateEndpointsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Specifies sort order to use, either `ASC` (ascending) or `DESC` (descending). + SortOrder ListDataSciencePrivateEndpointsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Filter results by its user-friendly name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Filter results by the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the resource. + CreatedBy *string `mandatory:"false" contributesTo:"query" name:"createdBy"` + + // Resource types in the Data Science service such as notebooks. + DataScienceResourceType ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum `mandatory:"false" contributesTo:"query" name:"dataScienceResourceType" 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 ListDataSciencePrivateEndpointsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListDataSciencePrivateEndpointsRequest) 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 ListDataSciencePrivateEndpointsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListDataSciencePrivateEndpointsRequest) 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 ListDataSciencePrivateEndpointsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListDataSciencePrivateEndpointsLifecycleStateEnum(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(GetListDataSciencePrivateEndpointsLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListDataSciencePrivateEndpointsSortByEnum(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(GetListDataSciencePrivateEndpointsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListDataSciencePrivateEndpointsSortOrderEnum(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(GetListDataSciencePrivateEndpointsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListDataSciencePrivateEndpointsDataScienceResourceTypeEnum(string(request.DataScienceResourceType)); !ok && request.DataScienceResourceType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DataScienceResourceType: %s. Supported values are: %s.", request.DataScienceResourceType, strings.Join(GetListDataSciencePrivateEndpointsDataScienceResourceTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListDataSciencePrivateEndpointsResponse wrapper for the ListDataSciencePrivateEndpoints operation +type ListDataSciencePrivateEndpointsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []DataSciencePrivateEndpointSummary instances + Items []DataSciencePrivateEndpointSummary `presentIn:"body"` + + // Retrieves the previous page of results. When this header appears in the response, previous pages of results exist. See List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` + + // Retrieves the next page of results. When this header appears in the response, additional pages of results remain. See List Pagination (https://docs.cloud.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, then provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListDataSciencePrivateEndpointsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListDataSciencePrivateEndpointsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListDataSciencePrivateEndpointsLifecycleStateEnum Enum with underlying type: string +type ListDataSciencePrivateEndpointsLifecycleStateEnum string + +// Set of constants representing the allowable values for ListDataSciencePrivateEndpointsLifecycleStateEnum +const ( + ListDataSciencePrivateEndpointsLifecycleStateCreating ListDataSciencePrivateEndpointsLifecycleStateEnum = "CREATING" + ListDataSciencePrivateEndpointsLifecycleStateActive ListDataSciencePrivateEndpointsLifecycleStateEnum = "ACTIVE" + ListDataSciencePrivateEndpointsLifecycleStateUpdating ListDataSciencePrivateEndpointsLifecycleStateEnum = "UPDATING" + ListDataSciencePrivateEndpointsLifecycleStateDeleting ListDataSciencePrivateEndpointsLifecycleStateEnum = "DELETING" + ListDataSciencePrivateEndpointsLifecycleStateDeleted ListDataSciencePrivateEndpointsLifecycleStateEnum = "DELETED" + ListDataSciencePrivateEndpointsLifecycleStateFailed ListDataSciencePrivateEndpointsLifecycleStateEnum = "FAILED" + ListDataSciencePrivateEndpointsLifecycleStateNeedsAttention ListDataSciencePrivateEndpointsLifecycleStateEnum = "NEEDS_ATTENTION" +) + +var mappingListDataSciencePrivateEndpointsLifecycleStateEnum = map[string]ListDataSciencePrivateEndpointsLifecycleStateEnum{ + "CREATING": ListDataSciencePrivateEndpointsLifecycleStateCreating, + "ACTIVE": ListDataSciencePrivateEndpointsLifecycleStateActive, + "UPDATING": ListDataSciencePrivateEndpointsLifecycleStateUpdating, + "DELETING": ListDataSciencePrivateEndpointsLifecycleStateDeleting, + "DELETED": ListDataSciencePrivateEndpointsLifecycleStateDeleted, + "FAILED": ListDataSciencePrivateEndpointsLifecycleStateFailed, + "NEEDS_ATTENTION": ListDataSciencePrivateEndpointsLifecycleStateNeedsAttention, +} + +var mappingListDataSciencePrivateEndpointsLifecycleStateEnumLowerCase = map[string]ListDataSciencePrivateEndpointsLifecycleStateEnum{ + "creating": ListDataSciencePrivateEndpointsLifecycleStateCreating, + "active": ListDataSciencePrivateEndpointsLifecycleStateActive, + "updating": ListDataSciencePrivateEndpointsLifecycleStateUpdating, + "deleting": ListDataSciencePrivateEndpointsLifecycleStateDeleting, + "deleted": ListDataSciencePrivateEndpointsLifecycleStateDeleted, + "failed": ListDataSciencePrivateEndpointsLifecycleStateFailed, + "needs_attention": ListDataSciencePrivateEndpointsLifecycleStateNeedsAttention, +} + +// GetListDataSciencePrivateEndpointsLifecycleStateEnumValues Enumerates the set of values for ListDataSciencePrivateEndpointsLifecycleStateEnum +func GetListDataSciencePrivateEndpointsLifecycleStateEnumValues() []ListDataSciencePrivateEndpointsLifecycleStateEnum { + values := make([]ListDataSciencePrivateEndpointsLifecycleStateEnum, 0) + for _, v := range mappingListDataSciencePrivateEndpointsLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListDataSciencePrivateEndpointsLifecycleStateEnumStringValues Enumerates the set of values in String for ListDataSciencePrivateEndpointsLifecycleStateEnum +func GetListDataSciencePrivateEndpointsLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "UPDATING", + "DELETING", + "DELETED", + "FAILED", + "NEEDS_ATTENTION", + } +} + +// GetMappingListDataSciencePrivateEndpointsLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDataSciencePrivateEndpointsLifecycleStateEnum(val string) (ListDataSciencePrivateEndpointsLifecycleStateEnum, bool) { + enum, ok := mappingListDataSciencePrivateEndpointsLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDataSciencePrivateEndpointsSortByEnum Enum with underlying type: string +type ListDataSciencePrivateEndpointsSortByEnum string + +// Set of constants representing the allowable values for ListDataSciencePrivateEndpointsSortByEnum +const ( + ListDataSciencePrivateEndpointsSortByTimecreated ListDataSciencePrivateEndpointsSortByEnum = "timeCreated" +) + +var mappingListDataSciencePrivateEndpointsSortByEnum = map[string]ListDataSciencePrivateEndpointsSortByEnum{ + "timeCreated": ListDataSciencePrivateEndpointsSortByTimecreated, +} + +var mappingListDataSciencePrivateEndpointsSortByEnumLowerCase = map[string]ListDataSciencePrivateEndpointsSortByEnum{ + "timecreated": ListDataSciencePrivateEndpointsSortByTimecreated, +} + +// GetListDataSciencePrivateEndpointsSortByEnumValues Enumerates the set of values for ListDataSciencePrivateEndpointsSortByEnum +func GetListDataSciencePrivateEndpointsSortByEnumValues() []ListDataSciencePrivateEndpointsSortByEnum { + values := make([]ListDataSciencePrivateEndpointsSortByEnum, 0) + for _, v := range mappingListDataSciencePrivateEndpointsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListDataSciencePrivateEndpointsSortByEnumStringValues Enumerates the set of values in String for ListDataSciencePrivateEndpointsSortByEnum +func GetListDataSciencePrivateEndpointsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + } +} + +// GetMappingListDataSciencePrivateEndpointsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDataSciencePrivateEndpointsSortByEnum(val string) (ListDataSciencePrivateEndpointsSortByEnum, bool) { + enum, ok := mappingListDataSciencePrivateEndpointsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDataSciencePrivateEndpointsSortOrderEnum Enum with underlying type: string +type ListDataSciencePrivateEndpointsSortOrderEnum string + +// Set of constants representing the allowable values for ListDataSciencePrivateEndpointsSortOrderEnum +const ( + ListDataSciencePrivateEndpointsSortOrderAsc ListDataSciencePrivateEndpointsSortOrderEnum = "ASC" + ListDataSciencePrivateEndpointsSortOrderDesc ListDataSciencePrivateEndpointsSortOrderEnum = "DESC" +) + +var mappingListDataSciencePrivateEndpointsSortOrderEnum = map[string]ListDataSciencePrivateEndpointsSortOrderEnum{ + "ASC": ListDataSciencePrivateEndpointsSortOrderAsc, + "DESC": ListDataSciencePrivateEndpointsSortOrderDesc, +} + +var mappingListDataSciencePrivateEndpointsSortOrderEnumLowerCase = map[string]ListDataSciencePrivateEndpointsSortOrderEnum{ + "asc": ListDataSciencePrivateEndpointsSortOrderAsc, + "desc": ListDataSciencePrivateEndpointsSortOrderDesc, +} + +// GetListDataSciencePrivateEndpointsSortOrderEnumValues Enumerates the set of values for ListDataSciencePrivateEndpointsSortOrderEnum +func GetListDataSciencePrivateEndpointsSortOrderEnumValues() []ListDataSciencePrivateEndpointsSortOrderEnum { + values := make([]ListDataSciencePrivateEndpointsSortOrderEnum, 0) + for _, v := range mappingListDataSciencePrivateEndpointsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListDataSciencePrivateEndpointsSortOrderEnumStringValues Enumerates the set of values in String for ListDataSciencePrivateEndpointsSortOrderEnum +func GetListDataSciencePrivateEndpointsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListDataSciencePrivateEndpointsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDataSciencePrivateEndpointsSortOrderEnum(val string) (ListDataSciencePrivateEndpointsSortOrderEnum, bool) { + enum, ok := mappingListDataSciencePrivateEndpointsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum Enum with underlying type: string +type ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum string + +// Set of constants representing the allowable values for ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum +const ( + ListDataSciencePrivateEndpointsDataScienceResourceTypeNotebookSession ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum = "NOTEBOOK_SESSION" +) + +var mappingListDataSciencePrivateEndpointsDataScienceResourceTypeEnum = map[string]ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum{ + "NOTEBOOK_SESSION": ListDataSciencePrivateEndpointsDataScienceResourceTypeNotebookSession, +} + +var mappingListDataSciencePrivateEndpointsDataScienceResourceTypeEnumLowerCase = map[string]ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum{ + "notebook_session": ListDataSciencePrivateEndpointsDataScienceResourceTypeNotebookSession, +} + +// GetListDataSciencePrivateEndpointsDataScienceResourceTypeEnumValues Enumerates the set of values for ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum +func GetListDataSciencePrivateEndpointsDataScienceResourceTypeEnumValues() []ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum { + values := make([]ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum, 0) + for _, v := range mappingListDataSciencePrivateEndpointsDataScienceResourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetListDataSciencePrivateEndpointsDataScienceResourceTypeEnumStringValues Enumerates the set of values in String for ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum +func GetListDataSciencePrivateEndpointsDataScienceResourceTypeEnumStringValues() []string { + return []string{ + "NOTEBOOK_SESSION", + } +} + +// GetMappingListDataSciencePrivateEndpointsDataScienceResourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListDataSciencePrivateEndpointsDataScienceResourceTypeEnum(val string) (ListDataSciencePrivateEndpointsDataScienceResourceTypeEnum, bool) { + enum, ok := mappingListDataSciencePrivateEndpointsDataScienceResourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_errors_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_errors_request_response.go index 9c779f69447..79a58332269 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_errors_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_errors_request_response.go @@ -24,6 +24,18 @@ type ListWorkRequestErrorsRequest struct { // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + // Example: `500` + 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. + // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + // 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 @@ -72,12 +84,18 @@ type ListWorkRequestErrorsResponse struct { // The underlying http response RawResponse *http.Response - // The []WorkRequestError instance + // A list of []WorkRequestError instances Items []WorkRequestError `presentIn:"body"` // Unique Oracle assigned identifier for the request. If you need to contact // Oracle about a particular request, then provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Retrieves the next page of results. When this header appears in the response, additional pages of results remain. See List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Retrieves the previous page of results. When this header appears in the response, previous pages of results exist. See List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` } func (response ListWorkRequestErrorsResponse) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_logs_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_logs_request_response.go index 3af08b84131..e505f544020 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_logs_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_request_logs_request_response.go @@ -24,6 +24,18 @@ type ListWorkRequestLogsRequest struct { // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then provide the request ID. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 1000 is the maximum. + // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + // Example: `500` + 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. + // See List Pagination (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + // 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 @@ -72,12 +84,18 @@ type ListWorkRequestLogsResponse struct { // The underlying http response RawResponse *http.Response - // The []WorkRequestLogEntry instance + // A list of []WorkRequestLogEntry instances Items []WorkRequestLogEntry `presentIn:"body"` // Unique Oracle assigned identifier for the request. If you need to contact // Oracle about a particular request, then provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Retrieves the next page of results. When this header appears in the response, additional pages of results remain. See List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Retrieves the previous page of results. When this header appears in the response, previous pages of results exist. See List Pagination (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` } func (response ListWorkRequestLogsResponse) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_requests_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_requests_request_response.go index 1f2ca1c9839..9f01ef1e092 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_requests_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_work_requests_request_response.go @@ -159,6 +159,10 @@ const ( ListWorkRequestsOperationTypePipelineRunCreate ListWorkRequestsOperationTypeEnum = "PIPELINE_RUN_CREATE" ListWorkRequestsOperationTypePipelineRunCancel ListWorkRequestsOperationTypeEnum = "PIPELINE_RUN_CANCEL" ListWorkRequestsOperationTypePipelineRunDelete ListWorkRequestsOperationTypeEnum = "PIPELINE_RUN_DELETE" + ListWorkRequestsOperationTypePrivateEndpointCreate ListWorkRequestsOperationTypeEnum = "PRIVATE_ENDPOINT_CREATE" + ListWorkRequestsOperationTypePrivateEndpointDelete ListWorkRequestsOperationTypeEnum = "PRIVATE_ENDPOINT_DELETE" + ListWorkRequestsOperationTypePrivateEndpointMove ListWorkRequestsOperationTypeEnum = "PRIVATE_ENDPOINT_MOVE" + ListWorkRequestsOperationTypePrivateEndpointUpdate ListWorkRequestsOperationTypeEnum = "PRIVATE_ENDPOINT_UPDATE" ) var mappingListWorkRequestsOperationTypeEnum = map[string]ListWorkRequestsOperationTypeEnum{ @@ -182,6 +186,10 @@ var mappingListWorkRequestsOperationTypeEnum = map[string]ListWorkRequestsOperat "PIPELINE_RUN_CREATE": ListWorkRequestsOperationTypePipelineRunCreate, "PIPELINE_RUN_CANCEL": ListWorkRequestsOperationTypePipelineRunCancel, "PIPELINE_RUN_DELETE": ListWorkRequestsOperationTypePipelineRunDelete, + "PRIVATE_ENDPOINT_CREATE": ListWorkRequestsOperationTypePrivateEndpointCreate, + "PRIVATE_ENDPOINT_DELETE": ListWorkRequestsOperationTypePrivateEndpointDelete, + "PRIVATE_ENDPOINT_MOVE": ListWorkRequestsOperationTypePrivateEndpointMove, + "PRIVATE_ENDPOINT_UPDATE": ListWorkRequestsOperationTypePrivateEndpointUpdate, } var mappingListWorkRequestsOperationTypeEnumLowerCase = map[string]ListWorkRequestsOperationTypeEnum{ @@ -205,6 +213,10 @@ var mappingListWorkRequestsOperationTypeEnumLowerCase = map[string]ListWorkReque "pipeline_run_create": ListWorkRequestsOperationTypePipelineRunCreate, "pipeline_run_cancel": ListWorkRequestsOperationTypePipelineRunCancel, "pipeline_run_delete": ListWorkRequestsOperationTypePipelineRunDelete, + "private_endpoint_create": ListWorkRequestsOperationTypePrivateEndpointCreate, + "private_endpoint_delete": ListWorkRequestsOperationTypePrivateEndpointDelete, + "private_endpoint_move": ListWorkRequestsOperationTypePrivateEndpointMove, + "private_endpoint_update": ListWorkRequestsOperationTypePrivateEndpointUpdate, } // GetListWorkRequestsOperationTypeEnumValues Enumerates the set of values for ListWorkRequestsOperationTypeEnum @@ -239,6 +251,10 @@ func GetListWorkRequestsOperationTypeEnumStringValues() []string { "PIPELINE_RUN_CREATE", "PIPELINE_RUN_CANCEL", "PIPELINE_RUN_DELETE", + "PRIVATE_ENDPOINT_CREATE", + "PRIVATE_ENDPOINT_DELETE", + "PRIVATE_ENDPOINT_MOVE", + "PRIVATE_ENDPOINT_UPDATE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_configuration_details.go index 5b0fa212180..59f56814b26 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_configuration_details.go @@ -26,7 +26,7 @@ type ModelConfigurationDetails struct { ScalingPolicy ScalingPolicy `mandatory:"false" json:"scalingPolicy"` - // The network bandwidth for the model. + // The minimum network bandwidth for the model deployment. BandwidthMbps *int `mandatory:"false" json:"bandwidthMbps"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_config_details.go index eb5567464be..f4d73474f80 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_config_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_config_details.go @@ -27,6 +27,9 @@ type NotebookSessionConfigDetails struct { // A notebook session instance is provided with a VNIC for network access. This specifies the OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. SubnetId *string `mandatory:"false" json:"subnetId"` + // The OCID of a Data Science private endpoint. + PrivateEndpointId *string `mandatory:"false" json:"privateEndpointId"` + NotebookSessionShapeConfigDetails *NotebookSessionShapeConfigDetails `mandatory:"false" json:"notebookSessionShapeConfigDetails"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_configuration_details.go index baae5cf3cd2..3eb7c8ba604 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_configuration_details.go @@ -27,6 +27,9 @@ type NotebookSessionConfigurationDetails struct { // A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. BlockStorageSizeInGBs *int `mandatory:"false" json:"blockStorageSizeInGBs"` + // The OCID of a Data Science private endpoint. + PrivateEndpointId *string `mandatory:"false" json:"privateEndpointId"` + NotebookSessionShapeConfigDetails *NotebookSessionShapeConfigDetails `mandatory:"false" json:"notebookSessionShapeConfigDetails"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_data_science_private_endpoint_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_data_science_private_endpoint_details.go new file mode 100644 index 00000000000..feba12454b8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_data_science_private_endpoint_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Data Science API +// +// Use the Data Science API to organize your data science work, access data and computing resources, and build, train, deploy and manage models and model deployments. For more information, see Data Science (https://docs.oracle.com/iaas/data-science/using/data-science.htm). +// + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateDataSciencePrivateEndpointDetails The details required to update a private endpoint. +type UpdateDataSciencePrivateEndpointDetails struct { + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.cloud.oracle.com/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. See Resource Tags (https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // 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"` + + // An array of network security group OCIDs. + NsgIds []string `mandatory:"false" json:"nsgIds"` +} + +func (m UpdateDataSciencePrivateEndpointDetails) 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 UpdateDataSciencePrivateEndpointDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_data_science_private_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_data_science_private_endpoint_request_response.go new file mode 100644 index 00000000000..e54bd3f5d54 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_data_science_private_endpoint_request_response.go @@ -0,0 +1,107 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateDataSciencePrivateEndpointRequest wrapper for the UpdateDataSciencePrivateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/UpdateDataSciencePrivateEndpoint.go.html to see an example of how to use UpdateDataSciencePrivateEndpointRequest. +type UpdateDataSciencePrivateEndpointRequest struct { + + // The unique ID for a Data Science private endpoint. + DataSciencePrivateEndpointId *string `mandatory:"true" contributesTo:"path" name:"dataSciencePrivateEndpointId"` + + // Details for updating a private endpoint. + UpdateDataSciencePrivateEndpointDetails `contributesTo:"body"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, then provide the request ID. + 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 is 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 UpdateDataSciencePrivateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateDataSciencePrivateEndpointRequest) 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 UpdateDataSciencePrivateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateDataSciencePrivateEndpointRequest) 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 UpdateDataSciencePrivateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateDataSciencePrivateEndpointResponse wrapper for the UpdateDataSciencePrivateEndpoint operation +type UpdateDataSciencePrivateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The DataSciencePrivateEndpoint instance + DataSciencePrivateEndpoint `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#eleven). + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle assigned identifier for the request. If you need to contact + // Oracle about a particular request, then provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/API/Concepts/identifiers.htm) of the work request. Use GetWorkRequest (https://docs.cloud.oracle.com/api/#/en/workrequests/20160918/WorkRequest/GetWorkRequest) + // with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` +} + +func (response UpdateDataSciencePrivateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateDataSciencePrivateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_configuration_details.go index c2c157a1957..3236fe814b8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_configuration_details.go @@ -26,7 +26,7 @@ type UpdateModelConfigurationDetails struct { ScalingPolicy ScalingPolicy `mandatory:"false" json:"scalingPolicy"` - // The network bandwidth for the model. + // The minimum network bandwidth for the model deployment. BandwidthMbps *int `mandatory:"false" json:"bandwidthMbps"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/work_request_operation_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/work_request_operation_type.go index 4a9f2019374..51d6e10eedb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/work_request_operation_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/work_request_operation_type.go @@ -38,6 +38,10 @@ const ( WorkRequestOperationTypePipelineRunCreate WorkRequestOperationTypeEnum = "PIPELINE_RUN_CREATE" WorkRequestOperationTypePipelineRunCancel WorkRequestOperationTypeEnum = "PIPELINE_RUN_CANCEL" WorkRequestOperationTypePipelineRunDelete WorkRequestOperationTypeEnum = "PIPELINE_RUN_DELETE" + WorkRequestOperationTypePrivateEndpointCreate WorkRequestOperationTypeEnum = "PRIVATE_ENDPOINT_CREATE" + WorkRequestOperationTypePrivateEndpointDelete WorkRequestOperationTypeEnum = "PRIVATE_ENDPOINT_DELETE" + WorkRequestOperationTypePrivateEndpointMove WorkRequestOperationTypeEnum = "PRIVATE_ENDPOINT_MOVE" + WorkRequestOperationTypePrivateEndpointUpdate WorkRequestOperationTypeEnum = "PRIVATE_ENDPOINT_UPDATE" ) var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnum{ @@ -61,6 +65,10 @@ var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnu "PIPELINE_RUN_CREATE": WorkRequestOperationTypePipelineRunCreate, "PIPELINE_RUN_CANCEL": WorkRequestOperationTypePipelineRunCancel, "PIPELINE_RUN_DELETE": WorkRequestOperationTypePipelineRunDelete, + "PRIVATE_ENDPOINT_CREATE": WorkRequestOperationTypePrivateEndpointCreate, + "PRIVATE_ENDPOINT_DELETE": WorkRequestOperationTypePrivateEndpointDelete, + "PRIVATE_ENDPOINT_MOVE": WorkRequestOperationTypePrivateEndpointMove, + "PRIVATE_ENDPOINT_UPDATE": WorkRequestOperationTypePrivateEndpointUpdate, } var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperationTypeEnum{ @@ -84,6 +92,10 @@ var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperati "pipeline_run_create": WorkRequestOperationTypePipelineRunCreate, "pipeline_run_cancel": WorkRequestOperationTypePipelineRunCancel, "pipeline_run_delete": WorkRequestOperationTypePipelineRunDelete, + "private_endpoint_create": WorkRequestOperationTypePrivateEndpointCreate, + "private_endpoint_delete": WorkRequestOperationTypePrivateEndpointDelete, + "private_endpoint_move": WorkRequestOperationTypePrivateEndpointMove, + "private_endpoint_update": WorkRequestOperationTypePrivateEndpointUpdate, } // GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum @@ -118,6 +130,10 @@ func GetWorkRequestOperationTypeEnumStringValues() []string { "PIPELINE_RUN_CREATE", "PIPELINE_RUN_CANCEL", "PIPELINE_RUN_DELETE", + "PRIVATE_ENDPOINT_CREATE", + "PRIVATE_ENDPOINT_DELETE", + "PRIVATE_ENDPOINT_MOVE", + "PRIVATE_ENDPOINT_UPDATE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/create_replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/create_replica_details.go index e897b12575e..2ea5a55a9b0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/create_replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/create_replica_details.go @@ -40,6 +40,8 @@ type CreateReplicaDetails struct { // the DB System is delete protected, read replicas can still be deleted individually if they are not delete // protected themselves. IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` + + ReplicaOverrides *ReplicaOverrides `mandatory:"false" json:"replicaOverrides"` } func (m CreateReplicaDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/list_replicas_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/list_replicas_request_response.go index aad588aa0d4..3e56a445464 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/list_replicas_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/list_replicas_request_response.go @@ -47,6 +47,13 @@ type ListReplicasRequest struct { // The read replica OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm). ReplicaId *string `mandatory:"false" contributesTo:"query" name:"replicaId"` + // The requested Configuration instance. + ConfigurationId *string `mandatory:"false" contributesTo:"query" name:"configurationId"` + + // Filter instances if they are using the latest revision of the + // Configuration they are associated with. + IsUpToDate *bool `mandatory:"false" contributesTo:"query" name:"isUpToDate"` + // The field to sort by. You can sort by one field only. By default, the Time field is sorted in descending order and the Display Name field in ascending order. SortBy ListReplicasSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica.go b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica.go index 52c8d8683bb..95c79ea935d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica.go @@ -36,7 +36,7 @@ type Replica struct { // The date and time the read replica was created, as described by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The MySQL version used by the read replica. + // The MySQL version currently in use by the read replica. MysqlVersion *string `mandatory:"true" json:"mysqlVersion"` // The IP address the read replica is configured to listen on. @@ -76,6 +76,16 @@ type Replica struct { // the DB System is delete protected, read replicas can still be deleted individually if they are not delete // protected themselves. IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` + + // The shape currently in use by the read replica. The shape determines the resources allocated: + // CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. + // To get a list of shapes, use the ListShapes operation. + ShapeName *string `mandatory:"false" json:"shapeName"` + + // The OCID of the Configuration currently in use by the read replica. + ConfigurationId *string `mandatory:"false" json:"configurationId"` + + ReplicaOverrides *ReplicaOverrides `mandatory:"false" json:"replicaOverrides"` } func (m Replica) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica_overrides.go b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica_overrides.go new file mode 100644 index 00000000000..556968979e7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica_overrides.go @@ -0,0 +1,50 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// MySQL Database Service API +// +// The API for the MySQL Database Service +// + +package mysql + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplicaOverrides By default a read replica inherits the MySQL version, shape, and configuration of the source DB system. +// If you want to override any of these, provide values in the properties, mysqlVersion, shapeName, +// and configurationId. If you set a property value to "", then the value is inherited from its +// source DB system. +type ReplicaOverrides struct { + + // The MySQL version to be used by the read replica. + MysqlVersion *string `mandatory:"false" json:"mysqlVersion"` + + // The shape to be used by the read replica. The shape determines the resources allocated: + // CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. + // To get a list of shapes, use the ListShapes operation. + ShapeName *string `mandatory:"false" json:"shapeName"` + + // The OCID of the Configuration to be used by the read replica. + ConfigurationId *string `mandatory:"false" json:"configurationId"` +} + +func (m ReplicaOverrides) 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 ReplicaOverrides) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica_summary.go index 95f04c7f026..f5f680b7700 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/replica_summary.go @@ -36,7 +36,7 @@ type ReplicaSummary struct { // The date and time the read replica was created, as described by RFC 3339 (https://tools.ietf.org/rfc/rfc3339). TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` - // The MySQL version used by the read replica. + // The MySQL version currently in use by the read replica. MysqlVersion *string `mandatory:"true" json:"mysqlVersion"` // The IP address the read replica is configured to listen on. @@ -76,6 +76,16 @@ type ReplicaSummary struct { // the DB System is delete protected, read replicas can still be deleted individually if they are not delete // protected themselves. IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` + + // The shape currently in use by the read replica. The shape determines the resources allocated: + // CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. + // To get a list of shapes, use the ListShapes operation. + ShapeName *string `mandatory:"false" json:"shapeName"` + + // The OCID of the Configuration currently in use by the read replica. + ConfigurationId *string `mandatory:"false" json:"configurationId"` + + ReplicaOverrides *ReplicaOverrides `mandatory:"false" json:"replicaOverrides"` } func (m ReplicaSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/update_replica_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/update_replica_details.go index d145d4f91a1..dcf9e458e0e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/mysql/update_replica_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/mysql/update_replica_details.go @@ -37,6 +37,8 @@ type UpdateReplicaDetails struct { // the DB System is delete protected, read replicas can still be deleted individually if they are not delete // protected themselves. IsDeleteProtected *bool `mandatory:"false" json:"isDeleteProtected"` + + ReplicaOverrides *ReplicaOverrides `mandatory:"false" json:"replicaOverrides"` } func (m UpdateReplicaDetails) String() string { diff --git a/vendor/modules.txt b/vendor/modules.txt index a48434ca007..cedbea61060 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -248,7 +248,7 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.0.0 ## explicit github.com/oklog/run -# github.com/oracle/oci-go-sdk/v65 v65.49.2 +# github.com/oracle/oci-go-sdk/v65 v65.49.3 ## explicit; go 1.13 github.com/oracle/oci-go-sdk/v65/adm github.com/oracle/oci-go-sdk/v65/aianomalydetection @@ -277,6 +277,7 @@ github.com/oracle/oci-go-sdk/v65/cloudmigrations github.com/oracle/oci-go-sdk/v65/common github.com/oracle/oci-go-sdk/v65/common/auth github.com/oracle/oci-go-sdk/v65/common/utils +github.com/oracle/oci-go-sdk/v65/computecloudatcustomer github.com/oracle/oci-go-sdk/v65/computeinstanceagent github.com/oracle/oci-go-sdk/v65/containerengine github.com/oracle/oci-go-sdk/v65/containerinstances diff --git a/website/docs/d/compute_cloud_at_customer_ccc_infrastructure.html.markdown b/website/docs/d/compute_cloud_at_customer_ccc_infrastructure.html.markdown new file mode 100644 index 00000000000..d2be48632b7 --- /dev/null +++ b/website/docs/d/compute_cloud_at_customer_ccc_infrastructure.html.markdown @@ -0,0 +1,91 @@ +--- +subcategory: "Compute Cloud At Customer" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_compute_cloud_at_customer_ccc_infrastructure" +sidebar_current: "docs-oci-datasource-compute_cloud_at_customer-ccc_infrastructure" +description: |- + Provides details about a specific Ccc Infrastructure in Oracle Cloud Infrastructure Compute Cloud At Customer service +--- + +# Data Source: oci_compute_cloud_at_customer_ccc_infrastructure +This data source provides details about a specific Ccc Infrastructure resource in Oracle Cloud Infrastructure Compute Cloud At Customer service. + +Gets a Compute Cloud@Customer infrastructure using the infrastructure +[OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + + +## Example Usage + +```hcl +data "oci_compute_cloud_at_customer_ccc_infrastructure" "test_ccc_infrastructure" { + #Required + ccc_infrastructure_id = oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccc_infrastructure_id` - (Required) An [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a Compute Cloud@Customer Infrastructure. + + +## Attributes Reference + +The following attributes are exported: + +* `ccc_upgrade_schedule_id` - Schedule used for upgrades. If no schedule is associated with the infrastructure, it can be updated at any time. +* `compartment_id` - The infrastructure compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `connection_details` - A message describing the current connection state in more detail. +* `connection_state` - The current connection state of the infrastructure. A user can only update it from REQUEST to READY or from any state back to REJECT. The system automatically handles the REJECT to REQUEST, READY to CONNECTED, or CONNECTED to DISCONNECTED transitions. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. Avoid entering confidential information. +* `display_name` - The name that will be used to display the Compute Cloud@Customer infrastructure in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. Avoid entering confidential information. +* `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` - The Compute Cloud@Customer infrastructure [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). This cannot be changed once created. +* `infrastructure_inventory` - Inventory for a Compute Cloud@Customer infrastructure. This information cannot be updated and is from the infrastructure. The information will only be available after the connectionState is transitioned to CONNECTED. + * `capacity_storage_tray_count` - The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for capacity storage. + * `compute_node_count` - The number of compute nodes that are available and usable on the Compute Cloud@Customer infrastructure rack. There is no distinction of compute node type in this information. + * `management_node_count` - The number of management nodes that are available and in active use on the Compute Cloud@Customer infrastructure rack. + * `performance_storage_tray_count` - The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for performance storage. + * `serial_number` - The serial number of the Compute Cloud@Customer infrastructure rack. +* `infrastructure_network_configuration` - Configuration information for the Compute Cloud@Customer infrastructure. This network configuration information cannot be updated and is retrieved from the data center. The information will only be available after the connectionState is transitioned to CONNECTED. + * `dns_ips` - The domain name system (DNS) addresses that the Compute Cloud@Customer infrastructure uses for the data center network. + * `infrastructure_routing_dynamic` - Dynamic routing information for the Compute Cloud@Customer infrastructure. + * `bgp_topology` - The topology in use for the Border Gateway Protocol (BGP) configuration. + * `oracle_asn` - The Oracle Autonomous System Number (ASN) to control routing and exchange information within the dynamic routing configuration. + * `peer_information` - The list of peer devices in the dynamic routing configuration. + * `asn` - The Autonomous System Number (ASN) of the peer network. + * `ip` - Neighbor Border Gateway Protocal (BGP) IP address. The IP address usually refers to the customer data center router. + * `infrastructure_routing_static` - Static routing information for a rack. + * `uplink_hsrp_group` - The uplink Hot Standby Router Protocol (HSRP) group value for the switch in the Compute Cloud@Customer infrastructure. + * `uplink_vlan` - The virtual local area network (VLAN) identifier used to connect to the uplink (only access mode is supported). + * `management_nodes` - Information about the management nodes that are provisioned in the Compute Cloud@Customer infrastructure. + * `hostname` - Hostname for interface to the management node. + * `ip` - Address of the management node. + * `mgmt_vip_hostname` - The hostname corresponding to the virtual IP (VIP) address of the management nodes. + * `mgmt_vip_ip` - The IP address used as the virtual IP (VIP) address of the management nodes. + * `spine_ips` - Addresses of the network spine switches. + * `spine_vip` - The spine switch public virtual IP (VIP). Traffic routed to the Compute Cloud@Customer infrastructure and and virtual cloud networks (VCNs) should have this address as next hop. + * `uplink_domain` - Domain name to be used as the base domain for the internal network and by public facing services. + * `uplink_gateway_ip` - Uplink gateway in the datacenter network that the Compute Cloud@Customer connects to. + * `uplink_netmask` - Netmask of the subnet that the Compute Cloud@Customer infrastructure is connected to. + * `uplink_port_count` - Number of uplink ports per spine switch. Connectivity is identical on both spine switches. For example, if input is two 100 gigabyte ports; then port-1 and port-2 on both spines will be configured. + * `uplink_port_forward_error_correction` - The port forward error correction (FEC) setting for the uplink port on the Compute Cloud@Customer infrastructure. + * `uplink_port_speed_in_gbps` - Uplink port speed defined in gigabytes per second. All uplink ports must have identical speed. + * `uplink_vlan_mtu` - The virtual local area network (VLAN) maximum transmission unit (MTU) size for the uplink ports. +* `lifecycle_details` - A message describing the current lifecycle state in more detail. For example, this can be used to provide actionable information for a resource that is in a Failed state. +* `provisioning_fingerprint` - Fingerprint of a Compute Cloud@Customer infrastructure in a data center generated during the initial connection to this resource. The fingerprint should be verified by the administrator when changing the connectionState from REQUEST to READY. +* `provisioning_pin` - Code that is required for service personnel to connect a Compute Cloud@Customer infrastructure in a data center to this resource. This code will only be available when the connectionState is REJECT (usually at create time of the Compute Cloud@Customer infrastructure). +* `short_name` - The Compute Cloud@Customer infrastructure short name. This cannot be changed once created. The short name is used to refer to the infrastructure in several contexts and is unique. +* `state` - The current state of the Compute Cloud@Customer infrastructure. +* `subnet_id` - [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is used to communicate with Compute Cloud@Customer infrastructure. +* `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` - Compute Cloud@Customer infrastructure creation date and time, using an RFC3339 formatted datetime string. +* `time_updated` - Compute Cloud@Customer infrastructure updated date and time, using an RFC3339 formatted datetime string. +* `upgrade_information` - Upgrade information that relates to a Compute Cloud@Customer infrastructure. This information cannot be updated. + * `current_version` - The current version of software installed on the Compute Cloud@Customer infrastructure. + * `is_active` - Indication that the Compute Cloud@Customer infrastructure is in the process of an upgrade or an upgrade activity (such as preloading upgrade images). + * `scheduled_upgrade_duration` - Expected duration of Compute Cloud@Customer infrastructure scheduled upgrade. The actual upgrade time might be longer or shorter than this duration depending on rack activity, this is only an estimate. + * `time_of_scheduled_upgrade` - Compute Cloud@Customer infrastructure next upgrade time. The rack might have performance impacts during this time. + diff --git a/website/docs/d/compute_cloud_at_customer_ccc_infrastructures.html.markdown b/website/docs/d/compute_cloud_at_customer_ccc_infrastructures.html.markdown new file mode 100644 index 00000000000..7857104053d --- /dev/null +++ b/website/docs/d/compute_cloud_at_customer_ccc_infrastructures.html.markdown @@ -0,0 +1,109 @@ +--- +subcategory: "Compute Cloud At Customer" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_compute_cloud_at_customer_ccc_infrastructures" +sidebar_current: "docs-oci-datasource-compute_cloud_at_customer-ccc_infrastructures" +description: |- + Provides the list of Ccc Infrastructures in Oracle Cloud Infrastructure Compute Cloud At Customer service +--- + +# Data Source: oci_compute_cloud_at_customer_ccc_infrastructures +This data source provides the list of Ccc Infrastructures in Oracle Cloud Infrastructure Compute Cloud At Customer service. + +Returns a list of Compute Cloud@Customer infrastructures. + + +## Example Usage + +```hcl +data "oci_compute_cloud_at_customer_ccc_infrastructures" "test_ccc_infrastructures" { + + #Optional + access_level = var.ccc_infrastructure_access_level + ccc_infrastructure_id = oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure.id + compartment_id = var.compartment_id + compartment_id_in_subtree = var.ccc_infrastructure_compartment_id_in_subtree + display_name = var.ccc_infrastructure_display_name + display_name_contains = var.ccc_infrastructure_display_name_contains + state = var.ccc_infrastructure_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `access_level` - (Optional) Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed. +* `ccc_infrastructure_id` - (Optional) An [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for a Compute Cloud@Customer Infrastructure. +* `compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `compartment_id_in_subtree` - (Optional) Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and sub-compartments in the tenancy are returned. Depends on the 'accessLevel' setting. +* `display_name` - (Optional) A filter to return only resources that match the entire display name given. +* `display_name_contains` - (Optional) A filter to return only resources whose display name contains the substring. +* `state` - (Optional) A filter used to return only resources that match the given lifecycleState. + + +## Attributes Reference + +The following attributes are exported: + +* `ccc_infrastructure_collection` - The list of ccc_infrastructure_collection. + +### CccInfrastructure Reference + +The following attributes are exported: + +* `ccc_upgrade_schedule_id` - Schedule used for upgrades. If no schedule is associated with the infrastructure, it can be updated at any time. +* `compartment_id` - The infrastructure compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `connection_details` - A message describing the current connection state in more detail. +* `connection_state` - The current connection state of the infrastructure. A user can only update it from REQUEST to READY or from any state back to REJECT. The system automatically handles the REJECT to REQUEST, READY to CONNECTED, or CONNECTED to DISCONNECTED transitions. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. Avoid entering confidential information. +* `display_name` - The name that will be used to display the Compute Cloud@Customer infrastructure in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. Avoid entering confidential information. +* `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` - The Compute Cloud@Customer infrastructure [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). This cannot be changed once created. +* `infrastructure_inventory` - Inventory for a Compute Cloud@Customer infrastructure. This information cannot be updated and is from the infrastructure. The information will only be available after the connectionState is transitioned to CONNECTED. + * `capacity_storage_tray_count` - The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for capacity storage. + * `compute_node_count` - The number of compute nodes that are available and usable on the Compute Cloud@Customer infrastructure rack. There is no distinction of compute node type in this information. + * `management_node_count` - The number of management nodes that are available and in active use on the Compute Cloud@Customer infrastructure rack. + * `performance_storage_tray_count` - The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for performance storage. + * `serial_number` - The serial number of the Compute Cloud@Customer infrastructure rack. +* `infrastructure_network_configuration` - Configuration information for the Compute Cloud@Customer infrastructure. This network configuration information cannot be updated and is retrieved from the data center. The information will only be available after the connectionState is transitioned to CONNECTED. + * `dns_ips` - The domain name system (DNS) addresses that the Compute Cloud@Customer infrastructure uses for the data center network. + * `infrastructure_routing_dynamic` - Dynamic routing information for the Compute Cloud@Customer infrastructure. + * `bgp_topology` - The topology in use for the Border Gateway Protocol (BGP) configuration. + * `oracle_asn` - The Oracle Autonomous System Number (ASN) to control routing and exchange information within the dynamic routing configuration. + * `peer_information` - The list of peer devices in the dynamic routing configuration. + * `asn` - The Autonomous System Number (ASN) of the peer network. + * `ip` - Neighbor Border Gateway Protocal (BGP) IP address. The IP address usually refers to the customer data center router. + * `infrastructure_routing_static` - Static routing information for a rack. + * `uplink_hsrp_group` - The uplink Hot Standby Router Protocol (HSRP) group value for the switch in the Compute Cloud@Customer infrastructure. + * `uplink_vlan` - The virtual local area network (VLAN) identifier used to connect to the uplink (only access mode is supported). + * `management_nodes` - Information about the management nodes that are provisioned in the Compute Cloud@Customer infrastructure. + * `hostname` - Hostname for interface to the management node. + * `ip` - Address of the management node. + * `mgmt_vip_hostname` - The hostname corresponding to the virtual IP (VIP) address of the management nodes. + * `mgmt_vip_ip` - The IP address used as the virtual IP (VIP) address of the management nodes. + * `spine_ips` - Addresses of the network spine switches. + * `spine_vip` - The spine switch public virtual IP (VIP). Traffic routed to the Compute Cloud@Customer infrastructure and and virtual cloud networks (VCNs) should have this address as next hop. + * `uplink_domain` - Domain name to be used as the base domain for the internal network and by public facing services. + * `uplink_gateway_ip` - Uplink gateway in the datacenter network that the Compute Cloud@Customer connects to. + * `uplink_netmask` - Netmask of the subnet that the Compute Cloud@Customer infrastructure is connected to. + * `uplink_port_count` - Number of uplink ports per spine switch. Connectivity is identical on both spine switches. For example, if input is two 100 gigabyte ports; then port-1 and port-2 on both spines will be configured. + * `uplink_port_forward_error_correction` - The port forward error correction (FEC) setting for the uplink port on the Compute Cloud@Customer infrastructure. + * `uplink_port_speed_in_gbps` - Uplink port speed defined in gigabytes per second. All uplink ports must have identical speed. + * `uplink_vlan_mtu` - The virtual local area network (VLAN) maximum transmission unit (MTU) size for the uplink ports. +* `lifecycle_details` - A message describing the current lifecycle state in more detail. For example, this can be used to provide actionable information for a resource that is in a Failed state. +* `provisioning_fingerprint` - Fingerprint of a Compute Cloud@Customer infrastructure in a data center generated during the initial connection to this resource. The fingerprint should be verified by the administrator when changing the connectionState from REQUEST to READY. +* `provisioning_pin` - Code that is required for service personnel to connect a Compute Cloud@Customer infrastructure in a data center to this resource. This code will only be available when the connectionState is REJECT (usually at create time of the Compute Cloud@Customer infrastructure). +* `short_name` - The Compute Cloud@Customer infrastructure short name. This cannot be changed once created. The short name is used to refer to the infrastructure in several contexts and is unique. +* `state` - The current state of the Compute Cloud@Customer infrastructure. +* `subnet_id` - [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is used to communicate with Compute Cloud@Customer infrastructure. +* `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` - Compute Cloud@Customer infrastructure creation date and time, using an RFC3339 formatted datetime string. +* `time_updated` - Compute Cloud@Customer infrastructure updated date and time, using an RFC3339 formatted datetime string. +* `upgrade_information` - Upgrade information that relates to a Compute Cloud@Customer infrastructure. This information cannot be updated. + * `current_version` - The current version of software installed on the Compute Cloud@Customer infrastructure. + * `is_active` - Indication that the Compute Cloud@Customer infrastructure is in the process of an upgrade or an upgrade activity (such as preloading upgrade images). + * `scheduled_upgrade_duration` - Expected duration of Compute Cloud@Customer infrastructure scheduled upgrade. The actual upgrade time might be longer or shorter than this duration depending on rack activity, this is only an estimate. + * `time_of_scheduled_upgrade` - Compute Cloud@Customer infrastructure next upgrade time. The rack might have performance impacts during this time. + diff --git a/website/docs/d/compute_cloud_at_customer_ccc_upgrade_schedule.html.markdown b/website/docs/d/compute_cloud_at_customer_ccc_upgrade_schedule.html.markdown new file mode 100644 index 00000000000..c875fc4a1f1 --- /dev/null +++ b/website/docs/d/compute_cloud_at_customer_ccc_upgrade_schedule.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "Compute Cloud At Customer" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_compute_cloud_at_customer_ccc_upgrade_schedule" +sidebar_current: "docs-oci-datasource-compute_cloud_at_customer-ccc_upgrade_schedule" +description: |- + Provides details about a specific Ccc Upgrade Schedule in Oracle Cloud Infrastructure Compute Cloud At Customer service +--- + +# Data Source: oci_compute_cloud_at_customer_ccc_upgrade_schedule +This data source provides details about a specific Ccc Upgrade Schedule resource in Oracle Cloud Infrastructure Compute Cloud At Customer service. + +Gets a Compute Cloud@Customer upgrade schedule by the specified +[OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + + +## Example Usage + +```hcl +data "oci_compute_cloud_at_customer_ccc_upgrade_schedule" "test_ccc_upgrade_schedule" { + #Required + ccc_upgrade_schedule_id = oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccc_upgrade_schedule_id` - (Required) Compute Cloud@Customer upgrade schedule [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). + + +## Attributes Reference + +The following attributes are exported: + +* `compartment_id` - Compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the Compute Cloud@Customer upgrade schedule. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - An optional description of the Compute Cloud@Customer upgrade schedule. Avoid entering confidential information. +* `display_name` - Compute Cloud@Customer upgrade schedule display name. Avoid entering confidential information. +* `events` - List of preferred times for Compute Cloud@Customer infrastructures associated with this schedule to be upgraded. + * `description` - A description of the Compute Cloud@Customer upgrade schedule time block. + * `name` - Generated name associated with the event. + * `schedule_event_duration` - The duration of this block of time. The duration must be specified and be of the ISO-8601 format for durations. + * `schedule_event_recurrences` - Frequency of recurrence of schedule block. When this field is not included, the event is assumed to be a one time occurrence. The frequency field is strictly parsed and must conform to RFC-5545 formatting for recurrences. + * `time_start` - The date and time when the Compute Cloud@Customer upgrade schedule event starts, inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, this is the date that a recurrence can start being applied. +* `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` - Upgrade schedule [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). This cannot be changed once created. +* `infrastructure_ids` - List of Compute Cloud@Customer infrastructure [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) that are using this upgrade schedule. +* `lifecycle_details` - A message describing the current state in more detail. For example, the message can be used to provide actionable information for a resource in a Failed state. +* `state` - Lifecycle state of the resource. +* `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 time the upgrade schedule was created, using an RFC3339 formatted datetime string. +* `time_updated` - The time the upgrade schedule was updated, using an RFC3339 formatted datetime string. + diff --git a/website/docs/d/compute_cloud_at_customer_ccc_upgrade_schedules.html.markdown b/website/docs/d/compute_cloud_at_customer_ccc_upgrade_schedules.html.markdown new file mode 100644 index 00000000000..2f44e71c846 --- /dev/null +++ b/website/docs/d/compute_cloud_at_customer_ccc_upgrade_schedules.html.markdown @@ -0,0 +1,73 @@ +--- +subcategory: "Compute Cloud At Customer" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_compute_cloud_at_customer_ccc_upgrade_schedules" +sidebar_current: "docs-oci-datasource-compute_cloud_at_customer-ccc_upgrade_schedules" +description: |- + Provides the list of Ccc Upgrade Schedules in Oracle Cloud Infrastructure Compute Cloud At Customer service +--- + +# Data Source: oci_compute_cloud_at_customer_ccc_upgrade_schedules +This data source provides the list of Ccc Upgrade Schedules in Oracle Cloud Infrastructure Compute Cloud At Customer service. + +Returns a list of Compute Cloud@Customer upgrade schedules. + + +## Example Usage + +```hcl +data "oci_compute_cloud_at_customer_ccc_upgrade_schedules" "test_ccc_upgrade_schedules" { + + #Optional + access_level = var.ccc_upgrade_schedule_access_level + ccc_upgrade_schedule_id = oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id + compartment_id = var.compartment_id + compartment_id_in_subtree = var.ccc_upgrade_schedule_compartment_id_in_subtree + display_name = var.ccc_upgrade_schedule_display_name + display_name_contains = var.ccc_upgrade_schedule_display_name_contains + state = var.ccc_upgrade_schedule_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `access_level` - (Optional) Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed. +* `ccc_upgrade_schedule_id` - (Optional) Compute Cloud@Customer upgrade schedule [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `compartment_id_in_subtree` - (Optional) Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and sub-compartments in the tenancy are returned. Depends on the 'accessLevel' setting. +* `display_name` - (Optional) A filter to return only resources that match the entire display name given. +* `display_name_contains` - (Optional) A filter to return only resources whose display name contains the substring. +* `state` - (Optional) A filter to return resources only when their lifecycleState matches the given lifecycleState. + + +## Attributes Reference + +The following attributes are exported: + +* `ccc_upgrade_schedule_collection` - The list of ccc_upgrade_schedule_collection. + +### CccUpgradeSchedule Reference + +The following attributes are exported: + +* `compartment_id` - Compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the Compute Cloud@Customer upgrade schedule. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - An optional description of the Compute Cloud@Customer upgrade schedule. Avoid entering confidential information. +* `display_name` - Compute Cloud@Customer upgrade schedule display name. Avoid entering confidential information. +* `events` - List of preferred times for Compute Cloud@Customer infrastructures associated with this schedule to be upgraded. + * `description` - A description of the Compute Cloud@Customer upgrade schedule time block. + * `name` - Generated name associated with the event. + * `schedule_event_duration` - The duration of this block of time. The duration must be specified and be of the ISO-8601 format for durations. + * `schedule_event_recurrences` - Frequency of recurrence of schedule block. When this field is not included, the event is assumed to be a one time occurrence. The frequency field is strictly parsed and must conform to RFC-5545 formatting for recurrences. + * `time_start` - The date and time when the Compute Cloud@Customer upgrade schedule event starts, inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, this is the date that a recurrence can start being applied. +* `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` - Upgrade schedule [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). This cannot be changed once created. +* `infrastructure_ids` - List of Compute Cloud@Customer infrastructure [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) that are using this upgrade schedule. +* `lifecycle_details` - A message describing the current state in more detail. For example, the message can be used to provide actionable information for a resource in a Failed state. +* `state` - Lifecycle state of the resource. +* `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 time the upgrade schedule was created, using an RFC3339 formatted datetime string. +* `time_updated` - The time the upgrade schedule was updated, using an RFC3339 formatted datetime string. + diff --git a/website/docs/d/database_autonomous_database.html.markdown b/website/docs/d/database_autonomous_database.html.markdown index 661ff641ea3..d73f4c10ea7 100644 --- a/website/docs/d/database_autonomous_database.html.markdown +++ b/website/docs/d/database_autonomous_database.html.markdown @@ -192,7 +192,11 @@ 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 Shared Autonomous Database. 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. + * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. 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. +* `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 + * `is_disabled` - Indicates if the resource pool should be deleted for the Autonomous Database. + * `pool_size` - Resource pool size. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. * `scheduled_operations` - The list of scheduled operations. @@ -234,6 +238,7 @@ The following attributes are exported: * `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_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. diff --git a/website/docs/d/database_autonomous_databases.html.markdown b/website/docs/d/database_autonomous_databases.html.markdown index 9c8db2186f9..bb5733bba0e 100644 --- a/website/docs/d/database_autonomous_databases.html.markdown +++ b/website/docs/d/database_autonomous_databases.html.markdown @@ -29,6 +29,8 @@ data "oci_database_autonomous_databases" "test_autonomous_databases" { is_data_guard_enabled = var.autonomous_database_is_data_guard_enabled is_free_tier = var.autonomous_database_is_free_tier is_refreshable_clone = var.autonomous_database_is_refreshable_clone + is_resource_pool_leader = var.autonomous_database_is_resource_pool_leader + resource_pool_leader_id = oci_database_resource_pool_leader.test_resource_pool_leader.id state = var.autonomous_database_state } ``` @@ -46,6 +48,8 @@ The following arguments are supported: * `is_data_guard_enabled` - (Optional) A filter to return only resources that have Data Guard enabled. * `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. +* `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. @@ -211,7 +215,11 @@ 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 Shared Autonomous Database. 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. + * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. 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. +* `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 + * `is_disabled` - Indicates if the resource pool should be deleted for the Autonomous Database. + * `pool_size` - Resource pool size. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. * `scheduled_operations` - The list of scheduled operations. @@ -253,6 +261,7 @@ The following attributes are exported: * `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_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. diff --git a/website/docs/d/database_autonomous_databases_clones.html.markdown b/website/docs/d/database_autonomous_databases_clones.html.markdown index d4a5b9d8ce7..ecf807f915d 100644 --- a/website/docs/d/database_autonomous_databases_clones.html.markdown +++ b/website/docs/d/database_autonomous_databases_clones.html.markdown @@ -203,7 +203,11 @@ 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 Shared Autonomous Database. 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. + * `disaster_recovery_type` - Indicates the disaster recovery (DR) type of the Shared Autonomous Database. 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. +* `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 + * `is_disabled` - Indicates if the resource pool should be deleted for the Autonomous Database. + * `pool_size` - Resource pool size. * `role` - The Data Guard role of the Autonomous Container Database or Autonomous Database, if Autonomous Data Guard is enabled. * `scheduled_operations` - The list of scheduled operations. diff --git a/website/docs/d/datascience_data_science_private_endpoint.html.markdown b/website/docs/d/datascience_data_science_private_endpoint.html.markdown new file mode 100644 index 00000000000..0a193ee4975 --- /dev/null +++ b/website/docs/d/datascience_data_science_private_endpoint.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_private_endpoint" +sidebar_current: "docs-oci-datasource-datascience-data_science_private_endpoint" +description: |- + Provides details about a specific Data Science Private Endpoint in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_private_endpoint +This data source provides details about a specific Data Science Private Endpoint resource in Oracle Cloud Infrastructure Data Science service. + +Retrieves an private endpoint using a `privateEndpointId`. + + +## Example Usage + +```hcl +data "oci_datascience_private_endpoint" "test_data_science_private_endpoint" { + #Required + data_science_private_endpoint_id = oci_datascience_private_endpoint.test_data_science_private_endpoint.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `data_science_private_endpoint_id` - (Required) The unique ID for a Data Science private endpoint. + + +## Attributes Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create private endpoint. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user that created the private endpoint. +* `data_science_resource_type` - Data Science resource type. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` +* `description` - A user friendly description. Avoid entering confidential information. +* `display_name` - A user friendly name. It doesn't have to be unique. Avoid entering confidential information. +* `fqdn` - Accesing the Data Science resource using FQDN. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. 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` - Details of the state of Data Science private endpoint. +* `nsg_ids` - An array of network security group OCIDs. +* `state` - State of the Data Science private endpoint. +* `subnet_id` - The OCID of a subnet. +* `time_created` - The date and time that the Data Science 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 Data Science private endpoint was updated expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` + diff --git a/website/docs/d/datascience_data_science_private_endpoints.html.markdown b/website/docs/d/datascience_data_science_private_endpoints.html.markdown new file mode 100644 index 00000000000..504c5d37f61 --- /dev/null +++ b/website/docs/d/datascience_data_science_private_endpoints.html.markdown @@ -0,0 +1,67 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_private_endpoints" +sidebar_current: "docs-oci-datasource-datascience-data_science_private_endpoints" +description: |- + Provides the list of Data Science Private Endpoints in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_private_endpoints +This data source provides the list of Data Science Private Endpoints in Oracle Cloud Infrastructure Data Science service. + +Lists all Data Science private endpoints in the specified compartment. The query must include compartmentId. The query can also include one other parameter. If the query doesn't include compartmentId, or includes compartmentId with two or more other parameters, then an error is returned. + + +## Example Usage + +```hcl +data "oci_datascience_private_endpoints" "test_data_science_private_endpoints" { + #Required + compartment_id = var.compartment_id + + #Optional + created_by = var.data_science_private_endpoint_created_by + data_science_resource_type = var.data_science_private_endpoint_data_science_resource_type + display_name = var.data_science_private_endpoint_display_name + state = var.data_science_private_endpoint_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) Filter results by the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `created_by` - (Optional) Filter results by the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the resource. +* `data_science_resource_type` - (Optional) Resource types in the Data Science service such as notebooks. +* `display_name` - (Optional) Filter results by its user-friendly name. +* `state` - (Optional) The lifecycle state of the private endpoint. + + +## Attributes Reference + +The following attributes are exported: + +* `data_science_private_endpoints` - The list of data_science_private_endpoints. + +### DataSciencePrivateEndpoint Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create private endpoint. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user that created the private endpoint. +* `data_science_resource_type` - Data Science resource type. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` +* `description` - A user friendly description. Avoid entering confidential information. +* `display_name` - A user friendly name. It doesn't have to be unique. Avoid entering confidential information. +* `fqdn` - Accesing the Data Science resource using FQDN. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. 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` - Details of the state of Data Science private endpoint. +* `nsg_ids` - An array of network security group OCIDs. +* `state` - State of the Data Science private endpoint. +* `subnet_id` - The OCID of a subnet. +* `time_created` - The date and time that the Data Science 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 Data Science private endpoint was updated expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` + diff --git a/website/docs/d/datascience_model_deployment.html.markdown b/website/docs/d/datascience_model_deployment.html.markdown index 66d5ee2a8d3..6ae296c4266 100644 --- a/website/docs/d/datascience_model_deployment.html.markdown +++ b/website/docs/d/datascience_model_deployment.html.markdown @@ -59,7 +59,7 @@ The following attributes are exported: * `image_digest` - The digest of the container image. For example, `sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030` * `server_port` - The port on which the web server serving the inference is running. The port can be anything between `1024` and `65535`. The following ports cannot be used `24224`, `8446`, `8447`. * `model_configuration_details` - The model configuration details. - * `bandwidth_mbps` - The network bandwidth for the model. + * `bandwidth_mbps` - The minimum network bandwidth for the model deployment. * `instance_configuration` - The model deployment instance configuration * `instance_shape_name` - The shape used to launch the model deployment instances. * `model_deployment_instance_shape_config_details` - Details for the model-deployment instance shape configuration. diff --git a/website/docs/d/datascience_model_deployments.html.markdown b/website/docs/d/datascience_model_deployments.html.markdown index ec6a5cb96cd..7f3913e3575 100644 --- a/website/docs/d/datascience_model_deployments.html.markdown +++ b/website/docs/d/datascience_model_deployments.html.markdown @@ -78,7 +78,7 @@ The following attributes are exported: * `image_digest` - The digest of the container image. For example, `sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030` * `server_port` - The port on which the web server serving the inference is running. The port can be anything between `1024` and `65535`. The following ports cannot be used `24224`, `8446`, `8447`. * `model_configuration_details` - The model configuration details. - * `bandwidth_mbps` - The network bandwidth for the model. + * `bandwidth_mbps` - The minimum network bandwidth for the model deployment. * `instance_configuration` - The model deployment instance configuration * `instance_shape_name` - The shape used to launch the model deployment instances. * `model_deployment_instance_shape_config_details` - Details for the model-deployment instance shape configuration. diff --git a/website/docs/d/datascience_notebook_session.html.markdown b/website/docs/d/datascience_notebook_session.html.markdown index 2ec6783b419..9f26bd93ab6 100644 --- a/website/docs/d/datascience_notebook_session.html.markdown +++ b/website/docs/d/datascience_notebook_session.html.markdown @@ -44,6 +44,7 @@ The following attributes are exported: * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. * `memory_in_gbs` - The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. * `shape` - The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_configuration_details` - Details for the notebook session configuration. @@ -51,6 +52,7 @@ The following attributes are exported: * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. * `memory_in_gbs` - The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. * `shape` - The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_runtime_config_details` - Notebook Session runtime configuration details. diff --git a/website/docs/d/datascience_notebook_sessions.html.markdown b/website/docs/d/datascience_notebook_sessions.html.markdown index a6f563ba933..a50c9547469 100644 --- a/website/docs/d/datascience_notebook_sessions.html.markdown +++ b/website/docs/d/datascience_notebook_sessions.html.markdown @@ -62,6 +62,7 @@ The following attributes are exported: * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. * `memory_in_gbs` - The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. * `shape` - The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_configuration_details` - Details for the notebook session configuration. @@ -69,6 +70,7 @@ The following attributes are exported: * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. * `memory_in_gbs` - The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. * `shape` - The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_runtime_config_details` - Notebook Session runtime configuration details. diff --git a/website/docs/d/kms_ekms_private_endpoint.html.markdown b/website/docs/d/kms_ekms_private_endpoint.html.markdown new file mode 100644 index 00000000000..95d5e01b5ab --- /dev/null +++ b/website/docs/d/kms_ekms_private_endpoint.html.markdown @@ -0,0 +1,49 @@ +--- +subcategory: "Kms" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_kms_ekms_private_endpoint" +sidebar_current: "docs-oci-datasource-kms-ekms_private_endpoint" +description: |- + Provides details about a specific Ekms Private Endpoint in Oracle Cloud Infrastructure Kms service +--- + +# Data Source: oci_kms_ekms_private_endpoint +This data source provides details about a specific Ekms Private Endpoint resource in Oracle Cloud Infrastructure Kms service. + +Gets a specific EKMS private by identifier. + +## Example Usage + +```hcl +data "oci_kms_ekms_private_endpoint" "test_ekms_private_endpoint" { + #Required + ekms_private_endpoint_id = oci_kms_ekms_private_endpoint.test_ekms_private_endpoint.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ekms_private_endpoint_id` - (Required) Unique EKMS private endpoint identifier. + + +## Attributes Reference + +The following attributes are exported: + +* `ca_bundle` - CABundle to validate TLS certificate of the external key manager system in PEM format +* `compartment_id` - Identifier of the compartment this EKMS private endpoint belongs to +* `defined_tags` - Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}` +* `display_name` - Mutable name of the EKMS private endpoint +* `external_key_manager_ip` - Private IP of the external key manager system to connect to from the EKMS private endpoint +* `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` - Unique identifier that is immutable +* `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. +* `port` - The port of the external key manager system +* `private_endpoint_ip` - The IP address in the customer's VCN for the EKMS private endpoint. This is taken from subnet +* `state` - The current state of the EKMS private endpoint resource. +* `subnet_id` - Subnet Identifier +* `time_created` - The time the EKMS private endpoint was created. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string. +* `time_updated` - The time the EKMS private endpoint was updated. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string. + diff --git a/website/docs/d/kms_ekms_private_endpoints.html.markdown b/website/docs/d/kms_ekms_private_endpoints.html.markdown new file mode 100644 index 00000000000..39910fbe535 --- /dev/null +++ b/website/docs/d/kms_ekms_private_endpoints.html.markdown @@ -0,0 +1,56 @@ +--- +subcategory: "Kms" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_kms_ekms_private_endpoints" +sidebar_current: "docs-oci-datasource-kms-ekms_private_endpoints" +description: |- + Provides the list of Ekms Private Endpoints in Oracle Cloud Infrastructure Kms service +--- + +# Data Source: oci_kms_ekms_private_endpoints +This data source provides the list of Ekms Private Endpoints in Oracle Cloud Infrastructure Kms service. + +Returns a list of all the EKMS private endpoints in the specified compartment. + + +## Example Usage + +```hcl +data "oci_kms_ekms_private_endpoints" "test_ekms_private_endpoints" { + #Required + compartment_id = var.compartment_id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) The OCID of the compartment. + + +## Attributes Reference + +The following attributes are exported: + +* `ekms_private_endpoints` - The list of ekms_private_endpoints. + +### EkmsPrivateEndpoint Reference + +The following attributes are exported: + +* `ca_bundle` - CABundle to validate TLS certificate of the external key manager system in PEM format +* `compartment_id` - Identifier of the compartment this EKMS private endpoint belongs to +* `defined_tags` - Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}` +* `display_name` - Mutable name of the EKMS private endpoint +* `external_key_manager_ip` - Private IP of the external key manager system to connect to from the EKMS private endpoint +* `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` - Unique identifier that is immutable +* `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. +* `port` - The port of the external key manager system +* `private_endpoint_ip` - The IP address in the customer's VCN for the EKMS private endpoint. This is taken from subnet +* `state` - The current state of the EKMS private endpoint resource. +* `subnet_id` - Subnet Identifier +* `time_created` - The time the EKMS private endpoint was created. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string. +* `time_updated` - The time the EKMS private endpoint was updated. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string. + diff --git a/website/docs/d/kms_key.html.markdown b/website/docs/d/kms_key.html.markdown index f8600500c79..ba5493ada52 100644 --- a/website/docs/d/kms_key.html.markdown +++ b/website/docs/d/kms_key.html.markdown @@ -44,17 +44,20 @@ The following attributes are exported: * `current_key_version` - The OCID of the key version used in cryptographic operations. During key rotation, the service might be in a transitional state where this or a newer key version are used intermittently. The `currentKeyVersion` property is updated when the service is guaranteed to use the new key version for all subsequent encryption operations. * `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 for the key. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_reference_details` - Key reference data to be returned to the customer as a response. + * `external_key_id` - ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM. + * `external_key_version_id` - Key version ID associated with the external key. * `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 key. -* `is_primary` - A boolean that will be true when key is primary, and will be false when key is a replica from a primary key. +* `is_primary` - A Boolean value that indicates whether the Key belongs to primary Vault or replica vault. * `key_shape` - The cryptographic properties of a key. - * `algorithm` - The algorithm used by a key's key versions to encrypt or decrypt. + * `algorithm` - The algorithm used by a key's key versions to encrypt or decrypt. Only AES algorithm is supported for `External` keys. * `curve_id` - Supported curve IDs for ECDSA keys. * `length` - The length of the key in bytes, expressed as an integer. Supported values include the following: * AES: 16, 24, or 32 * RSA: 256, 384, or 512 * ECDSA: 32, 48, or 66 -* `protection_mode` - The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. +* `protection_mode` - The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. Oracle only hold a reference to that key. All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. * `replica_details` - Key replica details * `replication_id` - ReplicationId associated with a key operation * `restored_from_key_id` - The OCID of the key from which this key was restored. diff --git a/website/docs/d/kms_key_version.html.markdown b/website/docs/d/kms_key_version.html.markdown index d1b26bf265c..195d0c20139 100644 --- a/website/docs/d/kms_key_version.html.markdown +++ b/website/docs/d/kms_key_version.html.markdown @@ -43,8 +43,11 @@ The following arguments are supported: The following attributes are exported: * `compartment_id` - The OCID of the compartment that contains this key version. +* `external_key_reference_details` - Key reference data to be returned to the customer as a response. + * `external_key_id` - ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM. + * `external_key_version_id` - Key version ID associated with the external key. * `id` - The OCID of the key version. -* `is_primary` - A boolean that will be true when key version is primary, and will be false when key version is a replica from a primary key version. +* `is_primary` - A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault. * `key_id` - The OCID of the master encryption key associated with this key version. * `public_key` - The public key in PEM format. (This value pertains only to RSA and ECDSA keys.) * `replica_details` - KeyVersion replica details diff --git a/website/docs/d/kms_key_versions.html.markdown b/website/docs/d/kms_key_versions.html.markdown index aa89ba31636..74dc64a95c7 100644 --- a/website/docs/d/kms_key_versions.html.markdown +++ b/website/docs/d/kms_key_versions.html.markdown @@ -48,8 +48,11 @@ The following attributes are exported: The following attributes are exported: * `compartment_id` - The OCID of the compartment that contains this key version. +* `external_key_reference_details` - Key reference data to be returned to the customer as a response. + * `external_key_id` - ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM. + * `external_key_version_id` - Key version ID associated with the external key. * `id` - The OCID of the key version. -* `is_primary` - A boolean that will be true when key version is primary, and will be false when key version is a replica from a primary key version. +* `is_primary` - A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault. * `key_id` - The OCID of the master encryption key associated with this key version. * `public_key` - The public key in PEM format. (This value pertains only to RSA and ECDSA keys.) * `replica_details` - KeyVersion replica details diff --git a/website/docs/d/kms_keys.html.markdown b/website/docs/d/kms_keys.html.markdown index 8d9f001e20a..f4965cb95bf 100644 --- a/website/docs/d/kms_keys.html.markdown +++ b/website/docs/d/kms_keys.html.markdown @@ -43,7 +43,7 @@ The following arguments are supported: * `curve_id` - (Optional) The curve ID of the keys. (This pertains only to ECDSA keys.) * `length` - (Optional) The length of the key in bytes, expressed as an integer. Supported values include 16, 24, or 32. * `management_endpoint` - (Required) The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint. -* `protection_mode` - (Optional) A key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. +* `protection_mode` - (Optional) A key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. Oracle only hold a reference to that key. All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. ## Attributes Reference @@ -60,17 +60,20 @@ The following attributes are exported: * `current_key_version` - The OCID of the key version used in cryptographic operations. During key rotation, the service might be in a transitional state where this or a newer key version are used intermittently. The `currentKeyVersion` property is updated when the service is guaranteed to use the new key version for all subsequent encryption operations. * `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 for the key. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_reference_details` - Key reference data to be returned to the customer as a response. + * `external_key_id` - ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM. + * `external_key_version_id` - Key version ID associated with the external key. * `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 key. -* `is_primary` - A boolean that will be true when key is primary, and will be false when key is a replica from a primary key. +* `is_primary` - A Boolean value that indicates whether the Key belongs to primary Vault or replica vault. * `key_shape` - The cryptographic properties of a key. - * `algorithm` - The algorithm used by a key's key versions to encrypt or decrypt. + * `algorithm` - The algorithm used by a key's key versions to encrypt or decrypt. Only AES algorithm is supported for `External` keys. * `curve_id` - Supported curve IDs for ECDSA keys. * `length` - The length of the key in bytes, expressed as an integer. Supported values include the following: * AES: 16, 24, or 32 * RSA: 256, 384, or 512 * ECDSA: 32, 48, or 66 -* `protection_mode` - The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. +* `protection_mode` - The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. Oracle only hold a reference to that key. All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. * `replica_details` - Key replica details * `replication_id` - ReplicationId associated with a key operation * `state` - The key's current lifecycle state. Example: `ENABLED` diff --git a/website/docs/d/kms_replication_status.html.markdown b/website/docs/d/kms_replication_status.html.markdown index 6356370b056..6a22bf2a822 100644 --- a/website/docs/d/kms_replication_status.html.markdown +++ b/website/docs/d/kms_replication_status.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: The following attributes are exported: -* `replica_details` - +* `replica_details` - Replica Details. * `region` - The replica region * `status` - Replication status associated with a replicationId diff --git a/website/docs/d/kms_vault.html.markdown b/website/docs/d/kms_vault.html.markdown index f28464fbf71..195c3d4642f 100644 --- a/website/docs/d/kms_vault.html.markdown +++ b/website/docs/d/kms_vault.html.markdown @@ -42,13 +42,20 @@ The following attributes are exported: * `crypto_endpoint` - The service endpoint to perform cryptographic operations against. Cryptographic operations include [Encrypt](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/EncryptedData/Encrypt), [Decrypt](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/DecryptedData/Decrypt), and [GenerateDataEncryptionKey](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) operations. * `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 for the vault. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_manager_metadata_summary` - Summary about metadata of external key manager to be returned to the customer as a response. + * `external_vault_endpoint_url` - URL of the vault on external key manager. + * `oauth_metadata_summary` - Summary about authorization to be returned to the customer as a response. + * `client_app_id` - ID of the client app created in IDP. + * `idcs_account_name_url` - Base URL of the IDCS account where confidential client app is created. + * `private_endpoint_id` - OCID of the private endpoint. + * `vendor` - Vendor of the external key manager. * `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 vault. -* `is_primary` - A boolean that will be true when vault is primary, and will be false when vault is a replica from a primary vault. +* `is_primary` - A Boolean value that indicates whether the Vault is primary Vault or replica Vault. * `management_endpoint` - The service endpoint to perform management operations against. Management operations include "Create," "Update," "List," "Get," and "Delete" operations. * `replica_details` - Vault replica details * `replication_id` - ReplicationId associated with a vault operation -* `restored_from_vault_id` - The OCID of the vault from which this vault was restored, if it was restored from a backup file. If you restore a vault to the same region, the vault retains the same OCID that it had when you backed up the vault. +* `restored_from_vault_id` - The OCID of the vault from which this vault was restored, if it was restored from a backup file. If you restore a vault to the same region, the vault retains the same OCID that it had when you backed up the vault. * `state` - The vault's current lifecycle state. Example: `DELETED` * `restore_from_file` - Details where vault was backed up. * `content_length` - content length of vault's backup binary file diff --git a/website/docs/d/kms_vault_replicas.html.markdown b/website/docs/d/kms_vault_replicas.html.markdown index adb78cbebe2..56f0e495dae 100644 --- a/website/docs/d/kms_vault_replicas.html.markdown +++ b/website/docs/d/kms_vault_replicas.html.markdown @@ -46,6 +46,6 @@ The following attributes are exported: * `crypto_endpoint` - The vault replica's crypto endpoint * `management_endpoint` - The vault replica's management endpoint -* `region` - Region to which vault is replicated to -* `status` - The vault replica's status +* `region` - Region to which vault is replicated to +* `status` - Status of the Vault diff --git a/website/docs/d/kms_vaults.html.markdown b/website/docs/d/kms_vaults.html.markdown index aeff0dd5a68..ff00df74e31 100644 --- a/website/docs/d/kms_vaults.html.markdown +++ b/website/docs/d/kms_vaults.html.markdown @@ -48,13 +48,20 @@ The following attributes are exported: * `crypto_endpoint` - The service endpoint to perform cryptographic operations against. Cryptographic operations include [Encrypt](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/EncryptedData/Encrypt), [Decrypt](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/DecryptedData/Decrypt), and [GenerateDataEncryptionKey](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) operations. * `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 for the vault. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_manager_metadata_summary` - Summary about metadata of external key manager to be returned to the customer as a response. + * `external_vault_endpoint_url` - URL of the vault on external key manager. + * `oauth_metadata_summary` - Summary about authorization to be returned to the customer as a response. + * `client_app_id` - ID of the client app created in IDP. + * `idcs_account_name_url` - Base URL of the IDCS account where confidential client app is created. + * `private_endpoint_id` - OCID of the private endpoint. + * `vendor` - Vendor of the external key manager. * `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 vault. -* `is_primary` - A boolean that will be true when vault is primary, and will be false when vault is a replica from a primary vault. +* `is_primary` - A Boolean value that indicates whether the Vault is primary Vault or replica Vault. * `management_endpoint` - The service endpoint to perform management operations against. Management operations include "Create," "Update," "List," "Get," and "Delete" operations. * `replica_details` - Vault replica details * `replication_id` - ReplicationId associated with a vault operation -* `restored_from_vault_id` - The OCID of the vault from which this vault was restored, if it was restored from a backup file. If you restore a vault to the same region, the vault retains the same OCID that it had when you backed up the vault. +* `restored_from_vault_id` - The OCID of the vault from which this vault was restored, if it was restored from a backup file. If you restore a vault to the same region, the vault retains the same OCID that it had when you backed up the vault. * `state` - The vault's current lifecycle state. Example: `DELETED` * `time_created` - The date and time this vault was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` * `time_of_deletion` - An optional property to indicate when to delete the vault, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` diff --git a/website/docs/d/mysql_replica.html.markdown b/website/docs/d/mysql_replica.html.markdown index b03325ba4e7..2b90248b30a 100644 --- a/website/docs/d/mysql_replica.html.markdown +++ b/website/docs/d/mysql_replica.html.markdown @@ -34,6 +34,7 @@ The following attributes are exported: * `availability_domain` - The name of the Availability Domain the read replica is located in. * `compartment_id` - The OCID of the compartment that contains the read replica. +* `configuration_id` - The OCID of the Configuration currently in use by the read replica. * `db_system_id` - The OCID of the DB System the read replica is associated with. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `description` - User provided description of the read replica. @@ -44,9 +45,14 @@ The following attributes are exported: * `ip_address` - The IP address the read replica is configured to listen on. * `is_delete_protected` - Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If the DB System is delete protected, read replicas can still be deleted individually if they are not delete protected themselves. * `lifecycle_details` - A message describing the state of the read replica. -* `mysql_version` - The MySQL version used by the read replica. +* `mysql_version` - The MySQL version currently in use by the read replica. * `port` - The port the read replica is configured to listen on. * `port_x` - The TCP network port on which X Plugin listens for connections. This is the X Plugin equivalent of port. +* `replica_overrides` - By default a read replica inherits the MySQL version, shape, and configuration of the source DB system. If you want to override any of these, provide values in the properties, mysqlVersion, shapeName, and configurationId. If you set a property value to "", then the value is inherited from its source DB system. + * `configuration_id` - The OCID of the Configuration to be used by the read replica. + * `mysql_version` - The MySQL version to be used by the read replica. + * `shape_name` - The shape to be used by the read replica. The shape determines the resources allocated: CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. To get a list of shapes, use the [ListShapes](https://docs.cloud.oracle.com/iaas/api/#/en/mysql/20190415/ShapeSummary/ListShapes) operation. +* `shape_name` - The shape currently in use by the read replica. The shape determines the resources allocated: CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. To get a list of shapes, use the [ListShapes](https://docs.cloud.oracle.com/iaas/api/#/en/mysql/20190415/ShapeSummary/ListShapes) operation. * `state` - The state of the read replica. * `time_created` - The date and time the read replica was created, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339). * `time_updated` - The time the read replica was last updated, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339). diff --git a/website/docs/d/mysql_replicas.html.markdown b/website/docs/d/mysql_replicas.html.markdown index ea0bfd46bd0..d784e25fa10 100644 --- a/website/docs/d/mysql_replicas.html.markdown +++ b/website/docs/d/mysql_replicas.html.markdown @@ -20,8 +20,10 @@ data "oci_mysql_replicas" "test_replicas" { compartment_id = var.compartment_id #Optional + configuration_id = oci_mysql_mysql_configuration.test_mysql_configuration.id db_system_id = oci_mysql_mysql_db_system.test_mysql_db_system.id display_name = var.replica_display_name + is_up_to_date = var.replica_is_up_to_date replica_id = oci_mysql_replica.test_replica.id state = var.replica_state } @@ -32,8 +34,10 @@ data "oci_mysql_replicas" "test_replicas" { The following arguments are supported: * `compartment_id` - (Required) The compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `configuration_id` - (Optional) The requested Configuration instance. * `db_system_id` - (Optional) The DB System [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). * `display_name` - (Optional) A filter to return only the resource matching the given display name exactly. +* `is_up_to_date` - (Optional) Filter instances if they are using the latest revision of the Configuration they are associated with. * `replica_id` - (Optional) The read replica [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). * `state` - (Optional) The LifecycleState of the read replica. @@ -50,6 +54,7 @@ The following attributes are exported: * `availability_domain` - The name of the Availability Domain the read replica is located in. * `compartment_id` - The OCID of the compartment that contains the read replica. +* `configuration_id` - The OCID of the Configuration currently in use by the read replica. * `db_system_id` - The OCID of the DB System the read replica is associated with. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `description` - User provided description of the read replica. @@ -60,9 +65,14 @@ The following attributes are exported: * `ip_address` - The IP address the read replica is configured to listen on. * `is_delete_protected` - Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If the DB System is delete protected, read replicas can still be deleted individually if they are not delete protected themselves. * `lifecycle_details` - A message describing the state of the read replica. -* `mysql_version` - The MySQL version used by the read replica. +* `mysql_version` - The MySQL version currently in use by the read replica. * `port` - The port the read replica is configured to listen on. * `port_x` - The TCP network port on which X Plugin listens for connections. This is the X Plugin equivalent of port. +* `replica_overrides` - By default a read replica inherits the MySQL version, shape, and configuration of the source DB system. If you want to override any of these, provide values in the properties, mysqlVersion, shapeName, and configurationId. If you set a property value to "", then the value is inherited from its source DB system. + * `configuration_id` - The OCID of the Configuration to be used by the read replica. + * `mysql_version` - The MySQL version to be used by the read replica. + * `shape_name` - The shape to be used by the read replica. The shape determines the resources allocated: CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. To get a list of shapes, use the [ListShapes](https://docs.cloud.oracle.com/iaas/api/#/en/mysql/20190415/ShapeSummary/ListShapes) operation. +* `shape_name` - The shape currently in use by the read replica. The shape determines the resources allocated: CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. To get a list of shapes, use the [ListShapes](https://docs.cloud.oracle.com/iaas/api/#/en/mysql/20190415/ShapeSummary/ListShapes) operation. * `state` - The state of the read replica. * `time_created` - The date and time the read replica was created, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339). * `time_updated` - The time the read replica was last updated, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339). diff --git a/website/docs/d/queue_queue.html.markdown b/website/docs/d/queue_queue.html.markdown index 1d8831d2607..044e661d187 100644 --- a/website/docs/d/queue_queue.html.markdown +++ b/website/docs/d/queue_queue.html.markdown @@ -10,7 +10,7 @@ description: |- # Data Source: oci_queue_queue This data source provides details about a specific Queue resource in Oracle Cloud Infrastructure Queue service. -Gets a Queue by identifier +Gets a queue by identifier. ## Example Usage @@ -25,27 +25,28 @@ data "oci_queue_queue" "test_queue" { The following arguments are supported: -* `queue_id` - (Required) unique Queue identifier +* `queue_id` - (Required) The unique queue identifier. ## Attributes Reference The following attributes are exported: -* `compartment_id` - Compartment Identifier -* `custom_encryption_key_id` - Id of the custom master encryption key which will be used to encrypt messages content +* `channel_consumption_limit` - The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can't exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue's resources. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the queue. +* `custom_encryption_key_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom encryption key to be used to encrypt messages content. * `dead_letter_queue_delivery_count` - The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` -* `display_name` - Queue Identifier, can be renamed +* `display_name` - A user-friendly name for the queue. Does not have to be unique, and it's changeable. Avoid entering confidential information. * `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` - Unique identifier that is immutable on creation -* `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. +* `id` - A unique identifier for the queue that is immutable on creation. +* `lifecycle_details` - Any additional details about the current state of the queue. * `messages_endpoint` - The endpoint to use to consume or publish messages in the queue. * `retention_in_seconds` - The retention period of the messages in the queue, in seconds. -* `state` - The current state of the Queue. +* `state` - The current state of the queue. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` -* `time_created` - The time the the Queue was created. An RFC3339 formatted datetime string -* `time_updated` - The time the Queue was updated. An RFC3339 formatted datetime string +* `time_created` - The time that the queue was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2018-04-20T00:00:07.405Z` +* `time_updated` - The time that the queue was updated, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2018-04-20T00:00:07.405Z` * `timeout_in_seconds` - The default polling timeout of the messages in the queue, in seconds. -* `visibility_in_seconds` - The default visibility of the messages consumed from the queue. +* `visibility_in_seconds` - The default visibility timeout of the messages consumed from the queue, in seconds. diff --git a/website/docs/d/queue_queues.html.markdown b/website/docs/d/queue_queues.html.markdown index 4a89982bd88..3a3f1a4062b 100644 --- a/website/docs/d/queue_queues.html.markdown +++ b/website/docs/d/queue_queues.html.markdown @@ -10,7 +10,7 @@ description: |- # Data Source: oci_queue_queues This data source provides the list of Queues in Oracle Cloud Infrastructure Queue service. -Returns a list of Queues. +Returns a list of queues. ## Example Usage @@ -30,9 +30,9 @@ data "oci_queue_queues" "test_queues" { The following arguments are supported: -* `compartment_id` - (Optional) The ID of the compartment in which to list resources. +* `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 entire display name given. -* `id` - (Optional) unique Queue identifier +* `id` - (Optional) The unique queue identifier. * `state` - (Optional) A filter to return only resources their lifecycleState matches the given lifecycleState. @@ -46,20 +46,21 @@ The following attributes are exported: The following attributes are exported: -* `compartment_id` - Compartment Identifier -* `custom_encryption_key_id` - Id of the custom master encryption key which will be used to encrypt messages content +* `channel_consumption_limit` - The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can't exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue's resources. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the queue. +* `custom_encryption_key_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom encryption key to be used to encrypt messages content. * `dead_letter_queue_delivery_count` - The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` -* `display_name` - Queue Identifier, can be renamed +* `display_name` - A user-friendly name for the queue. Does not have to be unique, and it's changeable. Avoid entering confidential information. * `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` - Unique identifier that is immutable on creation -* `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. +* `id` - A unique identifier for the queue that is immutable on creation. +* `lifecycle_details` - Any additional details about the current state of the queue. * `messages_endpoint` - The endpoint to use to consume or publish messages in the queue. * `retention_in_seconds` - The retention period of the messages in the queue, in seconds. -* `state` - The current state of the Queue. +* `state` - The current state of the queue. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` -* `time_created` - The time the the Queue was created. An RFC3339 formatted datetime string -* `time_updated` - The time the Queue was updated. An RFC3339 formatted datetime string +* `time_created` - The time that the queue was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2018-04-20T00:00:07.405Z` +* `time_updated` - The time that the queue was updated, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2018-04-20T00:00:07.405Z` * `timeout_in_seconds` - The default polling timeout of the messages in the queue, in seconds. -* `visibility_in_seconds` - The default visibility of the messages consumed from the queue. +* `visibility_in_seconds` - The default visibility timeout of the messages consumed from the queue, in seconds. diff --git a/website/docs/guides/resource_discovery.html.markdown b/website/docs/guides/resource_discovery.html.markdown index 737159601d4..6bb4bc64180 100644 --- a/website/docs/guides/resource_discovery.html.markdown +++ b/website/docs/guides/resource_discovery.html.markdown @@ -143,6 +143,7 @@ Make sure the `output_path` is empty before running resource discovery * `cloud_bridge` - Discovers cloud_bridge resources within the specified compartment * `cloud_guard` - Discovers cloud guard resources within the specified compartment * `cloud_migrations` - Discovers cloud_migrations resources within the specified compartment + * `compute_cloud_at_customer` - Discovers compute_cloud_at_customer resources within the specified compartment * `container_instances` - Discovers container_instances resources within the specified compartment * `containerengine` - Discovers containerengine resources within the specified compartment * `core` - Discovers compute, block storage, and networking resources within the specified compartment @@ -471,6 +472,11 @@ cloud_migrations * oci\_cloud\_migrations\_migration * oci\_cloud\_migrations\_replication\_schedule +compute_cloud_at_customer + +* oci\_compute\_cloud\_at\_customer\_ccc\_upgrade\_schedule +* oci\_compute\_cloud\_at\_customer\_ccc\_infrastructure + container_instances * oci\_container\_instances\_container\_instance @@ -642,6 +648,7 @@ datascience * oci\_datascience\_job\_run * oci\_datascience\_pipeline\_run * oci\_datascience\_pipeline +* oci\_datascience\_data\_science\_private\_endpoint * oci\_datascience\_model\_version\_set devops @@ -804,6 +811,7 @@ kms * oci\_kms\_vault * oci\_kms\_sign * oci\_kms\_verify +* oci\_kms\_ekms\_private\_endpoint license_manager diff --git a/website/docs/r/compute_cloud_at_customer_ccc_infrastructure.html.markdown b/website/docs/r/compute_cloud_at_customer_ccc_infrastructure.html.markdown new file mode 100644 index 00000000000..42e524b0591 --- /dev/null +++ b/website/docs/r/compute_cloud_at_customer_ccc_infrastructure.html.markdown @@ -0,0 +1,128 @@ +--- +subcategory: "Compute Cloud At Customer" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_compute_cloud_at_customer_ccc_infrastructure" +sidebar_current: "docs-oci-resource-compute_cloud_at_customer-ccc_infrastructure" +description: |- + Provides the Ccc Infrastructure resource in Oracle Cloud Infrastructure Compute Cloud At Customer service +--- + +# oci_compute_cloud_at_customer_ccc_infrastructure +This resource provides the Ccc Infrastructure resource in Oracle Cloud Infrastructure Compute Cloud At Customer service. + +Creates a Compute Cloud@Customer infrastructure. Once created, Oracle Services +must connect the rack in the data center to this Oracle Cloud Infrastructure resource. + + +## Example Usage + +```hcl +resource "oci_compute_cloud_at_customer_ccc_infrastructure" "test_ccc_infrastructure" { + #Required + compartment_id = var.compartment_id + display_name = var.ccc_infrastructure_display_name + subnet_id = oci_core_subnet.test_subnet.id + + #Optional + ccc_upgrade_schedule_id = oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule.id + connection_details = var.ccc_infrastructure_connection_details + connection_state = var.ccc_infrastructure_connection_state + defined_tags = {"foo-namespace.bar-key"= "value"} + description = var.ccc_infrastructure_description + freeform_tags = {"bar-key"= "value"} +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ccc_upgrade_schedule_id` - (Optional) (Updatable) Schedule used for upgrades. If no schedule is associated with the infrastructure, it can be upgraded at any time. +* `compartment_id` - (Required) (Updatable) The compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with the infrastructure. +* `connection_details` - (Optional) (Updatable) A message describing the current connection state in more detail. +* `connection_state` - (Optional) (Updatable) The current connection state of the Compute Cloud@Customer infrastructure. This value will default to REJECT if the value is not provided. The only valid value at creation time is REJECT. +* `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - (Optional) (Updatable) A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. Avoid entering confidential information. +* `display_name` - (Required) (Updatable) The name that will be used to display the Compute Cloud@Customer infrastructure in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. Avoid entering confidential information. +* `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"}` +* `subnet_id` - (Required) (Updatable) Identifier for network subnet that will be used to communicate with Compute Cloud@Customer infrastructure. + + +** 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: + +* `ccc_upgrade_schedule_id` - Schedule used for upgrades. If no schedule is associated with the infrastructure, it can be updated at any time. +* `compartment_id` - The infrastructure compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `connection_details` - A message describing the current connection state in more detail. +* `connection_state` - The current connection state of the infrastructure. A user can only update it from REQUEST to READY or from any state back to REJECT. The system automatically handles the REJECT to REQUEST, READY to CONNECTED, or CONNECTED to DISCONNECTED transitions. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - A mutable client-meaningful text description of the Compute Cloud@Customer infrastructure. Avoid entering confidential information. +* `display_name` - The name that will be used to display the Compute Cloud@Customer infrastructure in the Oracle Cloud Infrastructure console. Does not have to be unique and can be changed. Avoid entering confidential information. +* `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` - The Compute Cloud@Customer infrastructure [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). This cannot be changed once created. +* `infrastructure_inventory` - Inventory for a Compute Cloud@Customer infrastructure. This information cannot be updated and is from the infrastructure. The information will only be available after the connectionState is transitioned to CONNECTED. + * `capacity_storage_tray_count` - The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for capacity storage. + * `compute_node_count` - The number of compute nodes that are available and usable on the Compute Cloud@Customer infrastructure rack. There is no distinction of compute node type in this information. + * `management_node_count` - The number of management nodes that are available and in active use on the Compute Cloud@Customer infrastructure rack. + * `performance_storage_tray_count` - The number of storage trays in the Compute Cloud@Customer infrastructure rack that are designated for performance storage. + * `serial_number` - The serial number of the Compute Cloud@Customer infrastructure rack. +* `infrastructure_network_configuration` - Configuration information for the Compute Cloud@Customer infrastructure. This network configuration information cannot be updated and is retrieved from the data center. The information will only be available after the connectionState is transitioned to CONNECTED. + * `dns_ips` - The domain name system (DNS) addresses that the Compute Cloud@Customer infrastructure uses for the data center network. + * `infrastructure_routing_dynamic` - Dynamic routing information for the Compute Cloud@Customer infrastructure. + * `bgp_topology` - The topology in use for the Border Gateway Protocol (BGP) configuration. + * `oracle_asn` - The Oracle Autonomous System Number (ASN) to control routing and exchange information within the dynamic routing configuration. + * `peer_information` - The list of peer devices in the dynamic routing configuration. + * `asn` - The Autonomous System Number (ASN) of the peer network. + * `ip` - Neighbor Border Gateway Protocal (BGP) IP address. The IP address usually refers to the customer data center router. + * `infrastructure_routing_static` - Static routing information for a rack. + * `uplink_hsrp_group` - The uplink Hot Standby Router Protocol (HSRP) group value for the switch in the Compute Cloud@Customer infrastructure. + * `uplink_vlan` - The virtual local area network (VLAN) identifier used to connect to the uplink (only access mode is supported). + * `management_nodes` - Information about the management nodes that are provisioned in the Compute Cloud@Customer infrastructure. + * `hostname` - Hostname for interface to the management node. + * `ip` - Address of the management node. + * `mgmt_vip_hostname` - The hostname corresponding to the virtual IP (VIP) address of the management nodes. + * `mgmt_vip_ip` - The IP address used as the virtual IP (VIP) address of the management nodes. + * `spine_ips` - Addresses of the network spine switches. + * `spine_vip` - The spine switch public virtual IP (VIP). Traffic routed to the Compute Cloud@Customer infrastructure and and virtual cloud networks (VCNs) should have this address as next hop. + * `uplink_domain` - Domain name to be used as the base domain for the internal network and by public facing services. + * `uplink_gateway_ip` - Uplink gateway in the datacenter network that the Compute Cloud@Customer connects to. + * `uplink_netmask` - Netmask of the subnet that the Compute Cloud@Customer infrastructure is connected to. + * `uplink_port_count` - Number of uplink ports per spine switch. Connectivity is identical on both spine switches. For example, if input is two 100 gigabyte ports; then port-1 and port-2 on both spines will be configured. + * `uplink_port_forward_error_correction` - The port forward error correction (FEC) setting for the uplink port on the Compute Cloud@Customer infrastructure. + * `uplink_port_speed_in_gbps` - Uplink port speed defined in gigabytes per second. All uplink ports must have identical speed. + * `uplink_vlan_mtu` - The virtual local area network (VLAN) maximum transmission unit (MTU) size for the uplink ports. +* `lifecycle_details` - A message describing the current lifecycle state in more detail. For example, this can be used to provide actionable information for a resource that is in a Failed state. +* `provisioning_fingerprint` - Fingerprint of a Compute Cloud@Customer infrastructure in a data center generated during the initial connection to this resource. The fingerprint should be verified by the administrator when changing the connectionState from REQUEST to READY. +* `provisioning_pin` - Code that is required for service personnel to connect a Compute Cloud@Customer infrastructure in a data center to this resource. This code will only be available when the connectionState is REJECT (usually at create time of the Compute Cloud@Customer infrastructure). +* `short_name` - The Compute Cloud@Customer infrastructure short name. This cannot be changed once created. The short name is used to refer to the infrastructure in several contexts and is unique. +* `state` - The current state of the Compute Cloud@Customer infrastructure. +* `subnet_id` - [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the network subnet that is used to communicate with Compute Cloud@Customer infrastructure. +* `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` - Compute Cloud@Customer infrastructure creation date and time, using an RFC3339 formatted datetime string. +* `time_updated` - Compute Cloud@Customer infrastructure updated date and time, using an RFC3339 formatted datetime string. +* `upgrade_information` - Upgrade information that relates to a Compute Cloud@Customer infrastructure. This information cannot be updated. + * `current_version` - The current version of software installed on the Compute Cloud@Customer infrastructure. + * `is_active` - Indication that the Compute Cloud@Customer infrastructure is in the process of an upgrade or an upgrade activity (such as preloading upgrade images). + * `scheduled_upgrade_duration` - Expected duration of Compute Cloud@Customer infrastructure scheduled upgrade. The actual upgrade time might be longer or shorter than this duration depending on rack activity, this is only an estimate. + * `time_of_scheduled_upgrade` - Compute Cloud@Customer infrastructure next upgrade time. The rack might have performance impacts during this time. + +## 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 Ccc Infrastructure + * `update` - (Defaults to 20 minutes), when updating the Ccc Infrastructure + * `delete` - (Defaults to 20 minutes), when destroying the Ccc Infrastructure + + +## Import + +CccInfrastructures can be imported using the `id`, e.g. + +``` +$ terraform import oci_compute_cloud_at_customer_ccc_infrastructure.test_ccc_infrastructure "id" +``` + diff --git a/website/docs/r/compute_cloud_at_customer_ccc_upgrade_schedule.html.markdown b/website/docs/r/compute_cloud_at_customer_ccc_upgrade_schedule.html.markdown new file mode 100644 index 00000000000..7815920a108 --- /dev/null +++ b/website/docs/r/compute_cloud_at_customer_ccc_upgrade_schedule.html.markdown @@ -0,0 +1,97 @@ +--- +subcategory: "Compute Cloud At Customer" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_compute_cloud_at_customer_ccc_upgrade_schedule" +sidebar_current: "docs-oci-resource-compute_cloud_at_customer-ccc_upgrade_schedule" +description: |- + Provides the Ccc Upgrade Schedule resource in Oracle Cloud Infrastructure Compute Cloud At Customer service +--- + +# oci_compute_cloud_at_customer_ccc_upgrade_schedule +This resource provides the Ccc Upgrade Schedule resource in Oracle Cloud Infrastructure Compute Cloud At Customer service. + +Creates a new Compute Cloud@Customer upgrade schedule. + + +## Example Usage + +```hcl +resource "oci_compute_cloud_at_customer_ccc_upgrade_schedule" "test_ccc_upgrade_schedule" { + #Required + compartment_id = var.compartment_id + display_name = var.ccc_upgrade_schedule_display_name + events { + #Required + description = var.ccc_upgrade_schedule_events_description + schedule_event_duration = var.ccc_upgrade_schedule_events_schedule_event_duration + time_start = var.ccc_upgrade_schedule_events_time_start + + #Optional + schedule_event_recurrences = var.ccc_upgrade_schedule_events_schedule_event_recurrences + } + + #Optional + defined_tags = {"foo-namespace.bar-key"= "value"} + description = var.ccc_upgrade_schedule_description + freeform_tags = {"bar-key"= "value"} +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) (Updatable) Compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the Compute Cloud@Customer Upgrade Schedule. +* `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - (Optional) (Updatable) An optional description of the Compute Cloud@Customer upgrade schedule. Avoid entering confidential information. +* `display_name` - (Required) (Updatable) Compute Cloud@Customer upgrade schedule display name. Avoid entering confidential information. +* `events` - (Required) (Updatable) List of preferred times for Compute Cloud@Customer infrastructure to be upgraded. + * `description` - (Required) (Updatable) A description of the Compute Cloud@Customer upgrade schedule time block. + * `schedule_event_duration` - (Required) (Updatable) The duration of this block of time. The duration must be specified and be of the ISO-8601 format for durations. + * `schedule_event_recurrences` - (Optional) (Updatable) Frequency of recurrence of schedule block. When this field is not included, the event is assumed to be a one time occurrence. The frequency field is strictly parsed and must conform to RFC-5545 formatting for recurrences. + * `time_start` - (Required) (Updatable) The date and time when the Compute Cloud@Customer upgrade schedule event starts, inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, this is the date that a recurrence can start being applied. +* `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"}` + + +** 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` - Compartment [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) for the Compute Cloud@Customer upgrade schedule. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - An optional description of the Compute Cloud@Customer upgrade schedule. Avoid entering confidential information. +* `display_name` - Compute Cloud@Customer upgrade schedule display name. Avoid entering confidential information. +* `events` - List of preferred times for Compute Cloud@Customer infrastructures associated with this schedule to be upgraded. + * `description` - A description of the Compute Cloud@Customer upgrade schedule time block. + * `name` - Generated name associated with the event. + * `schedule_event_duration` - The duration of this block of time. The duration must be specified and be of the ISO-8601 format for durations. + * `schedule_event_recurrences` - Frequency of recurrence of schedule block. When this field is not included, the event is assumed to be a one time occurrence. The frequency field is strictly parsed and must conform to RFC-5545 formatting for recurrences. + * `time_start` - The date and time when the Compute Cloud@Customer upgrade schedule event starts, inclusive. An RFC3339 formatted UTC datetime string. For an event with recurrences, this is the date that a recurrence can start being applied. +* `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` - Upgrade schedule [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). This cannot be changed once created. +* `infrastructure_ids` - List of Compute Cloud@Customer infrastructure [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) that are using this upgrade schedule. +* `lifecycle_details` - A message describing the current state in more detail. For example, the message can be used to provide actionable information for a resource in a Failed state. +* `state` - Lifecycle state of the resource. +* `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 time the upgrade schedule was created, using an RFC3339 formatted datetime string. +* `time_updated` - The time the upgrade schedule was updated, using an RFC3339 formatted datetime string. + +## 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 Ccc Upgrade Schedule + * `update` - (Defaults to 20 minutes), when updating the Ccc Upgrade Schedule + * `delete` - (Defaults to 20 minutes), when destroying the Ccc Upgrade Schedule + + +## Import + +CccUpgradeSchedules can be imported using the `id`, e.g. + +``` +$ terraform import oci_compute_cloud_at_customer_ccc_upgrade_schedule.test_ccc_upgrade_schedule "id" +``` + diff --git a/website/docs/r/database_autonomous_container_database.html.markdown b/website/docs/r/database_autonomous_container_database.html.markdown index 447655a3a98..60152e1c41e 100644 --- a/website/docs/r/database_autonomous_container_database.html.markdown +++ b/website/docs/r/database_autonomous_container_database.html.markdown @@ -238,8 +238,12 @@ The following attributes are exported: * `provisionable_cpus` - An array of CPU values that can be used to successfully provision a single Autonomous Database.\ For Autonomous Database on Dedicated Exadata Infrastructure, the CPU type (OCPUs or ECPUs) is determined by the parent Autonomous Exadata VM Cluster's compute model. * `provisioned_cpus` - The number of CPUs provisioned in an Autonomous Container Database. * `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. See [Compute Models in Autonomous Database on Dedicated Exadata Infrastructure](https://docs.oracle.com/en/cloud/paas/autonomous-database/dedicated/adbak) for more details. + * 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. diff --git a/website/docs/r/database_autonomous_database.html.markdown b/website/docs/r/database_autonomous_database.html.markdown index cd5023ad310..7054134fb8a 100644 --- a/website/docs/r/database_autonomous_database.html.markdown +++ b/website/docs/r/database_autonomous_database.html.markdown @@ -66,6 +66,12 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { ocpu_count = var.autonomous_database_ocpu_count private_endpoint_label = var.autonomous_database_private_endpoint_label refreshable_mode = var.autonomous_database_refreshable_mode + resource_pool_leader_id = oci_database_resource_pool_leader.test_resource_pool_leader.id + resource_pool_summary { + #Optional + is_disabled = var.autonomous_database_resource_pool_summary_is_disabled + pool_size = var.autonomous_database_resource_pool_summary_pool_size + } scheduled_operations { #Required day_of_week { @@ -184,7 +190,7 @@ The following arguments are supported: * `operations_insights_status` - (Optional) (Updatable) Status of Operations Insights for this Autonomous Database. Values supported are `ENABLED` and `NOT_ENABLED` * `private_endpoint_label` - (Optional) (Updatable) The private endpoint label for the resource. * `refreshable_mode` - (Applicable when source=CLONE_TO_REFRESHABLE) (Updatable) The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous Database. -* `remote_disaster_recovery_type` - (Required when source=CROSS_REGION_DISASTER_RECOVERY) Indicates the cross-region disaster recovery (DR) type of the standby 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. +* `remote_disaster_recovery_type` - (Required when source=CROSS_REGION_DISASTER_RECOVERY) Indicates the cross-region disaster recovery (DR) type of the standby 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. * `scheduled_operations` - (Optional) (Updatable) The list of scheduled operations. 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. @@ -402,7 +408,7 @@ 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. + * `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. * `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. diff --git a/website/docs/r/datascience_data_science_private_endpoint.html.markdown b/website/docs/r/datascience_data_science_private_endpoint.html.markdown new file mode 100644 index 00000000000..3f6781a1369 --- /dev/null +++ b/website/docs/r/datascience_data_science_private_endpoint.html.markdown @@ -0,0 +1,88 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_private_endpoint" +sidebar_current: "docs-oci-resource-datascience-data_science_private_endpoint" +description: |- + Provides the Data Science Private Endpoint resource in Oracle Cloud Infrastructure Data Science service +--- + +# oci_datascience_private_endpoint +This resource provides the Data Science Private Endpoint resource in Oracle Cloud Infrastructure Data Science service. + +Creates a Data Science private endpoint to be used by a Data Science resource. + + +## Example Usage + +```hcl +resource "oci_datascience_private_endpoint" "test_data_science_private_endpoint" { + #Required + compartment_id = var.compartment_id + data_science_resource_type = var.data_science_private_endpoint_data_science_resource_type + subnet_id = oci_core_subnet.test_subnet.id + + #Optional + defined_tags = {"Operations.CostCenter"= "42"} + description = var.data_science_private_endpoint_description + display_name = var.data_science_private_endpoint_display_name + freeform_tags = {"Department"= "Finance"} + nsg_ids = var.data_science_private_endpoint_nsg_ids + sub_domain = var.data_science_private_endpoint_sub_domain +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create the private endpoint. +* `data_science_resource_type` - (Required) Data Science resource type. +* `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` +* `description` - (Optional) (Updatable) A user friendly description. Avoid entering confidential information. +* `display_name` - (Optional) (Updatable) A user friendly name. It doesn't have to be unique. 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. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `nsg_ids` - (Optional) (Updatable) An array of network security group OCIDs. +* `sub_domain` - (Optional) Subdomain for a private endpoint FQDN. +* `subnet_id` - (Required) The OCID of the subnet. + + +** 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](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where you want to create private endpoint. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user that created the private endpoint. +* `data_science_resource_type` - Data Science resource type. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` +* `description` - A user friendly description. Avoid entering confidential information. +* `display_name` - A user friendly name. It doesn't have to be unique. Avoid entering confidential information. +* `fqdn` - Accesing the Data Science resource using FQDN. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. 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` - Details of the state of Data Science private endpoint. +* `nsg_ids` - An array of network security group OCIDs. +* `state` - State of the Data Science private endpoint. +* `subnet_id` - The OCID of a subnet. +* `time_created` - The date and time that the Data Science 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 Data Science 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 Data Science Private Endpoint + * `update` - (Defaults to 20 minutes), when updating the Data Science Private Endpoint + * `delete` - (Defaults to 20 minutes), when destroying the Data Science Private Endpoint + + +## Import + +DataSciencePrivateEndpoints can be imported using the `id`, e.g. + +``` +$ terraform import oci_datascience_private_endpoint.test_data_science_private_endpoint "id" +``` + diff --git a/website/docs/r/datascience_model_deployment.html.markdown b/website/docs/r/datascience_model_deployment.html.markdown index 895b3b0ff79..383e62ae973 100644 --- a/website/docs/r/datascience_model_deployment.html.markdown +++ b/website/docs/r/datascience_model_deployment.html.markdown @@ -113,7 +113,7 @@ The following arguments are supported: * `image_digest` - (Applicable when environment_configuration_type=OCIR_CONTAINER) (Updatable) The digest of the container image. For example, `sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030` * `server_port` - (Applicable when environment_configuration_type=OCIR_CONTAINER) (Updatable) The port on which the web server serving the inference is running. The port can be anything between `1024` and `65535`. The following ports cannot be used `24224`, `8446`, `8447`. * `model_configuration_details` - (Required) (Updatable) The model configuration details. - * `bandwidth_mbps` - (Optional) (Updatable) The network bandwidth for the model. + * `bandwidth_mbps` - (Optional) (Updatable) The minimum network bandwidth for the model deployment. * `instance_configuration` - (Required) (Updatable) The model deployment instance configuration * `instance_shape_name` - (Required) (Updatable) The shape used to launch the model deployment instances. * `model_deployment_instance_shape_config_details` - (Optional) (Updatable) Details for the model-deployment instance shape configuration. @@ -161,7 +161,7 @@ The following attributes are exported: * `image_digest` - The digest of the container image. For example, `sha256:881303a6b2738834d795a32b4a98eb0e5e3d1cad590a712d1e04f9b2fa90a030` * `server_port` - The port on which the web server serving the inference is running. The port can be anything between `1024` and `65535`. The following ports cannot be used `24224`, `8446`, `8447`. * `model_configuration_details` - The model configuration details. - * `bandwidth_mbps` - The network bandwidth for the model. + * `bandwidth_mbps` - The minimum network bandwidth for the model deployment. * `instance_configuration` - The model deployment instance configuration * `instance_shape_name` - The shape used to launch the model deployment instances. * `model_deployment_instance_shape_config_details` - Details for the model-deployment instance shape configuration. diff --git a/website/docs/r/datascience_notebook_session.html.markdown b/website/docs/r/datascience_notebook_session.html.markdown index 94da71eaa4f..e540a25f800 100644 --- a/website/docs/r/datascience_notebook_session.html.markdown +++ b/website/docs/r/datascience_notebook_session.html.markdown @@ -36,6 +36,7 @@ resource "oci_datascience_notebook_session" "test_notebook_session" { memory_in_gbs = var.notebook_session_notebook_session_config_details_notebook_session_shape_config_details_memory_in_gbs ocpus = var.notebook_session_notebook_session_config_details_notebook_session_shape_config_details_ocpus } + private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id subnet_id = oci_core_subnet.test_subnet.id } notebook_session_configuration_details { @@ -51,6 +52,7 @@ resource "oci_datascience_notebook_session" "test_notebook_session" { memory_in_gbs = var.notebook_session_notebook_session_configuration_details_notebook_session_shape_config_details_memory_in_gbs ocpus = var.notebook_session_notebook_session_configuration_details_notebook_session_shape_config_details_ocpus } + private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id } notebook_session_runtime_config_details { @@ -81,6 +83,7 @@ The following arguments are supported: * `notebook_session_shape_config_details` - (Optional) Details for the notebook session shape configuration. * `memory_in_gbs` - (Optional) The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - (Optional) The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - (Optional) The OCID of a Data Science private endpoint. * `shape` - (Required) The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - (Optional) A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_configuration_details` - (Optional) (Updatable) Details for the notebook session configuration. @@ -88,6 +91,7 @@ The following arguments are supported: * `notebook_session_shape_config_details` - (Optional) (Updatable) Details for the notebook session shape configuration. * `memory_in_gbs` - (Optional) (Updatable) The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - (Optional) (Updatable) The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - (Optional) (Updatable) The OCID of a Data Science private endpoint. * `shape` - (Required) (Updatable) The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - (Required) (Updatable) A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_runtime_config_details` - (Optional) (Updatable) Notebook Session runtime configuration details. @@ -117,6 +121,7 @@ The following attributes are exported: * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. * `memory_in_gbs` - The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. * `shape` - The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_configuration_details` - Details for the notebook session configuration. @@ -124,6 +129,7 @@ The following attributes are exported: * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. * `memory_in_gbs` - The total amount of memory available to the notebook session instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the notebook session instance. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. * `shape` - The shape used to launch the notebook session compute instance. The list of available shapes in a given compartment can be retrieved using the `ListNotebookSessionShapes` endpoint. * `subnet_id` - A notebook session instance is provided with a VNIC for network access. This specifies the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the subnet to create a VNIC in. The subnet should be in a VCN with a NAT gateway for egress to the internet. * `notebook_session_runtime_config_details` - Notebook Session runtime configuration details. diff --git a/website/docs/r/kms_ekms_private_endpoint.html.markdown b/website/docs/r/kms_ekms_private_endpoint.html.markdown new file mode 100644 index 00000000000..10299233734 --- /dev/null +++ b/website/docs/r/kms_ekms_private_endpoint.html.markdown @@ -0,0 +1,84 @@ +--- +subcategory: "Kms" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_kms_ekms_private_endpoint" +sidebar_current: "docs-oci-resource-kms-ekms_private_endpoint" +description: |- + Provides the Ekms Private Endpoint resource in Oracle Cloud Infrastructure Kms service +--- + +# oci_kms_ekms_private_endpoint +This resource provides the Ekms Private Endpoint resource in Oracle Cloud Infrastructure Kms service. + +Create a new EKMS private endpoint used to connect to external key manager system + +## Example Usage + +```hcl +resource "oci_kms_ekms_private_endpoint" "test_ekms_private_endpoint" { + #Required + ca_bundle = var.ekms_private_endpoint_ca_bundle + compartment_id = var.compartment_id + display_name = var.ekms_private_endpoint_display_name + external_key_manager_ip = var.ekms_private_endpoint_external_key_manager_ip + subnet_id = oci_core_subnet.test_subnet.id + + #Optional + defined_tags = {"foo-namespace.bar-key"= "value"} + freeform_tags = {"bar-key"= "value"} + port = var.ekms_private_endpoint_port +} +``` + +## Argument Reference + +The following arguments are supported: + +* `ca_bundle` - (Required) CABundle to validate TLS certificate of the external key manager system in PEM format +* `compartment_id` - (Required) Compartment identifier. +* `defined_tags` - (Optional) (Updatable) Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}` +* `display_name` - (Required) (Updatable) Display name of the EKMS private endpoint resource being created. +* `external_key_manager_ip` - (Required) External private IP to connect to from this EKMS private endpoint +* `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"}` +* `port` - (Optional) The port of the external key manager system +* `subnet_id` - (Required) The OCID of subnet in which the EKMS private endpoint is to be created + + +** 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: + +* `ca_bundle` - CABundle to validate TLS certificate of the external key manager system in PEM format +* `compartment_id` - Identifier of the compartment this EKMS private endpoint belongs to +* `defined_tags` - Usage of predefined tag keys. These predefined keys are scoped to namespaces. Example: `{"foo-namespace.bar-key": "value"}` +* `display_name` - Mutable name of the EKMS private endpoint +* `external_key_manager_ip` - Private IP of the external key manager system to connect to from the EKMS private endpoint +* `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` - Unique identifier that is immutable +* `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. +* `port` - The port of the external key manager system +* `private_endpoint_ip` - The IP address in the customer's VCN for the EKMS private endpoint. This is taken from subnet +* `state` - The current state of the EKMS private endpoint resource. +* `subnet_id` - Subnet Identifier +* `time_created` - The time the EKMS private endpoint was created. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string. +* `time_updated` - The time the EKMS private endpoint was updated. An [RFC3339](https://tools.ietf.org/html/rfc3339) formatted datetime string. + +## 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 Ekms Private Endpoint + * `update` - (Defaults to 20 minutes), when updating the Ekms Private Endpoint + * `delete` - (Defaults to 20 minutes), when destroying the Ekms Private Endpoint + + +## Import + +EkmsPrivateEndpoints can be imported using the `id`, e.g. + +``` +$ terraform import oci_kms_ekms_private_endpoint.test_ekms_private_endpoint "id" +``` + diff --git a/website/docs/r/kms_encrypted_data.html.markdown b/website/docs/r/kms_encrypted_data.html.markdown index 3b2ccc39251..c17d03eb258 100644 --- a/website/docs/r/kms_encrypted_data.html.markdown +++ b/website/docs/r/kms_encrypted_data.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: * `associated_data` - (Optional) Information that can be used to provide an encryption context for the encrypted data. The length of the string representation of the associated data must be fewer than 4096 characters. * `crypto_endpoint` - (Required) The service endpoint to perform cryptographic operations against. Cryptographic operations include 'Encrypt,' 'Decrypt,' and 'GenerateDataEncryptionKey' operations. see Vault Crypto endpoint. -* `encryption_algorithm` - (Optional) The encryption algorithm to use to encrypt and decrypt data with a customer-managed key. `AES_256_GCM` indicates that the key is a symmetric key that uses the Advanced Encryption Standard (AES) algorithm and that the mode of encryption is the Galois/Counter Mode (GCM). `RSA_OAEP_SHA_1` indicates that the key is an asymmetric key that uses the RSA encryption algorithm and uses Optimal Asymmetric Encryption Padding (OAEP). `RSA_OAEP_SHA_256` indicates that the key is an asymmetric key that uses the RSA encryption algorithm with a SHA-256 hash and uses OAEP. +* `encryption_algorithm` - (Optional) The encryption algorithm to use to encrypt and decrypt data with a customer-managed key. `AES_256_GCM` indicates that the key is a symmetric key that uses the Advanced Encryption Standard (AES) algorithm and that the mode of encryption is the Galois/Counter Mode (GCM). `RSA_OAEP_SHA_1` indicates that the key is an asymmetric key that uses the RSA encryption algorithm and uses Optimal Asymmetric Encryption Padding (OAEP). `RSA_OAEP_SHA_256` indicates that the key is an asymmetric key that uses the RSA encryption algorithm with a SHA-256 hash and uses OAEP. * `key_id` - (Required) The OCID of the key to encrypt with. * `key_version_id` - (Optional) The OCID of the key version used to encrypt the ciphertext. * `logging_context` - (Optional) Information that provides context for audit logging. You can provide this additional data as key-value pairs to include in the audit logs when audit logging is enabled. @@ -52,7 +52,7 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: * `ciphertext` - The encrypted data. -* `encryption_algorithm` - The encryption algorithm to use to encrypt and decrypt data with a customer-managed key. `AES_256_GCM` indicates that the key is a symmetric key that uses the Advanced Encryption Standard (AES) algorithm and that the mode of encryption is the Galois/Counter Mode (GCM). `RSA_OAEP_SHA_1` indicates that the key is an asymmetric key that uses the RSA encryption algorithm and uses Optimal Asymmetric Encryption Padding (OAEP). `RSA_OAEP_SHA_256` indicates that the key is an asymmetric key that uses the RSA encryption algorithm with a SHA-256 hash and uses OAEP. +* `encryption_algorithm` - The encryption algorithm to use to encrypt and decrypt data with a customer-managed key. `AES_256_GCM` indicates that the key is a symmetric key that uses the Advanced Encryption Standard (AES) algorithm and that the mode of encryption is the Galois/Counter Mode (GCM). `RSA_OAEP_SHA_1` indicates that the key is an asymmetric key that uses the RSA encryption algorithm and uses Optimal Asymmetric Encryption Padding (OAEP). `RSA_OAEP_SHA_256` indicates that the key is an asymmetric key that uses the RSA encryption algorithm with a SHA-256 hash and uses OAEP. * `key_id` - The OCID of the key used to encrypt the ciphertext. * `key_version_id` - The OCID of the key version used to encrypt the ciphertext. diff --git a/website/docs/r/kms_generated_key.html.markdown b/website/docs/r/kms_generated_key.html.markdown index b7b7313267d..046a4383b9b 100644 --- a/website/docs/r/kms_generated_key.html.markdown +++ b/website/docs/r/kms_generated_key.html.markdown @@ -45,7 +45,7 @@ The following arguments are supported: * `include_plaintext_key` - (Required) If true, the generated key is also returned unencrypted. * `key_id` - (Required) The OCID of the master encryption key to encrypt the generated data encryption key with. * `key_shape` - (Required) The cryptographic properties of a key. - * `algorithm` - (Required) The algorithm used by a key's key versions to encrypt or decrypt. + * `algorithm` - (Required) The algorithm used by a key's key versions to encrypt or decrypt. Only AES algorithm is supported for `External` keys. * `curve_id` - (Optional) Supported curve IDs for ECDSA keys. * `length` - (Required) The length of the key in bytes, expressed as an integer. Supported values include the following: * AES: 16, 24, or 32 diff --git a/website/docs/r/kms_key.html.markdown b/website/docs/r/kms_key.html.markdown index 46162869123..925585f89b3 100644 --- a/website/docs/r/kms_key.html.markdown +++ b/website/docs/r/kms_key.html.markdown @@ -37,6 +37,10 @@ resource "oci_kms_key" "test_key" { #Optional defined_tags = {"Operations.CostCenter"= "42"} + external_key_reference { + #Required + external_key_id = oci_kms_key.test_key.id + } freeform_tags = {"Department"= "Finance"} protection_mode = "${var.key_protection_mode}" } @@ -50,16 +54,18 @@ The following arguments are supported: * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` * `desired_state` - (Optional) (Updatable) Desired state of the key. Possible values : `ENABLED` or `DISABLED` * `display_name` - (Required) (Updatable) A user-friendly name for the key. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_reference` - (Optional) A reference to the key on external key manager. + * `external_key_id` - (Required) ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM * `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"}` * `key_shape` - (Required) The cryptographic properties of a key. - * `algorithm` - (Required) The algorithm used by a key's key versions to encrypt or decrypt. + * `algorithm` - (Required) The algorithm used by a key's key versions to encrypt or decrypt. Only AES algorithm is supported for `External` keys. * `curve_id` - (Optional) Supported curve IDs for ECDSA keys. * `length` - (Required) The length of the key in bytes, expressed as an integer. Supported values include the following: * AES: 16, 24, or 32 * RSA: 256, 384, or 512 * ECDSA: 32, 48, or 66 * `management_endpoint` - (Required) The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint. -* `protection_mode` - (Optional) The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. +* `protection_mode` - (Optional) The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. Oracle only hold a reference to that key. All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. * `restore_from_file` - (Optional) (Updatable) Details where key was backed up. * `content_length` - (Required) (Updatable) content length of key's backup binary file * `content_md5` - (Optional) (Updatable) content md5 hashed value of key's backup file @@ -84,17 +90,20 @@ The following attributes are exported: * `current_key_version` - The OCID of the key version used in cryptographic operations. During key rotation, the service might be in a transitional state where this or a newer key version are used intermittently. The `currentKeyVersion` property is updated when the service is guaranteed to use the new key version for all subsequent encryption operations. * `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 for the key. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_reference_details` - Key reference data to be returned to the customer as a response. + * `external_key_id` - ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM. + * `external_key_version_id` - Key version ID associated with the external key. * `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 key. -* `is_primary` - A boolean that will be true when key is primary, and will be false when key is a replica from a primary key. +* `is_primary` - A Boolean value that indicates whether the Key belongs to primary Vault or replica vault. * `key_shape` - The cryptographic properties of a key. - * `algorithm` - The algorithm used by a key's key versions to encrypt or decrypt. + * `algorithm` - The algorithm used by a key's key versions to encrypt or decrypt. Only AES algorithm is supported for `External` keys. * `curve_id` - Supported curve IDs for ECDSA keys. * `length` - The length of the key in bytes, expressed as an integer. Supported values include the following: * AES: 16, 24, or 32 * RSA: 256, 384, or 512 * ECDSA: 32, 48, or 66 -* `protection_mode` - The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. +* `protection_mode` - The key's protection mode indicates how the key persists and where cryptographic operations that use the key are performed. A protection mode of `HSM` means that the key persists on a hardware security module (HSM) and all cryptographic operations are performed inside the HSM. A protection mode of `SOFTWARE` means that the key persists on the server, protected by the vault's RSA wrapping key which persists on the HSM. All cryptographic operations that use a key with a protection mode of `SOFTWARE` are performed on the server. By default, a key's protection mode is set to `HSM`. You can't change a key's protection mode after the key is created or imported. A protection mode of `EXTERNAL` mean that the key persists on the customer's external key manager which is hosted externally outside of oracle. Oracle only hold a reference to that key. All cryptographic operations that use a key with a protection mode of `EXTERNAL` are performed by external key manager. * `replica_details` - Key replica details * `replication_id` - ReplicationId associated with a key operation * `restored_from_key_id` - The OCID of the key from which this key was restored. diff --git a/website/docs/r/kms_key_version.html.markdown b/website/docs/r/kms_key_version.html.markdown index f79297d00a6..49e2892f59d 100644 --- a/website/docs/r/kms_key_version.html.markdown +++ b/website/docs/r/kms_key_version.html.markdown @@ -26,6 +26,9 @@ resource "oci_kms_key_version" "test_key_version" { #Required key_id = oci_kms_key.test_key.id management_endpoint = var.key_version_management_endpoint + + #Optional + external_key_version_id = oci_kms_key_version.test_key_version.id } ``` @@ -33,6 +36,7 @@ resource "oci_kms_key_version" "test_key_version" { The following arguments are supported: +* `external_key_version_id` - (Optional) Key version ID associated with the external key. * `key_id` - (Required) The OCID of the key. * `management_endpoint` - (Required) The service endpoint to perform management operations against. Management operations include 'Create,' 'Update,' 'List,' 'Get,' and 'Delete' operations. See Vault Management endpoint. * `time_of_deletion` - (Optional) (Updatable) An optional property for the deletion time of the key version, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` @@ -45,8 +49,11 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: * `compartment_id` - The OCID of the compartment that contains this key version. +* `external_key_reference_details` - Key reference data to be returned to the customer as a response. + * `external_key_id` - ExternalKeyId refers to the globally unique key Id associated with the key created in external vault in CTM. + * `external_key_version_id` - Key version ID associated with the external key. * `id` - The OCID of the key version. -* `is_primary` - A boolean that will be true when key version is primary, and will be false when key version is a replica from a primary key version. +* `is_primary` - A Boolean value that indicates whether the KeyVersion belongs to primary Vault or replica Vault. * `key_id` - The OCID of the master encryption key associated with this key version. * `public_key` - The public key in PEM format. (This value pertains only to RSA and ECDSA keys.) * `replica_details` - KeyVersion replica details diff --git a/website/docs/r/kms_sign.html.markdown b/website/docs/r/kms_sign.html.markdown index 9f46c99ce46..5416f70990b 100644 --- a/website/docs/r/kms_sign.html.markdown +++ b/website/docs/r/kms_sign.html.markdown @@ -10,9 +10,10 @@ description: |- # oci_kms_sign This resource provides the Sign resource in Oracle Cloud Infrastructure Kms service. -Creates a digital signature for a message or message digest by using the private key of a public-private key pair, -also known as an asymmetric key. To verify the generated signature, you can use the [Verify](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/VerifiedData/Verify) +Creates a digital signature for a message or message digest by using the private key of a public-private key pair, +also known as an asymmetric key. To verify the generated signature, you can use the [Verify](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/VerifiedData/Verify) operation. Or, if you want to validate the signature outside of the service, you can do so by using the public key of the same asymmetric key. +This operation is not supported for keys having protection mode `EXTERNAL`. ## Example Usage @@ -39,8 +40,8 @@ The following arguments are supported: * `key_id` - (Required) The OCID of the key used to sign the message. * `key_version_id` - (Optional) The OCID of the key version used to sign the message. * `message` - (Required) The base64-encoded binary data object denoting the message or message digest to sign. You can have a message up to 4096 bytes in size. To sign a larger message, provide the message digest. -* `message_type` - (Optional) Denotes whether the value of the message parameter is a raw message or a message digest. The default value, `RAW`, indicates a message. To indicate a message digest, use `DIGEST`. -* `signing_algorithm` - (Required) The algorithm to use to sign the message or message digest. For RSA keys, supported signature schemes include PKCS #1 and RSASSA-PSS, along with different hashing algorithms. For ECDSA keys, ECDSA is the supported signature scheme with different hashing algorithms. When you pass a message digest for signing, ensure that you specify the same hashing algorithm as used when creating the message digest. +* `message_type` - (Optional) Denotes whether the value of the message parameter is a raw message or a message digest. The default value, `RAW`, indicates a message. To indicate a message digest, use `DIGEST`. +* `signing_algorithm` - (Required) The algorithm to use to sign the message or message digest. For RSA keys, supported signature schemes include PKCS #1 and RSASSA-PSS, along with different hashing algorithms. For ECDSA keys, ECDSA is the supported signature scheme with different hashing algorithms. When you pass a message digest for signing, ensure that you specify the same hashing algorithm as used when creating the message digest. ** IMPORTANT ** @@ -53,7 +54,7 @@ The following attributes are exported: * `key_id` - The OCID of the key used to sign the message. * `key_version_id` - The OCID of the key version used to sign the message. * `signature` - The base64-encoded binary data object denoting the cryptographic signature generated for the message or message digest. -* `signing_algorithm` - The algorithm to use to sign the message or message digest. For RSA keys, supported signature schemes include PKCS #1 and RSASSA-PSS, along with different hashing algorithms. For ECDSA keys, ECDSA is the supported signature scheme with different hashing algorithms. When you pass a message digest for signing, ensure that you specify the same hashing algorithm as used when creating the message digest. +* `signing_algorithm` - The algorithm to use to sign the message or message digest. For RSA keys, supported signature schemes include PKCS #1 and RSASSA-PSS, along with different hashing algorithms. For ECDSA keys, ECDSA is the supported signature scheme with different hashing algorithms. When you pass a message digest for signing, ensure that you specify the same hashing algorithm as used when creating the message digest. ## Timeouts diff --git a/website/docs/r/kms_vault.html.markdown b/website/docs/r/kms_vault.html.markdown index e4a1f346c90..4ad45367b5d 100644 --- a/website/docs/r/kms_vault.html.markdown +++ b/website/docs/r/kms_vault.html.markdown @@ -32,6 +32,17 @@ resource "oci_kms_vault" "test_vault" { #Optional defined_tags = {"Operations.CostCenter"= "42"} + external_key_manager_metadata { + #Required + external_vault_endpoint_url = var.vault_external_key_manager_metadata_external_vault_endpoint_url + oauth_metadata { + #Required + client_app_id = oci_kms_client_app.test_client_app.id + client_app_secret = var.vault_external_key_manager_metadata_oauth_metadata_client_app_secret + idcs_account_name_url = var.vault_external_key_manager_metadata_oauth_metadata_idcs_account_name_url + } + private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id + } freeform_tags = {"Department"= "Finance"} } ``` @@ -43,6 +54,13 @@ The following arguments are supported: * `compartment_id` - (Required) (Updatable) The OCID of the compartment where you want to create this vault. * `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 user-friendly name for the vault. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_manager_metadata` - (Optional) Metadata required for accessing External Key manager + * `external_vault_endpoint_url` - (Required) URI of the vault on external key manager. + * `oauth_metadata` - (Required) Authorization details required to get access token from IDP for accessing protected resources. + * `client_app_id` - (Required) ID of the client app created in IDP. + * `client_app_secret` - (Required) Secret of the client app created in IDP. + * `idcs_account_name_url` - (Required) Base URL of the IDCS account where confidential client app is created. + * `private_endpoint_id` - (Required) OCID of private endpoint created by customer. * `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"}` * `restore_from_file` - (Optional) (Updatable) Details where vault was backed up. * `content_length` - content length of vault's backup binary file @@ -68,13 +86,20 @@ The following attributes are exported: * `crypto_endpoint` - The service endpoint to perform cryptographic operations against. Cryptographic operations include [Encrypt](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/EncryptedData/Encrypt), [Decrypt](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/DecryptedData/Decrypt), and [GenerateDataEncryptionKey](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/GeneratedKey/GenerateDataEncryptionKey) operations. * `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 for the vault. It does not have to be unique, and it is changeable. Avoid entering confidential information. +* `external_key_manager_metadata_summary` - Summary about metadata of external key manager to be returned to the customer as a response. + * `external_vault_endpoint_url` - URL of the vault on external key manager. + * `oauth_metadata_summary` - Summary about authorization to be returned to the customer as a response. + * `client_app_id` - ID of the client app created in IDP. + * `idcs_account_name_url` - Base URL of the IDCS account where confidential client app is created. + * `private_endpoint_id` - OCID of the private endpoint. + * `vendor` - Vendor of the external key manager. * `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 vault. -* `is_primary` - A boolean that will be true when vault is primary, and will be false when vault is a replica from a primary vault. +* `is_primary` - A Boolean value that indicates whether the Vault is primary Vault or replica Vault. * `management_endpoint` - The service endpoint to perform management operations against. Management operations include "Create," "Update," "List," "Get," and "Delete" operations. * `replica_details` - Vault replica details * `replication_id` - ReplicationId associated with a vault operation -* `restored_from_vault_id` - The OCID of the vault from which this vault was restored, if it was restored from a backup file. If you restore a vault to the same region, the vault retains the same OCID that it had when you backed up the vault. +* `restored_from_vault_id` - The OCID of the vault from which this vault was restored, if it was restored from a backup file. If you restore a vault to the same region, the vault retains the same OCID that it had when you backed up the vault. * `state` - The vault's current lifecycle state. Example: `DELETED` * `time_created` - The date and time this vault was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` * `time_of_deletion` - An optional property to indicate when to delete the vault, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2018-04-03T21:10:29.600Z` diff --git a/website/docs/r/kms_verify.html.markdown b/website/docs/r/kms_verify.html.markdown index 375265e82a4..4fea0b53a45 100644 --- a/website/docs/r/kms_verify.html.markdown +++ b/website/docs/r/kms_verify.html.markdown @@ -10,9 +10,10 @@ description: |- # oci_kms_verify This resource provides the Verify resource in Oracle Cloud Infrastructure Kms service. -Verifies a digital signature that was generated by the [Sign](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/SignedData/Sign) operation -by using the public key of the same asymmetric key that was used to sign the data. If you want to validate the +Verifies a digital signature that was generated by the [Sign](https://docs.cloud.oracle.com/iaas/api/#/en/key/latest/SignedData/Sign) operation +by using the public key of the same asymmetric key that was used to sign the data. If you want to validate the digital signature outside of the service, you can do so by using the public key of the asymmetric key. +This operation is not supported for keys having protection mode `EXTERNAL`. ## Example Usage @@ -40,9 +41,9 @@ The following arguments are supported: * `key_id` - (Required) The OCID of the key used to sign the message. * `key_version_id` - (Required) The OCID of the key version used to sign the message. * `message` - (Required) The base64-encoded binary data object denoting the message or message digest to sign. You can have a message up to 4096 bytes in size. To sign a larger message, provide the message digest. -* `message_type` - (Optional) Denotes whether the value of the message parameter is a raw message or a message digest. The default value, `RAW`, indicates a message. To indicate a message digest, use `DIGEST`. +* `message_type` - (Optional) Denotes whether the value of the message parameter is a raw message or a message digest. The default value, `RAW`, indicates a message. To indicate a message digest, use `DIGEST`. * `signature` - (Required) The base64-encoded binary data object denoting the cryptographic signature generated for the message. -* `signing_algorithm` - (Required) The algorithm to use to sign the message or message digest. For RSA keys, supported signature schemes include PKCS #1 and RSASSA-PSS, along with different hashing algorithms. For ECDSA keys, ECDSA is the supported signature scheme with different hashing algorithms. When you pass a message digest for signing, ensure that you specify the same hashing algorithm as used when creating the message digest. +* `signing_algorithm` - (Required) The algorithm to use to sign the message or message digest. For RSA keys, supported signature schemes include PKCS #1 and RSASSA-PSS, along with different hashing algorithms. For ECDSA keys, ECDSA is the supported signature scheme with different hashing algorithms. When you pass a message digest for signing, ensure that you specify the same hashing algorithm as used when creating the message digest. ** IMPORTANT ** diff --git a/website/docs/r/mysql_replica.html.markdown b/website/docs/r/mysql_replica.html.markdown index 46532d97789..f5223d33e3f 100644 --- a/website/docs/r/mysql_replica.html.markdown +++ b/website/docs/r/mysql_replica.html.markdown @@ -25,6 +25,13 @@ resource "oci_mysql_replica" "test_replica" { display_name = var.replica_display_name freeform_tags = {"bar-key"= "value"} is_delete_protected = var.replica_is_delete_protected + replica_overrides { + + #Optional + configuration_id = oci_mysql_mysql_configuration.test_mysql_configuration.id + mysql_version = var.replica_replica_overrides_mysql_version + shape_name = oci_mysql_shape.test_shape.name + } } ``` @@ -38,6 +45,10 @@ The following arguments are supported: * `display_name` - (Optional) (Updatable) The user-friendly name for the read replica. It does not have to be unique. * `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"}` * `is_delete_protected` - (Optional) (Updatable) Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If the DB System is delete protected, read replicas can still be deleted individually if they are not delete protected themselves. +* `replica_overrides` - (Optional) (Updatable) By default a read replica inherits the MySQL version, shape, and configuration of the source DB system. If you want to override any of these, provide values in the properties, mysqlVersion, shapeName, and configurationId. If you set a property value to "", then the value is inherited from its source DB system. + * `configuration_id` - (Optional) (Updatable) The OCID of the Configuration to be used by the read replica. + * `mysql_version` - (Optional) (Updatable) The MySQL version to be used by the read replica. + * `shape_name` - (Optional) (Updatable) The shape to be used by the read replica. The shape determines the resources allocated: CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. To get a list of shapes, use the [ListShapes](https://docs.cloud.oracle.com/iaas/api/#/en/mysql/20190415/ShapeSummary/ListShapes) operation. ** IMPORTANT ** @@ -49,6 +60,7 @@ The following attributes are exported: * `availability_domain` - The name of the Availability Domain the read replica is located in. * `compartment_id` - The OCID of the compartment that contains the read replica. +* `configuration_id` - The OCID of the Configuration currently in use by the read replica. * `db_system_id` - The OCID of the DB System the read replica is associated with. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `description` - User provided description of the read replica. @@ -59,9 +71,14 @@ The following attributes are exported: * `ip_address` - The IP address the read replica is configured to listen on. * `is_delete_protected` - Specifies whether the read replica can be deleted. Set to true to prevent deletion, false (default) to allow. Note that if a read replica is delete protected it also prevents the entire DB System from being deleted. If the DB System is delete protected, read replicas can still be deleted individually if they are not delete protected themselves. * `lifecycle_details` - A message describing the state of the read replica. -* `mysql_version` - The MySQL version used by the read replica. +* `mysql_version` - The MySQL version currently in use by the read replica. * `port` - The port the read replica is configured to listen on. * `port_x` - The TCP network port on which X Plugin listens for connections. This is the X Plugin equivalent of port. +* `replica_overrides` - By default a read replica inherits the MySQL version, shape, and configuration of the source DB system. If you want to override any of these, provide values in the properties, mysqlVersion, shapeName, and configurationId. If you set a property value to "", then the value is inherited from its source DB system. + * `configuration_id` - The OCID of the Configuration to be used by the read replica. + * `mysql_version` - The MySQL version to be used by the read replica. + * `shape_name` - The shape to be used by the read replica. The shape determines the resources allocated: CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. To get a list of shapes, use the [ListShapes](https://docs.cloud.oracle.com/iaas/api/#/en/mysql/20190415/ShapeSummary/ListShapes) operation. +* `shape_name` - The shape currently in use by the read replica. The shape determines the resources allocated: CPU cores and memory for VM shapes, CPU cores, memory and storage for non-VM (bare metal) shapes. To get a list of shapes, use the [ListShapes](https://docs.cloud.oracle.com/iaas/api/#/en/mysql/20190415/ShapeSummary/ListShapes) operation. * `state` - The state of the read replica. * `time_created` - The date and time the read replica was created, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339). * `time_updated` - The time the read replica was last updated, as described by [RFC 3339](https://tools.ietf.org/rfc/rfc3339). diff --git a/website/docs/r/queue_queue.html.markdown b/website/docs/r/queue_queue.html.markdown index f70cae61ec9..8a29c13d894 100644 --- a/website/docs/r/queue_queue.html.markdown +++ b/website/docs/r/queue_queue.html.markdown @@ -10,7 +10,7 @@ description: |- # oci_queue_queue This resource provides the Queue resource in Oracle Cloud Infrastructure Queue service. -Creates a new Queue. +Creates a new queue. ## Example Usage @@ -22,6 +22,7 @@ resource "oci_queue_queue" "test_queue" { display_name = var.queue_display_name #Optional + channel_consumption_limit = var.queue_channel_consumption_limit custom_encryption_key_id = oci_kms_key.test_key.id dead_letter_queue_delivery_count = var.queue_dead_letter_queue_delivery_count defined_tags = {"foo-namespace.bar-key"= "value"} @@ -36,15 +37,16 @@ resource "oci_queue_queue" "test_queue" { The following arguments are supported: -* `compartment_id` - (Required) (Updatable) Compartment Identifier -* `custom_encryption_key_id` - (Optional) (Updatable) Id of the custom master encryption key which will be used to encrypt messages content +* `channel_consumption_limit` - (Optional) (Updatable) The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can't exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue's resources. +* `compartment_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the queue. +* `custom_encryption_key_id` - (Optional) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom encryption key to be used to encrypt messages content. * `dead_letter_queue_delivery_count` - (Optional) (Updatable) The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. * `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` - (Required) (Updatable) Queue Identifier +* `display_name` - (Required) (Updatable) The user-friendly name of the queue. * `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"}` -* `retention_in_seconds` - (Optional) The retention period of the messages in the queue, in seconds. +* `retention_in_seconds` - (Optional) The retention period of messages in the queue, in seconds. * `timeout_in_seconds` - (Optional) (Updatable) The default polling timeout of the messages in the queue, in seconds. -* `visibility_in_seconds` - (Optional) (Updatable) The default visibility of the messages consumed from the queue. +* `visibility_in_seconds` - (Optional) (Updatable) The default visibility timeout of the messages consumed from the queue, in seconds. * `purge_trigger` - (Optional) (Updatable) An optional property when incremented triggers Purge. Could be set to any integer value. @@ -55,22 +57,23 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: -* `compartment_id` - Compartment Identifier -* `custom_encryption_key_id` - Id of the custom master encryption key which will be used to encrypt messages content +* `channel_consumption_limit` - The percentage of allocated queue resources that can be consumed by a single channel. For example, if a queue has a storage limit of 2Gb, and a single channel consumption limit is 0.1 (10%), that means data size of a single channel can't exceed 200Mb. Consumption limit of 100% (default) means that a single channel can consume up-to all allocated queue's resources. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the queue. +* `custom_encryption_key_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the custom encryption key to be used to encrypt messages content. * `dead_letter_queue_delivery_count` - The number of times a message can be delivered to a consumer before being moved to the dead letter queue. A value of 0 indicates that the DLQ is not used. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` -* `display_name` - Queue Identifier, can be renamed +* `display_name` - A user-friendly name for the queue. Does not have to be unique, and it's changeable. Avoid entering confidential information. * `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` - Unique identifier that is immutable on creation -* `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. +* `id` - A unique identifier for the queue that is immutable on creation. +* `lifecycle_details` - Any additional details about the current state of the queue. * `messages_endpoint` - The endpoint to use to consume or publish messages in the queue. * `retention_in_seconds` - The retention period of the messages in the queue, in seconds. -* `state` - The current state of the Queue. +* `state` - The current state of the queue. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` -* `time_created` - The time the the Queue was created. An RFC3339 formatted datetime string -* `time_updated` - The time the Queue was updated. An RFC3339 formatted datetime string +* `time_created` - The time that the queue was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2018-04-20T00:00:07.405Z` +* `time_updated` - The time that the queue was updated, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2018-04-20T00:00:07.405Z` * `timeout_in_seconds` - The default polling timeout of the messages in the queue, in seconds. -* `visibility_in_seconds` - The default visibility of the messages consumed from the queue. +* `visibility_in_seconds` - The default visibility timeout of the messages consumed from the queue, in seconds. ## Timeouts diff --git a/website/oci.erb b/website/oci.erb index a43cbdd6ebc..9ea3ff46881 100644 --- a/website/oci.erb +++ b/website/oci.erb @@ -1186,6 +1186,39 @@ +