diff --git a/CHANGELOG.md b/CHANGELOG.md index d8d5328b97e..c7cc3b58e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,32 @@ +## 7.13.0 (August 6, 2025) + +### Added +- Max Parallel Chunks configurable via env +- Formatting changes in files + +### Bug Fix +- for Create route table when route rule contains route_type. +- Api Gateway terraform correction to align with public sdk resource locking changes +- Adbs switchover logic and secret Id bug + +## 7.12.0 (July 30, 2025) + +### Added +- Support for ODSC - Enable Burstable for Data Science Notebooks, ML Jobs, and ML Pipeline +- Support for APM - Scheduled Backend Queries - UI & API +- Support for Ops Insights support for ADB@ExaCC +- oprional parameters to import +- Support for API Platform Cloud Service +- Support for OCI Data Science Multi Model Deployment Experience +- Support for Design/Implement CPU architecture agnostic configurations +- Support for Secrets in Vault - Cross Region Replication Feature +- Support for APM - Agent & Configurations Updates + +### Bug Fix +- Update domain override logic to get realm domain from oci-go-sdk instead of using regex to extract realmn domain +- Fix for VCN is_ipv6enabled plan drift on apply. +- ed - Pagination for resource discovery of private zones + ## 7.11.0 (July 23, 2025) ### Added diff --git a/examples/api_gateway/api/api.tf b/examples/api_gateway/api/api.tf index dde7b4428bc..55def54c20f 100644 --- a/examples/api_gateway/api/api.tf +++ b/examples/api_gateway/api/api.tf @@ -20,6 +20,18 @@ variable "api_display_name" { default = "test API definiton" } +variable "locks_type" { + default = "DELETE" +} + +variable "locks_message" { + default = "LockTest" +} + +variable "is_lock_override" { + default = true +} + provider "oci" { tenancy_ocid = var.tenancy_ocid user_ocid = var.user_ocid diff --git a/examples/api_platform/api_platform_instance/main.tf b/examples/api_platform/api_platform_instance/main.tf new file mode 100644 index 00000000000..6f01cf74cdc --- /dev/null +++ b/examples/api_platform/api_platform_instance/main.tf @@ -0,0 +1,60 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_id" {} + +variable "api_platform_instance_description" { + default = "description" +} + +variable "api_platform_instance_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "api_platform_instance_name" { + default = "name" +} + +variable "api_platform_instance_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_api_platform_api_platform_instance" "test_api_platform_instance" { + #Required + compartment_id = var.compartment_id + name = var.api_platform_instance_name + + #Optional + defined_tags = { "example-tag-namespace-all.example-tag" = "value" } + description = var.api_platform_instance_description + freeform_tags = var.api_platform_instance_freeform_tags +} + +data "oci_api_platform_api_platform_instances" "test_api_platform_instances" { + #Required + compartment_id = var.compartment_id + + #Optional + id = oci_api_platform_api_platform_instance.test_api_platform_instance.id + name = var.api_platform_instance_name + state = var.api_platform_instance_state +} + +data "oci_api_platform_api_platform_instance" "test_api_platform_instance_data" { + #Required + api_platform_instance_id = oci_api_platform_api_platform_instance.test_api_platform_instance.id +} \ No newline at end of file diff --git a/examples/apm/apm_config/agent_config/main.tf b/examples/apm/apm_config/agent_config/main.tf new file mode 100644 index 00000000000..db9b9f7d5e7 --- /dev/null +++ b/examples/apm/apm_config/agent_config/main.tf @@ -0,0 +1,130 @@ +// Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" { } +variable "user_ocid" { } +variable "fingerprint" { } +variable "private_key_path" { } +variable "region" { } +variable "compartment_ocid" { } + +variable "config_config_type" { + default = "AGENT" +} + +variable "config_defined_tags_value" { + default = "value" +} + +variable "configMapFileName" { + default = "fileName" +} + +variable "configMapBody" { + default = "Y29tLm9yYWNsZS5hcG0uYWdlbnQudHJhY2VyLmVuYWJsZS5qZnIgPSB7eyBpc0pmckVuYWJsZWQgfCBkZWZhdWx0IGZhbHNlIH19" +} + +variable "configMapContentType" { + default = "charset=utf-8" +} + +variable "overrideListAgentFilter" { + default = "Component='Server'" +} + +variable "overrideListOverrideMap" { + default = { + isJfrEnabled= "true" + } +} + +variable "match_agents_with_attribute_value" { + default = "value1" +} + +variable "config_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "apm_domain_description" { + default = "description" +} + +variable "apm_domain_display_name" { + default = "displayName" +} + +variable "apm_domain_freeform_tags" { + default = { "Department" = "Finance" } +} + +variable "apm_domain_is_free_tier" { + default = false +} + +variable "apm_domain_state" { + default = "ACTIVE" +} + +variable "data_key_data_key_type" { + default = "PRIVATE" +} + +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_apm_apm_domain" "test_apm_domain" { + #Required + compartment_id = var.compartment_ocid + display_name = var.apm_domain_display_name + + #Optional + description = var.apm_domain_description + freeform_tags = var.apm_domain_freeform_tags + is_free_tier = var.apm_domain_is_free_tier +} + + +resource "oci_apm_config_config" "test_config" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + config_type = var.config_config_type + match_agents_with_attribute_value = var.match_agents_with_attribute_value + + #Optional + config { + config_map { + file_name = var.configMapFileName + body = var.configMapBody + content_type = var.configMapContentType + } + + # config_map { + # // Second config map + # } + } + + overrides { + override_list { + agent_filter = var.overrideListAgentFilter + override_map = var.overrideListOverrideMap + } + + # override_list { + # // Second override list + # } + } +} + +data "oci_apm_config_configs" "test_configs" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + + #Optional + config_type = var.config_config_type +} diff --git a/examples/apm/apm_config/macs_apm_extension/main.tf b/examples/apm/apm_config/macs_apm_extension/main.tf new file mode 100644 index 00000000000..639e25f5294 --- /dev/null +++ b/examples/apm/apm_config/macs_apm_extension/main.tf @@ -0,0 +1,113 @@ +// Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" { } +variable "user_ocid" { } +variable "fingerprint" { } +variable "private_key_path" { } +variable "region" { } +variable "compartment_ocid" { } +variable "management_agent_ocid" { } + +variable "config_config_type" { + default = "MACS_APM_EXTENSION" +} + +variable "process_filter" { + default = [".*org.apache.catalina.startup.Bootstrap.*", ".*jetty.*"] +} + +variable "run_as_user" { + default = "tomcat" +} + +variable "service_name" { + default = "Tomcat" +} + +variable "agent_version" { + default = "1.16.0.585" +} + +variable "attach_install_dir" { + default = "/opt/oracle/apm_attach_process" +} + +variable "display_name" { + default = "Display name" +} + +variable "config_defined_tags_value" { + default = "value" +} + +variable "config_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "apm_domain_description" { + default = "description" +} + +variable "apm_domain_display_name" { + default = "displayName" +} + +variable "apm_domain_freeform_tags" { + default = { "Department" = "Finance" } +} + +variable "apm_domain_is_free_tier" { + default = false +} + +variable "apm_domain_state" { + default = "ACTIVE" +} + +variable "data_key_data_key_type" { + default = "PRIVATE" +} + +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_apm_apm_domain" "test_apm_domain" { + #Required + compartment_id = var.compartment_ocid + display_name = var.apm_domain_display_name + + #Optional + description = var.apm_domain_description + freeform_tags = var.apm_domain_freeform_tags + is_free_tier = true +} + + +resource "oci_apm_config_config" "test_config" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + config_type = var.config_config_type + management_agent_id = var.management_agent_ocid + process_filter = var.process_filter + run_as_user = var.run_as_user + service_name = var.service_name + agent_version = var.agent_version + attach_install_dir = var.attach_install_dir + + #Optional + display_name = var.display_name +} + +data "oci_apm_config_configs" "test_configs" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + + #Optional + config_type = var.config_config_type +} diff --git a/examples/apm/apm_traces/attribute/main.tf b/examples/apm/apm_traces/attribute/main.tf new file mode 100644 index 00000000000..15a91b5a443 --- /dev/null +++ b/examples/apm/apm_traces/attribute/main.tf @@ -0,0 +1,29 @@ +// Copyright (c) 2017, 2025, 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 "apm_domain_id" {} + +variable "attribute_auto_activate_status_data_key_type" { + default = "PRIVATE_DATA_KEY" +} + + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_apm_traces_attribute_auto_activate_status" "test_attribute_auto_activate_status" { + #Required + apm_domain_id = var.apm_domain_id + data_key_type = var.attribute_auto_activate_status_data_key_type +} diff --git a/examples/apm/apm_traces/log/main.tf b/examples/apm/apm_traces/log/main.tf new file mode 100644 index 00000000000..fc99c6dbccf --- /dev/null +++ b/examples/apm/apm_traces/log/main.tf @@ -0,0 +1,39 @@ +// Copyright (c) 2017, 2025, 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 "apm_domain_id" {} + +variable "log_log_key" { + default = "logKey" +} + +variable "log_time_log_ended_less_than" { + default = "2025-05-23T00:00:00Z" +} + +variable "log_time_log_started_greater_than_or_equal_to" { + default = "2025-05-18T00:00:00Z" +} + + + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +data "oci_apm_traces_log" "test_log" { + #Required + apm_domain_id = var.apm_domain_id + log_key = var.log_log_key + time_log_ended_less_than = var.log_time_log_ended_less_than + time_log_started_greater_than_or_equal_to = var.log_time_log_started_greater_than_or_equal_to +} diff --git a/examples/apm/apm_traces/scheduled_query/main.tf b/examples/apm/apm_traces/scheduled_query/main.tf new file mode 100644 index 00000000000..4a797cce38b --- /dev/null +++ b/examples/apm/apm_traces/scheduled_query/main.tf @@ -0,0 +1,170 @@ +// Copyright (c) 2017, 2025, 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 "apm_domain_id" {} + +variable "scheduled_query_defined_tags_value" { + default = "value" +} + +variable "scheduled_query_display_name" { + default = "displayName" +} + +variable "scheduled_query_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "scheduled_query_opc_dry_run" { + default = "opcDryRun" +} + +variable "scheduled_query_scheduled_query_description" { + default = "scheduledQueryDescription" +} + +variable "scheduled_query_scheduled_query_maximum_runtime_in_seconds" { + default = 10 +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_compartment" { + default = "compartment" +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_description" { + default = "description" +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_is_anomaly_detection_enabled" { + default = false +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_is_metric_published" { + default = false +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_name" { + default = "name" +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_namespace" { + default = "namespace" +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_resource_group" { + default = "resourceGroup" +} + +variable "scheduled_query_scheduled_query_processing_configuration_custom_metric_unit" { + default = "unit" +} + +variable "scheduled_query_scheduled_query_processing_configuration_object_storage_bucket" { + default = "bucket" +} + +variable "scheduled_query_scheduled_query_processing_configuration_object_storage_name_space" { + default = "nameSpace" +} + +variable "scheduled_query_scheduled_query_processing_configuration_object_storage_object_name_prefix" { + default = "objectNamePrefix" +} + +variable "scheduled_query_scheduled_query_processing_sub_type" { + default = "OBJECT_STORAGE" +} + +variable "scheduled_query_scheduled_query_processing_type" { + default = "EXPORT" +} + +variable "scheduled_query_scheduled_query_retention_criteria" { + default = "UPDATE" +} + +variable "scheduled_query_scheduled_query_retention_period_in_ms" { + default = 10 +} + +variable "scheduled_query_scheduled_query_schedule" { + default = "SCHEDULE STARTING AFTER 2025-06-20T21:20:00Z EVERY 60 MINUTES" +} + +variable "scheduled_query_scheduled_query_text" { + default = "SHOW SPANS time_bucket_start(1,apmdbInsertTime2) AS metricStartTime,1 MINUTE AS metricDuration,serviceName,operationName,count(*) AS metricValue WHERE apmdbinserttime2>=TimeTruncate(now(),'minute') - 5 MINUTES GROUP BY time_bucket_start(1,apmdbInsertTime2),serviceName,operationName FIRST 10000 ROWS BETWEEN now() - 2 HOURS AND now()" +} + +variable "scheduled_query_scheduled_query_name" { + default = "scheduledQueryName" +} + + +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_apm_traces_scheduled_query" "test_scheduled_query" { + #Required + apm_domain_id = var.apm_domain_id + + #Optional + #defined_tags = map(oci_identity_tag_namespace.tag-namespace1.name.oci_identity_tag.tag1.name, var.scheduled_query_defined_tags_value) + freeform_tags = var.scheduled_query_freeform_tags + opc_dry_run = var.scheduled_query_opc_dry_run + scheduled_query_description = var.scheduled_query_scheduled_query_description + scheduled_query_maximum_runtime_in_seconds = var.scheduled_query_scheduled_query_maximum_runtime_in_seconds + scheduled_query_name = var.scheduled_query_scheduled_query_name + scheduled_query_processing_configuration { + + #Optional + custom_metric { + #Required + name = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_name + + #Optional + compartment = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_compartment + description = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_description + is_anomaly_detection_enabled = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_is_anomaly_detection_enabled + is_metric_published = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_is_metric_published + namespace = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_namespace + resource_group = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_resource_group + unit = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_unit + } + object_storage { + + #Optional + bucket = var.scheduled_query_scheduled_query_processing_configuration_object_storage_bucket + name_space = var.scheduled_query_scheduled_query_processing_configuration_object_storage_name_space + object_name_prefix = var.scheduled_query_scheduled_query_processing_configuration_object_storage_object_name_prefix + } + streaming { + + #Optional + #stream_id = oci_streaming_stream.test_stream.id + } + } + scheduled_query_processing_sub_type = var.scheduled_query_scheduled_query_processing_sub_type + scheduled_query_processing_type = var.scheduled_query_scheduled_query_processing_type + scheduled_query_retention_criteria = var.scheduled_query_scheduled_query_retention_criteria + scheduled_query_retention_period_in_ms = var.scheduled_query_scheduled_query_retention_period_in_ms + scheduled_query_schedule = var.scheduled_query_scheduled_query_schedule + scheduled_query_text = var.scheduled_query_scheduled_query_text +} + +data "oci_apm_traces_scheduled_queries" "test_scheduled_queries" { + #Required + apm_domain_id = var.apm_domain_id + + #Optional + display_name = var.scheduled_query_display_name +} diff --git a/examples/management_dashboard/main.tf b/examples/management_dashboard/main.tf index 704d169a370..e795c99909c 100644 --- a/examples/management_dashboard/main.tf +++ b/examples/management_dashboard/main.tf @@ -10,7 +10,7 @@ provider "oci" { } data "oci_management_dashboard_management_dashboards_export" "test_export" { - export_dashboard_id = "{\"dashboardIds\":[\"ocid1.managementdashboard.dev..aaaaaaaazrrxainoaive7adj77uqejld45vch7zkoqrlh5fwv2_dummy_ocids\"]}" + export_dashboard_id = "%7B%22dashboardIds%22%3A%5B%22dummy_ocid%22%5D%7D" } // example showing import_details usage @@ -23,6 +23,21 @@ resource "oci_management_dashboard_management_dashboards_import" "test_import_vi import_details_file = "sample.json" } +resource "oci_management_dashboard_management_dashboards_import" "test_import_override_name" { + override_same_name = true + import_details_file = "sample.json" +} + +resource "oci_management_dashboard_management_dashboards_import" "test_import_override_ss_compartment" { + override_saved_search_compartment_ocid = "dummy_ocid" + import_details_file = "sample.json" +} + +resource "oci_management_dashboard_management_dashboards_import" "test_import_override_db_compartment" { + override_dashboard_compartment_ocid = "dummy_ocid" + import_details_file = "sample.json" +} + output "test_export_data_all" { value = data.oci_management_dashboard_management_dashboards_export.test_export } diff --git a/examples/networking/route_table/route_table.tf b/examples/networking/route_table/route_table.tf index b255a29f245..bbde5e831e4 100644 --- a/examples/networking/route_table/route_table.tf +++ b/examples/networking/route_table/route_table.tf @@ -57,3 +57,30 @@ resource "oci_core_route_table" "example_route_table" { } } +resource "oci_core_vcn" "example_vcn_2" { + cidr_block = "10.1.0.0/16" + compartment_id = var.compartment_ocid + display_name = "exampleVCN" + dns_label = "tfexamplevcn" +} + +resource "oci_core_internet_gateway" "example_ig_2" { + compartment_id = var.compartment_ocid + display_name = "exampleIG" + vcn_id = oci_core_vcn.example_vcn_2.id +} + +resource "oci_core_route_table" "example_route_table_static" { + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.example_vcn_2.id + display_name = "exampleRouteTable" + + route_rules { + description = var.route_table_route_rules_description + destination = "10.0.0.0/0" + destination_type = "CIDR_BLOCK" + network_entity_id = oci_core_internet_gateway.example_ig_2.id + route_type = "STATIC" + } +} + diff --git a/examples/networking/vcn/vcn.tf b/examples/networking/vcn/vcn.tf index 335709bcdb1..a4fc178d374 100644 --- a/examples/networking/vcn/vcn.tf +++ b/examples/networking/vcn/vcn.tf @@ -39,7 +39,25 @@ resource "oci_core_vcn" "vcn" { security_attributes = {"sample-namespace.value": "examplevalue", "sample-namespace.mode": "examplemode"} } +resource "oci_core_vcn" "test_vcn_ipv6" { + compartment_id = var.compartment_ocid + display_name = "test-vcn-ipv6" + cidr_blocks = [ + "10.0.100.0/24", + "10.0.101.0/24", + ] + is_ipv6enabled = "true" + is_oracle_gua_allocation_enabled = "false" + ipv6private_cidr_blocks = [ + "2a04:4447:f001:100::/64", + ] +} + output "vcn_id" { value = oci_core_vcn.vcn.id } +output "vcn_ipv6_id" { + value = oci_core_vcn.test_vcn_ipv6.id +} + diff --git a/examples/opsi/database_insight/macs_adb_insight/macs_adb_insight.tf b/examples/opsi/database_insight/macs_adb_insight/macs_adb_insight.tf new file mode 100644 index 00000000000..4b969ae9bd7 --- /dev/null +++ b/examples/opsi/database_insight/macs_adb_insight/macs_adb_insight.tf @@ -0,0 +1,128 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_ocid" {} +variable "management_agent_id" {} +variable "macs_adb_id" {} +variable "service_name" {} +variable "adb_host" {} +variable "adb_port" {} +variable "named_credential_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 +} + +resource "oci_identity_tag_namespace" "tag-namespace1" { + compartment_id = var.tenancy_ocid + description = "example tag namespace" + name = "examples-tag-namespace-all" + is_retired = false +} + +resource "oci_identity_tag" "tag1" { + description = "example tag" + name = "example-tag" + tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id + is_cost_tracking = false + is_retired = false +} + +variable "database_insight_database_type" { + default = ["ATP-EXACC"] +} + +variable "deployment_type" { + default = "EXACC" +} + +variable "database_insight_connection_credential_details_credential_type" { + default = "CREDENTIALS_BY_NAMED_CREDS" +} + +variable "database_insight_connection_credential_details_role" { + default = "NORMAL" +} + +variable "database_insight_database_resource_type" { + default = "autonomousdatabase" +} + +variable "database_insight_defined_tags_value" { + default = "value" +} + +variable "database_insight_entity_source" { + default = "MACS_MANAGED_AUTONOMOUS_DATABASE" +} + +variable "database_insight_fields" { + default = ["databaseName", "databaseType", "compartmentId", "databaseDisplayName", "freeformTags", "definedTags"] +} + +variable "database_insight_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "resource_status" { + default = "ENABLED" +} + +// Create Database insight for EM managed External Database +resource "oci_opsi_database_insight" "test_database_insight" { + #Required + compartment_id = var.compartment_ocid + entity_source = var.database_insight_entity_source + + #Optional + management_agent_id = var.management_agent_id + database_id = var.macs_adb_id + deployment_type = var.deployment_type + database_resource_type = var.database_insight_database_resource_type + connection_credential_details { + credential_type = var.database_insight_connection_credential_details_credential_type + named_credential_id = var.named_credential_id + } + connection_details { + host_name = var.adb_host + protocol = "TCP" + service_name = var.service_name + port = var.adb_port + } + defined_tags = "${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "${var.database_insight_defined_tags_value}")}" + freeform_tags = var.database_insight_freeform_tags + status = var.resource_status +} + +variable "database_insight_state" { + default = ["ACTIVE"] +} + +variable "database_insight_status" { + default = ["ENABLED"] +} + +// List MACS Cloud database insights +data "oci_opsi_database_insights" "test_database_insights" { + #Optional + compartment_id = var.compartment_ocid + database_type = var.database_insight_database_type + fields = var.database_insight_fields + state = var.database_insight_state + status = var.database_insight_status +} + +// Get an EM managed database insight +data "oci_opsi_database_insight" "test_database_insight" { + database_insight_id = oci_opsi_database_insight.test_database_insight.id +} + diff --git a/examples/opsi/exadata_insight/macs_adb_exadata_insight/macs_adb_exadata_insight.tf b/examples/opsi/exadata_insight/macs_adb_exadata_insight/macs_adb_exadata_insight.tf new file mode 100644 index 00000000000..0d622385afc --- /dev/null +++ b/examples/opsi/exadata_insight/macs_adb_exadata_insight/macs_adb_exadata_insight.tf @@ -0,0 +1,140 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_ocid" {} +variable "management_agent_id" {} +variable "macs_adb_id" {} +variable "exadata_infra_id" {} +variable "vmcluster_id" {} +variable "named_credential_id" {} +variable "adb_host" {} +variable "adb_port" {} +variable "service_name" {} + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path + region = var.region +} + +resource "oci_identity_tag_namespace" "tag-namespace1" { + compartment_id = var.tenancy_ocid + description = "example tag namespace" + name = "examples-tag-namespace-all" + is_retired = false +} + +resource "oci_identity_tag" "tag1" { + description = "example tag" + name = "example-tag" + tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id + is_cost_tracking = false + is_retired = false +} + +variable "exadata_insight_type" { + default = ["EXACC"] +} + +variable "deployment_type" { + default = "EXACC" +} + +variable "credential_details_credential_type" { + default = "CREDENTIALS_BY_NAMED_CREDS" +} + +variable "credential_details_role" { + default = "NORMAL" +} + +variable "database_resource_type" { + default = "autonomousdatabase" +} + +variable "exadata_insight_defined_tags_value" { + default = "value" +} + +variable "exadata_insight_entity_source" { + default = "MACS_MANAGED_CLOUD_EXADATA" +} + +variable "vm_cluster_type" { + default = "vmCluster" +} + +variable "freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "resource_status" { + default = "ENABLED" +} + +// Create MACS Cloud Exadata insight +resource "oci_opsi_exadata_insight" "test_exadata_insight" { + #Required + compartment_id = var.compartment_ocid + entity_source = var.exadata_insight_entity_source + #Optional + exadata_infra_id = var.exadata_infra_id + member_vm_cluster_details { + vmcluster_id = var.vmcluster_id + compartment_id = var.compartment_ocid + vm_cluster_type = var.vm_cluster_type + member_autonomous_details { + entity_source = "MACS_MANAGED_AUTONOMOUS_DATABASE" + compartment_id = var.compartment_ocid + database_id = var.macs_adb_id + database_resource_type = var.database_resource_type + management_agent_id = var.management_agent_id + deployment_type = var.deployment_type + connection_credential_details { + credential_type = var.credential_details_credential_type + named_credential_id = var.named_credential_id + } + connection_details { + host_name = var.adb_host + protocol = "TCP" + service_name = var.service_name + port = var.adb_port + } + } + } + defined_tags = "${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "${var.exadata_insight_defined_tags_value}")}" + freeform_tags = var.freeform_tags +} + +variable "exadata_insight_state" { + default = ["ACTIVE"] +} + +variable "exadata_insight_status" { + default = ["ENABLED"] +} + +variable "exadata_type" { + default = ["EXACC"] +} + +// List MACS Cloud exadata insights +data "oci_opsi_exadata_insights" "test_exadata_insights" { + #Optional + compartment_id = var.compartment_ocid + exadata_type = var.exadata_insight_type + state = var.exadata_insight_state + status = var.exadata_insight_status +} + +// Get a MACS exadata insight +data "oci_opsi_exadata_insight" "test_exadata_insight" { + exadata_insight_id = oci_opsi_exadata_insight.test_exadata_insight.id +} \ No newline at end of file diff --git a/examples/opsi/exadata_insight/pecomanaged_adb_exadata_insight/pecomanaged_adb_exadata_insight.tf b/examples/opsi/exadata_insight/pecomanaged_adb_exadata_insight/pecomanaged_adb_exadata_insight.tf new file mode 100644 index 00000000000..856fb55625b --- /dev/null +++ b/examples/opsi/exadata_insight/pecomanaged_adb_exadata_insight/pecomanaged_adb_exadata_insight.tf @@ -0,0 +1,143 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "compartment_ocid" {} +variable "adb_compartment_ocid" {} +variable "opsi_private_endpoint_id" {} +variable "adb_id" {} +variable "adb_port" {} +variable "adb_host" {} +variable "service_name" {} +variable "user_name" {} +variable "password_secret_id" {} +variable "exadata_infra_id" {} +variable "vmcluster_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 +} + +resource "oci_identity_tag_namespace" "tag-namespace1" { + compartment_id = var.tenancy_ocid + description = "example tag namespace" + name = "examples-tag-namespace-all" + is_retired = false +} + +resource "oci_identity_tag" "tag1" { + description = "example tag" + name = "example-tag" + tag_namespace_id = oci_identity_tag_namespace.tag-namespace1.id + is_cost_tracking = false + is_retired = false +} + +variable "exadata_insight_type" { + default = ["EXACS"] +} + +variable "deployment_type" { + default = "EXACS" +} + +variable "credential_details_credential_type" { + default = "CREDENTIALS_BY_VAULT" +} + +variable "database_resource_type" { + default = "autonomousdatabase" +} + +variable "exadata_insight_defined_tags_value" { + default = "value" +} + +variable "exadata_insight_entity_source" { + default = "PE_COMANAGED_EXADATA" +} + +variable "freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "resource_status" { + default = "ENABLED" +} + +variable "is_advanced_features_enabled" { + default = true +} + +// Create PE Comanaged Exadata insight +resource "oci_opsi_exadata_insight" "test_exadata_insight" { + #Required + compartment_id = var.compartment_ocid + entity_source = var.exadata_insight_entity_source + + #Optional + exadata_infra_id = var.exadata_infra_id + member_vm_cluster_details { + vmcluster_id = var.vmcluster_id + vm_cluster_type = "autonomousVmCluster" + compartment_id = var.compartment_ocid + opsi_private_endpoint_id = var.opsi_private_endpoint_id + member_autonomous_details { + entity_source = "AUTONOMOUS_DATABASE" + compartment_id = var.adb_compartment_ocid + database_id = var.adb_id + database_resource_type = var.database_resource_type + opsi_private_endpoint_id = var.opsi_private_endpoint_id + is_advanced_features_enabled = var.is_advanced_features_enabled + credential_details { + credential_type = var.credential_details_credential_type + password_secret_id = var.password_secret_id + user_name = var.user_name + } + connection_details { + host_name = var.adb_host + protocol = "TCPS" + service_name = var.service_name + port = var.adb_port + } + } + } + defined_tags = "${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "${var.exadata_insight_defined_tags_value}")}" + freeform_tags = var.freeform_tags +} + +variable "exadata_insight_state" { + default = ["ACTIVE"] +} + +variable "exadata_insight_status" { + default = ["ENABLED"] +} + +variable "exadata_type" { + default = ["EXACS"] +} + +// List PE comanaged exadata insights +data "oci_opsi_exadata_insights" "test_exadata_insights" { + #Optional + compartment_id = var.compartment_ocid + exadata_type = var.exadata_insight_type + state = var.exadata_insight_state + status = var.exadata_insight_status +} + +// Get a PE comanaged exadata insight +data "oci_opsi_exadata_insight" "test_exadata_insight" { + exadata_insight_id = oci_opsi_exadata_insight.test_exadata_insight.id +} + diff --git a/examples/psql/main.tf b/examples/psql/main.tf index c3048cdc577..b8e7b3a69bc 100644 --- a/examples/psql/main.tf +++ b/examples/psql/main.tf @@ -135,8 +135,8 @@ resource "oci_psql_db_system" "test_flexdb_system" { } } -# Creating a dbSystem configuration -resource "oci_psql_configuration" "test_configuration" { +# Creating a dbSystem flex configuration +resource "oci_psql_configuration" "test_fixed_configuration" { #Required compartment_id = var.compartment_ocid shape = "VM.Standard.E4.Flex" @@ -147,15 +147,14 @@ resource "oci_psql_configuration" "test_configuration" { } } db_version = "14" - display_name = "terraform test configuration" - - #Optional + display_name = "terraform test configuration" instance_memory_size_in_gbs = "64" instance_ocpu_count = "4" - description = "test configuration created by terraform" + is_flexible=false + description = "test fixed configuration created by terraform" } -# Creating a dbSystem configuration +# Creating a dbSystem flex configuration resource "oci_psql_configuration" "test_flexible_configuration" { #Required compartment_id = var.compartment_ocid @@ -168,11 +167,33 @@ resource "oci_psql_configuration" "test_flexible_configuration" { } db_version = "14" display_name = "terraform test flex configuration" + + #Optional + instance_memory_size_in_gbs = "0" + instance_ocpu_count = "0" + is_flexible = true + description = "test flexible configuration created by terraform" +} + +# Creating a dbSystem flex configuration with multiple compatible shapes +resource "oci_psql_configuration" "test_flexible_multiple_comp_configuration" { + #Required + compartment_id = var.compartment_ocid + compatible_shapes = ["VM.Standard.E5.Flex", "VM.Standard.E4.Flex"] + db_configuration_overrides { + items { + config_key = "effective_io_concurrency" + overriden_config_value = "1" + } + } + db_version = "15" + display_name = "terraform test fixed configuration" + #Optional instance_memory_size_in_gbs = "0" instance_ocpu_count = "0" is_flexible = true - description = "test configuration created by terraform" + description = "test flexible configuration with multiple compatible shapes created by terraform" } data "oci_psql_configurations" "test_configurations" { diff --git a/examples/vault_secret/XRR/main.tf b/examples/vault_secret/XRR/main.tf new file mode 100644 index 00000000000..a2e6dd9d0ba --- /dev/null +++ b/examples/vault_secret/XRR/main.tf @@ -0,0 +1,147 @@ +variable "tenancy_ocid" {} +variable "region" {} +variable "kms_vault_ocid" {} +variable "kms_key_ocid" {} +variable "compartment_ocid" {} + +provider "oci" { + tenancy_ocid = var.tenancy_ocid + region = var.region + // .. auth options +} + +data "oci_vault_secrets" "test_secrets" { + compartment_id = var.compartment_ocid + state = "ACTIVE" + vault_id = var.kms_vault_ocid +} + +resource "oci_vault_secret" "test_secret" { + #Required + compartment_id = var.compartment_ocid + secret_content { + #Required + content_type = "BASE64" + + #Optional + content = "PHZhcj4mbHQ7YmFzZTY0X2VuY29kZWRfc2VjcmV0X2NvbnRlbnRzJmd0OzwvdmFyPg==" + name = "XRRSecretSample1" + stage = "CURRENT" + } + replication_config { + replication_targets { + target_key_id = var.kms_key_ocid + target_region = "us-phoenix-1" + target_vault_id = var.kms_vault_ocid + } + #Optional + is_write_forward_enabled = false + } + + key_id = var.kms_key_ocid + secret_name = "XRRSecretSample1105" + vault_id = var.kms_vault_ocid +} + +resource "oci_vault_secret" "test_secret_wf_enabled" { + #Required + compartment_id = var.compartment_ocid + secret_content { + #Required + content_type = "BASE64" + + #Optional + content = "PHZhcj4mbHQ7YmFzZTY0X2VuY29kZWRfc2VjcmV0X2NvbnRlbnRzJmd0OzwvdmFyPg==" + name = "XRRSecretSample102" + stage = "CURRENT" + } + replication_config { + replication_targets { + target_key_id = var.kms_key_ocid + target_region = "us-phoenix-1" + target_vault_id = var.kms_vault_ocid + } + #Optional + is_write_forward_enabled = true + } + + key_id = var.kms_key_ocid + secret_name = "XRRSecretSample1104" + vault_id = var.kms_vault_ocid +} + +resource "oci_vault_secret" "test_secret_multiple_replication_targets" { + #Required + compartment_id = var.compartment_ocid + secret_content { + #Required + content_type = "BASE64" + + #Optional + content = "PHZhcj4mbHQ7YmFzZTY0X2VuY29kZWRfc2VjcmV0X2NvbnRlbnRzJmd0OzwvdmFyPg==" + name = "XRRSecretSample1" + stage = "CURRENT" + } + replication_config { + replication_targets { + target_key_id = var.kms_key_ocid + target_region = "us-phoenix-1" + target_vault_id = var.kms_vault_ocid + } + replication_targets { + target_key_id = var.kms_key_ocid + target_region = "us-sanjose-1" + target_vault_id = var.kms_vault_ocid + } + #Optional + is_write_forward_enabled = true + } + + key_id = var.kms_key_ocid + secret_name = "XRRSecretSample1103" + vault_id = var.kms_vault_ocid +} + +data "oci_vault_secret" "test_secret" { + secret_id = oci_vault_secret.test_secret.id +} + +data "oci_vault_secret" "test_secret_wf_enabled" { + secret_id = oci_vault_secret.test_secret_wf_enabled.id +} + +data "oci_vault_secret" "test_secret_multiple_replication_targets" { + secret_id = oci_vault_secret.test_secret_multiple_replication_targets.id +} + +data "oci_vault_secrets" "test_secret_xrr" { + compartment_id = var.compartment_ocid +} + +data "oci_secrets_secretbundle_versions" "test_secretbundle_versions" { + #Required + secret_id = oci_vault_secret.test_secret.id +} + +// Get Secret content +data "oci_secrets_secretbundle" "test_secretbundles" { + #Required + secret_id = oci_vault_secret.test_secret.id + stage = "CURRENT" +} + +output "all_vault_secrets_data" { + value = data.oci_vault_secrets.test_secret_xrr +} + +output "all_vault_secrets_data_for_xrr_secret" { + value = data.oci_vault_secret.test_secret +} + +output "all_vault_secrets_data_for_xrr_secret_wf_enabled" { + value = data.oci_vault_secret.test_secret_wf_enabled +} + +output "all_vault_secrets_data_for_xrr_secret_multiple_replication_targets" { + value = data.oci_vault_secret.test_secret_multiple_replication_targets +} \ No newline at end of file diff --git a/go.mod b/go.mod index 1f62a1547da..2a96c523ba3 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/hashicorp/terraform-plugin-mux v0.18.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.36.1 github.com/hashicorp/terraform-plugin-testing v1.9.0 - github.com/oracle/oci-go-sdk/v65 v65.96.0 + github.com/oracle/oci-go-sdk/v65 v65.97.1 github.com/stretchr/testify v1.9.0 golang.org/x/mod v0.24.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/go.sum b/go.sum index 82be4e90b6d..bb87010b85a 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,11 @@ +cel.dev/expr v0.20.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.26.0/go.mod h1:2bIszWvQRlJVmJLiuLhukLImRjKPcYdzzsx6darK02A= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw= @@ -11,13 +17,19 @@ github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:o github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bsm/go-vlq v0.0.0-20150828105119-ec6e8d4f5f4e/go.mod h1:N+BjUcTjSxc2mtRGSCPsat1kze3CUtvJN3/jTXlp29k= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8= +github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= +github.com/cncf/xds/go v0.0.0-20250121191232-2f005788dc42/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,6 +37,10 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/envoyproxy/go-control-plane v0.13.4/go.mod h1:kDfuBlDVsSj2MjrLEtRWtHlsWIFcGyB2RMO44Dc5GZA= +github.com/envoyproxy/go-control-plane/envoy v1.32.4/go.mod h1:Gzjc5k8JcJswLjAx1Zm+wSYE20UrLtt7JZMWiWQXQEw= +github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= +github.com/envoyproxy/protoc-gen-validate v1.2.1/go.mod h1:d/C80l/jxXLdfEIhX1W2TmLfsJ31lvEjwamM4DxlWXU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= @@ -35,6 +51,7 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60= github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k= +github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= @@ -44,6 +61,7 @@ github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3a github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= +github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -55,10 +73,12 @@ github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6 github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/cli v1.1.7/go.mod h1:e6Mfpga9OCT1vqzFuoGZiiF/KaG9CbUfO5s3ghU3YgU= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -117,6 +137,8 @@ github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv2 github.com/hashicorp/yamux v0.1.2 h1:XtB8kyFOyHXYVFnwT5C3+Bdo8gArse7j2AQ0DA0Uey8= github.com/hashicorp/yamux v0.1.2/go.mod h1:C+zze2n6e/7wshOZep2A70/aQU6QBRWJO/G6FT1wIns= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -160,21 +182,31 @@ github.com/oracle/oci-go-sdk/v65 v65.95.2 h1:0HJ0AgpLydp/DtvYrF2d4str2BjXOVAeNbu github.com/oracle/oci-go-sdk/v65 v65.95.2/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA= github.com/oracle/oci-go-sdk/v65 v65.96.0 h1:ew0WavsB6N/I6etYCC160cD5qDXbek/1xZgujqTzork= github.com/oracle/oci-go-sdk/v65 v65.96.0/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA= +github.com/oracle/oci-go-sdk/v65 v65.97.0 h1:QyOOg/qCIY6vBSD+GHUfEQaJk9Wbl8a6VESkXfZ0fYo= +github.com/oracle/oci-go-sdk/v65 v65.97.0/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8W3BQeqJ6ZZt9VLA= +github.com/oracle/oci-go-sdk/v65 v65.97.1 h1:tuYBKZWiFgHBxAot0vJGe934Kh1arRvW2QdMUnI/CJA= +github.com/oracle/oci-go-sdk/v65 v65.97.1/go.mod h1:RGiXfpDDmRRlLtqlStTzeBjjdUNXyqm3KXKyLCm3A/Q= github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4= github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= github.com/sony/gobreaker v0.5.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sony/gobreaker v1.0.0 h1:feX5fGGXSl3dYd4aHZItw+FpHLvvoaqkawKjVNiFMNQ= github.com/sony/gobreaker v1.0.0/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spiffe/go-spiffe/v2 v2.5.0/go.mod h1:P+NxobPc6wXhVtINNtFjNWGBTreew1GBUCwT2wPmb7g= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -205,8 +237,10 @@ github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70 github.com/zclconf/go-cty v1.16.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo= github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM= +github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= @@ -220,12 +254,18 @@ go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -237,13 +277,20 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= +golang.org/x/oauth2 v0.26.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -262,16 +309,25 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= +golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -279,13 +335,18 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.33.0 h1:4qz2S3zmRxbGIhDIAgjxvFutSvH5EfnsYrRBj0UI0bc= golang.org/x/tools v0.33.0/go.mod h1:CIJMaWEY88juyUfo7UbgPqbC8rU2OqfAV1h2Qp0oMYI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -293,6 +354,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= +google.golang.org/genproto/googleapis/api v0.0.0-20250218202821-56aae31c358a/go.mod h1:3kWAYMk1I75K4vykHtKt2ycnOgpA6974V7bREqbsenU= google.golang.org/genproto/googleapis/rpc v0.0.0-20250512202823-5a2f75b736a9 h1:IkAfh6J/yllPtpYFU0zZN1hUPYdT0ogkBT/9hMxHjvg= google.golang.org/genproto/googleapis/rpc v0.0.0-20250512202823-5a2f75b736a9/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= diff --git a/internal/client/api_platform_clients.go b/internal/client/api_platform_clients.go new file mode 100644 index 00000000000..f1268fd0f24 --- /dev/null +++ b/internal/client/api_platform_clients.go @@ -0,0 +1,34 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package client + +import ( + oci_api_platform "github.com/oracle/oci-go-sdk/v65/apiplatform" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" +) + +func init() { + RegisterOracleClient("oci_api_platform.ApiPlatformClient", &OracleClient{InitClientFn: initApiplatformApiPlatformClient}) +} + +func initApiplatformApiPlatformClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_api_platform.NewApiPlatformClientWithConfigurationProvider(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) ApiPlatformClient() *oci_api_platform.ApiPlatformClient { + return m.GetClient("oci_api_platform.ApiPlatformClient").(*oci_api_platform.ApiPlatformClient) +} diff --git a/internal/client/apm_traces_clients.go b/internal/client/apm_traces_clients.go index a9ccda57709..32618299b29 100644 --- a/internal/client/apm_traces_clients.go +++ b/internal/client/apm_traces_clients.go @@ -10,10 +10,32 @@ import ( ) func init() { + RegisterOracleClient("oci_apm_traces.AttributesClient", &OracleClient{InitClientFn: initApmtracesAttributesClient}) RegisterOracleClient("oci_apm_traces.QueryClient", &OracleClient{InitClientFn: initApmtracesQueryClient}) + RegisterOracleClient("oci_apm_traces.ScheduledQueryClient", &OracleClient{InitClientFn: initApmtracesScheduledQueryClient}) RegisterOracleClient("oci_apm_traces.TraceClient", &OracleClient{InitClientFn: initApmtracesTraceClient}) } +func initApmtracesAttributesClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_apm_traces.NewAttributesClientWithConfigurationProvider(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) AttributesClient() *oci_apm_traces.AttributesClient { + return m.GetClient("oci_apm_traces.AttributesClient").(*oci_apm_traces.AttributesClient) +} + func initApmtracesQueryClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { client, err := oci_apm_traces.NewQueryClientWithConfigurationProvider(configProvider) if err != nil { @@ -34,6 +56,26 @@ func (m *OracleClients) QueryClient() *oci_apm_traces.QueryClient { return m.GetClient("oci_apm_traces.QueryClient").(*oci_apm_traces.QueryClient) } +func initApmtracesScheduledQueryClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_apm_traces.NewScheduledQueryClientWithConfigurationProvider(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) ScheduledQueryClient() *oci_apm_traces.ScheduledQueryClient { + return m.GetClient("oci_apm_traces.ScheduledQueryClient").(*oci_apm_traces.ScheduledQueryClient) +} + func initApmtracesTraceClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { client, err := oci_apm_traces.NewTraceClientWithConfigurationProvider(configProvider) if err != nil { diff --git a/internal/globalvar/constants.go b/internal/globalvar/constants.go index a650d8a9608..6afde4d7341 100644 --- a/internal/globalvar/constants.go +++ b/internal/globalvar/constants.go @@ -33,6 +33,7 @@ const ( UserAgentSDKNameEnv = "OCI_SDK_APPEND_USER_AGENT" DomainNameOverrideEnv = "domain_name_override" HasCorrectDomainNameEnv = "has_correct_domain_name" + OciRegionMetadataEnv = "OCI_REGION_METADATA" ClientHostOverridesEnv = "CLIENT_HOST_OVERRIDES" CustomCertLocationEnv = "custom_cert_location" AcceptLocalCerts = "accept_local_certs" diff --git a/internal/globalvar/version.go b/internal/globalvar/version.go index 3917831477b..c2961571521 100644 --- a/internal/globalvar/version.go +++ b/internal/globalvar/version.go @@ -7,8 +7,8 @@ import ( "log" ) -const Version = "7.11.0" -const ReleaseDate = "2025-07-28" +const Version = "7.13.0" +const ReleaseDate = "2025-08-06" func PrintVersion() { log.Printf("[INFO] terraform-provider-oci %s\n", Version) diff --git a/internal/integrationtest/api_platform_api_platform_instance_test.go b/internal/integrationtest/api_platform_api_platform_instance_test.go new file mode 100644 index 00000000000..24f49333d75 --- /dev/null +++ b/internal/integrationtest/api_platform_api_platform_instance_test.go @@ -0,0 +1,346 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + oci_api_platform "github.com/oracle/oci-go-sdk/v65/apiplatform" + "github.com/oracle/oci-go-sdk/v65/common" + + "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 ( + ApiPlatformApiPlatformInstanceRequiredOnlyResource = ApiPlatformApiPlatformInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Required, acctest.Create, ApiPlatformApiPlatformInstanceRepresentation) + + ApiPlatformApiPlatformInstanceResourceConfig = ApiPlatformApiPlatformInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Optional, acctest.Update, ApiPlatformApiPlatformInstanceRepresentation) + + ApiPlatformApiPlatformInstanceSingularDataSourceRepresentation = map[string]interface{}{ + "api_platform_instance_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_api_platform_api_platform_instance.test_api_platform_instance.id}`}, + } + + ApiPlatformApiPlatformInstanceDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_api_platform_api_platform_instance.test_api_platform_instance.id}`}, + "name": acctest.Representation{RepType: acctest.Optional, Create: `name`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `ACTIVE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ApiPlatformApiPlatformInstanceDataSourceFilterRepresentation}} + ApiPlatformApiPlatformInstanceDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_api_platform_api_platform_instance.test_api_platform_instance.id}`}}, + } + + ApiPlatformApiPlatformInstanceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "name": acctest.Representation{RepType: acctest.Required, Create: `name`}, + "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`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ApiPlatformApiPlatformInstanceIgnoreChangesDeploymentRepresentation}, + } + + ApiPlatformApiPlatformInstanceIgnoreChangesDeploymentRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`, `system_tags`}}, + } + + ApiPlatformApiPlatformInstanceResourceDependencies = DefinedTagsDependencies +) + +// issue-routing-tag: api_platform/default +func TestApiPlatformApiPlatformInstanceResource_basic(t *testing.T) { + httpreplay.SetScenario("TestApiPlatformApiPlatformInstanceResource_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_api_platform_api_platform_instance.test_api_platform_instance" + datasourceName := "data.oci_api_platform_api_platform_instances.test_api_platform_instances" + singularDatasourceName := "data.oci_api_platform_api_platform_instance.test_api_platform_instance" + + var resId, resId2 string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+ApiPlatformApiPlatformInstanceResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Optional, acctest.Create, ApiPlatformApiPlatformInstanceRepresentation), "apiplatform", "apiPlatformInstance", t) + + acctest.ResourceTest(t, testAccCheckApiPlatformApiPlatformInstanceDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + ApiPlatformApiPlatformInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Required, acctest.Create, ApiPlatformApiPlatformInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "name", "name"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + ApiPlatformApiPlatformInstanceResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + ApiPlatformApiPlatformInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Optional, acctest.Create, ApiPlatformApiPlatformInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "name", "name"), + 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 + ApiPlatformApiPlatformInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(ApiPlatformApiPlatformInstanceRepresentation, map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id_for_update}`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "description", "description"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "name", "name"), + 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 + ApiPlatformApiPlatformInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Optional, acctest.Update, ApiPlatformApiPlatformInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "description", "description2"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "name", "name"), + 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_api_platform_api_platform_instances", "test_api_platform_instances", acctest.Optional, acctest.Update, ApiPlatformApiPlatformInstanceDataSourceRepresentation) + + compartmentIdVariableStr + ApiPlatformApiPlatformInstanceResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Optional, acctest.Update, ApiPlatformApiPlatformInstanceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "id"), + resource.TestCheckResourceAttr(datasourceName, "name", "name"), + resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + + resource.TestCheckResourceAttr(datasourceName, "api_platform_instance_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "api_platform_instance_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_api_platform_api_platform_instance", "test_api_platform_instance", acctest.Required, acctest.Create, ApiPlatformApiPlatformInstanceSingularDataSourceRepresentation) + + compartmentIdVariableStr + ApiPlatformApiPlatformInstanceResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "api_platform_instance_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "idcs_app.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "name", "name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + resource.TestCheckResourceAttr(singularDatasourceName, "uris.#", "1"), + ), + }, + // verify resource import + { + Config: config + ApiPlatformApiPlatformInstanceRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckApiPlatformApiPlatformInstanceDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).ApiPlatformClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_api_platform_api_platform_instance" { + noResourceFound = false + request := oci_api_platform.GetApiPlatformInstanceRequest{} + + tmp := rs.Primary.ID + request.ApiPlatformInstanceId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "api_platform") + + response, err := client.GetApiPlatformInstance(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_api_platform.ApiPlatformInstanceLifecycleStateDeleted): 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("ApiPlatformApiPlatformInstance") { + resource.AddTestSweepers("ApiPlatformApiPlatformInstance", &resource.Sweeper{ + Name: "ApiPlatformApiPlatformInstance", + Dependencies: acctest.DependencyGraph["apiPlatformInstance"], + F: sweepApiPlatformApiPlatformInstanceResource, + }) + } +} + +func sweepApiPlatformApiPlatformInstanceResource(compartment string) error { + apiPlatformClient := acctest.GetTestClients(&schema.ResourceData{}).ApiPlatformClient() + apiPlatformInstanceIds, err := getApiPlatformApiPlatformInstanceIds(compartment) + if err != nil { + return err + } + for _, apiPlatformInstanceId := range apiPlatformInstanceIds { + if ok := acctest.SweeperDefaultResourceId[apiPlatformInstanceId]; !ok { + deleteApiPlatformInstanceRequest := oci_api_platform.DeleteApiPlatformInstanceRequest{} + + deleteApiPlatformInstanceRequest.ApiPlatformInstanceId = &apiPlatformInstanceId + + deleteApiPlatformInstanceRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "api_platform") + _, error := apiPlatformClient.DeleteApiPlatformInstance(context.Background(), deleteApiPlatformInstanceRequest) + if error != nil { + fmt.Printf("Error deleting ApiPlatformInstance %s %s, It is possible that the resource is already deleted. Please verify manually \n", apiPlatformInstanceId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &apiPlatformInstanceId, ApiPlatformApiPlatformInstanceSweepWaitCondition, time.Duration(3*time.Minute), + ApiPlatformApiPlatformInstanceSweepResponseFetchOperation, "api_platform", true) + } + } + return nil +} + +func getApiPlatformApiPlatformInstanceIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ApiPlatformInstanceId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + apiPlatformClient := acctest.GetTestClients(&schema.ResourceData{}).ApiPlatformClient() + + listApiPlatformInstancesRequest := oci_api_platform.ListApiPlatformInstancesRequest{} + listApiPlatformInstancesRequest.CompartmentId = &compartmentId + listApiPlatformInstancesRequest.LifecycleState = oci_api_platform.ApiPlatformInstanceLifecycleStateActive + listApiPlatformInstancesResponse, err := apiPlatformClient.ListApiPlatformInstances(context.Background(), listApiPlatformInstancesRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting ApiPlatformInstance list for compartment id : %s , %s \n", compartmentId, err) + } + for _, apiPlatformInstance := range listApiPlatformInstancesResponse.Items { + id := *apiPlatformInstance.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ApiPlatformInstanceId", id) + } + return resourceIds, nil +} + +func ApiPlatformApiPlatformInstanceSweepWaitCondition(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 apiPlatformInstanceResponse, ok := response.Response.(oci_api_platform.GetApiPlatformInstanceResponse); ok { + return apiPlatformInstanceResponse.LifecycleState != oci_api_platform.ApiPlatformInstanceLifecycleStateDeleted + } + return false +} + +func ApiPlatformApiPlatformInstanceSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.ApiPlatformClient().GetApiPlatformInstance(context.Background(), oci_api_platform.GetApiPlatformInstanceRequest{ + ApiPlatformInstanceId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/apm_config_agent_config_test.go b/internal/integrationtest/apm_config_agent_config_test.go new file mode 100644 index 00000000000..662f80475c2 --- /dev/null +++ b/internal/integrationtest/apm_config_agent_config_test.go @@ -0,0 +1,367 @@ +// Copyright (c) 2025, Oracle and/or its affiliates. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "net/url" + "regexp" + "strconv" + "strings" + "testing" + + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "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/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + oci_apm_config "github.com/oracle/oci-go-sdk/v65/apmconfig" + "github.com/oracle/oci-go-sdk/v65/common" + + "github.com/oracle/terraform-provider-oci/httpreplay" +) + +var ( + ApmConfigAgentConfigRequiredOnlyResource = acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_agent_config", acctest.Required, acctest.Create, configAgentConfigRepresentation) + + ApmConfigAgentConfigResource = ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_agent_config", acctest.Optional, acctest.Update, configAgentConfigRepresentation) + + ApmConfigAgentConfigDataResource = acctest.GenerateDataSourceFromRepresentationMap("oci_apm_config_config", "test_agent_config", acctest.Required, acctest.Create, ApmConfigAgentconfigSingularDataSourceRepresentation) + + ApmConfigAgentconfigSingularDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_apm_domain.test_apm_domain.id}`}, + "config_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_config_config.test_agent_config.id}`}, + } + + ApmConfigAgentConfigDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_apm_domain.test_apm_domain.id}`}, + "config_type": acctest.Representation{RepType: acctest.Optional, Create: configTypeAgentConfig, Update: configTypeAgentConfig}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ApmConfigAgentConfigFilterDataSourceFilterRepresentation}, + } + + ApmConfigAgentConfigFilterDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${data.oci_apm_config_config.test_agent_config.id}`}}, + } + + configTypeAgentConfig = "AGENT" + + configAgentConfigRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_apm_domain.test_apm_domain.id}`}, + "config_type": acctest.Representation{RepType: acctest.Required, Create: configTypeAgentConfig, Update: configTypeAgentConfig}, + "config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: configAgentConfigConfigRepresentation}, + "match_agents_with_attribute_value": acctest.Representation{RepType: acctest.Required, Create: "value1"}, + "overrides": acctest.RepresentationGroup{RepType: acctest.Optional, Group: configAgentConfigOverridesRepresentation}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, + Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, + Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + } + + configAgentConfigConfigRepresentation = map[string]interface{}{ + "config_map": acctest.RepresentationGroup{RepType: acctest.Required, Group: configAgentConfigConfigFileRepresentation}, + } + + configAgentConfigConfigFileRepresentation = map[string]interface{}{ + "file_name": acctest.Representation{RepType: acctest.Required, Create: "example1", Update: "example2"}, + "body": acctest.Representation{RepType: acctest.Required, Create: "Y29tLm9yYWNsZS5hcG0uYWdlbnQudHJhY2VyLmVuYWJsZS5qZnIgPSB7eyBpc0pmckVuYWJsZWQgfCBkZWZhdWx0IGZhbHNlIH19", + Update: "Y29tLm9yYWNsZS5hcG0uYWdlbnQuY2lyY3VpdC5icmVha2VyLmVuYWJsZSA9IHt7IGlzQ2lyY3VpdEJyZWFrZXJFbmFibGVkIHwgZGVmYXVsdCB0cnVlIH19"}, + "content_type": acctest.Representation{RepType: acctest.Required, Create: "charset=utf-8"}, + } + + configAgentConfigOverridesRepresentation = map[string]interface{}{ + "override_list": acctest.RepresentationGroup{RepType: acctest.Optional, Group: configAgentConfigOverrideListRepresentation}, + } + + configAgentConfigOverrideListRepresentation = map[string]interface{}{ + "agent_filter": acctest.Representation{RepType: acctest.Optional, Create: "Component='Server'", Update: "Component='Browser'"}, + "override_map": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"isJfrEnabled": "true"}, Update: map[string]string{"isCircuitBreakerEnabled": "false"}}, + } +) + +// issue-routing-tag: apm_config/default +func TestApmConfigAgentConfigResource_basic(t *testing.T) { + httpreplay.SetScenario("TestApmConfigAgentConfigResource_basic") + defer httpreplay.SaveScenario() + + provider := acctest.TestAccProvider + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_apm_config_config.test_agent_config" + datasourceName := "data.oci_apm_config_configs.test_agent_configs" + singularDatasourceName := "data.oci_apm_config_config.test_agent_config" + + 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+ApmConfigConfigResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_agent_config", acctest.Optional, acctest.Create, configAgentConfigRepresentation), "apmconfig", "config", t) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + Providers: map[string]*schema.Provider{ + "oci": provider, + }, + CheckDestroy: testAccCheckApmConfigAgentConfigDestroy, + Steps: []resource.TestStep{ + // Find these steps in the test log easily with "Executing step (number)" + // Step 1: verify create Agent Config + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_agent_config", acctest.Required, acctest.Create, configAgentConfigRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "config_type", configTypeAgentConfig), + resource.TestCheckResourceAttr(resourceName, "config.#", "0"), + resource.TestCheckResourceAttr(resourceName, "match_agents_with_attribute_value", "value1"), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttrSet(resourceName, "updated_by"), + resource.TestCheckResourceAttrSet(resourceName, "etag"), + resource.TestCheckResourceAttr(resourceName, "in_use_by.0.items.#", "0"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + utils.Logf("This is error") + return err + }, + ), + }, + // Step 2: delete Agent Config before next create + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies, + }, + // Step 3: verify create Agent Config with optionals + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_agent_config", acctest.Optional, acctest.Create, configAgentConfigRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "config_type", configTypeAgentConfig), + resource.TestCheckResourceAttr(resourceName, "config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "config.0.config_map.#", "1"), + resource.TestCheckResourceAttr(resourceName, "config.0.config_map.0.file_name", "example1"), + resource.TestCheckResourceAttr(resourceName, "overrides.0.override_list.0.agent_filter", "Component='Server'"), + resource.TestCheckResourceAttr(resourceName, "match_agents_with_attribute_value", "value1"), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttrSet(resourceName, "updated_by"), + resource.TestCheckResourceAttrSet(resourceName, "etag"), + resource.TestCheckResourceAttr(resourceName, "in_use_by.0.items.#", "0"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + // Step 4: verify updates to Agent Config updatable parameters + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_agent_config", acctest.Optional, acctest.Update, configAgentConfigRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "config_type", configTypeAgentConfig), + resource.TestCheckResourceAttr(resourceName, "config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "config.0.config_map.0.file_name", "example2"), + resource.TestCheckResourceAttr(resourceName, "overrides.0.override_list.0.agent_filter", "Component='Browser'"), + resource.TestCheckResourceAttr(resourceName, "match_agents_with_attribute_value", "value1"), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttrSet(resourceName, "updated_by"), + resource.TestCheckResourceAttrSet(resourceName, "etag"), + resource.TestCheckResourceAttr(resourceName, "in_use_by.0.items.#", "0"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "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 + }, + ), + }, + // Step 5: verify datasource (Agent Config) + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_apm_config_configs", "test_agent_configs", acctest.Optional, acctest.Update, ApmConfigAgentConfigDataSourceRepresentation) + + compartmentIdVariableStr + ApmConfigAgentConfigResource + ApmConfigAgentConfigDataResource, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "apm_domain_id"), + resource.TestCheckResourceAttr(datasourceName, "config_type", configTypeAgentConfig), + resource.TestCheckResourceAttr(datasourceName, "config_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "config_collection.0.items.#", "1"), + ), + }, + // Step 6: verify singular datasource (Agent Config) + { + Config: config + compartmentIdVariableStr + ApmConfigAgentConfigResource + ApmConfigAgentConfigDataResource, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "config_type", configTypeAgentConfig), + resource.TestCheckResourceAttr(singularDatasourceName, "config.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "config.0.config_map.0.file_name", "example2"), + resource.TestCheckResourceAttr(singularDatasourceName, "overrides.0.override_list.0.agent_filter", "Component='Browser'"), + resource.TestCheckResourceAttr(singularDatasourceName, "match_agents_with_attribute_value", "value1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "created_by"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "updated_by"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "etag"), + resource.TestCheckResourceAttr(singularDatasourceName, "in_use_by.0.items.#", "0"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + ), + }, + // Step 7: remove singular datasource from previous step so that it doesn't conflict with import tests + { + Config: config + compartmentIdVariableStr + ApmConfigAgentConfigResource, + }, + // Step 8: verify resource import + { + Config: config + ApmConfigAgentConfigRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apm_domain_id", + "opc_dry_run", + }, + ResourceName: resourceName, + }, + }, + }) +} + +func testAccCheckApmConfigAgentConfigDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).ConfigClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_apm_config_config" { + noResourceFound = false + request := oci_apm_config.GetConfigRequest{} + + if value, ok := rs.Primary.Attributes["apm_domain_id"]; ok { + request.ApmDomainId = &value + } + + tmp, _ := parseConfigCompositeId(rs.Primary.ID) + request.ConfigId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "apm_config") + + _, err := client.GetConfig(context.Background(), request) + + if err == nil { + return fmt.Errorf("resource still exists") + } + + //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 parseConfigCompositeId(compositeId string) (configId string, err error) { + parts := strings.Split(compositeId, "/") + + match, _ := regexp.MatchString("configs/.*/apmDomainId/.*", compositeId) + if !match || len(parts) != 4 { + err = fmt.Errorf("illegal compositeId %s encountered", compositeId) + return + } + configId, _ = url.PathUnescape(parts[1]) + + return +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("ApmConfigAgentConfig") { + resource.AddTestSweepers("ApmConfigAgentConfig", &resource.Sweeper{ + Name: "ApmConfigAgentConfig", + Dependencies: acctest.DependencyGraph["config"], + F: sweepApmConfigAgentConfigResource, + }) + } +} + +func sweepApmConfigAgentConfigResource(compartment string) error { + configClient := acctest.GetTestClients(&schema.ResourceData{}).ConfigClient() + configIds, err := getAgentConfigIds(compartment) + if err != nil { + return err + } + for _, configId := range configIds { + if ok := acctest.SweeperDefaultResourceId[configId]; !ok { + deleteConfigRequest := oci_apm_config.DeleteConfigRequest{} + + deleteConfigRequest.ConfigId = &configId + + deleteConfigRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "apm_config") + _, error := configClient.DeleteConfig(context.Background(), deleteConfigRequest) + if error != nil { + fmt.Printf("Error deleting Config %s %s, It is possible that the resource is already deleted. Please verify manually \n", configId, error) + continue + } + } + } + return nil +} + +func getAgentConfigIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ConfigId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + configClient := acctest.GetTestClients(&schema.ResourceData{}).ConfigClient() + + listConfigsRequest := oci_apm_config.ListConfigsRequest{} + //listConfigsRequest.CompartmentId = &compartmentId + + apmDomainIds, error := getApmDomainIds(compartment) + if error != nil { + return resourceIds, fmt.Errorf("Error getting apmDomainId required for Config resource requests \n") + } + for _, apmDomainId := range apmDomainIds { + listConfigsRequest.ApmDomainId = &apmDomainId + + listConfigsResponse, err := configClient.ListConfigs(context.Background(), listConfigsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting Config list for compartment id : %s , %s \n", compartmentId, err) + } + for _, config := range listConfigsResponse.Items { + id := *config.GetId() + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ConfigId", id) + } + + } + return resourceIds, nil +} diff --git a/internal/integrationtest/apm_config_macs_apm_extension_test.go b/internal/integrationtest/apm_config_macs_apm_extension_test.go new file mode 100644 index 00000000000..2a68678d1be --- /dev/null +++ b/internal/integrationtest/apm_config_macs_apm_extension_test.go @@ -0,0 +1,358 @@ +// Copyright (c) 2025, Oracle and/or its affiliates. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "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/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + oci_apm_config "github.com/oracle/oci-go-sdk/v65/apmconfig" + "github.com/oracle/oci-go-sdk/v65/common" + + "github.com/oracle/terraform-provider-oci/httpreplay" +) + +var ( + ApmConfigMacsApmExtensionRequiredOnlyResource = acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_macs_apm_extension", acctest.Required, acctest.Create, configMacsApmExtensionRepresentation) + + ApmConfigMacsApmExtensionResource = ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_macs_apm_extension", acctest.Optional, acctest.Update, configMacsApmExtensionRepresentation) + + ApmConfigMacsApmExtensionDataResource = acctest.GenerateDataSourceFromRepresentationMap("oci_apm_config_config", "test_macs_apm_extension", acctest.Required, acctest.Create, ApmConfigMacsApmExtensionSingularDataSourceRepresentation) + + ApmConfigMacsApmExtensionSingularDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_apm_domain.test_apm_domain.id}`}, + "config_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_config_config.test_macs_apm_extension.id}`}, + } + + ApmConfigMacsApmExtensionDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_apm_domain.test_apm_domain.id}`}, + "config_type": acctest.Representation{RepType: acctest.Optional, Create: configTypeMacsApmExtension, Update: configTypeMacsApmExtension}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ApmConfigMacsApmExtensionFilterDataSourceFilterRepresentation}, + } + + ApmConfigMacsApmExtensionFilterDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${data.oci_apm_config_config.test_macs_apm_extension.id}`}}, + } + + configTypeMacsApmExtension = "MACS_APM_EXTENSION" + + configManagementAgentOcid = utils.GetEnvSettingWithBlankDefault("management_agent_ocid") + + configMacsApmExtensionRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_apm_domain.test_apm_domain.id}`}, + "config_type": acctest.Representation{RepType: acctest.Required, Create: configTypeMacsApmExtension, Update: configTypeMacsApmExtension}, + "management_agent_id": acctest.Representation{RepType: acctest.Required, Create: configManagementAgentOcid}, + "process_filter": acctest.Representation{RepType: acctest.Required, Create: []string{".*org.apache.catalina.startup.Bootstrap.*", ".*jetty.*"}, + Update: []string{".*org.jboss.*", ".*org.apache.bootstrap.*"}}, + "run_as_user": acctest.Representation{RepType: acctest.Required, Create: "tomcat", Update: "tomcat2"}, + "service_name": acctest.Representation{RepType: acctest.Required, Create: "Tomcat", Update: "Tomcat2"}, + "agent_version": acctest.Representation{RepType: acctest.Required, Create: "1.16.0.585", Update: "1.16.0.586"}, + "attach_install_dir": acctest.Representation{RepType: acctest.Required, Create: "/opt/oracle/apm_attach_process", Update: "/opt/oracle/apm_attach_process2"}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: "Display name 1", Update: "Display name 2"}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, + Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, + Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "updatedValue"})}`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + } +) + +// issue-routing-tag: apm_config/default +func TestApmConfigMacsApmExtensionResource_basic(t *testing.T) { + httpreplay.SetScenario("TestApmConfigMacsApmExtensionResource_basic") + defer httpreplay.SaveScenario() + + provider := acctest.TestAccProvider + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_apm_config_config.test_macs_apm_extension" + datasourceName := "data.oci_apm_config_configs.test_macs_apm_extensions" + singularDatasourceName := "data.oci_apm_config_config.test_macs_apm_extension" + + 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+ApmConfigConfigResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_macs_apm_extension", acctest.Optional, acctest.Create, configMacsApmExtensionRepresentation), "apmconfig", "config", t) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acctest.PreCheck(t) }, + Providers: map[string]*schema.Provider{ + "oci": provider, + }, + CheckDestroy: testAccCheckApmConfigMacsApmExtensionDestroy, + Steps: []resource.TestStep{ + // Find these steps in the test log easily with "Executing step (number)" + // Step 1: verify create Macs APM Extension + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_macs_apm_extension", acctest.Required, acctest.Create, configMacsApmExtensionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "config_type", configTypeMacsApmExtension), + resource.TestCheckResourceAttr(resourceName, "management_agent_id", configManagementAgentOcid), + resource.TestCheckResourceAttr(resourceName, "process_filter.#", "2"), + resource.TestCheckResourceAttr(resourceName, "process_filter.0", ".*org.apache.catalina.startup.Bootstrap.*"), + resource.TestCheckResourceAttr(resourceName, "process_filter.1", ".*jetty.*"), + resource.TestCheckResourceAttr(resourceName, "run_as_user", "tomcat"), + resource.TestCheckResourceAttr(resourceName, "service_name", "Tomcat"), + resource.TestCheckResourceAttr(resourceName, "agent_version", "1.16.0.585"), + resource.TestCheckResourceAttr(resourceName, "attach_install_dir", "/opt/oracle/apm_attach_process"), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttrSet(resourceName, "updated_by"), + resource.TestCheckResourceAttrSet(resourceName, "etag"), + resource.TestCheckResourceAttr(resourceName, "in_use_by.0.items.#", "0"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + utils.Logf("This is error") + return err + }, + ), + }, + // Step 2: delete Macs APM Extension before next create + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies, + }, + // Step 3: verify create Macs APM Extension with optionals + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_macs_apm_extension", acctest.Optional, acctest.Create, configMacsApmExtensionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "config_type", configTypeMacsApmExtension), + resource.TestCheckResourceAttr(resourceName, "management_agent_id", configManagementAgentOcid), + resource.TestCheckResourceAttr(resourceName, "process_filter.#", "2"), + resource.TestCheckResourceAttr(resourceName, "process_filter.0", ".*org.apache.catalina.startup.Bootstrap.*"), + resource.TestCheckResourceAttr(resourceName, "process_filter.1", ".*jetty.*"), + resource.TestCheckResourceAttr(resourceName, "run_as_user", "tomcat"), + resource.TestCheckResourceAttr(resourceName, "service_name", "Tomcat"), + resource.TestCheckResourceAttr(resourceName, "agent_version", "1.16.0.585"), + resource.TestCheckResourceAttr(resourceName, "attach_install_dir", "/opt/oracle/apm_attach_process"), + resource.TestCheckResourceAttr(resourceName, "display_name", "Display name 1"), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttrSet(resourceName, "updated_by"), + resource.TestCheckResourceAttrSet(resourceName, "etag"), + resource.TestCheckResourceAttr(resourceName, "in_use_by.0.items.#", "0"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + // Step 4: verify updates to Macs APM Extension updatable parameters + { + Config: config + compartmentIdVariableStr + ApmConfigConfigResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_config_config", "test_macs_apm_extension", acctest.Optional, acctest.Update, configMacsApmExtensionRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "config_type", configTypeMacsApmExtension), + resource.TestCheckResourceAttr(resourceName, "management_agent_id", configManagementAgentOcid), + resource.TestCheckResourceAttr(resourceName, "process_filter.#", "2"), + resource.TestCheckResourceAttr(resourceName, "process_filter.0", ".*org.jboss.*"), + resource.TestCheckResourceAttr(resourceName, "process_filter.1", ".*org.apache.bootstrap.*"), + resource.TestCheckResourceAttr(resourceName, "run_as_user", "tomcat2"), + resource.TestCheckResourceAttr(resourceName, "service_name", "Tomcat2"), + resource.TestCheckResourceAttr(resourceName, "agent_version", "1.16.0.586"), + resource.TestCheckResourceAttr(resourceName, "attach_install_dir", "/opt/oracle/apm_attach_process2"), + resource.TestCheckResourceAttr(resourceName, "display_name", "Display name 2"), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), + resource.TestCheckResourceAttrSet(resourceName, "updated_by"), + resource.TestCheckResourceAttrSet(resourceName, "etag"), + resource.TestCheckResourceAttr(resourceName, "in_use_by.0.items.#", "0"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "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 + }, + ), + }, + // Step 5: verify datasource (Macs APM Extension) + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_apm_config_configs", "test_macs_apm_extensions", acctest.Optional, acctest.Update, ApmConfigMacsApmExtensionDataSourceRepresentation) + + compartmentIdVariableStr + ApmConfigMacsApmExtensionResource + ApmConfigMacsApmExtensionDataResource, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "apm_domain_id"), + resource.TestCheckResourceAttr(datasourceName, "config_type", configTypeMacsApmExtension), + resource.TestCheckResourceAttr(datasourceName, "config_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "config_collection.0.items.#", "1"), + ), + }, + // Step 6: verify singular datasource (Macs APM Extension) + { + Config: config + compartmentIdVariableStr + ApmConfigMacsApmExtensionResource + ApmConfigMacsApmExtensionDataResource, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "config_type", configTypeMacsApmExtension), + resource.TestCheckResourceAttr(singularDatasourceName, "management_agent_id", configManagementAgentOcid), + resource.TestCheckResourceAttr(singularDatasourceName, "process_filter.#", "2"), + resource.TestCheckResourceAttr(singularDatasourceName, "process_filter.0", ".*org.jboss.*"), + resource.TestCheckResourceAttr(singularDatasourceName, "process_filter.1", ".*org.apache.bootstrap.*"), + resource.TestCheckResourceAttr(singularDatasourceName, "run_as_user", "tomcat2"), + resource.TestCheckResourceAttr(singularDatasourceName, "service_name", "Tomcat2"), + resource.TestCheckResourceAttr(singularDatasourceName, "agent_version", "1.16.0.586"), + resource.TestCheckResourceAttr(singularDatasourceName, "attach_install_dir", "/opt/oracle/apm_attach_process2"), + resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "Display name 2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "created_by"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "updated_by"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "etag"), + resource.TestCheckResourceAttr(singularDatasourceName, "in_use_by.0.items.#", "0"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + ), + }, + // Step 7: remove singular datasource from previous step so that it doesn't conflict with import tests + { + Config: config + compartmentIdVariableStr + ApmConfigMacsApmExtensionResource, + }, + // Step 8: verify resource import + { + Config: config + ApmConfigMacsApmExtensionRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apm_domain_id", + "opc_dry_run", + }, + ResourceName: resourceName, + }, + }, + }) +} + +func testAccCheckApmConfigMacsApmExtensionDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).ConfigClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_apm_config_config" { + noResourceFound = false + request := oci_apm_config.GetConfigRequest{} + + if value, ok := rs.Primary.Attributes["apm_domain_id"]; ok { + request.ApmDomainId = &value + } + + tmp, _ := parseConfigCompositeId(rs.Primary.ID) + request.ConfigId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "apm_config") + + _, err := client.GetConfig(context.Background(), request) + + if err == nil { + return fmt.Errorf("resource still exists") + } + + //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("ApmConfigMacsApmExtension") { + resource.AddTestSweepers("ApmConfigMacsApmExtension", &resource.Sweeper{ + Name: "ApmConfigMacsApmExtension", + Dependencies: acctest.DependencyGraph["config"], + F: sweepApmConfigMacsApmExtensionResource, + }) + } +} + +func sweepApmConfigMacsApmExtensionResource(compartment string) error { + configClient := acctest.GetTestClients(&schema.ResourceData{}).ConfigClient() + configIds, err := getMacsApmExtensionIds(compartment) + if err != nil { + return err + } + for _, configId := range configIds { + if ok := acctest.SweeperDefaultResourceId[configId]; !ok { + deleteConfigRequest := oci_apm_config.DeleteConfigRequest{} + + deleteConfigRequest.ConfigId = &configId + + deleteConfigRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "apm_config") + _, error := configClient.DeleteConfig(context.Background(), deleteConfigRequest) + if error != nil { + fmt.Printf("Error deleting Config %s %s, It is possible that the resource is already deleted. Please verify manually \n", configId, error) + continue + } + } + } + return nil +} + +func getMacsApmExtensionIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ConfigId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + configClient := acctest.GetTestClients(&schema.ResourceData{}).ConfigClient() + + listConfigsRequest := oci_apm_config.ListConfigsRequest{} + //listConfigsRequest.CompartmentId = &compartmentId + + apmDomainIds, error := getApmDomainIds(compartment) + if error != nil { + return resourceIds, fmt.Errorf("Error getting apmDomainId required for Config resource requests \n") + } + for _, apmDomainId := range apmDomainIds { + listConfigsRequest.ApmDomainId = &apmDomainId + + listConfigsResponse, err := configClient.ListConfigs(context.Background(), listConfigsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting Config list for compartment id : %s , %s \n", compartmentId, err) + } + for _, config := range listConfigsResponse.Items { + id := *config.GetId() + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ConfigId", id) + } + + } + return resourceIds, nil +} diff --git a/internal/integrationtest/apm_traces_attribute_auto_activate_status_test.go b/internal/integrationtest/apm_traces_attribute_auto_activate_status_test.go new file mode 100644 index 00000000000..0ba7feee52a --- /dev/null +++ b/internal/integrationtest/apm_traces_attribute_auto_activate_status_test.go @@ -0,0 +1,64 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ApmTracesAttributeAutoActivateStatusSingularDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${var.apm_domain_id}`}, + "data_key_type": acctest.Representation{RepType: acctest.Required, Create: `PRIVATE_DATA_KEY`}, + } + + //ApmTracesAttributeAutoActivateStatusResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_apm_apm_domain", "test_apm_domain", acctest.Required, acctest.Create, apmDomainRepresentation) +) + +// issue-routing-tag: apm_traces/default +func TestApmTracesAttributeAutoActivateStatusResource_basic(t *testing.T) { + httpreplay.SetScenario("TestApmTracesAttributeAutoActivateStatusResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + //This is a manual test. It requires apm_domain_id and trace_key as environment variables. + apmDomainId := utils.GetEnvSettingWithBlankDefault("apm_domain_id") + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + if apmDomainId == "" { + t.Skip("Set apm_domain_id and data_key_type to run this test") + } + + apmDomainIdVariableStr := fmt.Sprintf("variable \"apm_domain_id\" { default = \"%s\" }\n", apmDomainId) + + singularDatasourceName := "data.oci_apm_traces_attribute_auto_activate_status.test_attribute_auto_activate_status" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify singular datasource + { + Config: config + apmDomainIdVariableStr + compartmentIdVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_apm_traces_attribute_auto_activate_status", "test_attribute_auto_activate_status", acctest.Required, acctest.Create, ApmTracesAttributeAutoActivateStatusSingularDataSourceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "apm_domain_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "data_key_type", "PRIVATE_DATA_KEY"), + + resource.TestCheckResourceAttrSet(singularDatasourceName, "data_key"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + ), + }, + }) +} diff --git a/internal/integrationtest/apm_traces_log_test.go b/internal/integrationtest/apm_traces_log_test.go new file mode 100644 index 00000000000..7e499306d57 --- /dev/null +++ b/internal/integrationtest/apm_traces_log_test.go @@ -0,0 +1,84 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ApmTracesLogSingularDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${var.apm_domain_id}`}, + "log_key": acctest.Representation{RepType: acctest.Required, Create: `${var.log_key}`}, + "time_log_ended_less_than": acctest.Representation{RepType: acctest.Required, Create: `${var.time_log_ended_less_than}`}, + "time_log_started_greater_than_or_equal_to": acctest.Representation{RepType: acctest.Required, Create: `${var.time_log_started_greater_than_or_equal_to}`}, + } + + //ApmTracesLogResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_apm_apm_domain", "test_apm_domain", acctest.Required, acctest.Create, apmDomainRepresentation) +) + +// issue-routing-tag: apm_traces/default +func TestApmTracesLogResource_basic(t *testing.T) { + httpreplay.SetScenario("TestApmTracesLogResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + apmDomainId := utils.GetEnvSettingWithBlankDefault("apm_domain_id") + logKey := utils.GetEnvSettingWithBlankDefault("log_key") + timeLogStartedGreaterThanOrEqualTo := utils.GetEnvSettingWithBlankDefault("time_log_started_greater_than_or_equal_to") + timeLogEndedLessThan := utils.GetEnvSettingWithBlankDefault("time_log_ended_less_than") + + if apmDomainId == "" || logKey == "" { + t.Skip("Set apm_domain_id, logKey to run this test") + } + + apmDomainIdVariableStr := fmt.Sprintf("variable \"apm_domain_id\" { default = \"%s\" }\n", apmDomainId) + logKeyVariableStr := fmt.Sprintf("variable \"log_key\" { default = \"%s\" }\n", logKey) + timeLogStartedGreaterThanOrEqualToVariableStr := fmt.Sprintf("variable \"time_log_started_greater_than_or_equal_to\" { default = \"%s\" }\n", timeLogStartedGreaterThanOrEqualTo) + timeLogEndedLessThanVariableStr := fmt.Sprintf("variable \"time_log_ended_less_than\" { default = \"%s\" }\n", timeLogEndedLessThan) + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + singularDatasourceName := "data.oci_apm_traces_log.test_log" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify singular datasource + { + Config: config + apmDomainIdVariableStr + logKeyVariableStr + timeLogStartedGreaterThanOrEqualToVariableStr + timeLogEndedLessThanVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_apm_traces_log", "test_log", acctest.Required, acctest.Create, ApmTracesLogSingularDataSourceRepresentation) + + compartmentIdVariableStr, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "apm_domain_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "log_key", logKey), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_log_ended_less_than"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_log_started_greater_than_or_equal_to"), + + resource.TestCheckResourceAttr(singularDatasourceName, "attributes.#", "7"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "body"), + //resource.TestCheckResourceAttrSet(singularDatasourceName, "event_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "overflow_attributes"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "severity_number"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "severity_text"), + //resource.TestCheckResourceAttrSet(singularDatasourceName, "span_key"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_observed"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "timestamp"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "trace_flags"), + //resource.TestCheckResourceAttrSet(singularDatasourceName, "trace_key"), + ), + }, + }) +} diff --git a/internal/integrationtest/apm_traces_scheduled_query_test.go b/internal/integrationtest/apm_traces_scheduled_query_test.go new file mode 100644 index 00000000000..3fc7f698209 --- /dev/null +++ b/internal/integrationtest/apm_traces_scheduled_query_test.go @@ -0,0 +1,420 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + oci_apm_traces "github.com/oracle/oci-go-sdk/v65/apmtraces" + "github.com/oracle/oci-go-sdk/v65/common" + + "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 ( + ApmTracesScheduledQueryRequiredOnlyResource = ApmTracesScheduledQueryResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Required, acctest.Create, ApmTracesScheduledQueryRepresentation) + + ApmTracesScheduledQueryResourceConfig = ApmTracesScheduledQueryResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Optional, acctest.Update, ApmTracesScheduledQueryRepresentation) + + ApmTracesScheduledQuerySingularDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${var.apm_domain_id}`}, + "scheduled_query_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_apm_traces_scheduled_query.test_scheduled_query.id}`}, + } + + ApmTracesScheduledQueryDataSourceRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${var.apm_domain_id}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: ApmTracesScheduledQueryDataSourceFilterRepresentation}} + ApmTracesScheduledQueryDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_apm_traces_scheduled_query.test_scheduled_query.id}`}}, + } + + ApmTracesScheduledQueryRepresentation = map[string]interface{}{ + "apm_domain_id": acctest.Representation{RepType: acctest.Required, Create: `${var.apm_domain_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")}`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagsDifferencesRepresentation}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + "opc_dry_run": acctest.Representation{RepType: acctest.Optional, Create: `opcDryRun`, Update: `opcDryRun2`}, + "scheduled_query_description": acctest.Representation{RepType: acctest.Optional, Create: `scheduledQueryDescription`, Update: `scheduledQueryDescription2`}, + "scheduled_query_maximum_runtime_in_seconds": acctest.Representation{RepType: acctest.Required, Create: `10`, Update: `11`}, + "scheduled_query_name": acctest.Representation{RepType: acctest.Required, Create: `TestScheduledQuery1`, Update: `TestScheduledQuery2`}, + "scheduled_query_processing_configuration": acctest.RepresentationGroup{RepType: acctest.Required, Group: ApmTracesScheduledQueryScheduledQueryProcessingConfigurationRepresentation}, + "scheduled_query_processing_sub_type": acctest.Representation{RepType: acctest.Required, Create: `CUSTOM_METRIC`}, + "scheduled_query_processing_type": acctest.Representation{RepType: acctest.Required, Create: `EXPORT`}, + "scheduled_query_retention_criteria": acctest.Representation{RepType: acctest.Required, Create: `UPDATE`}, + "scheduled_query_retention_period_in_ms": acctest.Representation{RepType: acctest.Required, Create: `10`, Update: `30`}, + "scheduled_query_schedule": acctest.Representation{RepType: acctest.Required, Create: `SCHEDULE STARTING AFTER 2025-06-20T21:20:00Z EVERY 5 MINUTES`}, + "scheduled_query_text": acctest.Representation{RepType: acctest.Required, Create: `SHOW SPANS time_bucket_start(1,apmdbInsertTime2) AS metricStartTime,1 MINUTE AS metricDuration,serviceName,operationName,count(*) AS metricValue WHERE apmdbinserttime2>=TimeTruncate(now(),'minute') - 5 MINUTES GROUP BY time_bucket_start(1,apmdbInsertTime2),serviceName,operationName FIRST 10000 ROWS BETWEEN now() - 2 HOURS AND now()`}, + } + ApmTracesScheduledQueryScheduledQueryProcessingConfigurationRepresentation = map[string]interface{}{ + "custom_metric": acctest.RepresentationGroup{RepType: acctest.Required, Group: ApmTracesScheduledQueryScheduledQueryProcessingConfigurationCustomMetricRepresentation}, + /*"object_storage": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ApmTracesScheduledQueryScheduledQueryProcessingConfigurationObjectStorageRepresentation}, + "streaming": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ApmTracesScheduledQueryScheduledQueryProcessingConfigurationStreamingRepresentation},*/ + } + ApmTracesScheduledQueryScheduledQueryProcessingConfigurationCustomMetricRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `name`}, + "compartment": acctest.Representation{RepType: acctest.Optional, Create: `compartment`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`}, + "is_anomaly_detection_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "is_metric_published": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "namespace": acctest.Representation{RepType: acctest.Optional, Create: `namespace`}, + "resource_group": acctest.Representation{RepType: acctest.Optional, Create: `resourceGroup`}, + "unit": acctest.Representation{RepType: acctest.Optional, Create: `unit`}, + } + ApmTracesScheduledQueryScheduledQueryProcessingConfigurationObjectStorageRepresentation = map[string]interface{}{ + "bucket": acctest.Representation{RepType: acctest.Optional, Create: `bucket`, Update: `bucket2`}, + "name_space": acctest.Representation{RepType: acctest.Optional, Create: `nameSpace`, Update: `nameSpace2`}, + "object_name_prefix": acctest.Representation{RepType: acctest.Optional, Create: `objectNamePrefix`, Update: `objectNamePrefix2`}, + } + ApmTracesScheduledQueryScheduledQueryProcessingConfigurationStreamingRepresentation = map[string]interface{}{ + "stream_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_streaming_stream.test_stream.id}`}, + } + + ApmTracesScheduledQueryResourceDependencies = DefinedTagsDependencies /*+ + acctest.GenerateResourceFromRepresentationMap("oci_objectstorage_bucket", "test_bucket", acctest.Required, acctest.Create, ObjectStorageBucketRepresentation) + + acctest.GenerateDataSourceFromRepresentationMap("oci_objectstorage_namespace", "test_namespace", acctest.Required, acctest.Create, NamespaceSingularDataSourceRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_streaming_stream", "test_stream", acctest.Required, acctest.Create, StreamingStreamRepresentation)*/ +) + +// issue-routing-tag: apm_traces/default +func TestApmTracesScheduledQueryResource_basic(t *testing.T) { + httpreplay.SetScenario("TestApmTracesScheduledQueryResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + apmDomainId := utils.GetEnvSettingWithBlankDefault("apm_domain_id") + if apmDomainId == "" { + t.Skip("Set apm_domain_id to run this test") + } + apmDomainIdVariableStr := fmt.Sprintf("variable \"apm_domain_id\" { default = \"%s\" }\n", apmDomainId) + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_apm_traces_scheduled_query.test_scheduled_query" + datasourceName := "data.oci_apm_traces_scheduled_queries.test_scheduled_queries" + singularDatasourceName := "data.oci_apm_traces_scheduled_query.test_scheduled_query" + + 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+ApmTracesScheduledQueryResourceDependencies+apmDomainIdVariableStr+ + acctest.GenerateResourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Optional, acctest.Create, ApmTracesScheduledQueryRepresentation), "apmtraces", "scheduledQuery", t) + + acctest.ResourceTest(t, testAccCheckApmTracesScheduledQueryDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + ApmTracesScheduledQueryResourceDependencies + apmDomainIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Required, acctest.Create, ApmTracesScheduledQueryRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + ApmTracesScheduledQueryResourceDependencies + apmDomainIdVariableStr, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + ApmTracesScheduledQueryResourceDependencies + apmDomainIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Optional, acctest.Create, ApmTracesScheduledQueryRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "opc_dry_run", "opcDryRun"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_description", "scheduledQueryDescription"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_maximum_runtime_in_seconds", "10"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_name", "TestScheduledQuery1"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.compartment", "compartment"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.description", "description"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.is_anomaly_detection_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.is_metric_published", "false"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.name", "name"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.namespace", "namespace"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.resource_group", "resourceGroup"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.unit", "unit"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_sub_type", "CUSTOM_METRIC"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_type", "EXPORT"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_retention_criteria", "UPDATE"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_retention_period_in_ms", "10"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_schedule", "SCHEDULE STARTING AFTER 2025-06-20T21:20:00Z EVERY 5 MINUTES"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_text", "SHOW SPANS time_bucket_start(1,apmdbInsertTime2) AS metricStartTime,1 MINUTE AS metricDuration,serviceName,operationName,count(*) AS metricValue WHERE apmdbinserttime2>=TimeTruncate(now(),'minute') - 5 MINUTES GROUP BY time_bucket_start(1,apmdbInsertTime2),serviceName,operationName FIRST 10000 ROWS BETWEEN now() - 2 HOURS AND now()"), + + 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 (ScheduledQueryName, ScheduledQueryDescription , ScheduledQueryMaxRuntimeInSeconds) + { + Config: config + compartmentIdVariableStr + ApmTracesScheduledQueryResourceDependencies + apmDomainIdVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Optional, acctest.Update, ApmTracesScheduledQueryRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "apm_domain_id"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "opc_dry_run", "opcDryRun2"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_description", "scheduledQueryDescription2"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_maximum_runtime_in_seconds", "11"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_name", "TestScheduledQuery2"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.compartment", "compartment"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.description", "description"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.is_anomaly_detection_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.is_metric_published", "false"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.name", "name"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.namespace", "namespace"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.resource_group", "resourceGroup"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_configuration.0.custom_metric.0.unit", "unit"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_sub_type", "CUSTOM_METRIC"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_processing_type", "EXPORT"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_retention_criteria", "UPDATE"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_retention_period_in_ms", "30"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_schedule", "SCHEDULE STARTING AFTER 2025-06-20T21:20:00Z EVERY 5 MINUTES"), + resource.TestCheckResourceAttr(resourceName, "scheduled_query_text", "SHOW SPANS time_bucket_start(1,apmdbInsertTime2) AS metricStartTime,1 MINUTE AS metricDuration,serviceName,operationName,count(*) AS metricValue WHERE apmdbinserttime2>=TimeTruncate(now(),'minute') - 5 MINUTES GROUP BY time_bucket_start(1,apmdbInsertTime2),serviceName,operationName FIRST 10000 ROWS BETWEEN now() - 2 HOURS AND now()"), + + 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 + apmDomainIdVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_apm_traces_scheduled_queries", "test_scheduled_queries", acctest.Optional, acctest.Update, ApmTracesScheduledQueryDataSourceRepresentation) + + compartmentIdVariableStr + ApmTracesScheduledQueryResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Optional, acctest.Update, ApmTracesScheduledQueryRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(datasourceName, "apm_domain_id"), + resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName"), + + resource.TestCheckResourceAttr(datasourceName, "scheduled_query_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "scheduled_query_collection.0.items.#", "0"), + ), + }, + // verify singular datasource + { + Config: config + apmDomainIdVariableStr + + acctest.GenerateDataSourceFromRepresentationMap("oci_apm_traces_scheduled_query", "test_scheduled_query", acctest.Required, acctest.Create, ApmTracesScheduledQuerySingularDataSourceRepresentation) + + compartmentIdVariableStr + ApmTracesScheduledQueryResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "apm_domain_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "scheduled_query_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_description", "scheduledQueryDescription2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "scheduled_query_instances"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_maximum_runtime_in_seconds", "11"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_name", "TestScheduledQuery2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "scheduled_query_next_run_in_ms"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.compartment", "compartment"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.description", "description"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.is_anomaly_detection_enabled", "false"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.is_metric_published", "false"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.name", "name"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.namespace", "namespace"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.resource_group", "resourceGroup"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.custom_metric.0.unit", "unit"), + /*resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.object_storage.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.object_storage.0.bucket", "bucket2"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.object_storage.0.name_space", "nameSpace2"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.object_storage.0.object_name_prefix", "objectNamePrefix2"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_configuration.0.streaming.#", "1"),*/ + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_sub_type", "CUSTOM_METRIC"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_processing_type", "EXPORT"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_retention_criteria", "UPDATE"), + //resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_retention_period_in_ms", "30"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_schedule", "SCHEDULE STARTING AFTER 2025-06-20T21:20:00Z EVERY 5 MINUTES"), + resource.TestCheckResourceAttr(singularDatasourceName, "scheduled_query_text", "SHOW SPANS time_bucket_start(1,apmdbInsertTime2) AS metricStartTime,1 MINUTE AS metricDuration,serviceName,operationName,count(*) AS metricValue WHERE apmdbinserttime2>=TimeTruncate(now(),'minute') - 5 MINUTES GROUP BY time_bucket_start(1,apmdbInsertTime2),serviceName,operationName FIRST 10000 ROWS BETWEEN now() - 2 HOURS AND now()"), + resource.TestCheckResourceAttr(singularDatasourceName, "state", "ACTIVE"), + ), + }, + // verify resource import + { + Config: config + ApmTracesScheduledQueryRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apm_domain_id", + "opc_dry_run", + "scheduled_query_retention_period_in_ms", //ignore as it does not apply to this case + "scheduled_query_next_run_in_ms", //ignore as it after each run, it calculates the value for next run + }, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckApmTracesScheduledQueryDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).ScheduledQueryClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_apm_traces_scheduled_query" { + noResourceFound = false + request := oci_apm_traces.GetScheduledQueryRequest{} + + if value, ok := rs.Primary.Attributes["apm_domain_id"]; ok { + request.ApmDomainId = &value + } + + tmp := rs.Primary.ID + request.ScheduledQueryId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "apm_traces") + + response, err := client.GetScheduledQuery(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_apm_traces.LifecycleStatesDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.LifecycleState)]; !ok { + //resource lifecycle state is not in expected deleted lifecycle states. + return fmt.Errorf("resource lifecycle state: %s is not in expected deleted lifecycle states", response.LifecycleState) + } + //resource lifecycle state is in expected deleted lifecycle states. continue with next one. + continue + } + + //Verify that exception is for '404 not found'. + if failure, isServiceError := common.IsServiceError(err); !isServiceError || failure.GetHTTPStatusCode() != 404 { + return err + } + } + } + if noResourceFound { + return fmt.Errorf("at least one resource was expected from the state file, but could not be found") + } + + return nil +} + +func init() { + if acctest.DependencyGraph == nil { + acctest.InitDependencyGraph() + } + if !acctest.InSweeperExcludeList("ApmTracesScheduledQuery") { + resource.AddTestSweepers("ApmTracesScheduledQuery", &resource.Sweeper{ + Name: "ApmTracesScheduledQuery", + Dependencies: acctest.DependencyGraph["scheduledQuery"], + F: sweepApmTracesScheduledQueryResource, + }) + } +} + +func sweepApmTracesScheduledQueryResource(compartment string) error { + scheduledQueryClient := acctest.GetTestClients(&schema.ResourceData{}).ScheduledQueryClient() + scheduledQueryIds, err := getApmTracesScheduledQueryIds(compartment) + if err != nil { + return err + } + for _, scheduledQueryId := range scheduledQueryIds { + if ok := acctest.SweeperDefaultResourceId[scheduledQueryId]; !ok { + deleteScheduledQueryRequest := oci_apm_traces.DeleteScheduledQueryRequest{} + + deleteScheduledQueryRequest.ScheduledQueryId = &scheduledQueryId + + deleteScheduledQueryRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "apm_traces") + _, error := scheduledQueryClient.DeleteScheduledQuery(context.Background(), deleteScheduledQueryRequest) + if error != nil { + fmt.Printf("Error deleting ScheduledQuery %s %s, It is possible that the resource is already deleted. Please verify manually \n", scheduledQueryId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &scheduledQueryId, ApmTracesScheduledQuerySweepWaitCondition, time.Duration(3*time.Minute), + ApmTracesScheduledQuerySweepResponseFetchOperation, "apm_traces", true) + } + } + return nil +} + +func getApmTracesScheduledQueryIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ScheduledQueryId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + scheduledQueryClient := acctest.GetTestClients(&schema.ResourceData{}).ScheduledQueryClient() + + listScheduledQueriesRequest := oci_apm_traces.ListScheduledQueriesRequest{} + //listScheduledQueriesRequest.CompartmentId = &compartmentId + + apmDomainIds, error := getApmDomainIds(compartment) + if error != nil { + return resourceIds, fmt.Errorf("Error getting apmDomainId required for ScheduledQuery resource requests \n") + } + for _, apmDomainId := range apmDomainIds { + listScheduledQueriesRequest.ApmDomainId = &apmDomainId + + listScheduledQueriesResponse, err := scheduledQueryClient.ListScheduledQueries(context.Background(), listScheduledQueriesRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting ScheduledQuery list for compartment id : %s , %s \n", compartmentId, err) + } + for _, scheduledQuery := range listScheduledQueriesResponse.Items { + id := *scheduledQuery.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ScheduledQueryId", id) + } + + } + return resourceIds, nil +} + +func ApmTracesScheduledQuerySweepWaitCondition(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 scheduledQueryResponse, ok := response.Response.(oci_apm_traces.GetScheduledQueryResponse); ok { + return scheduledQueryResponse.LifecycleState != oci_apm_traces.LifecycleStatesDeleted + } + return false +} + +func ApmTracesScheduledQuerySweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.ScheduledQueryClient().GetScheduledQuery(context.Background(), oci_apm_traces.GetScheduledQueryRequest{ + ScheduledQueryId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/core_route_table_resource_test.go b/internal/integrationtest/core_route_table_resource_test.go index d3c135288d9..7f6af422fc9 100644 --- a/internal/integrationtest/core_route_table_resource_test.go +++ b/internal/integrationtest/core_route_table_resource_test.go @@ -339,6 +339,7 @@ func TestResourceCoreRouteTable_defaultResource(t *testing.T) { route_rules { cidr_block = "0.0.0.0/0" network_entity_id = "${oci_core_internet_gateway.internet-gateway1.id}" + route_type = "STATIC" } }` + defaultRouteTable, Check: acctest.ComposeAggregateTestCheckFuncWrapper( @@ -354,6 +355,12 @@ func TestResourceCoreRouteTable_defaultResource(t *testing.T) { []string{ "network_entity_id", }), + acctest.CheckResourceSetContainsElementWithProperties(resourceName, "route_rules", map[string]string{ + "route_type": "STATIC", + }, + []string{ + "network_entity_id", + }), resource.TestCheckResourceAttrSet(defaultResourceName, "manage_default_resource_id"), resource.TestCheckResourceAttrSet(defaultResourceName, "compartment_id"), resource.TestCheckResourceAttr(defaultResourceName, "state", string(core.RouteTableLifecycleStateAvailable)), @@ -414,6 +421,12 @@ func TestResourceCoreRouteTable_defaultResource(t *testing.T) { []string{ "network_entity_id", }), + acctest.CheckResourceSetContainsElementWithProperties(resourceName, "route_rules", map[string]string{ + "route_type": "STATIC", + }, + []string{ + "network_entity_id", + }), resource.TestCheckResourceAttr(resourceName, "state", string(core.RouteTableLifecycleStateAvailable)), resource.TestCheckResourceAttrSet(defaultResourceName, "manage_default_resource_id"), resource.TestCheckResourceAttr(defaultResourceName, "compartment_id", compartmentIdU), @@ -431,6 +444,12 @@ func TestResourceCoreRouteTable_defaultResource(t *testing.T) { []string{ "network_entity_id", }), + acctest.CheckResourceSetContainsElementWithProperties(resourceName, "route_rules", map[string]string{ + "route_type": "STATIC", + }, + []string{ + "network_entity_id", + }), resource.TestCheckResourceAttr(defaultResourceName, "state", string(core.RouteTableLifecycleStateAvailable)), ), }, diff --git a/internal/integrationtest/core_vcn_test.go b/internal/integrationtest/core_vcn_test.go index bff55d9a930..d6a698c1a2c 100644 --- a/internal/integrationtest/core_vcn_test.go +++ b/internal/integrationtest/core_vcn_test.go @@ -48,7 +48,7 @@ var ( CoreVcnRepresentation = map[string]interface{}{ "cidr_block": acctest.Representation{RepType: acctest.Required, Create: `10.0.0.0/16`}, "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}" = "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}"= "updatedValue"})}`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, "dns_label": acctest.Representation{RepType: acctest.Optional, Create: `dnslabel`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, @@ -61,7 +61,7 @@ var ( "is_ipv6enabled": acctest.Representation{RepType: acctest.Required, Create: `true`}, "ipv6private_cidr_blocks": acctest.Representation{RepType: acctest.Required, Create: []string{`fc00:1000::/56`}}, "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}"= "value"})}`, Update: `${tomap({"${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}"= "updatedValue"})}`}, "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, "dns_label": acctest.Representation{RepType: acctest.Optional, Create: `dnslabel`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, @@ -103,7 +103,7 @@ func TestCoreVcnResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "cidr_block", "10.0.0.0/16"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - + resource.TestCheckResourceAttr(resourceName, "is_ipv6enabled", "false"), func(s *terraform.State) (err error) { resId, err = acctest.FromInstanceState(s, resourceName, "id") return err diff --git a/internal/integrationtest/datascience_job_test.go b/internal/integrationtest/datascience_job_test.go index 8d89c68b025..4bc5c1f4bd4 100644 --- a/internal/integrationtest/datascience_job_test.go +++ b/internal/integrationtest/datascience_job_test.go @@ -10,9 +10,10 @@ import ( "testing" "time" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + "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" @@ -52,20 +53,21 @@ var ( } DatascienceJobRepresentation = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "job_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceJobJobConfigurationDetailsRepresentation}, - "job_infrastructure_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceJobJobInfrastructureConfigurationDetailsRepresentation}, - "job_environment_configuration_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceJobJobEnvironmentConfigurationDetailsRepresentation}, - "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_project.test_project.id}`}, - "job_artifact": acctest.Representation{RepType: acctest.Optional, Create: `../../examples/datascience/job-artifact.py`}, - "artifact_content_length": acctest.Representation{RepType: acctest.Optional, Create: `1380`}, // wc -c job-artifact.py - "artifact_content_disposition": acctest.Representation{RepType: acctest.Optional, Create: `attachment; filename=job-artifact.py`}, - "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`}, - "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, - "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, - "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "delete_related_job_runs": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, - "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreMlJobDefinedTagsChangesRepresentation}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "job_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceJobJobConfigurationDetailsRepresentation}, + "job_infrastructure_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceJobJobInfrastructureConfigurationDetailsRepresentation}, + "job_environment_configuration_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceJobJobEnvironmentConfigurationDetailsRepresentation}, + "job_storage_mount_configuration_details_list": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceJobStorageMountConfigurationDetailsListRepresentation}, + "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_project.test_project.id}`}, + "job_artifact": acctest.Representation{RepType: acctest.Optional, Create: `../../examples/datascience/job-artifact.py`}, + "artifact_content_length": acctest.Representation{RepType: acctest.Optional, Create: `1380`}, // wc -c job-artifact.py + "artifact_content_disposition": acctest.Representation{RepType: acctest.Optional, Create: `attachment; filename=job-artifact.py`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "delete_related_job_runs": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreMlJobDefinedTagsChangesRepresentation}, } DatascienceJobJobConfigurationDetailsRepresentation = map[string]interface{}{ "job_type": acctest.Representation{RepType: acctest.Required, Create: `DEFAULT`}, @@ -76,19 +78,34 @@ var ( DatascienceJobJobInfrastructureConfigurationDetailsRepresentation = map[string]interface{}{ "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `50`, Update: `100`}, "job_infrastructure_type": acctest.Representation{RepType: acctest.Required, Create: `STANDALONE`}, - "shape_name": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, + "shape_name": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard.E4.Flex`}, "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, + "job_shape_config_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceJobJobInfrastructureConfigurationDetailsJobShapeConfigDetailsRepresentation}, } DatascienceJobJobEnvironmentConfigurationDetailsRepresentation = map[string]interface{}{ "image": acctest.Representation{RepType: acctest.Required, Create: `iad.ocir.io/ociodscdev/byod_hello_wrld:1.0`}, "job_environment_type": acctest.Representation{RepType: acctest.Required, Create: `OCIR_CONTAINER`}, - "cmd": acctest.Representation{RepType: acctest.Optional, Create: []string{``}}, - "entrypoint": acctest.Representation{RepType: acctest.Optional, Create: []string{``}}, + "cmd": acctest.Representation{RepType: acctest.Optional, Create: []string{}}, + "entrypoint": acctest.Representation{RepType: acctest.Optional, Create: []string{}}, "image_digest": acctest.Representation{RepType: acctest.Optional, Create: ``}, "image_signature_id": acctest.Representation{RepType: acctest.Optional, Create: ``}, } + DatascienceJobStorageMountConfigurationDetailsListRepresentation = map[string]interface{}{ + "destination_directory_name": acctest.Representation{RepType: acctest.Required, Create: `oss`, Update: `oss1`}, + "storage_type": acctest.Representation{RepType: acctest.Required, Create: `OBJECT_STORAGE`}, + "bucket": acctest.Representation{RepType: acctest.Optional, Create: `storage-mount-test`}, + "destination_path": acctest.Representation{RepType: acctest.Optional, Create: `/mnt`, Update: `/mnt`}, + "namespace": acctest.Representation{RepType: acctest.Optional, Create: `idtlxnfdweil`}, + "prefix": acctest.Representation{RepType: acctest.Optional, Create: `prod`}, + } ignoreMlJobDefinedTagsChangesRepresentation = map[string]interface{}{ - "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`, `job_infrastructure_configuration_details`}}, + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}}, + } + + DatascienceJobJobInfrastructureConfigurationDetailsJobShapeConfigDetailsRepresentation = map[string]interface{}{ + "cpu_baseline": acctest.Representation{RepType: acctest.Optional, Create: `BASELINE_1_8`, Update: `BASELINE_1_2`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `2.0`, Update: `4.0`}, + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `14.0`, Update: `28.0`}, } // easier to work with from JobRuns @@ -169,24 +186,34 @@ func TestDatascienceJobResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_datascience_job", "test_job", acctest.Optional, acctest.Create, DatascienceJobRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), resource.TestCheckResourceAttr(resourceName, "description", "description"), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.command_line_arguments", "commandLineArguments"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.environment_variables.%", "1"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.job_type", "DEFAULT"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.maximum_runtime_in_minutes", "10"), - resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), - resource.TestCheckResourceAttrSet(resourceName, "job_infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.cmd.#", ""), - resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.entrypoint.#", ""), + resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.cmd.#", "0"), + resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.entrypoint.#", "0"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image", "iad.ocir.io/ociodscdev/byod_hello_wrld:1.0"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image_digest", ""), - resource.TestCheckResourceAttrSet(resourceName, "job_environment_configuration_details.0."), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.job_environment_type", "OCIR_CONTAINER"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_infrastructure_type", "STANDALONE"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.ocpus", "2"), + resource.TestCheckResourceAttrSet(resourceName, "job_infrastructure_configuration_details.0.shape_name"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_directory_name", "oss"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_path", "/mnt"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.storage_type", "OBJECT_STORAGE"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -212,23 +239,34 @@ func TestDatascienceJobResource_basic(t *testing.T) { })), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), resource.TestCheckResourceAttr(resourceName, "description", "description"), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.command_line_arguments", "commandLineArguments"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.environment_variables.%", "1"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.job_type", "DEFAULT"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.maximum_runtime_in_minutes", "10"), - resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.cmd.#", ""), - resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.entrypoint.#", ""), + resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.cmd.#", "0"), + resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.entrypoint.#", "0"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image", "iad.ocir.io/ociodscdev/byod_hello_wrld:1.0"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image_digest", ""), - resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image_signature_id", ""), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.job_environment_type", "OCIR_CONTAINER"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_infrastructure_type", "STANDALONE"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.ocpus", "2"), + resource.TestCheckResourceAttrSet(resourceName, "job_infrastructure_configuration_details.0.shape_name"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_directory_name", "oss"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_path", "/mnt"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.storage_type", "OBJECT_STORAGE"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -249,24 +287,33 @@ func TestDatascienceJobResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_datascience_job", "test_job", acctest.Optional, acctest.Update, DatascienceJobRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "created_by"), resource.TestCheckResourceAttr(resourceName, "description", "description2"), resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.command_line_arguments", "commandLineArguments"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.environment_variables.%", "1"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.job_type", "DEFAULT"), resource.TestCheckResourceAttr(resourceName, "job_configuration_details.0.maximum_runtime_in_minutes", "10"), - resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), - resource.TestCheckResourceAttrSet(resourceName, "job_infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.cmd.#", "1"), - resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.entrypoint.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.cmd.#", "0"), + resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.entrypoint.#", "0"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image", "iad.ocir.io/ociodscdev/byod_hello_wrld:1.0"), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image_digest", ""), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.image_signature_id", ""), resource.TestCheckResourceAttr(resourceName, "job_environment_configuration_details.0.job_environment_type", "OCIR_CONTAINER"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "100"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.cpu_baseline", "BASELINE_1_2"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.memory_in_gbs", "28"), + resource.TestCheckResourceAttr(resourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.ocpus", "4"), + resource.TestCheckResourceAttrSet(resourceName, "job_infrastructure_configuration_details.0.shape_name"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_directory_name", "oss1"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_path", "/mnt"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -289,11 +336,15 @@ func TestDatascienceJobResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_datascience_job", "test_job", acctest.Optional, acctest.Update, DatascienceJobRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "created_by"), resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), + resource.TestCheckResourceAttrSet(datasourceName, "id"), resource.TestCheckResourceAttrSet(datasourceName, "project_id"), resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), + resource.TestCheckResourceAttr(datasourceName, "jobs.#", "1"), resource.TestCheckResourceAttr(datasourceName, "jobs.0.compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "jobs.0.created_by"), resource.TestCheckResourceAttr(datasourceName, "jobs.0.display_name", "displayName2"), resource.TestCheckResourceAttr(datasourceName, "jobs.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "jobs.0.id"), @@ -311,22 +362,30 @@ func TestDatascienceJobResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "job_id"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(singularDatasourceName, "created_by"), resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttr(singularDatasourceName, "job_configuration_details.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "job_configuration_details.0.command_line_arguments", "commandLineArguments"), resource.TestCheckResourceAttr(singularDatasourceName, "job_configuration_details.0.environment_variables.%", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "job_configuration_details.0.job_type", "DEFAULT"), resource.TestCheckResourceAttr(singularDatasourceName, "job_configuration_details.0.maximum_runtime_in_minutes", "10"), - resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.#", "1"), - resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.#", "1"), - resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.0.cmd.#", ""), - resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.0.entrypoint.#", ""), + resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.0.cmd.#", "0"), + resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.0.entrypoint.#", "0"), resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.0.image", "iad.ocir.io/ociodscdev/byod_hello_wrld:1.0"), resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.0.image_digest", ""), - resource.TestCheckResourceAttr(singularDatasourceName, "job_environment_configuration_details.0.job_environment_type", "OCIR_CONTAINER"), + resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.0.block_storage_size_in_gbs", "100"), + resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.cpu_baseline", "BASELINE_1_2"), + resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.memory_in_gbs", "28"), + resource.TestCheckResourceAttr(singularDatasourceName, "job_infrastructure_configuration_details.0.job_shape_config_details.0.ocpus", "4"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.#", "1"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_directory_name", "oss1"), + resource.TestCheckResourceAttr(resourceName, "job_storage_mount_configuration_details_list.0.destination_path", "/mnt"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), ), diff --git a/internal/integrationtest/datascience_model_deployment_model_state_test.go b/internal/integrationtest/datascience_model_deployment_model_state_test.go new file mode 100644 index 00000000000..cce552e7742 --- /dev/null +++ b/internal/integrationtest/datascience_model_deployment_model_state_test.go @@ -0,0 +1,55 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +// issue-routing-tag: datascience/default +func TestDatascienceModelDeploymentModelStateResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatascienceModelDeploymentModelStateResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + datasourceName := "data.oci_datascience_model_group_models.test_model_group_models" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_datascience_model_group_models", "test_model_group_models", acctest.Required, acctest.Create, DatascienceModelGroupModelDataSourceRepresentation) + + compartmentIdVariableStr + DatascienceModelGroupModelResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_id"), + + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.#"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.category"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.created_by"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.is_model_by_reference"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.model_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.project_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.time_updated"), + ), + }, + }) +} diff --git a/internal/integrationtest/datascience_model_group_artifact_content_test.go b/internal/integrationtest/datascience_model_group_artifact_content_test.go new file mode 100644 index 00000000000..ff34a7ce248 --- /dev/null +++ b/internal/integrationtest/datascience_model_group_artifact_content_test.go @@ -0,0 +1,49 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + DatascienceModelGroupArtifactContentSingularDataSourceRepresentation = map[string]interface{}{ + "model_group_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_model_group.test_model_group.id}`}, + "range": acctest.Representation{RepType: acctest.Optional, Create: `range`}, + } + + DatascienceModelGroupArtifactContentResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group", "test_model_group", acctest.Required, acctest.Create, DatascienceModelGroupRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model", "test_model", acctest.Required, acctest.Create, DatascienceModelRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) +) + +// issue-routing-tag: datascience/default +func TestDatascienceModelGroupArtifactContentResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatascienceModelGroupArtifactContentResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_datascience_model_group_artifact_content", "test_model_group_artifact_content", acctest.Required, acctest.Create, DatascienceModelGroupArtifactContentSingularDataSourceRepresentation) + + compartmentIdVariableStr + DatascienceModelGroupArtifactContentResourceConfig, + }, + }) +} diff --git a/internal/integrationtest/datascience_model_group_artifact_test.go b/internal/integrationtest/datascience_model_group_artifact_test.go new file mode 100644 index 00000000000..0830fe0c309 --- /dev/null +++ b/internal/integrationtest/datascience_model_group_artifact_test.go @@ -0,0 +1,55 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +// issue-routing-tag: datascience/default +func TestDatascienceModelGroupArtifactResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatascienceModelGroupArtifactResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + datasourceName := "data.oci_datascience_model_group_models.test_model_group_models" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_datascience_model_group_models", "test_model_group_models", acctest.Required, acctest.Create, DatascienceModelGroupModelDataSourceRepresentation) + + compartmentIdVariableStr + DatascienceModelGroupModelResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_id"), + + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.#"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.category"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.created_by"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.is_model_by_reference"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.model_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.project_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.time_updated"), + ), + }, + }) +} diff --git a/internal/integrationtest/datascience_model_group_model_test.go b/internal/integrationtest/datascience_model_group_model_test.go new file mode 100644 index 00000000000..b70f4b6d8f9 --- /dev/null +++ b/internal/integrationtest/datascience_model_group_model_test.go @@ -0,0 +1,72 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + DatascienceModelGroupModelDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "model_group_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_model_group.test_model_group.id}`}, + "created_by": acctest.Representation{RepType: acctest.Optional, Create: `createdBy`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model_group_model.test_model_group_model.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`}, + } + + DatascienceModelGroupModelResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group", "test_model_group", acctest.Required, acctest.Create, DatascienceModelGroupRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model", "test_model", acctest.Required, acctest.Create, DatascienceModelRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) +) + +// issue-routing-tag: datascience/default +func TestDatascienceModelGroupModelResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatascienceModelGroupModelResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + datasourceName := "data.oci_datascience_model_group_models.test_model_group_models" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_datascience_model_group_models", "test_model_group_models", acctest.Required, acctest.Create, DatascienceModelGroupModelDataSourceRepresentation) + + compartmentIdVariableStr + DatascienceModelGroupModelResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_id"), + + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.#"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.category"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.compartment_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.created_by"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.display_name"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.is_model_by_reference"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.model_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.project_id"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.state"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.time_created"), + resource.TestCheckResourceAttrSet(datasourceName, "model_group_models.0.time_updated"), + ), + }, + }) +} diff --git a/internal/integrationtest/datascience_model_group_test.go b/internal/integrationtest/datascience_model_group_test.go new file mode 100644 index 00000000000..23c8d365777 --- /dev/null +++ b/internal/integrationtest/datascience_model_group_test.go @@ -0,0 +1,282 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_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/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + DatascienceModelGroupRequiredOnlyResource = DatascienceModelGroupResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group", "test_model_group", acctest.Required, acctest.Create, DatascienceModelGroupRepresentation) + + DatascienceModelGroupResourceConfig = DatascienceModelGroupResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group", "test_model_group_optional", acctest.Optional, acctest.Update, DatascienceModelGroupRepresentation) + + DatascienceModelGroupSingularDataSourceRepresentation = map[string]interface{}{ + "model_group_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_model_group.test_model_group.id}`}, + } + + DatascienceModelGroupDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "created_by": acctest.Representation{RepType: acctest.Optional, Create: `createdBy`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model_group.test_model_group.id}`}, + "model_group_version_history_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model_group_version_history.test_model_group_version_history.id}`}, + "project_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_project.test_project.id}`}, + "member_model_entries": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupMemberModelEntriesRepresentation}, + "model_group_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupModelGroupDetailsRepresentation}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupDataSourceFilterRepresentation}} + DatascienceModelGroupDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_datascience_model_group.test_model_group.id}`}}, + } + + DatascienceModelGroupRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "create_type": acctest.Representation{RepType: acctest.Required, Create: `CREATE`}, + "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_project.test_project.id}`}, + "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{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "member_model_entries": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupMemberModelEntriesRepresentation}, + "model_group_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupModelGroupDetailsRepresentation}, + "model_group_version_history_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model_group_version_history.test_model_group_version_history.id}`}, + "version_label": acctest.Representation{RepType: acctest.Optional, Create: `versionLabel`, Update: `versionLabel2`}, + } + DatascienceModelGroupMemberModelEntriesRepresentation = map[string]interface{}{ + "member_model_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupMemberModelEntriesMemberModelDetailsRepresentation}, + } + DatascienceModelGroupModelGroupCloneSourceDetailsRepresentation = map[string]interface{}{ + "model_group_clone_source_type": acctest.Representation{RepType: acctest.Required, Create: `MODEL_GROUP`}, + "source_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_source.test_source.id}`}, + "modify_model_group_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceModelGroupModelGroupCloneSourceDetailsModifyModelGroupDetailsRepresentation}, + "patch_model_group_member_model_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceModelGroupModelGroupCloneSourceDetailsPatchModelGroupMemberModelDetailsRepresentation}, + } + DatascienceModelGroupModelGroupDetailsRepresentation = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `HOMOGENEOUS`}, + "base_model_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model.test_model.id}`}, + "custom_metadata_list": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceModelGroupModelGroupDetailsCustomMetadataListRepresentation}, + } + DatascienceModelGroupMemberModelEntriesMemberModelDetailsRepresentation = map[string]interface{}{ + "inference_key": acctest.Representation{RepType: acctest.Optional, Create: `inferenceKey`}, + "model_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_model.test_model.id}`}, + } + DatascienceModelGroupModelGroupCloneSourceDetailsModifyModelGroupDetailsRepresentation = map[string]interface{}{ + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"freeformTags": "freeformTags"}, Update: map[string]string{"freeformTags2": "freeformTags2"}}, + "model_group_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupModelGroupCloneSourceDetailsModifyModelGroupDetailsModelGroupDetailsRepresentation}, + "member_model_entries": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupMemberModelEntriesRepresentation}, + "model_group_version_history_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model_group_version_history.test_model_group_version_history.id}`}, + "version_label": acctest.Representation{RepType: acctest.Optional, Create: `versionLabel`}, + } + DatascienceModelGroupModelGroupCloneSourceDetailsPatchModelGroupMemberModelDetailsRepresentation = map[string]interface{}{ + "items": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceModelGroupModelGroupCloneSourceDetailsPatchModelGroupMemberModelDetailsItemsRepresentation}, + } + DatascienceModelGroupModelGroupDetailsCustomMetadataListRepresentation = map[string]interface{}{ + "category": acctest.Representation{RepType: acctest.Optional, Create: `category`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`}, + "key": acctest.Representation{RepType: acctest.Optional, Create: `key`}, + "value": acctest.Representation{RepType: acctest.Optional, Create: `value`}, + } + DatascienceModelGroupModelGroupCloneSourceDetailsModifyModelGroupDetailsModelGroupDetailsRepresentation = map[string]interface{}{ + "type": acctest.Representation{RepType: acctest.Required, Create: `HOMOGENEOUS`}, + "base_model_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model.test_model.id}`}, + "custom_metadata_list": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatascienceModelGroupModelGroupCloneSourceDetailsModifyModelGroupDetailsModelGroupDetailsCustomMetadataListRepresentation}, + } + DatascienceModelGroupModelGroupCloneSourceDetailsPatchModelGroupMemberModelDetailsItemsRepresentation = map[string]interface{}{ + "operation": acctest.Representation{RepType: acctest.Required, Create: `INSERT`}, + "values": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupModelGroupCloneSourceDetailsPatchModelGroupMemberModelDetailsItemsValuesRepresentation}, + } + DatascienceModelGroupModelGroupCloneSourceDetailsModifyModelGroupDetailsModelGroupDetailsCustomMetadataListRepresentation = map[string]interface{}{ + "category": acctest.Representation{RepType: acctest.Optional, Create: `category`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`}, + "key": acctest.Representation{RepType: acctest.Optional, Create: `key`}, + "value": acctest.Representation{RepType: acctest.Optional, Create: `value`}, + } + DatascienceModelGroupModelGroupCloneSourceDetailsPatchModelGroupMemberModelDetailsItemsValuesRepresentation = map[string]interface{}{ + "model_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_model.test_model.id}`}, + "inference_key": acctest.Representation{RepType: acctest.Optional, Create: `inferenceKey`}, + } + + DatascienceModelGroupResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group_version_history", "test_model_group_version_history", acctest.Required, acctest.Create, DatascienceModelGroupVersionHistoryRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model", "test_model", acctest.Required, acctest.Create, DatascienceModelRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + + DefinedTagsDependencies +) + +// issue-routing-tag: datascience/default +func TestDatascienceModelGroupResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatascienceModelGroupResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_datascience_model_group.test_model_group" + + // 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+DatascienceModelGroupResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group", "test_model_group", acctest.Optional, acctest.Create, DatascienceModelGroupRepresentation), "datascience", "model-group", t) + + acctest.ResourceTest(t, testAccCheckDatascienceModelGroupDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + DatascienceModelGroupResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group", "test_model_group", acctest.Required, acctest.Create, DatascienceModelGroupRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "member_model_entries.#", "1"), + resource.TestCheckResourceAttr(resourceName, "model_group_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "model_group_details.0.type", "HOMOGENEOUS"), + resource.TestCheckResourceAttrSet(resourceName, "project_id"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + }) +} + +func testAccCheckDatascienceModelGroupDestroy(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_model_group" { + noResourceFound = false + request := oci_datascience.GetModelGroupRequest{} + + tmp := rs.Primary.ID + request.ModelGroupId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "datascience") + + response, err := client.GetModelGroup(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_datascience.ModelGroupLifecycleStateDeleted): 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("DatascienceModelGroup") { + resource.AddTestSweepers("DatascienceModelGroup", &resource.Sweeper{ + Name: "DatascienceModelGroup", + Dependencies: acctest.DependencyGraph["model-group"], + F: sweepDatascienceModelGroupResource, + }) + } +} + +func sweepDatascienceModelGroupResource(compartment string) error { + dataScienceClient := acctest.GetTestClients(&schema.ResourceData{}).DataScienceClient() + modelGroupIds, err := getDatascienceModelGroupIds(compartment) + if err != nil { + return err + } + for _, modelGroupId := range modelGroupIds { + if ok := acctest.SweeperDefaultResourceId[modelGroupId]; !ok { + deleteModelGroupRequest := oci_datascience.DeleteModelGroupRequest{} + + deleteModelGroupRequest.ModelGroupId = &modelGroupId + + deleteModelGroupRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "datascience") + _, error := dataScienceClient.DeleteModelGroup(context.Background(), deleteModelGroupRequest) + if error != nil { + fmt.Printf("Error deleting ModelGroup %s %s, It is possible that the resource is already deleted. Please verify manually \n", modelGroupId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &modelGroupId, DatascienceModelGroupSweepWaitCondition, time.Duration(3*time.Minute), + DatascienceModelGroupSweepResponseFetchOperation, "datascience", true) + } + } + return nil +} + +func getDatascienceModelGroupIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ModelGroupId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + dataScienceClient := acctest.GetTestClients(&schema.ResourceData{}).DataScienceClient() + + listModelGroupsRequest := oci_datascience.ListModelGroupsRequest{} + listModelGroupsRequest.CompartmentId = &compartmentId + listModelGroupsRequest.LifecycleState = oci_datascience.ListModelGroupsLifecycleStateActive + listModelGroupsResponse, err := dataScienceClient.ListModelGroups(context.Background(), listModelGroupsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting ModelGroup list for compartment id : %s , %s \n", compartmentId, err) + } + for _, modelGroup := range listModelGroupsResponse.Items { + id := *modelGroup.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ModelGroupId", id) + } + return resourceIds, nil +} + +func DatascienceModelGroupSweepWaitCondition(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 modelGroupResponse, ok := response.Response.(oci_datascience.GetModelGroupResponse); ok { + return modelGroupResponse.LifecycleState != oci_datascience.ModelGroupLifecycleStateDeleted + } + return false +} + +func DatascienceModelGroupSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.DataScienceClient().GetModelGroup(context.Background(), oci_datascience.GetModelGroupRequest{ + ModelGroupId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/datascience_model_group_version_history_test.go b/internal/integrationtest/datascience_model_group_version_history_test.go new file mode 100644 index 00000000000..ae226f42d50 --- /dev/null +++ b/internal/integrationtest/datascience_model_group_version_history_test.go @@ -0,0 +1,218 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_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/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + DatascienceModelGroupVersionHistoryRequiredOnlyResource = DatascienceModelGroupVersionHistoryResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group_version_history", "test_model_group_version_history", acctest.Required, acctest.Create, DatascienceModelGroupVersionHistoryRepresentation) + + DatascienceModelGroupVersionHistoryResourceConfig = DatascienceModelGroupVersionHistoryResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group_version_history", "test_model_group_version_history", acctest.Optional, acctest.Update, DatascienceModelGroupVersionHistoryRepresentation) + + DatascienceModelGroupVersionHistorySingularDataSourceRepresentation = map[string]interface{}{ + "model_group_version_history_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_datascience_model_group_version_history.test_model_group_version_history.id}`}, + } + + DatascienceModelGroupVersionHistoryDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "created_by": acctest.Representation{RepType: acctest.Optional, Create: `createdBy`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `displayName`, Update: `displayName2`}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model_group_version_history.test_model_group_version_history.id}`}, + "project_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_project.test_project.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `AVAILABLE`}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatascienceModelGroupVersionHistoryDataSourceFilterRepresentation}} + DatascienceModelGroupVersionHistoryDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_datascience_model_group_version_history.test_model_group_version_history.id}`}}, + } + + DatascienceModelGroupVersionHistoryRepresentation = 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")}`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `displayName`, Update: `displayName2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "latest_model_group_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_datascience_model_group.test_model_group.id}`}, + } + + DatascienceModelGroupVersionHistoryResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group", "test_model_group", acctest.Required, acctest.Create, DatascienceModelGroupRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model", "test_model", acctest.Required, acctest.Create, DatascienceModelRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + + DefinedTagsDependencies +) + +// issue-routing-tag: datascience/default +func TestDatascienceModelGroupVersionHistoryResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatascienceModelGroupVersionHistoryResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_datascience_model_group_version_history.test_model_group_version_history" + + // 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+DatascienceModelGroupVersionHistoryResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group_version_history", "test_model_group_version_history", acctest.Optional, acctest.Create, DatascienceModelGroupVersionHistoryRepresentation), "datascience", "modelGroupVersionHistory", t) + + acctest.ResourceTest(t, testAccCheckDatascienceModelGroupVersionHistoryDestroy, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + DatascienceModelGroupVersionHistoryResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_datascience_model_group_version_history", "test_model_group_version_history", acctest.Required, acctest.Create, DatascienceModelGroupVersionHistoryRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "project_id"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + }) +} + +func testAccCheckDatascienceModelGroupVersionHistoryDestroy(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_model_group_version_history" { + noResourceFound = false + request := oci_datascience.GetModelGroupVersionHistoryRequest{} + + tmp := rs.Primary.ID + request.ModelGroupVersionHistoryId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "datascience") + + response, err := client.GetModelGroupVersionHistory(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_datascience.ModelGroupVersionHistoryLifecycleStateDeleted): 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("DatascienceModelGroupVersionHistory") { + resource.AddTestSweepers("DatascienceModelGroupVersionHistory", &resource.Sweeper{ + Name: "DatascienceModelGroupVersionHistory", + Dependencies: acctest.DependencyGraph["modelGroupVersionHistory"], + F: sweepDatascienceModelGroupVersionHistoryResource, + }) + } +} + +func sweepDatascienceModelGroupVersionHistoryResource(compartment string) error { + dataScienceClient := acctest.GetTestClients(&schema.ResourceData{}).DataScienceClient() + modelGroupVersionHistoryIds, err := getDatascienceModelGroupVersionHistoryIds(compartment) + if err != nil { + return err + } + for _, modelGroupVersionHistoryId := range modelGroupVersionHistoryIds { + if ok := acctest.SweeperDefaultResourceId[modelGroupVersionHistoryId]; !ok { + deleteModelGroupVersionHistoryRequest := oci_datascience.DeleteModelGroupVersionHistoryRequest{} + + deleteModelGroupVersionHistoryRequest.ModelGroupVersionHistoryId = &modelGroupVersionHistoryId + + deleteModelGroupVersionHistoryRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "datascience") + _, error := dataScienceClient.DeleteModelGroupVersionHistory(context.Background(), deleteModelGroupVersionHistoryRequest) + if error != nil { + fmt.Printf("Error deleting ModelGroupVersionHistory %s %s, It is possible that the resource is already deleted. Please verify manually \n", modelGroupVersionHistoryId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &modelGroupVersionHistoryId, DatascienceModelGroupVersionHistorySweepWaitCondition, time.Duration(3*time.Minute), + DatascienceModelGroupVersionHistorySweepResponseFetchOperation, "datascience", true) + } + } + return nil +} + +func getDatascienceModelGroupVersionHistoryIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ModelGroupVersionHistoryId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + dataScienceClient := acctest.GetTestClients(&schema.ResourceData{}).DataScienceClient() + + listModelGroupVersionHistoriesRequest := oci_datascience.ListModelGroupVersionHistoriesRequest{} + listModelGroupVersionHistoriesRequest.CompartmentId = &compartmentId + listModelGroupVersionHistoriesRequest.LifecycleState = oci_datascience.ListModelGroupVersionHistoriesLifecycleStateActive + listModelGroupVersionHistoriesResponse, err := dataScienceClient.ListModelGroupVersionHistories(context.Background(), listModelGroupVersionHistoriesRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting ModelGroupVersionHistory list for compartment id : %s , %s \n", compartmentId, err) + } + for _, modelGroupVersionHistory := range listModelGroupVersionHistoriesResponse.Items { + id := *modelGroupVersionHistory.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ModelGroupVersionHistoryId", id) + } + return resourceIds, nil +} + +func DatascienceModelGroupVersionHistorySweepWaitCondition(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 modelGroupVersionHistoryResponse, ok := response.Response.(oci_datascience.GetModelGroupVersionHistoryResponse); ok { + return modelGroupVersionHistoryResponse.LifecycleState != oci_datascience.ModelGroupVersionHistoryLifecycleStateDeleted + } + return false +} + +func DatascienceModelGroupVersionHistorySweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.DataScienceClient().GetModelGroupVersionHistory(context.Background(), oci_datascience.GetModelGroupVersionHistoryRequest{ + ModelGroupVersionHistoryId: 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 a61850f36b4..6e5c9cc8a9d 100644 --- a/internal/integrationtest/datascience_notebook_session_test.go +++ b/internal/integrationtest/datascience_notebook_session_test.go @@ -86,9 +86,9 @@ var ( } notebookSessionConfigDetailsRepresentation = map[string]interface{}{ - "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, + "shape": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard.E4.Flex`}, "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `100`}, - "notebook_session_shape_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: notebookSessionConfigDetailsShapeConfigDetailsRepresentation}, + "notebook_session_shape_config_details": acctest.RepresentationGroup{RepType: acctest.Required, 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}`}, } @@ -111,8 +111,9 @@ var ( } notebookSessionConfigDetailsShapeConfigDetailsRepresentation = map[string]interface{}{ - "memory_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `1.0`}, - "ocpus": acctest.Representation{RepType: acctest.Optional, Create: `1.0`}, + "cpu_baseline": acctest.Representation{RepType: acctest.Optional, Create: `BASELINE_1_8`, Update: `BASELINE_1_2`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `2.0`, Update: `4.0`}, + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `14.0`, Update: `28.0`}, } definedTagsIgnoreRepresentation = map[string]interface{}{ @@ -186,8 +187,11 @@ 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.#", "1"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.ocpus", "2"), 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"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -243,9 +247,13 @@ 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.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.ocpus", "2"), 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, "notebook_session_configuration_details.0.private_endpoint_id"), + resource.TestCheckResourceAttrSet(resourceName, "notebook_session_configuration_details.0.subnet_id"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -272,9 +280,13 @@ 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.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.0.ocpus", "2"), resource.TestCheckResourceAttrSet(resourceName, "notebook_session_config_details.0.private_endpoint_id"), - resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.shape", "VM.Standard2.1"), + resource.TestCheckResourceAttr(resourceName, "notebook_session_config_details.0.shape", "VM.Standard.E4.Flex"), + resource.TestCheckResourceAttrSet(resourceName, "notebook_session_config_details.0.subnet_id"), resource.TestCheckResourceAttrSet(resourceName, "project_id"), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), @@ -303,8 +315,8 @@ func TestDatascienceNotebookSessionWithConfigDetailsResource_basic(t *testing.T) resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_config_details.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_config_details.0.block_storage_size_in_gbs", "100"), - resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.#", "0"), - resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_config_details.0.shape", "VM.Standard2.1"), + resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_config_details.0.notebook_session_shape_config_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_config_details.0.shape", "VM.Standard.E4.Flex"), resource.TestCheckResourceAttrSet(singularDatasourceName, "notebook_session_url"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), @@ -455,6 +467,7 @@ 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.#", "1"), 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"), @@ -476,6 +489,8 @@ func TestDatascienceNotebookSessionWithConfigurationDetailsResource_basic(t *tes resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_configuration_details.0.block_storage_size_in_gbs", "100"), + resource.TestCheckResourceAttr(singularDatasourceName, "notebook_session_configuration_details.0.shape", "VM.Standard2.1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "notebook_session_url"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), diff --git a/internal/integrationtest/datascience_pipeline_run_test.go b/internal/integrationtest/datascience_pipeline_run_test.go index 98ae6d136f2..a8e9c1a7ddd 100644 --- a/internal/integrationtest/datascience_pipeline_run_test.go +++ b/internal/integrationtest/datascience_pipeline_run_test.go @@ -126,7 +126,7 @@ var ( } DatasciencePipelineRunStepOverrideDetailsContainerConfigurationDetailsRepresentation = map[string]interface{}{ "container_type": acctest.Representation{RepType: acctest.Required, Create: `OCIR_CONTAINER`}, - "image": acctest.Representation{RepType: acctest.Required, Create: `iad.ocir.io/idtlxnfdweil/byod-hello-world:1`}, + "image": acctest.Representation{RepType: acctest.Required, Create: `iad.ocir.io/idtlxnfdweil/byod/test-hello-world:1.0`}, "cmd": acctest.Representation{RepType: acctest.Optional, Create: []string{``}}, "entrypoint": acctest.Representation{RepType: acctest.Optional, Create: []string{``}}, "image_digest": acctest.Representation{RepType: acctest.Optional, Create: ``}, @@ -161,17 +161,23 @@ var ( PipelineRunResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_pipeline", "test_pipeline", acctest.Required, acctest.Create, pipelineRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_logging_log_group", "terraform_test_custom_log_group", acctest.Required, acctest.Create, pipelineLogGroupRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_logging_log", "terraform_test_custom_log", acctest.Required, acctest.Create, pipelineLogRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_logging_log", "terraform_test_custom_log", acctest.Required, acctest.Create, pipelineLogRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) PipelineRunContainerResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_pipeline", "test_pipeline", acctest.Optional, acctest.Create, pipelineRepresentationContainer) + acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_logging_log_group", "terraform_test_custom_log_group", acctest.Required, acctest.Create, pipelineLogGroupRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_logging_log", "terraform_test_custom_log", acctest.Required, acctest.Create, pipelineLogRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_logging_log", "terraform_test_custom_log", acctest.Required, acctest.Create, pipelineLogRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) PipelineRunDataflowResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_datascience_pipeline", "test_pipeline", acctest.Optional, acctest.Create, pipelineRepresentationDataflow) + acctest.GenerateResourceFromRepresentationMap("oci_datascience_project", "test_project", acctest.Required, acctest.Create, DatascienceProjectRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_logging_log_group", "terraform_test_custom_log_group", acctest.Required, acctest.Create, pipelineLogGroupRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_logging_log", "terraform_test_custom_log", acctest.Required, acctest.Create, pipelineLogRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_logging_log", "terraform_test_custom_log", acctest.Required, acctest.Create, pipelineLogRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) ) // issue-routing-tag: datascience/default @@ -198,70 +204,70 @@ func TestDatasciencePipelineRunResource_basic(t *testing.T) { acctest.ResourceTest(t, testAccCheckDatasciencePipelineRunDestroy, []resource.TestStep{ // Step 0 - Verify Create Pipeline Run with Container - { - Config: config + compartmentIdVariableStr + PipelineRunDataflowResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_datascience_pipeline_run", "test_pipeline_run", acctest.Optional, acctest.Create, pipelineRunDataflowRepresentation), - Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttrSet(resourceName, "pipeline_id"), - resource.TestCheckResourceAttrSet(resourceName, "project_id"), - resource.TestCheckResourceAttrSet(resourceName, "id"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_name", "stepNameDataflow"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape", "VM.Standard.E5.Flex"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape_config_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape_config_details.0.memory_in_gbs", "16"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape_config_details.0.ocpus", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape", "VM.Standard.E5.Flex"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape_config_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape_config_details.0.memory_in_gbs", "16"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape_config_details.0.ocpus", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.logs_bucket_uri", "oci://xuejuzha-test@idtlxnfdweil/"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.num_executors", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.warehouse_bucket_uri", "oci://xuejuzha-test@idtlxnfdweil/"), - - func(s *terraform.State) (err error) { - resId, err = acctest.FromInstanceState(s, resourceName, "id") - return err - }, - ), - }, - { - Config: config + compartmentIdVariableStr + PipelineRunContainerResourceDependencies, // current pipeline state = ACCEPTED and DELETE after SUCCEEDED/CANCELED/FAILED - }, - { - Config: config + compartmentIdVariableStr + PipelineRunContainerResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_datascience_pipeline_run", "test_pipeline_run", acctest.Optional, acctest.Create, pipelineRunContainerRepresentation), - Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttrSet(resourceName, "pipeline_id"), - resource.TestCheckResourceAttrSet(resourceName, "project_id"), - resource.TestCheckResourceAttrSet(resourceName, "id"), - resource.TestCheckResourceAttr(resourceName, "configuration_override_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.0.command_line_arguments", "commandLineArgumentsOverriden"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.0.environment_variables.%", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.0.maximum_runtime_in_minutes", "10"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_name", "stepNameContainer"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.container_type", "OCIR_CONTAINER"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.image", "iad.ocir.io/idtlxnfdweil/byod-hello-world:1"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.cmd.#", "0"), - resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.entrypoint.#", "0"), - - func(s *terraform.State) (err error) { - resId, err = acctest.FromInstanceState(s, resourceName, "id") - return err - }, - ), - }, - // Step 1 - delete before next Create - { - Config: config + compartmentIdVariableStr + PipelineRunContainerResourceDependencies, // current pipeline state = ACCEPTED and DELETE after SUCCEEDED/CANCELED/FAILED - }, + //{ + // Config: config + compartmentIdVariableStr + PipelineRunDataflowResourceDependencies + + // acctest.GenerateResourceFromRepresentationMap("oci_datascience_pipeline_run", "test_pipeline_run", acctest.Optional, acctest.Create, pipelineRunDataflowRepresentation), + // Check: acctest.ComposeAggregateTestCheckFuncWrapper( + // resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + // resource.TestCheckResourceAttrSet(resourceName, "pipeline_id"), + // resource.TestCheckResourceAttrSet(resourceName, "project_id"), + // resource.TestCheckResourceAttrSet(resourceName, "id"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_name", "stepNameDataflow"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape", "VM.Standard.E5.Flex"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape_config_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape_config_details.0.memory_in_gbs", "14"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.driver_shape_config_details.0.ocpus", "2"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape", "VM.Standard.E5.Flex"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape_config_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape_config_details.0.memory_in_gbs", "14"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.executor_shape_config_details.0.ocpus", "2"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.logs_bucket_uri", "oci://xuejuzha-test@idtlxnfdweil/"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.num_executors", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_dataflow_configuration_details.0.warehouse_bucket_uri", "oci://xuejuzha-test@idtlxnfdweil/"), + // + // func(s *terraform.State) (err error) { + // resId, err = acctest.FromInstanceState(s, resourceName, "id") + // return err + // }, + // ), + //}, + //{ + // Config: config + compartmentIdVariableStr + PipelineRunContainerResourceDependencies, // current pipeline state = ACCEPTED and DELETE after SUCCEEDED/CANCELED/FAILED + //}, + //{ + // Config: config + compartmentIdVariableStr + PipelineRunContainerResourceDependencies + + // acctest.GenerateResourceFromRepresentationMap("oci_datascience_pipeline_run", "test_pipeline_run", acctest.Optional, acctest.Create, pipelineRunContainerRepresentation), + // Check: acctest.ComposeAggregateTestCheckFuncWrapper( + // resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + // resource.TestCheckResourceAttrSet(resourceName, "pipeline_id"), + // resource.TestCheckResourceAttrSet(resourceName, "project_id"), + // resource.TestCheckResourceAttrSet(resourceName, "id"), + // resource.TestCheckResourceAttr(resourceName, "configuration_override_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.0.command_line_arguments", "commandLineArgumentsOverriden"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.0.environment_variables.%", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_configuration_details.0.maximum_runtime_in_minutes", "10"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_name", "stepNameContainer"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.#", "1"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.container_type", "OCIR_CONTAINER"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.image", "iad.ocir.io/idtlxnfdweil/byod/test-hello-world:1.0"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.cmd.#", "0"), + // resource.TestCheckResourceAttr(resourceName, "step_override_details.0.step_container_configuration_details.0.entrypoint.#", "0"), + // + // func(s *terraform.State) (err error) { + // resId, err = acctest.FromInstanceState(s, resourceName, "id") + // return err + // }, + // ), + //}, + //// Step 1 - delete before next Create + //{ + // Config: config + compartmentIdVariableStr + PipelineRunContainerResourceDependencies, // current pipeline state = ACCEPTED and DELETE after SUCCEEDED/CANCELED/FAILED + //}, // Step 2 - verify Create { Config: config + compartmentIdVariableStr + PipelineRunResourceDependencies + diff --git a/internal/integrationtest/datascience_pipeline_test.go b/internal/integrationtest/datascience_pipeline_test.go index 4f4dda58f16..306a934d11e 100644 --- a/internal/integrationtest/datascience_pipeline_test.go +++ b/internal/integrationtest/datascience_pipeline_test.go @@ -56,7 +56,7 @@ 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{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "infrastructure_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: pipelineInfrastructureConfigurationDetailsRepresentation}, + "infrastructure_configuration_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatasciencePipelineInfrastructureConfigurationDetailsRepresentation}, "log_configuration_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: pipelineLogConfigurationDetailsRepresentation}, "step_artifact": acctest.RepresentationGroup{RepType: acctest.Required, Group: pipelineStepArtifactRepresentation}, "storage_mount_configuration_details_list": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatasciencePipelineStorageMountConfigurationDetailsListRepresentation}, @@ -111,7 +111,7 @@ var ( "description": acctest.Representation{RepType: acctest.Optional, Create: `description`, Update: `description2`}, "step_storage_mount_configuration_details_list": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatasciencePipelineStorageMountConfigurationDetailsListRepresentation}, "step_configuration_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: pipelineStepDetailsStepConfigurationDetailsRepresentation}, - "step_infrastructure_configuration_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: pipelineStepDetailsStepInfrastructureConfigurationDetailsRepresentation}, + "step_infrastructure_configuration_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatasciencePipelineStepDetailsStepInfrastructureConfigurationDetailsRepresentation}, } pipelineStepDetailsRepresentationContainer = map[string]interface{}{ @@ -125,8 +125,9 @@ var ( } pipelineStepDetailsRepresentationDataflow = map[string]interface{}{ - "step_name": acctest.Representation{RepType: acctest.Required, Create: `stepNameDataflow`}, - "step_type": acctest.Representation{RepType: acctest.Required, Create: `DATAFLOW`}, + "step_name": acctest.Representation{RepType: acctest.Required, Create: `stepNameDataflow`}, + "step_type": acctest.Representation{RepType: acctest.Required, Create: `DATAFLOW`}, + // replace {application_id} with a real dataflow application id created in the test tenancy and compartment when running test "application_id": acctest.Representation{RepType: acctest.Required, Create: `{application_id}`}, "depends_on": acctest.Representation{RepType: acctest.Optional, Create: []string{}}, "description": acctest.Representation{RepType: acctest.Optional, Create: `descriptionDataflow`}, @@ -145,18 +146,12 @@ var ( } DatasciencePipelineInfrastructureConfigurationDetailsRepresentation = map[string]interface{}{ "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `50`, Update: `60`}, - "shape_name": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, - "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: `{subnet_id}`}, - //"shape_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: pipelineInfrastructureConfigurationDetailsShapeConfigDetailsRepresentation}, + "shape_name": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard.E4.Flex`}, + "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_core_subnet.test_subnet.id}`}, + "shape_config_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: DatasciencePipelineInfrastructureConfigurationDetailsShapeConfigDetailsRepresentation}, // "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: ``}, } - pipelineInfrastructureConfigurationDetailsRepresentation = map[string]interface{}{ - "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `50`}, - "shape_name": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, - "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: `{subnet_id}`}, - } - pipelineLogConfigurationDetailsRepresentation = map[string]interface{}{ "enable_auto_log_creation": acctest.Representation{RepType: acctest.Optional, Create: `false`}, "enable_logging": acctest.Representation{RepType: acctest.Optional, Create: `true`}, @@ -209,9 +204,9 @@ var ( DatasciencePipelineStepDetailsStepInfrastructureConfigurationDetailsRepresentation = map[string]interface{}{ "block_storage_size_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `50`}, //Applicable when step_type=CUSTOM_SCRIPT Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. - //"shape_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: pipelineStepDetailsStepInfrastructureConfigurationDetailsShapeConfigDetailsRepresentation}, - "shape_name": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard2.1`}, - "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: `{subnet_id}`}, + "shape_config_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: DatasciencePipelineStepDetailsStepInfrastructureConfigurationDetailsShapeConfigDetailsRepresentation}, + "shape_name": acctest.Representation{RepType: acctest.Required, Create: `VM.Standard.E4.Flex`}, + "subnet_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_core_subnet.test_subnet.id}`}, } DatasciencePipelineStepDetailsStepStorageMountConfigurationDetailsListRepresentation = map[string]interface{}{ "destination_directory_name": acctest.Representation{RepType: acctest.Required, Create: `destinationDirectoryName`, Update: `destinationDirectoryName2`}, @@ -224,20 +219,22 @@ var ( "prefix": acctest.Representation{RepType: acctest.Optional, Create: `prefix`, Update: `prefix2`}, } DatasciencePipelineInfrastructureConfigurationDetailsShapeConfigDetailsRepresentation = 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`}, + "cpu_baseline": acctest.Representation{RepType: acctest.Optional, Create: `BASELINE_1_8`, Update: `BASELINE_1_2`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `2.0`, Update: `4.0`}, + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `14.0`, Update: `28.0`}, } DatasciencePipelineStepDetailsStepDataflowConfigurationDetailsDriverShapeConfigDetailsRepresentation = map[string]interface{}{ - "memory_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `16.0`, Update: `16.0`}, - "ocpus": acctest.Representation{RepType: acctest.Optional, Create: `1.0`, Update: `2.0`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `2.0`, Update: `4.0`}, + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `14.0`, Update: `28.0`}, } DatasciencePipelineStepDetailsStepDataflowConfigurationDetailsExecutorShapeConfigDetailsRepresentation = map[string]interface{}{ - "memory_in_gbs": acctest.Representation{RepType: acctest.Optional, Create: `16.0`, Update: `16.0`}, - "ocpus": acctest.Representation{RepType: acctest.Optional, Create: `1.0`, Update: `2.0`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `2.0`, Update: `4.0`}, + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `14.0`, Update: `28.0`}, } DatasciencePipelineStepDetailsStepInfrastructureConfigurationDetailsShapeConfigDetailsRepresentation = 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`}, + "cpu_baseline": acctest.Representation{RepType: acctest.Optional, Create: `BASELINE_1_8`, Update: `BASELINE_1_2`}, + "ocpus": acctest.Representation{RepType: acctest.Required, Create: `2.0`, Update: `4.0`}, + "memory_in_gbs": acctest.Representation{RepType: acctest.Required, Create: `14.0`, Update: `28.0`}, } // shape_configuration_details supported and tested but currently not supported by ml_jobs @@ -344,6 +341,10 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.ocpus", "2"), resource.TestCheckResourceAttrSet(resourceName, "infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "log_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "log_configuration_details.0.enable_auto_log_creation", "false"), @@ -362,6 +363,10 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "step_details.0.step_configuration_details.0.maximum_runtime_in_minutes", "10"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.ocpus", "2"), resource.TestCheckResourceAttrSet(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "storage_mount_configuration_details_list.#", "1"), resource.TestCheckResourceAttr(resourceName, "storage_mount_configuration_details_list.0.destination_directory_name", "oss"), @@ -406,6 +411,10 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.ocpus", "2"), resource.TestCheckResourceAttrSet(resourceName, "infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "log_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "log_configuration_details.0.enable_auto_log_creation", "false"), @@ -424,7 +433,10 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "step_details.0.step_configuration_details.0.maximum_runtime_in_minutes", "10"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), - resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_8"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.ocpus", "2"), resource.TestCheckResourceAttrSet(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_name", "stepName"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_type", "CUSTOM_SCRIPT"), @@ -457,7 +469,11 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.#", "1"), - resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.block_storage_size_in_gbs", "60"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_2"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "28"), + resource.TestCheckResourceAttr(resourceName, "infrastructure_configuration_details.0.shape_config_details.0.ocpus", "4"), resource.TestCheckResourceAttrSet(resourceName, "infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "log_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "log_configuration_details.0.enable_auto_log_creation", "false"), @@ -476,8 +492,20 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "step_details.0.step_configuration_details.0.maximum_runtime_in_minutes", "10"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), - resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_2"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "28"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.ocpus", "4"), + resource.TestCheckResourceAttrSet(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_name"), + resource.TestCheckResourceAttrSet(resourceName, "step_details.0.step_infrastructure_configuration_details.0.subnet_id"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_name", "stepName"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_storage_mount_configuration_details_list.#", "1"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_storage_mount_configuration_details_list.0.bucket", "storage-mount-test"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_storage_mount_configuration_details_list.0.destination_directory_name", "oss1"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_storage_mount_configuration_details_list.0.destination_path", "/mnt"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_storage_mount_configuration_details_list.0.namespace", "idtlxnfdweil"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_storage_mount_configuration_details_list.0.prefix", "prod"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_storage_mount_configuration_details_list.0.storage_type", "OBJECT_STORAGE"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_type", "CUSTOM_SCRIPT"), resource.TestCheckResourceAttr(resourceName, "storage_mount_configuration_details_list.#", "1"), resource.TestCheckResourceAttr(resourceName, "storage_mount_configuration_details_list.0.destination_directory_name", "oss1"), @@ -539,7 +567,11 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_configuration_details.#", "1"), - resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), + resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_configuration_details.0.block_storage_size_in_gbs", "60"), + resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_2"), + resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "28"), + resource.TestCheckResourceAttr(singularDatasourceName, "infrastructure_configuration_details.0.shape_config_details.0.ocpus", "4"), resource.TestCheckResourceAttr(singularDatasourceName, "log_configuration_details.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "log_configuration_details.0.enable_auto_log_creation", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "log_configuration_details.0.enable_logging", "true"), @@ -554,8 +586,18 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_configuration_details.0.maximum_runtime_in_minutes", "10"), resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_infrastructure_configuration_details.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), - resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "0"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.cpu_baseline", "BASELINE_1_2"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "28"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.ocpus", "4"), resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_name", "stepName"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_storage_mount_configuration_details_list.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_storage_mount_configuration_details_list.0.bucket", "storage-mount-test"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_storage_mount_configuration_details_list.0.destination_directory_name", "oss1"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_storage_mount_configuration_details_list.0.destination_path", "/mnt"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_storage_mount_configuration_details_list.0.namespace", "idtlxnfdweil"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_storage_mount_configuration_details_list.0.prefix", "prod"), + resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_storage_mount_configuration_details_list.0.storage_type", "OBJECT_STORAGE"), resource.TestCheckResourceAttr(singularDatasourceName, "step_details.0.step_type", "CUSTOM_SCRIPT"), resource.TestCheckResourceAttr(singularDatasourceName, "storage_mount_configuration_details_list.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "storage_mount_configuration_details_list.0.storage_type", "OBJECT_STORAGE"), @@ -596,10 +638,10 @@ func TestDatasciencePipelineResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "step_details.0.step_container_configuration_details.0.image_signature_id", ""), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.block_storage_size_in_gbs", "50"), - resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "0"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.#", "1"), // For flex shape only - //resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "1.0"), - //resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.ocpus", "1.0"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.memory_in_gbs", "14"), + resource.TestCheckResourceAttr(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_config_details.0.ocpus", "2"), resource.TestCheckResourceAttrSet(resourceName, "step_details.0.step_infrastructure_configuration_details.0.shape_name"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_name", "stepNameContainer"), resource.TestCheckResourceAttr(resourceName, "step_details.0.step_type", "CONTAINER"), diff --git a/internal/integrationtest/opsi_macs_adb_exadata_insight_test.go b/internal/integrationtest/opsi_macs_adb_exadata_insight_test.go new file mode 100644 index 00000000000..80146e5e520 --- /dev/null +++ b/internal/integrationtest/opsi_macs_adb_exadata_insight_test.go @@ -0,0 +1,439 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_opsi "github.com/oracle/oci-go-sdk/v65/opsi" + "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" + + "github.com/oracle/terraform-provider-oci/httpreplay" +) + +var ( + OpsiMacsAdbExadataInsight = OpsiMacsAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Required, acctest.Create, OpsiMacsAdbExadataInsightRepresentation) + + OpsiMacsAdbExadataInsightResourceConfig = OpsiMacsAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, OpsiMacsAdbExadataInsightRepresentation) + + OpsiMacsAdbExadataInsightSingularDataSourceRepresentation = map[string]interface{}{ + "exadata_insight_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_opsi_exadata_insight.test_exadata_insight.id}`}, + } + + OpsiMacsAdbExadataInsightDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "exadata_type": acctest.Representation{RepType: acctest.Optional, Create: []string{`EXACC`}}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_opsi_exadata_insight.test_exadata_insight.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: []string{`ACTIVE`}}, + "status": acctest.Representation{RepType: acctest.Optional, Create: []string{`ENABLED`}, Update: []string{`DISABLED`}}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiMacsAdbExadataInsightDataSourceFilterRepresentation}} + + OpsiMacsAdbExadataInsightDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_opsi_exadata_insight.test_exadata_insight.id}`}}, + } + + OpsiMacsAdbExadataInsightRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "exadata_infra_id": acctest.Representation{RepType: acctest.Required, Create: `${var.exadata_infra_id}`}, + "entity_source": acctest.Representation{RepType: acctest.Required, Create: `MACS_MANAGED_CLOUD_EXADATA`}, + "status": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`}, + "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"}}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangesOpsiMacsAdbExadataInsightRepresentation}, + "member_vm_cluster_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: OpsiMacsAdbExadataInsightMemberVmClusterDetailsRepresentation}, + } + + OpsiMacsAdbExadataInsightMemberVmClusterDetailsRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "vmcluster_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.vmcluster_id}`}, + "member_autonomous_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: OpsiMacsAdbExadataInsightMemberVmClusterDetailsMemberAdbDetailsRepresentation}, + } + + OpsiMacsAdbExadataInsightMemberVmClusterDetailsMemberAdbDetailsRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "connection_credential_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiMacsAdbExadataInsightNamedCredentialDetailsRepresentation}, + "connection_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiMacsAdbExadataInsightConnectionDetailsRepresentation}, + "database_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.macs_adb_id}`}, + "database_resource_type": acctest.Representation{RepType: acctest.Optional, Create: `autonomousdatabase`}, + "deployment_type": acctest.Representation{RepType: acctest.Optional, Create: `EXACC`}, + "entity_source": acctest.Representation{RepType: acctest.Optional, Create: `MACS_MANAGED_AUTONOMOUS_DATABASE`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"freeformTags": "freeformTags"}}, + "management_agent_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.management_agent_id}`}, + } + + OpsiMacsAdbExadataInsightNamedCredentialDetailsRepresentation = map[string]interface{}{ + "credential_type": acctest.Representation{RepType: acctest.Required, Create: `CREDENTIALS_BY_NAMED_CREDS`}, + "named_credential_id": acctest.Representation{RepType: acctest.Required, Create: `${var.named_credential_id}`}, + } + + OpsiMacsAdbExadataInsightConnectionDetailsRepresentation = map[string]interface{}{ + "host_name": acctest.Representation{RepType: acctest.Required, Create: `${var.adb_host}`}, + "port": acctest.Representation{RepType: acctest.Required, Create: `${var.adb_port}`}, + "protocol": acctest.Representation{RepType: acctest.Required, Create: `TCP`}, + "service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.service_name}`}, + } + + ignoreChangesOpsiMacsAdbExadataInsightRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`, `freeform_tags`}}, + } + + OpsiMacsAdbExadataInsightResourceDependencies = DefinedTagsDependencies +) + +// issue-routing-tag: opsi/controlPlane +func TestOpsiMacsAdbExadataInsightResource_basic(t *testing.T) { + httpreplay.SetScenario("TestOpsiMacsAdbExadataInsightResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + exacsAvailable := utils.GetEnvSettingWithBlankDefault("opsi_exacs_available") + if exacsAvailable == "" { + // Suggested by Rakshith Siddanahalli for our case of required but scarce ExaCS systems + t.Skip("Skipping tests which require ExaCS") + } + + 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) + + exadataInfraId := utils.GetEnvSettingWithBlankDefault("exadata_infra_id") + exadataInfraIdVariableStr := fmt.Sprintf("variable \"exadata_infra_id\" { default = \"%s\" }\n", exadataInfraId) + + vmClusterId := utils.GetEnvSettingWithBlankDefault("vmcluster_id") + vmClusterIdVariableStr := fmt.Sprintf("variable \"vmcluster_id\" { default = \"%s\" }\n", vmClusterId) + + managementAgentId := utils.GetEnvSettingWithBlankDefault("management_agent_id") + managementAgentIdVariableStr := fmt.Sprintf("variable \"management_agent_id\" { default = \"%s\" }\n", managementAgentId) + + namedCredentialId := utils.GetEnvSettingWithBlankDefault("named_credential_id") + namedCredentialIdVariableStr := fmt.Sprintf("variable \"named_credential_id\" { default = \"%s\" }\n", namedCredentialId) + + macsDatabaseId := utils.GetEnvSettingWithBlankDefault("macs_adb_id") + macsDatabaseIdVariableStr := fmt.Sprintf("variable \"macs_adb_id\" { default = \"%s\" }\n", macsDatabaseId) + + serviceName := utils.GetEnvSettingWithBlankDefault("service_name") + serviceNameVariableStr := fmt.Sprintf("variable \"service_name\" { default = \"%s\" }\n", serviceName) + + adbHostName := utils.GetEnvSettingWithBlankDefault("adb_host") + adbHostNameVariableStr := fmt.Sprintf("variable \"adb_host\" { default = \"%s\" }\n", adbHostName) + + adbPort := utils.GetEnvSettingWithBlankDefault("adb_port") + adbPortVariableStr := fmt.Sprintf("variable \"adb_port\" { default = \"%s\" }\n", adbPort) + + envVarsString := compartmentIdVariableStr + compartmentIdUVariableStr + managementAgentIdVariableStr + exadataInfraIdVariableStr + vmClusterIdVariableStr + namedCredentialIdVariableStr + macsDatabaseIdVariableStr + serviceNameVariableStr + + adbPortVariableStr + adbHostNameVariableStr + + resourceName := "oci_opsi_exadata_insight.test_exadata_insight" + datasourceName := "data.oci_opsi_exadata_insights.test_exadata_insights" + singularDatasourceName := "data.oci_opsi_exadata_insight.test_exadata_insight" + + 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+envVarsString+OpsiMacsAdbExadataInsightResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Create, OpsiMacsAdbExadataInsightRepresentation), "opsi", "exadataInsight", t) + + acctest.ResourceTest(t, testAccCheckOpsiMacsAdbExadataInsightDestroy, []resource.TestStep{ + // verify Create with optionals - Step 0 + { + Config: config + envVarsString + OpsiMacsAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Create, OpsiMacsAdbExadataInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "MACS_MANAGED_CLOUD_EXADATA"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + 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) - Step 1 + { + Config: config + envVarsString + OpsiMacsAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(OpsiMacsAdbExadataInsightRepresentation, 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, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "MACS_MANAGED_CLOUD_EXADATA"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + 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("Step 1: resource recreated when it was supposed to be updated") + } + return err + }, + ), + }, + // verify updates to updatable parameters - Step 2 (Update causes status to go to disabled) + { + Config: config + envVarsString + OpsiMacsAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, OpsiMacsAdbExadataInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "MACS_MANAGED_CLOUD_EXADATA"), + resource.TestCheckResourceAttr(resourceName, "status", "DISABLED"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceName, "id") + if resId != resId2 { + return fmt.Errorf("Step 2: resource recreated when it was supposed to be updated") + } + return err + }, + ), + }, + //verify enable - Step 3 + { + Config: config + envVarsString + OpsiMacsAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, + acctest.RepresentationCopyWithNewProperties(OpsiMacsAdbExadataInsightRepresentation, map[string]interface{}{ + "status": acctest.Representation{RepType: acctest.Required, Update: `ENABLED`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceName, "id") + if resId != resId2 { + return fmt.Errorf("Step 3: resource recreated when it was supposed to be updated") + } + return err + }, + ), + }, + // verify datasource - Step 4 + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_opsi_exadata_insights", "test_exadata_insights", acctest.Optional, acctest.Update, OpsiMacsAdbExadataInsightDataSourceRepresentation) + + envVarsString + OpsiMacsAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, OpsiMacsAdbExadataInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"), + resource.TestCheckResourceAttr(datasourceName, "exadata_type.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "state.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "status.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "filter.#", "1"), + ), + }, + //verify singular datasource - Step 5 + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Required, acctest.Create, OpsiMacsAdbExadataInsightSingularDataSourceRepresentation) + + envVarsString + OpsiMacsAdbExadataInsightResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_insight_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "entity_source", "MACS_MANAGED_CLOUD_EXADATA"), + resource.TestCheckResourceAttr(singularDatasourceName, "status", "DISABLED"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_display_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // verify resource import - Step 6 + { + Config: config + OpsiMacsAdbExadataInsight, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "member_vm_cluster_details", + }, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckOpsiMacsAdbExadataInsightDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).OperationsInsightsClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_opsi_exadata_insight" { + noResourceFound = false + request := oci_opsi.GetExadataInsightRequest{} + + tmp := rs.Primary.ID + request.ExadataInsightId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + + response, err := client.GetExadataInsight(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_opsi.ExadataInsightLifecycleStateDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.GetLifecycleState())]; !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.GetLifecycleState()) + } + //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("OpsiMacsAdbExadataInsight") { + resource.AddTestSweepers("OpsiMacsAdbExadataInsight", &resource.Sweeper{ + Name: "OpsiMacsAdbExadataInsight", + Dependencies: acctest.DependencyGraph["exadataInsight"], + F: sweepOpsiMacsAdbExadataInsightResource, + }) + } +} + +func sweepOpsiMacsAdbExadataInsightResource(compartment string) error { + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + exadataInsightIds, err := getOpsiMacsAdbExadataInsightIds(compartment) + if err != nil { + return err + } + for _, exadataInsightId := range exadataInsightIds { + if ok := acctest.SweeperDefaultResourceId[exadataInsightId]; !ok { + deleteExadataInsightRequest := oci_opsi.DeleteExadataInsightRequest{} + + deleteExadataInsightRequest.ExadataInsightId = &exadataInsightId + + deleteExadataInsightRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + _, error := operationsInsightsClient.DeleteExadataInsight(context.Background(), deleteExadataInsightRequest) + if error != nil { + fmt.Printf("Error deleting ExadataInsight %s %s, It is possible that the resource is already deleted. Please verify manually \n", exadataInsightId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &exadataInsightId, OpsiMacsAdbExadataInsightSweepWaitCondition, time.Duration(3*time.Minute), + OpsiMacsAdbExadataInsightSweepResponseFetchOperation, "opsi", true) + } + } + return nil +} + +func getOpsiMacsAdbExadataInsightIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ExadataInsightId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + + listExadataInsightsRequest := oci_opsi.ListExadataInsightsRequest{} + listExadataInsightsRequest.CompartmentId = &compartmentId + listExadataInsightsRequest.LifecycleState = []oci_opsi.LifecycleStateEnum{oci_opsi.LifecycleStateActive} + listExadataInsightsResponse, err := operationsInsightsClient.ListExadataInsights(context.Background(), listExadataInsightsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting ExadataInsight list for compartment id : %s , %s \n", compartmentId, err) + } + for _, exadataInsight := range listExadataInsightsResponse.Items { + id := *exadataInsight.GetId() + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ExadataInsightId", id) + } + return resourceIds, nil +} + +func OpsiMacsAdbExadataInsightSweepWaitCondition(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 exadataInsightResponse, ok := response.Response.(oci_opsi.GetExadataInsightResponse); ok { + return exadataInsightResponse.GetLifecycleState() != oci_opsi.ExadataInsightLifecycleStateDeleted + } + return false +} + +func OpsiMacsAdbExadataInsightSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.OperationsInsightsClient().GetExadataInsight(context.Background(), oci_opsi.GetExadataInsightRequest{ + ExadataInsightId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/opsi_macs_cloud_adb_insight_test.go b/internal/integrationtest/opsi_macs_cloud_adb_insight_test.go new file mode 100644 index 00000000000..c4536e84b87 --- /dev/null +++ b/internal/integrationtest/opsi_macs_cloud_adb_insight_test.go @@ -0,0 +1,449 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_opsi "github.com/oracle/oci-go-sdk/v65/opsi" + "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 ( + OpsiMacsCloudAdbInsightRequiredOnlyResource = OpsiMacsCloudAdbInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Required, acctest.Create, OpsiMacsCloudAdbInsightRepresentation) + + OpsiMacsCloudAdbInsightResourceConfig = OpsiMacsCloudAdbInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Optional, acctest.Update, OpsiMacsCloudAdbInsightRepresentation) + + OpsiMacsCloudAdbInsightSingularDataSourceRepresentation = map[string]interface{}{ + "database_insight_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_opsi_database_insight.test_database_insight.id}`}, + } + + OpsiMacsCloudAdbInsightDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "database_type": acctest.Representation{RepType: acctest.Optional, Create: []string{`ATP-EXACC`}}, + "fields": acctest.Representation{RepType: acctest.Optional, Create: []string{`databaseName`, `databaseType`, `compartmentId`, `databaseDisplayName`, `freeformTags`, `definedTags`}}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_opsi_database_insight.test_database_insight.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: []string{`ACTIVE`}}, + "status": acctest.Representation{RepType: acctest.Optional, Create: []string{`ENABLED`}, Update: []string{`DISABLED`}}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiMacsCloudAdbInsightDataSourceFilterRepresentation}, + } + + OpsiMacsCloudAdbInsightDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_opsi_database_insight.test_database_insight.id}`}}, + } + + OpsiMacsCloudAdbInsightRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "entity_source": acctest.Representation{RepType: acctest.Required, Create: `MACS_MANAGED_AUTONOMOUS_DATABASE`, Update: `MACS_MANAGED_AUTONOMOUS_DATABASE`}, + "is_advanced_features_enabled": acctest.Representation{RepType: acctest.Required, Create: `true`}, + "connection_credential_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiMacsCloudAdbInsightCredentialDetailsRepresentation}, + "connection_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiMacsCloudAdbInsightConnectionDetailsRepresentation}, + "management_agent_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.management_agent_id}`}, + "database_id": acctest.Representation{RepType: acctest.Required, Create: `${var.macs_adb_id}`}, + "database_resource_type": acctest.Representation{RepType: acctest.Required, Create: `autonomousdatabase`}, + "deployment_type": acctest.Representation{RepType: acctest.Required, Create: `EXACC`}, + "status": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`}, + "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"}}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangesOpsiMacsCloudAdbInsightRepresentation}, + } + + OpsiMacsCloudAdbInsightCredentialDetailsRepresentation = map[string]interface{}{ + "credential_type": acctest.Representation{RepType: acctest.Required, Create: `CREDENTIALS_BY_NAMED_CREDS`}, + "named_credential_id": acctest.Representation{RepType: acctest.Required, Create: `${var.named_credential_id}`}, + } + + OpsiMacsCloudAdbInsightConnectionDetailsRepresentation = map[string]interface{}{ + "host_name": acctest.Representation{RepType: acctest.Required, Create: `${var.adb_host}`}, + "port": acctest.Representation{RepType: acctest.Required, Create: `${var.adb_port}`}, + "protocol": acctest.Representation{RepType: acctest.Required, Create: `TCP`}, + "service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.service_name}`}, + } + + OpsiMacsCloudAdbInsightCredentialDetailsForUpdateRepresentation = map[string]interface{}{ + "credential_type": acctest.Representation{RepType: acctest.Required, Create: `CREDENTIALS_BY_NAMED_CREDS`}, + "named_credential_id": acctest.Representation{RepType: acctest.Required, Create: `${var.named_credential_id_for_update}`}, + } + + ignoreChangesOpsiMacsCloudAdbInsightRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}}, + } + + OpsiMacsCloudAdbInsightResourceDependencies = DefinedTagsDependencies +) + +// issue-routing-tag: opsi/controlPlane +func TestOpsiMacsCloudAdbInsightResource_basic(t *testing.T) { + httpreplay.SetScenario("TestOpsiMacsCloudAdbInsightResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + managementAgentId := utils.GetEnvSettingWithBlankDefault("management_agent_id") + managementAgentIdVariableStr := fmt.Sprintf("variable \"management_agent_id\" { default = \"%s\" }\n", managementAgentId) + + macsAdbId := utils.GetEnvSettingWithBlankDefault("macs_adb_id") + macsAdbIdVariableStr := fmt.Sprintf("variable \"macs_adb_id\" { default = \"%s\" }\n", macsAdbId) + + serviceName := utils.GetEnvSettingWithBlankDefault("service_name") + serviceNameVariableStr := fmt.Sprintf("variable \"service_name\" { default = \"%s\" }\n", serviceName) + + namedCredentialId := utils.GetEnvSettingWithBlankDefault("named_credential_id") + namedCredentialIdVariableStr := fmt.Sprintf("variable \"named_credential_id\" { default = \"%s\" }\n", namedCredentialId) + + namedCredentialIdU := utils.GetEnvSettingWithDefault("named_credential_id_for_update", namedCredentialId) + namedCredentialIdUVariableStr := fmt.Sprintf("variable \"named_credential_id_for_update\" { default = \"%s\" }\n", namedCredentialIdU) + + adbHostName := utils.GetEnvSettingWithBlankDefault("adb_host") + adbHostNameVariableStr := fmt.Sprintf("variable \"adb_host\" { default = \"%s\" }\n", adbHostName) + + adbPort := utils.GetEnvSettingWithBlankDefault("adb_port") + adbPortVariableStr := fmt.Sprintf("variable \"adb_port\" { default = \"%s\" }\n", adbPort) + + envVarsString := compartmentIdVariableStr + macsAdbIdVariableStr + managementAgentIdVariableStr + serviceNameVariableStr + + namedCredentialIdVariableStr + adbPortVariableStr + adbHostNameVariableStr + + resourceName := "oci_opsi_database_insight.test_database_insight" + datasourceName := "data.oci_opsi_database_insights.test_database_insights" + singularDatasourceName := "data.oci_opsi_database_insight.test_database_insight" + + 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+envVarsString+OpsiMacsCloudAdbInsightResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Optional, acctest.Create, OpsiMacsCloudAdbInsightRepresentation), "opsi", "databaseInsight", t) + + acctest.ResourceTest(t, testAccCheckOpsiMacsCloudAdbInsightDestroy, []resource.TestStep{ + // verify create with optional managementAgentId + { + Config: config + envVarsString + OpsiMacsCloudAdbInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Optional, acctest.Create, OpsiMacsCloudAdbInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "connection_credential_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "connection_credential_details.0.credential_type", "CREDENTIALS_BY_NAMED_CREDS"), + resource.TestCheckResourceAttrSet(resourceName, "connection_credential_details.0.named_credential_id"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.host_name"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.port"), + resource.TestCheckResourceAttr(resourceName, "connection_details.0.protocol", "TCP"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.service_name"), + resource.TestCheckResourceAttrSet(resourceName, "database_id"), + resource.TestCheckResourceAttrSet(resourceName, "database_name"), + resource.TestCheckResourceAttr(resourceName, "database_resource_type", "autonomousdatabase"), + resource.TestCheckResourceAttr(resourceName, "deployment_type", "EXACC"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "MACS_MANAGED_AUTONOMOUS_DATABASE"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "management_agent_id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + 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 named_credential_id (the namedCredentialId will be switched back in the next step) + { + Config: config + compartmentIdVariableStr + macsAdbIdVariableStr + managementAgentIdVariableStr + serviceNameVariableStr + + namedCredentialIdUVariableStr + adbPortVariableStr + adbHostNameVariableStr + OpsiMacsCloudAdbInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(OpsiMacsCloudAdbInsightRepresentation, map[string]interface{}{ + "connection_credential_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiMacsCloudAdbInsightCredentialDetailsForUpdateRepresentation}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "connection_credential_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "connection_credential_details.0.credential_type", "CREDENTIALS_BY_NAMED_CREDS"), + resource.TestCheckResourceAttr(resourceName, "connection_credential_details.0.named_credential_id", namedCredentialIdU), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.host_name"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.port"), + resource.TestCheckResourceAttr(resourceName, "connection_details.0.protocol", "TCP"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.service_name"), + resource.TestCheckResourceAttrSet(resourceName, "database_id"), + resource.TestCheckResourceAttrSet(resourceName, "database_name"), + resource.TestCheckResourceAttr(resourceName, "database_resource_type", "autonomousdatabase"), + resource.TestCheckResourceAttr(resourceName, "deployment_type", "EXACC"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "MACS_MANAGED_AUTONOMOUS_DATABASE"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "management_agent_id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + 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 + envVarsString + OpsiMacsCloudAdbInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Optional, acctest.Update, OpsiMacsCloudAdbInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "connection_credential_details.#", "1"), + resource.TestCheckResourceAttr(resourceName, "connection_credential_details.0.credential_type", "CREDENTIALS_BY_NAMED_CREDS"), + resource.TestCheckResourceAttrSet(resourceName, "connection_credential_details.0.named_credential_id"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.host_name"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.port"), + resource.TestCheckResourceAttr(resourceName, "connection_details.0.protocol", "TCP"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.service_name"), + resource.TestCheckResourceAttrSet(resourceName, "database_id"), + resource.TestCheckResourceAttrSet(resourceName, "database_name"), + resource.TestCheckResourceAttr(resourceName, "database_resource_type", "autonomousdatabase"), + resource.TestCheckResourceAttr(resourceName, "deployment_type", "EXACC"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "MACS_MANAGED_AUTONOMOUS_DATABASE"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "management_agent_id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + resource.TestCheckResourceAttr(resourceName, "status", "DISABLED"), + 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_opsi_database_insights", "test_database_insights", acctest.Optional, acctest.Update, OpsiMacsCloudAdbInsightDataSourceRepresentation) + + envVarsString + OpsiMacsCloudAdbInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Optional, acctest.Update, OpsiMacsCloudAdbInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"), + resource.TestCheckResourceAttr(datasourceName, "database_type.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "fields.#", "6"), + resource.TestCheckResourceAttr(datasourceName, "state.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "status.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "database_insights_collection.#", "1"), + //resource.TestCheckResourceAttr(datasourceName, "database_insights_collection.0.items.#", "1"), + ), + }, + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Required, acctest.Create, OpsiMacsCloudAdbInsightSingularDataSourceRepresentation) + + envVarsString + OpsiMacsCloudAdbInsightResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "connection_credential_details.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "connection_credential_details.0.credential_type", "CREDENTIALS_BY_NAMED_CREDS"), + resource.TestCheckResourceAttrSet(resourceName, "connection_credential_details.0.named_credential_id"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.host_name"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.port"), + resource.TestCheckResourceAttr(resourceName, "connection_details.0.protocol", "TCP"), + resource.TestCheckResourceAttrSet(resourceName, "connection_details.0.service_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "database_display_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "database_name"), + resource.TestCheckResourceAttr(singularDatasourceName, "database_resource_type", "autonomousdatabase"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "database_type"), + resource.TestCheckResourceAttr(singularDatasourceName, "entity_source", "MACS_MANAGED_AUTONOMOUS_DATABASE"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "status"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // remove singular datasource from previous step so that it doesn't conflict with import tests + { + Config: config + envVarsString + OpsiMacsCloudAdbInsightResourceConfig, + }, + // verify enable + { + Config: config + envVarsString + //OpsiMacsCloudAdbInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_database_insight", "test_database_insight", acctest.Optional, acctest.Update, + acctest.RepresentationCopyWithNewProperties(OpsiMacsCloudAdbInsightRepresentation, map[string]interface{}{ + "status": acctest.Representation{RepType: acctest.Required, Update: `ENABLED`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), + + 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 resource import + { + Config: config + OpsiMacsCloudAdbInsightRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "deployment_type", + "is_advanced_features_enable", + }, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckOpsiMacsCloudAdbInsightDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).OperationsInsightsClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_opsi_database_insight" { + noResourceFound = false + request := oci_opsi.GetDatabaseInsightRequest{} + + tmp := rs.Primary.ID + request.DatabaseInsightId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + + response, err := client.GetDatabaseInsight(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_opsi.LifecycleStateDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.GetLifecycleState())]; !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.GetLifecycleState()) + } + //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("OpsiMacsCloudAdbInsight") { + resource.AddTestSweepers("OpsiMacsCloudAdbInsight", &resource.Sweeper{ + Name: "OpsiMacsCloudAdbInsight", + Dependencies: acctest.DependencyGraph["databaseInsight"], + F: sweepOpsiMacsCloudAdbInsightResource, + }) + } +} + +func sweepOpsiMacsCloudAdbInsightResource(compartment string) error { + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + databaseInsightIds, err := getOpsiMacsCloudAdbInsightIds(compartment) + if err != nil { + return err + } + for _, databaseInsightId := range databaseInsightIds { + if ok := acctest.SweeperDefaultResourceId[databaseInsightId]; !ok { + deleteDatabaseInsightRequest := oci_opsi.DeleteDatabaseInsightRequest{} + + deleteDatabaseInsightRequest.DatabaseInsightId = &databaseInsightId + + deleteDatabaseInsightRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + _, error := operationsInsightsClient.DeleteDatabaseInsight(context.Background(), deleteDatabaseInsightRequest) + if error != nil { + fmt.Printf("Error deleting DatabaseInsight %s %s, It is possible that the resource is already deleted. Please verify manually \n", databaseInsightId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &databaseInsightId, OpsiMacsCloudAdbInsightSweepWaitCondition, time.Duration(3*time.Minute), + OpsiMacsCloudAdbInsightSweepResponseFetchOperation, "opsi", true) + } + } + return nil +} + +func getOpsiMacsCloudAdbInsightIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "DatabaseInsightId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + + listDatabaseInsightsRequest := oci_opsi.ListDatabaseInsightsRequest{} + listDatabaseInsightsRequest.CompartmentId = &compartmentId + listDatabaseInsightsRequest.LifecycleState = []oci_opsi.LifecycleStateEnum{oci_opsi.LifecycleStateActive} + listDatabaseInsightsResponse, err := operationsInsightsClient.ListDatabaseInsights(context.Background(), listDatabaseInsightsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting DatabaseInsight list for compartment id : %s , %s \n", compartmentId, err) + } + for _, databaseInsight := range listDatabaseInsightsResponse.Items { + id := *databaseInsight.GetId() + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "DatabaseInsightId", id) + } + return resourceIds, nil +} + +func OpsiMacsCloudAdbInsightSweepWaitCondition(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 databaseInsightResponse, ok := response.Response.(oci_opsi.GetDatabaseInsightResponse); ok { + return databaseInsightResponse.GetLifecycleState() != oci_opsi.LifecycleStateDeleted + } + return false +} + +func OpsiMacsCloudAdbInsightSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.OperationsInsightsClient().GetDatabaseInsight(context.Background(), oci_opsi.GetDatabaseInsightRequest{ + DatabaseInsightId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/opsi_pecomanaged_adb_exadata_insight_test.go b/internal/integrationtest/opsi_pecomanaged_adb_exadata_insight_test.go new file mode 100644 index 00000000000..556f45bf078 --- /dev/null +++ b/internal/integrationtest/opsi_pecomanaged_adb_exadata_insight_test.go @@ -0,0 +1,451 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "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/schema" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_opsi "github.com/oracle/oci-go-sdk/v65/opsi" + + "github.com/oracle/terraform-provider-oci/httpreplay" +) + +var ( + peComanagedAdbExadataInsightRequiredOnlyResource = peComanagedAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Required, acctest.Create, peComanagedAdbExadataInsightRepresentation) + + peComanagedAdbExadataInsightResourceConfig = peComanagedAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, peComanagedAdbExadataInsightRepresentation) + + peComanagedAdbExadataInsightSingularDataSourceRepresentation = map[string]interface{}{ + "exadata_insight_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_opsi_exadata_insight.test_exadata_insight.id}`}, + } + + peComanagedAdbExadataInsightDataSourceRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "exadata_type": acctest.Representation{RepType: acctest.Optional, Create: []string{`EXACS`}}, + "id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_opsi_exadata_insight.test_exadata_insight.id}`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: []string{`ACTIVE`}}, + "status": acctest.Representation{RepType: acctest.Optional, Create: []string{`ENABLED`}, Update: []string{`DISABLED`}}, + "filter": acctest.RepresentationGroup{RepType: acctest.Required, Group: peComanagedAdbExadataInsightDataSourceFilterRepresentation}} + + peComanagedAdbExadataInsightDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_opsi_exadata_insight.test_exadata_insight.id}`}}, + } + + peComanagedAdbExadataInsightRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "exadata_infra_id": acctest.Representation{RepType: acctest.Required, Create: `${var.exadata_infra_id}`}, + "entity_source": acctest.Representation{RepType: acctest.Required, Create: `PE_COMANAGED_EXADATA`}, + "status": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`}, + "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"}}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangespeComanagedAdbExadataInsightRepresentation}, + "member_vm_cluster_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: peComanagedAdbExadataInsightMemberVmClusterDetailsRepresentation}, + } + + peComanagedAdbExadataInsightMemberVmClusterDetailsRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "vm_cluster_type": acctest.Representation{RepType: acctest.Optional, Create: `autonomousVmCluster`}, + "member_autonomous_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: peComanagedAdbExadataInsightMemberVmClusterDetailsMemberDatabaseDetailsRepresentation}, + "opsi_private_endpoint_id": acctest.Representation{RepType: acctest.Required, Create: `${var.opsi_private_endpoint_id}`}, + "vmcluster_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.vmcluster_id}`}, + } + + peComanagedAdbExadataInsightMemberVmClusterDetailsMemberDatabaseDetailsRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.adb_compartment_id}`}, + "credential_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: peComanagedAdbExadataInsightCredentialDetailsRepresentation}, + "connection_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: peComanagedAdbExadataInsightConnectionDetailsRepresentation}, + "database_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.adb_id}`}, + "database_resource_type": acctest.Representation{RepType: acctest.Optional, Create: `autonomousdatabase`}, + "entity_source": acctest.Representation{RepType: acctest.Optional, Create: `AUTONOMOUS_DATABASE`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"freeformTags": "freeformTags"}}, + "opsi_private_endpoint_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.opsi_private_endpoint_id}`}, + "is_advanced_features_enabled": acctest.Representation{RepType: acctest.Required, Create: `true`}, + } + + peComanagedAdbExadataInsightCredentialDetailsRepresentation = map[string]interface{}{ + "credential_type": acctest.Representation{RepType: acctest.Required, Create: `CREDENTIALS_BY_VAULT`}, + "password_secret_id": acctest.Representation{RepType: acctest.Required, Create: `${var.password_secret_id}`}, + "role": acctest.Representation{RepType: acctest.Optional, Create: `NORMAL`}, + "user_name": acctest.Representation{RepType: acctest.Required, Create: `${var.user_name}`}, + } + + peComanagedAdbExadataInsightConnectionDetailsRepresentation = map[string]interface{}{ + "host_name": acctest.Representation{RepType: acctest.Required, Create: `${var.adb_host}`}, + "port": acctest.Representation{RepType: acctest.Required, Create: `${var.adb_port}`}, + "protocol": acctest.Representation{RepType: acctest.Required, Create: `TCPS`}, + "service_name": acctest.Representation{RepType: acctest.Required, Create: `${var.service_name}`}, + } + + ignoreChangespeComanagedAdbExadataInsightRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}}, + } + + peComanagedAdbExadataInsightResourceDependencies = DefinedTagsDependencies +) + +// issue-routing-tag: opsi/controlPlane +func TestPeComanagedAdbExadataInsightResource_basic(t *testing.T) { + httpreplay.SetScenario("TestPeComanagedAdbExadataInsightResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + exacsAvailable := utils.GetEnvSettingWithBlankDefault("opsi_exacs_available") + if exacsAvailable == "" { + // Suggested by Rakshith Siddanahalli for our case of required but scarce ExaCS systems + t.Skip("Skipping tests which require ExaCS") + } + + 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) + + adbCompartmentId := utils.GetEnvSettingWithBlankDefault("adb_compartment_ocid") + adbCompartmentIdVariableStr := fmt.Sprintf("variable \"adb_compartment_id\" { default = \"%s\" }\n", adbCompartmentId) + + opsiPrivateEndpointId := utils.GetEnvSettingWithBlankDefault("opsi_private_endpoint_id") + opsiPrivateEndpointIdVariableStr := fmt.Sprintf("variable \"opsi_private_endpoint_id\" { default = \"%s\" }\n", opsiPrivateEndpointId) + + exadataInfraId := utils.GetEnvSettingWithBlankDefault("exadata_infra_id") + exadataInfraIdVariableStr := fmt.Sprintf("variable \"exadata_infra_id\" { default = \"%s\" }\n", exadataInfraId) + + vmClusterId := utils.GetEnvSettingWithBlankDefault("vmcluster_id") + vmClusterIdVariableStr := fmt.Sprintf("variable \"vmcluster_id\" { default = \"%s\" }\n", vmClusterId) + + secretId := utils.GetEnvSettingWithBlankDefault("password_secret_id") + secretIdVariableStr := fmt.Sprintf("variable \"password_secret_id\" { default = \"%s\" }\n", secretId) + + userName := utils.GetEnvSettingWithBlankDefault("user_name") + userNameVariableStr := fmt.Sprintf("variable \"user_name\" { default = \"%s\" }\n", userName) + + adbId := utils.GetEnvSettingWithBlankDefault("adb_id") + adbIdVariableStr := fmt.Sprintf("variable \"adb_id\" { default = \"%s\" }\n", adbId) + + adbHostName := utils.GetEnvSettingWithBlankDefault("adb_host") + adbHostNameVariableStr := fmt.Sprintf("variable \"adb_host\" { default = \"%s\" }\n", adbHostName) + + adbPort := utils.GetEnvSettingWithBlankDefault("adb_port") + adbPortVariableStr := fmt.Sprintf("variable \"adb_port\" { default = \"%s\" }\n", adbPort) + + serviceName := utils.GetEnvSettingWithBlankDefault("service_name") + serviceNameVariableStr := fmt.Sprintf("variable \"service_name\" { default = \"%s\" }\n", serviceName) + + envVarsString := compartmentIdVariableStr + compartmentIdUVariableStr + adbCompartmentIdVariableStr + opsiPrivateEndpointIdVariableStr + exadataInfraIdVariableStr + vmClusterIdVariableStr + + secretIdVariableStr + userNameVariableStr + adbIdVariableStr + serviceNameVariableStr + adbHostNameVariableStr + adbPortVariableStr + + resourceName := "oci_opsi_exadata_insight.test_exadata_insight" + datasourceName := "data.oci_opsi_exadata_insights.test_exadata_insights" + singularDatasourceName := "data.oci_opsi_exadata_insight.test_exadata_insight" + + 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+envVarsString+ //peComanagedAdbExadataInsightResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Create, peComanagedAdbExadataInsightRepresentation), "opsi", "exadataInsight", t) + + acctest.ResourceTest(t, testAccCheckpeComanagedAdbExadataInsightDestroy, []resource.TestStep{ + // verify Create with optionals - Step 0 + { + Config: config + envVarsString + peComanagedAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Create, peComanagedAdbExadataInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "PE_COMANAGED_EXADATA"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + 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) - Step 1 + { + Config: config + envVarsString + peComanagedAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(peComanagedAdbExadataInsightRepresentation, 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, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "PE_COMANAGED_EXADATA"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "status"), + 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("Step 1: resource recreated when it was supposed to be updated") + } + return err + }, + ), + }, + // verify updates to updatable parameters - Step 2 (Update causes status to go to disabled) + { + Config: config + envVarsString + peComanagedAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, peComanagedAdbExadataInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "entity_source", "PE_COMANAGED_EXADATA"), + resource.TestCheckResourceAttr(resourceName, "status", "DISABLED"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(resourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttrSet(resourceName, "state"), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceName, "id") + if resId != resId2 { + return fmt.Errorf("Step 2: resource recreated when it was supposed to be updated") + } + return err + }, + ), + }, + //verify enable - Step 3 + { + Config: config + envVarsString + //peComanagedAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, + acctest.RepresentationCopyWithNewProperties(peComanagedAdbExadataInsightRepresentation, map[string]interface{}{ + "status": acctest.Representation{RepType: acctest.Required, Update: `ENABLED`}, + })), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), + + func(s *terraform.State) (err error) { + resId2, err = acctest.FromInstanceState(s, resourceName, "id") + if resId != resId2 { + return fmt.Errorf("Step 3: resource recreated when it was supposed to be updated") + } + return err + }, + ), + }, + // verify datasource - Step 4 + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_opsi_exadata_insights", "test_exadata_insights", acctest.Optional, acctest.Update, peComanagedOpsiExadataInsightDataSourceRepresentation) + + envVarsString + peComanagedAdbExadataInsightResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Optional, acctest.Update, peComanagedAdbExadataInsightRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"), + resource.TestCheckResourceAttr(datasourceName, "exadata_type.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "state.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "status.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "filter.#", "1"), + ), + }, + //verify singular datasource - Step 5 + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_opsi_exadata_insight", "test_exadata_insight", acctest.Required, acctest.Create, peComanagedOpsiExadataInsightSingularDataSourceRepresentation) + + envVarsString + peComanagedAdbExadataInsightResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_insight_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "exadata_infra_id", exadataInfraId), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "entity_source", "PE_COMANAGED_EXADATA"), + resource.TestCheckResourceAttr(singularDatasourceName, "status", "DISABLED"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_display_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_type"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_shape"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_infra_resource_type"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "exadata_rack_type"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + // verify resource import - Step 6 + { + Config: config + peComanagedAdbExadataInsightRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "member_vm_cluster_details", + }, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckpeComanagedAdbExadataInsightDestroy(s *terraform.State) error { + noResourceFound := true + client := acctest.TestAccProvider.Meta().(*tf_client.OracleClients).OperationsInsightsClient() + for _, rs := range s.RootModule().Resources { + if rs.Type == "oci_opsi_exadata_insight" { + noResourceFound = false + request := oci_opsi.GetExadataInsightRequest{} + + tmp := rs.Primary.ID + request.ExadataInsightId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + + response, err := client.GetExadataInsight(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_opsi.ExadataInsightLifecycleStateDeleted): true, + } + if _, ok := deletedLifecycleStates[string(response.GetLifecycleState())]; !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.GetLifecycleState()) + } + //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("peComanagedAdbExadataInsight") { + resource.AddTestSweepers("peComanagedAdbExadataInsight", &resource.Sweeper{ + Name: "peComanagedAdbExadataInsight", + Dependencies: acctest.DependencyGraph["exadataInsight"], + F: sweeppeComanagedAdbExadataInsightResource, + }) + } +} + +func sweeppeComanagedAdbExadataInsightResource(compartment string) error { + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + exadataInsightIds, err := getpeComanagedAdbExadataInsightIds(compartment) + if err != nil { + return err + } + for _, exadataInsightId := range exadataInsightIds { + if ok := acctest.SweeperDefaultResourceId[exadataInsightId]; !ok { + deleteExadataInsightRequest := oci_opsi.DeleteExadataInsightRequest{} + + deleteExadataInsightRequest.ExadataInsightId = &exadataInsightId + + deleteExadataInsightRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + _, error := operationsInsightsClient.DeleteExadataInsight(context.Background(), deleteExadataInsightRequest) + if error != nil { + fmt.Printf("Error deleting ExadataInsight %s %s, It is possible that the resource is already deleted. Please verify manually \n", exadataInsightId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &exadataInsightId, peComanagedAdbExadataInsightSweepWaitCondition, time.Duration(3*time.Minute), + peComanagedAdbExadataInsightSweepResponseFetchOperation, "opsi", true) + } + } + return nil +} + +func getpeComanagedAdbExadataInsightIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "ExadataInsightId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + + listExadataInsightsRequest := oci_opsi.ListExadataInsightsRequest{} + listExadataInsightsRequest.CompartmentId = &compartmentId + listExadataInsightsRequest.LifecycleState = []oci_opsi.LifecycleStateEnum{oci_opsi.LifecycleStateActive} + listExadataInsightsResponse, err := operationsInsightsClient.ListExadataInsights(context.Background(), listExadataInsightsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting ExadataInsight list for compartment id : %s , %s \n", compartmentId, err) + } + for _, exadataInsight := range listExadataInsightsResponse.Items { + id := *exadataInsight.GetId() + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ExadataInsightId", id) + } + return resourceIds, nil +} + +func peComanagedAdbExadataInsightSweepWaitCondition(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 exadataInsightResponse, ok := response.Response.(oci_opsi.GetExadataInsightResponse); ok { + return exadataInsightResponse.GetLifecycleState() != oci_opsi.ExadataInsightLifecycleStateDeleted + } + return false +} + +func peComanagedAdbExadataInsightSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.OperationsInsightsClient().GetExadataInsight(context.Background(), oci_opsi.GetExadataInsightRequest{ + ExadataInsightId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/integrationtest/provider_test.go b/internal/integrationtest/provider_test.go new file mode 100644 index 00000000000..9e4b60b2f7e --- /dev/null +++ b/internal/integrationtest/provider_test.go @@ -0,0 +1,23 @@ +package integrationtest + +import ( + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/oracle/terraform-provider-oci/internal/acctest" + "github.com/oracle/terraform-provider-oci/internal/globalvar" + "github.com/stretchr/testify/assert" +) + +func TestProviderServiceEndpointOverridePrecedenceOverDomainOverrideWhenBothSet(t *testing.T) { + domainOverride := "orac.cloud80.com" + clientHostOverrides := "oci_identity.IdentityClient=identity.us-mars-1.dont.change.domain.com" + expectedHost := strings.Split(clientHostOverrides, "=")[1] + + t.Setenv(globalvar.DomainNameOverrideEnv, domainOverride) + t.Setenv(globalvar.ClientHostOverridesEnv, clientHostOverrides) + + client := acctest.GetTestClients(&schema.ResourceData{}).IdentityClient() + assert.Equal(t, expectedHost, client.Host) +} diff --git a/internal/integrationtest/psql_configuration_test.go b/internal/integrationtest/psql_configuration_test.go index ccad3d05a1d..ed93264cf92 100644 --- a/internal/integrationtest/psql_configuration_test.go +++ b/internal/integrationtest/psql_configuration_test.go @@ -193,6 +193,7 @@ func TestPsqlConfigurationResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_psql_configuration", "test_configuration", acctest.Optional, acctest.Create, PsqlConfigurationRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "compatible_shapes.#", "1"), resource.TestCheckResourceAttr(resourceName, "configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "db_configuration_overrides.#", "1"), resource.TestCheckResourceAttr(resourceName, "db_configuration_overrides.0.items.#", "1"), @@ -232,6 +233,7 @@ func TestPsqlConfigurationResource_basic(t *testing.T) { })), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), + resource.TestCheckResourceAttr(resourceName, "compatible_shapes.#", "1"), resource.TestCheckResourceAttr(resourceName, "configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "db_configuration_overrides.#", "1"), resource.TestCheckResourceAttr(resourceName, "db_configuration_overrides.0.items.#", "1"), @@ -266,6 +268,7 @@ func TestPsqlConfigurationResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_psql_configuration", "test_configuration", acctest.Optional, acctest.Update, PsqlConfigurationRepresentation), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "compatible_shapes.#", "1"), resource.TestCheckResourceAttr(resourceName, "configuration_details.#", "1"), resource.TestCheckResourceAttr(resourceName, "db_configuration_overrides.#", "1"), resource.TestCheckResourceAttr(resourceName, "db_configuration_overrides.0.items.#", "1"), @@ -362,6 +365,7 @@ func TestPsqlConfigurationResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "configuration_id"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "compatible_shapes.#", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "config_type"), resource.TestCheckResourceAttr(singularDatasourceName, "configuration_details.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "db_version", "14"), @@ -491,6 +495,8 @@ func getPsqlConfigurationIds(compartment string) ([]string, error) { id := *configuration.Id resourceIds = append(resourceIds, id) acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "ConfigurationId", id) + acctest.SweeperDefaultResourceId[*configuration.DefaultConfigId] = true + } return resourceIds, nil } diff --git a/internal/integrationtest/psql_default_configuration_test.go b/internal/integrationtest/psql_default_configuration_test.go index 4bef4354035..876889b8d6b 100644 --- a/internal/integrationtest/psql_default_configuration_test.go +++ b/internal/integrationtest/psql_default_configuration_test.go @@ -118,6 +118,7 @@ func TestPsqlDefaultConfigurationResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttrSet(singularDatasourceName, "default_configuration_id"), + resource.TestCheckResourceAttr(singularDatasourceName, "compatible_shapes.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "configuration_details.#", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "db_version"), resource.TestCheckResourceAttrSet(singularDatasourceName, "description"), diff --git a/internal/integrationtest/vault_secret_test.go b/internal/integrationtest/vault_secret_test.go index 8ff39972bdf..70e1c674bff 100644 --- a/internal/integrationtest/vault_secret_test.go +++ b/internal/integrationtest/vault_secret_test.go @@ -6,7 +6,6 @@ package integrationtest import ( "fmt" "testing" - "time" "github.com/oracle/terraform-provider-oci/internal/acctest" "github.com/oracle/terraform-provider-oci/internal/utils" @@ -50,11 +49,16 @@ var ( "enable_auto_generation": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, "metadata": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"metadata": "metadata"}, Update: map[string]string{"metadata2": "metadata2"}}, + "replication_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: VaultSecretReplicationConfigRepresentation}, "rotation_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: VaultSecretRotationConfigRepresentation}, "secret_content": acctest.RepresentationGroup{RepType: acctest.Required, Group: VaultSecretSecretContentRepresentation}, "secret_generation_context": acctest.RepresentationGroup{RepType: acctest.Optional, Group: VaultSecretSecretGenerationContextRepresentation}, "secret_rules": acctest.RepresentationGroup{RepType: acctest.Optional, Group: VaultSecretSecretRulesRepresentation}, } + VaultSecretReplicationConfigRepresentation = map[string]interface{}{ + "replication_targets": acctest.RepresentationGroup{RepType: acctest.Required, Group: VaultSecretReplicationConfigReplicationTargetsRepresentation}, + "is_write_forward_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, + } VaultSecretRotationConfigRepresentation = map[string]interface{}{ "target_system_details": acctest.RepresentationGroup{RepType: acctest.Required, Group: VaultSecretRotationConfigTargetSystemDetailsRepresentation}, "is_scheduled_rotation_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `false`}, @@ -76,7 +80,12 @@ var ( "is_enforced_on_deleted_secret_versions": acctest.Representation{RepType: acctest.Optional, Create: `false`, Update: `true`}, "is_secret_content_retrieval_blocked_on_expiry": acctest.Representation{RepType: acctest.Optional, Create: `false`}, "secret_version_expiry_interval": acctest.Representation{RepType: acctest.Optional, Create: `P3D`}, - "time_of_absolute_expiry": acctest.Representation{RepType: acctest.Optional, Create: deletionTime.Format(time.RFC3339)}, + "time_of_absolute_expiry": acctest.Representation{RepType: acctest.Optional, Create: ``}, + } + VaultSecretReplicationConfigReplicationTargetsRepresentation = map[string]interface{}{ + "target_key_id": acctest.Representation{RepType: acctest.Required, Create: `${var.key_id}`}, + "target_region": acctest.Representation{RepType: acctest.Required, Create: `us-phoenix-1`, Update: `us-sanjose-1`}, + "target_vault_id": acctest.Representation{RepType: acctest.Required, Create: `${var.vault_id}`}, } VaultSecretRotationConfigTargetSystemDetailsRepresentation = map[string]interface{}{ "target_system_type": acctest.Representation{RepType: acctest.Required, Create: `ADB`, Update: `ADB`}, @@ -159,6 +168,12 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "key_id"), resource.TestCheckResourceAttr(resourceName, "metadata.%", "1"), + resource.TestCheckResourceAttr(resourceName, "replication_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.is_write_forward_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.replication_targets.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "replication_config.0.replication_targets.0.target_key_id"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.replication_targets.0.target_region", "us-phoenix-1"), + resource.TestCheckResourceAttrSet(resourceName, "replication_config.0.replication_targets.0.target_vault_id"), resource.TestCheckResourceAttr(resourceName, "rotation_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "rotation_config.0.is_scheduled_rotation_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "rotation_config.0.rotation_interval", "P30D"), @@ -180,7 +195,7 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "secret_rules.0.is_secret_content_retrieval_blocked_on_expiry", "false"), resource.TestCheckResourceAttr(resourceName, "secret_rules.0.rule_type", "SECRET_EXPIRY_RULE"), resource.TestCheckResourceAttr(resourceName, "secret_rules.0.secret_version_expiry_interval", "P3D"), - resource.TestCheckResourceAttr(resourceName, "secret_rules.0.time_of_absolute_expiry", deletionTime.Format(time.RFC3339)), + resource.TestCheckResourceAttr(resourceName, "secret_rules.0.time_of_absolute_expiry", ``), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), resource.TestCheckResourceAttrSet(resourceName, "vault_id"), @@ -213,6 +228,12 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "key_id"), resource.TestCheckResourceAttr(resourceName, "metadata.%", "1"), + resource.TestCheckResourceAttr(resourceName, "replication_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.is_write_forward_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.replication_targets.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "replication_config.0.replication_targets.0.target_key_id"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.replication_targets.0.target_region", "us-phoenix-1"), + resource.TestCheckResourceAttrSet(resourceName, "replication_config.0.replication_targets.0.target_vault_id"), resource.TestCheckResourceAttr(resourceName, "rotation_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "rotation_config.0.is_scheduled_rotation_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "rotation_config.0.rotation_interval", "P30D"), @@ -234,7 +255,7 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "secret_rules.0.is_secret_content_retrieval_blocked_on_expiry", "false"), resource.TestCheckResourceAttr(resourceName, "secret_rules.0.rule_type", "SECRET_EXPIRY_RULE"), resource.TestCheckResourceAttr(resourceName, "secret_rules.0.secret_version_expiry_interval", "P3D"), - resource.TestCheckResourceAttr(resourceName, "secret_rules.0.time_of_absolute_expiry", deletionTime.Format(time.RFC3339)), + resource.TestCheckResourceAttr(resourceName, "secret_rules.0.time_of_absolute_expiry", ``), resource.TestCheckResourceAttrSet(resourceName, "state"), resource.TestCheckResourceAttrSet(resourceName, "time_created"), resource.TestCheckResourceAttrSet(resourceName, "vault_id"), @@ -267,6 +288,12 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "key_id"), resource.TestCheckResourceAttr(resourceName, "metadata.%", "1"), + resource.TestCheckResourceAttr(resourceName, "replication_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.is_write_forward_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.replication_targets.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "replication_config.0.replication_targets.0.target_key_id"), + resource.TestCheckResourceAttr(resourceName, "replication_config.0.replication_targets.0.target_region", "us-sanjose-1"), + resource.TestCheckResourceAttrSet(resourceName, "replication_config.0.replication_targets.0.target_vault_id"), resource.TestCheckResourceAttr(resourceName, "rotation_config.#", "1"), resource.TestCheckResourceAttr(resourceName, "rotation_config.0.is_scheduled_rotation_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "rotation_config.0.rotation_interval", "P90D"), @@ -319,7 +346,16 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "secrets.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.id"), resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.is_auto_generation_enabled"), + resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.is_replica"), resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.key_id"), + //resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.last_rotation_time"), + //resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.next_rotation_time"), + resource.TestCheckResourceAttr(datasourceName, "secrets.0.replication_config.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "secrets.0.replication_config.0.is_write_forward_enabled", "true"), + resource.TestCheckResourceAttr(datasourceName, "secrets.0.replication_config.0.replication_targets.#", "1"), + resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.replication_config.0.replication_targets.0.target_key_id"), + resource.TestCheckResourceAttr(datasourceName, "secrets.0.replication_config.0.replication_targets.0.target_region", "us-sanjose-1"), + resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.replication_config.0.replication_targets.0.target_vault_id"), resource.TestCheckResourceAttr(datasourceName, "secrets.0.rotation_config.#", "1"), resource.TestCheckResourceAttr(datasourceName, "secrets.0.rotation_config.0.is_scheduled_rotation_enabled", "false"), resource.TestCheckResourceAttr(datasourceName, "secrets.0.rotation_config.0.rotation_interval", "P90D"), @@ -331,6 +367,7 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "secrets.0.secret_generation_context.0.generation_template", "DBAAS_DEFAULT_PASSWORD"), resource.TestCheckResourceAttr(datasourceName, "secrets.0.secret_generation_context.0.generation_type", "PASSPHRASE"), resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.secret_name"), + resource.TestCheckResourceAttr(datasourceName, "secrets.0.source_region_information.#", "0"), resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.state"), resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.time_created"), resource.TestCheckResourceAttrSet(datasourceName, "secrets.0.vault_id"), @@ -356,7 +393,14 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "is_auto_generation_enabled"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "is_replica"), + //resource.TestCheckResourceAttrSet(singularDatasourceName, "last_rotation_time"), resource.TestCheckResourceAttr(singularDatasourceName, "metadata.%", "1"), + //resource.TestCheckResourceAttrSet(singularDatasourceName, "next_rotation_time"), + resource.TestCheckResourceAttr(singularDatasourceName, "replication_config.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "replication_config.0.is_write_forward_enabled", "true"), + resource.TestCheckResourceAttr(singularDatasourceName, "replication_config.0.replication_targets.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "replication_config.0.replication_targets.0.target_region", "us-sanjose-1"), resource.TestCheckResourceAttr(singularDatasourceName, "rotation_config.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "rotation_config.0.is_scheduled_rotation_enabled", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "rotation_config.0.rotation_interval", "P90D"), @@ -370,7 +414,9 @@ func TestVaultSecretResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "secret_rules.0.is_enforced_on_deleted_secret_versions", "true"), resource.TestCheckResourceAttr(singularDatasourceName, "secret_rules.0.is_secret_content_retrieval_blocked_on_expiry", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "secret_rules.0.rule_type", "SECRET_REUSE_RULE"), - resource.TestCheckResourceAttr(singularDatasourceName, "secret_rules.0.secret_version_expiry_interval", ""), + //resource.TestCheckResourceAttr(singularDatasourceName, "secret_rules.0.secret_version_expiry_interval", "secretVersionExpiryInterval2"), + //resource.TestCheckResourceAttrSet(singularDatasourceName, "secret_rules.0.time_of_absolute_expiry"), + resource.TestCheckResourceAttr(singularDatasourceName, "source_region_information.#", "0"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), resource.TestCheckResourceAttrSet(singularDatasourceName, "time_of_current_version_expiry"), diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 8c40085ec99..c013ebc9e28 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -11,7 +11,6 @@ import ( "os" "path" "path/filepath" - "regexp" "strconv" "strings" "time" @@ -681,11 +680,16 @@ func BuildConfigureClientFn(configProvider oci_common.ConfigurationProvider, htt domainNameOverride := utils.GetEnvSettingWithBlankDefault(globalvar.DomainNameOverrideEnv) - if domainNameOverride != "" { + //Example host:https://auth.us-ashburn-1.oraclecloud.com Example DomainOverride value: oraclecloudmars35.com + //Output Host after Override should be: https://auth.us-ashburn-1.oraclecloudmars35.com + if domainNameOverride != "" && !strings.HasSuffix(client.Host, domainNameOverride) { hasCorrectDomainName := utils.GetEnvSettingWithBlankDefault(globalvar.HasCorrectDomainNameEnv) - re := regexp.MustCompile(`(.*?)[-\w]+\.\w+$`) // (capture: preamble) match: d0main-name . tld end-of-string if hasCorrectDomainName == "" || !strings.HasSuffix(client.Host, hasCorrectDomainName) { - client.Host = re.ReplaceAllString(client.Host, "${1}"+domainNameOverride) // non-match conveniently returns original string + region, _ := configProvider.Region() + currentRealmDomain := oci_common.StringToRegion(region).SecondLevelDomain() + if currentRealmDomain != "" && strings.HasSuffix(client.Host, currentRealmDomain) { + client.Host = strings.TrimSuffix(client.Host, currentRealmDomain) + domainNameOverride + } } } diff --git a/internal/provider/provider_isolated_test.go b/internal/provider/provider_isolated_test.go new file mode 100644 index 00000000000..d6eb0a2ea93 --- /dev/null +++ b/internal/provider/provider_isolated_test.go @@ -0,0 +1,319 @@ +package provider + +import ( + "crypto/tls" + "net/http" + "os" + "os/exec" + "strings" + "testing" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/terraform-provider-oci/internal/globalvar" + "github.com/oracle/terraform-provider-oci/internal/utils" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +// ensure a custom domain can be targeted and expected http client settings are preserved +// issue-routing-tag: terraform/default +func TestUnitBuildClientConfigureFn_withDomainNameOverride_inIsolation(t *testing.T) { + + // --- Child process: Run actual test and exit the flow after running test logic + if subProcessFlag := os.Getenv("GO_TEST_ISOLATED_SUBPROCESS"); subProcessFlag != "" { + t.Setenv(globalvar.DomainNameOverrideEnv, "0r4-c10ud.com") + t.Setenv(globalvar.HasCorrectDomainNameEnv, "") + t.Setenv(globalvar.OciRegionMetadataEnv, `{"realmKey":"OC150","realmDomainComponent":"oraclecloud150.sol.mar","regionKey":"mars","regionIdentifier":"solar-mars-1"}`) + + assert.Equal(t, "0r4-c10ud.com", utils.GetEnvSettingWithBlankDefault(globalvar.DomainNameOverrideEnv)) + assert.Equal(t, `{"realmKey":"OC150","realmDomainComponent":"oraclecloud150.sol.mar","regionKey":"mars","regionIdentifier":"solar-mars-1"}`, utils.GetEnvSettingWithBlankDefault(globalvar.OciRegionMetadataEnv)) + configProvider := oci_common.NewRawConfigurationProvider(testTenancyOCID, testUserOCID, "solar-mars-1", testKeyFingerPrint, testPrivateKey, nil) + httpClient := BuildHttpClient() + configureClientFn, err := BuildConfigureClientFn(configProvider, httpClient) + assert.NoError(t, err) + + baseClient := &oci_common.BaseClient{} + baseClient.Host = oci_common.StringToRegion("mars").Endpoint("megatron") + assert.Equal(t, `megatron.solar-mars-1.oraclecloud150.sol.mar`, baseClient.Host) + err = configureClientFn(baseClient) + assert.NoError(t, err) + + // verify transport settings are unchanged + tr := httpClient.Transport.(*http.Transport) + assert.NotNil(t, tr.TLSClientConfig) + assert.Equal(t, uint16(tls.VersionTLS12), tr.TLSClientConfig.MinVersion, "expected min tls 1.2") + assert.NotNil(t, tr.Proxy, "expected http.ProxyFromEnvironment fn") + assert.Nil(t, tr.TLSClientConfig.RootCAs) + + // verify url has expected domain + assert.Equal(t, `megatron.solar-mars-1.0r4-c10ud.com`, baseClient.Host) + + // verify subdomains are preserved + baseClient = &oci_common.BaseClient{} + baseClient.Host = "avnzdivwaadfa-management.kms.solar-mars-1.oraclecloud150.sol.mar" + err = configureClientFn(baseClient) + assert.NoError(t, err) + assert.Equal(t, `avnzdivwaadfa-management.kms.solar-mars-1.0r4-c10ud.com`, baseClient.Host) + + // verify non-match preserves original url + baseClient = &oci_common.BaseClient{} + baseClient.Host = "DUMMY_ENDPOINT" + err = configureClientFn(baseClient) + assert.NoError(t, err) + assert.Equal(t, `DUMMY_ENDPOINT`, baseClient.Host) + + os.Exit(0) + } + + //Parent process: Make the test run in a new process for isolation. + exe, err := os.Executable() + if err != nil { + t.Fatal(err) + } + + name := t.Name() + cmd := exec.Command(exe, "-test.v", "-test.run", "^"+name+"$") + cmd.Env = append(os.Environ(), "GO_TEST_ISOLATED_SUBPROCESS="+name) + combinedStdOutStdErr, err := cmd.CombinedOutput() + outputStr := string(combinedStdOutStdErr) + if err != nil { + t.Fatalf("%s failed: %v\n%s", name, err, outputStr) + } + if combinedStdOutStdErr != nil && + (strings.Contains(strings.ToLower(outputStr), "error") || strings.Contains(strings.ToLower(outputStr), "fail")) { + t.Fatalf("%s failed: \n%s", name, string(combinedStdOutStdErr)) + } +} + +// ensure a custom domain that has already override with more than 2 dots can be targeted and expected http client settings are preserved +// issue-routing-tag: terraform/default +func TestUnitBuildClientConfigureFn_withDomainNameOverrideAndCorrectDomainName_inIsolation(t *testing.T) { + + // --- Child process: Run actual test and exit the flow after running test logic + if subProcessFlag := os.Getenv("GO_TEST_ISOLATED_SUBPROCESS"); subProcessFlag != "" { + t.Setenv(globalvar.DomainNameOverrideEnv, "oc.0r4-c10ud.com") + t.Setenv(globalvar.HasCorrectDomainNameEnv, "oc.0r4-c10ud.com") + assert.Equal(t, "oc.0r4-c10ud.com", utils.GetEnvSettingWithBlankDefault(globalvar.DomainNameOverrideEnv)) + assert.Equal(t, "oc.0r4-c10ud.com", utils.GetEnvSettingWithBlankDefault(globalvar.HasCorrectDomainNameEnv)) + configProvider := oci_common.DefaultConfigProvider() + httpClient := BuildHttpClient() + configureClientFn, err := BuildConfigureClientFn(configProvider, httpClient) + assert.NoError(t, err) + + baseClient := &oci_common.BaseClient{} + baseClient.Host = "https://svc.region.oc.0r4-c10ud.com" + err = configureClientFn(baseClient) + assert.NoError(t, err) + + // verify transport settings are unchanged + tr := httpClient.Transport.(*http.Transport) + assert.NotNil(t, tr.TLSClientConfig) + assert.Equal(t, uint16(tls.VersionTLS12), tr.TLSClientConfig.MinVersion, "expected min tls 1.2") + assert.NotNil(t, tr.Proxy, "expected http.ProxyFromEnvironment fn") + assert.Nil(t, tr.TLSClientConfig.RootCAs) + + // verify url has expected domain + assert.Equal(t, `https://svc.region.oc.0r4-c10ud.com`, baseClient.Host) + + // verify subdomains are preserved + baseClient = &oci_common.BaseClient{} + baseClient.Host = "avnzdivwaadfa-management.kms.us-phoenix-1.oraclecloud.com" + err = configureClientFn(baseClient) + assert.NoError(t, err) + assert.Equal(t, `avnzdivwaadfa-management.kms.us-phoenix-1.oc.0r4-c10ud.com`, baseClient.Host) + + // verify non-match preserves original url + baseClient = &oci_common.BaseClient{} + baseClient.Host = "DUMMY_ENDPOINT" + err = configureClientFn(baseClient) + assert.NoError(t, err) + assert.Equal(t, `DUMMY_ENDPOINT`, baseClient.Host) + + os.Exit(0) + } + + //Parent process: Make the test run in a new process for isolation. + exe, err := os.Executable() + if err != nil { + t.Fatal(err) + } + + name := t.Name() + cmd := exec.Command(exe, "-test.v", "-test.run", "^"+name+"$") + cmd.Env = append(os.Environ(), "GO_TEST_ISOLATED_SUBPROCESS="+name) + combinedStdOutStdErr, err := cmd.CombinedOutput() + outputStr := string(combinedStdOutStdErr) + if err != nil { + t.Fatalf("%s failed: %v\n%s", name, err, outputStr) + } + if combinedStdOutStdErr != nil && + (strings.Contains(strings.ToLower(outputStr), "error") || strings.Contains(strings.ToLower(outputStr), "fail")) { + t.Fatalf("%s failed: \n%s", name, string(combinedStdOutStdErr)) + } +} + +// Ensure that domain override doesnt overrides domain when custom endpoint template with static domain is used for end point creation. +func TestUnitBuildClientConfigureFn_withDomainNameOverride_andCustomServiceEndpointTemplate_withoutRealmDomainInTemplate_inIsolation(t *testing.T) { + // --- Child process: Run actual test and exit the flow after running test logic + if subProcessFlag := os.Getenv("GO_TEST_ISOLATED_SUBPROCESS"); subProcessFlag != "" { + domainOverride := "orac.cloud80.com" + region := "solar-mars-1" + expectedHost := "adm.solar-mars-1.oci.tel" + + t.Setenv(globalvar.DomainNameOverrideEnv, domainOverride) + + configurationProvider := oci_common.NewRawConfigurationProvider( + testTenancyOCID, testUserOCID, region, + testKeyFingerPrint, testPrivateKey, nil) + + configure, err := BuildConfigureClientFn(configurationProvider, http.DefaultClient) + require.NoError(t, err) + + baseClient := &oci_common.BaseClient{ + Host: oci_common.StringToRegion("solar-mars-1").EndpointForTemplate("megatron", "adm.{region}.oci.tel"), + } + require.NoError(t, configure(baseClient)) + + assert.Equal(t, expectedHost, baseClient.Host) + + os.Exit(0) + } + + //Parent process: Make the test run in a new process for isolation. + exe, err := os.Executable() + if err != nil { + t.Fatal(err) + } + + name := t.Name() + cmd := exec.Command(exe, "-test.v", "-test.run", "^"+name+"$") + cmd.Env = append(os.Environ(), "GO_TEST_ISOLATED_SUBPROCESS="+name) + combinedStdOutStdErr, err := cmd.CombinedOutput() + outputStr := string(combinedStdOutStdErr) + if err != nil { + t.Fatalf("%s failed: %v\n%s", name, err, outputStr) + } + if combinedStdOutStdErr != nil && + (strings.Contains(strings.ToLower(outputStr), "error") || strings.Contains(strings.ToLower(outputStr), "fail")) { + t.Fatalf("%s failed: \n%s", name, string(combinedStdOutStdErr)) + } +} + +// Ensure that domain override doesn't override realm domain when realm specific endpoint template with static domain is used. +func TestUnitBuildClientConfigureFn_withDomainNameOverride_andRealmSpecificEndpointEnabled_inIsolation(t *testing.T) { + + // --- Child process: Run actual test and exit the flow after running test logic + if subProcessFlag := os.Getenv("GO_TEST_ISOLATED_SUBPROCESS"); subProcessFlag != "" { + domainOverride := "orac.cloud80.com" + region := "solar-mars-1" + objectStorageNamespace := "abcdefghijklmnop" + + realmSpecificEndpointTemplate := objectStorageNamespace + ".objectstorage.{region}.oci.customer-oci.com" + expectedHost := objectStorageNamespace + "." + "objectstorage" + "." + region + "." + "oci.customer-oci.com" + + t.Setenv(globalvar.DomainNameOverrideEnv, domainOverride) + + configurationProvider := oci_common.NewRawConfigurationProvider( + testTenancyOCID, testUserOCID, region, + testKeyFingerPrint, testPrivateKey, nil) + + configure, err := BuildConfigureClientFn(configurationProvider, http.DefaultClient) + require.NoError(t, err) + + baseClient := &oci_common.BaseClient{ + Host: oci_common.StringToRegion("solar-mars-1").EndpointForTemplate("megatron", realmSpecificEndpointTemplate), + } + require.NoError(t, configure(baseClient)) + + assert.Equal(t, expectedHost, baseClient.Host) + + os.Exit(0) + } + + //Parent process: Make the test run in a new process for isolation. + exe, err := os.Executable() + if err != nil { + t.Fatal(err) + } + + name := t.Name() + cmd := exec.Command(exe, "-test.v", "-test.run", "^"+name+"$") + cmd.Env = append(os.Environ(), "GO_TEST_ISOLATED_SUBPROCESS="+name) + combinedStdOutStdErr, err := cmd.CombinedOutput() + outputStr := string(combinedStdOutStdErr) + if err != nil { + t.Fatalf("%s failed: %v\n%s", name, err, outputStr) + } + if combinedStdOutStdErr != nil && + (strings.Contains(strings.ToLower(outputStr), "error") || strings.Contains(strings.ToLower(outputStr), "fail")) { + t.Fatalf("%s failed: \n%s", name, string(combinedStdOutStdErr)) + } +} + +func TestBuildClientConfigureFn_hostMutation_DomainOverride_inIsolation(t *testing.T) { + tests := []struct { + name string + regionMetaData string + override string + expectedHost string + }{ + {"with region metadata and realm domain same as override", + `{"realmKey":"OC150","realmDomainComponent":"oc140.usa.sec","regionKey":"mars","regionIdentifier":"solar-mars-1"}`, + "oc140.usa.sec", + "megatron.solar-mars-1.oc140.usa.sec"}, + {"with region metadata and realm domain not same as override", + `{"realmKey":"OC150","realmDomainComponent":"oraclecloud150.sol.mar","regionKey":"mars","regionIdentifier":"solar-mars-1"}`, + "oc140.usa.sec", + "megatron.solar-mars-1.oc140.usa.sec"}, + {"no region metadata", + "", + "oc140.usa.sec", + "megatron.solar-mars-1.oc140.usa.sec"}, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + + // --- Child process: Run actual test and exit the flow after running test logic + if subProcessFlag := os.Getenv("GO_TEST_ISOLATED_SUBPROCESS"); subProcessFlag != "" { + t.Setenv(globalvar.DomainNameOverrideEnv, tc.override) + t.Setenv(globalvar.OciRegionMetadataEnv, tc.regionMetaData) + + configurationProvider := oci_common.NewRawConfigurationProvider( + testTenancyOCID, testUserOCID, "solar-mars-1", + testKeyFingerPrint, testPrivateKey, nil) + + configure, err := BuildConfigureClientFn(configurationProvider, http.DefaultClient) + require.NoError(t, err) + + baseClient := &oci_common.BaseClient{ + Host: oci_common.StringToRegion("solar-mars-1").Endpoint("megatron"), + } + require.NoError(t, configure(baseClient)) + + assert.Equal(t, tc.expectedHost, baseClient.Host) + + os.Exit(0) + } + + //Parent process: Make the test run in a new process for isolation. + exe, err := os.Executable() + if err != nil { + t.Fatal(err) + } + + name := t.Name() + cmd := exec.Command(exe, "-test.v", "-test.run", "^"+name+"$") + cmd.Env = append(os.Environ(), "GO_TEST_ISOLATED_SUBPROCESS="+name) + combinedStdOutStdErr, err := cmd.CombinedOutput() + outputStr := string(combinedStdOutStdErr) + if err != nil { + t.Fatalf("%s failed: %v\n%s", name, err, outputStr) + } + if combinedStdOutStdErr != nil && + (strings.Contains(strings.ToLower(outputStr), "error") || strings.Contains(strings.ToLower(outputStr), "fail")) { + t.Fatalf("%s failed: \n%s", name, string(combinedStdOutStdErr)) + } + }) + } +} diff --git a/internal/provider/provider_test.go b/internal/provider/provider_test.go index 47e5828cfe7..39cd805f86a 100644 --- a/internal/provider/provider_test.go +++ b/internal/provider/provider_test.go @@ -59,6 +59,8 @@ gzRMpGgWnjsaz0ldu3uO7ozRxZg8FgdToIzAIaTytpHKI8HvONvPJlYywOMC1gRi KwX6p26xaVtCV8PbDpF3RHuEJV1NU6PDIhaIHhdL374BiX/KmcJ6yv7tbkczpK+V -----END RSA PRIVATE KEY-----` +var testPrivateKeyPassphrase = "dummy-passphrase" + // This test runs the Provider sanity checks. // issue-routing-tag: terraform/default func TestUnitProvider(t *testing.T) { @@ -124,14 +126,7 @@ func TestUnitBuildClientConfigureFn_withCustomCert(t *testing.T) { t.Error(err) } - prevEnvVar, hadPreviousEnvVar := os.LookupEnv(globalvar.CustomCertLocationEnv) - if hadPreviousEnvVar { - defer os.Setenv(globalvar.CustomCertLocationEnv, prevEnvVar) - } else { - defer os.Unsetenv(globalvar.CustomCertLocationEnv) - } - - os.Setenv(globalvar.CustomCertLocationEnv, tempCert.Name()) + t.Setenv(globalvar.CustomCertLocationEnv, tempCert.Name()) assert.Equal(t, tempCert.Name(), utils.GetEnvSettingWithBlankDefault(globalvar.CustomCertLocationEnv)) configProvider := oci_common.DefaultConfigProvider() httpClient := BuildHttpClient() @@ -152,12 +147,7 @@ func TestUnitBuildClientConfigureFn_withCustomCert(t *testing.T) { // ensure local certs can be admitted // issue-routing-tag: terraform/default func TestUnitBuildClientConfigureFn_acceptLocalCerts(t *testing.T) { - prevEnvVar, hadPreviousEnvVar := os.LookupEnv(globalvar.AcceptLocalCerts) - if hadPreviousEnvVar { - defer os.Setenv(globalvar.AcceptLocalCerts, prevEnvVar) - } else { - defer os.Unsetenv(globalvar.AcceptLocalCerts) - } + t.Setenv(globalvar.AcceptLocalCerts, "") // ensure disabled by default - no env var os.Unsetenv(globalvar.AcceptLocalCerts) @@ -223,130 +213,12 @@ func TestUnitBuildClientConfigureFn_acceptLocalCerts(t *testing.T) { assert.True(t, tr.TLSClientConfig.InsecureSkipVerify) } -// ensure a custom domain can be targeted and expected http client settings are preserved -// issue-routing-tag: terraform/default -func TestUnitBuildClientConfigureFn_withDomainNameOverride(t *testing.T) { - - prevEnvVar, hadPreviousEnvVar := os.LookupEnv(globalvar.DomainNameOverrideEnv) - if hadPreviousEnvVar { - defer os.Setenv(globalvar.DomainNameOverrideEnv, prevEnvVar) - } else { - defer os.Unsetenv(globalvar.DomainNameOverrideEnv) - } - - if hadPreviousEnvVar { - defer os.Setenv(globalvar.HasCorrectDomainNameEnv, prevEnvVar) - } else { - defer os.Unsetenv(globalvar.HasCorrectDomainNameEnv) - } - - os.Setenv(globalvar.DomainNameOverrideEnv, "0r4-c10ud.com") - assert.Equal(t, "0r4-c10ud.com", utils.GetEnvSettingWithBlankDefault(globalvar.DomainNameOverrideEnv)) - configProvider := oci_common.DefaultConfigProvider() - httpClient := BuildHttpClient() - configureClientFn, err := BuildConfigureClientFn(configProvider, httpClient) - assert.NoError(t, err) - - baseClient := &oci_common.BaseClient{} - baseClient.Host = "https://svc.region.oraclecloud.com" - err = configureClientFn(baseClient) - assert.NoError(t, err) - - // verify transport settings are unchanged - tr := httpClient.Transport.(*http.Transport) - assert.NotNil(t, tr.TLSClientConfig) - assert.Equal(t, uint16(tls.VersionTLS12), tr.TLSClientConfig.MinVersion, "expected min tls 1.2") - assert.NotNil(t, tr.Proxy, "expected http.ProxyFromEnvironment fn") - assert.Nil(t, tr.TLSClientConfig.RootCAs) - - // verify url has expected domain - assert.Equal(t, `https://svc.region.0r4-c10ud.com`, baseClient.Host) - - // verify subdomains are preserved - baseClient = &oci_common.BaseClient{} - baseClient.Host = "avnzdivwaadfa-management.kms.us-phoenix-1.oraclecloud.com" - err = configureClientFn(baseClient) - assert.NoError(t, err) - assert.Equal(t, `avnzdivwaadfa-management.kms.us-phoenix-1.0r4-c10ud.com`, baseClient.Host) - - // verify non-match preserves original url - baseClient = &oci_common.BaseClient{} - baseClient.Host = "DUMMY_ENDPOINT" - err = configureClientFn(baseClient) - assert.NoError(t, err) - assert.Equal(t, `DUMMY_ENDPOINT`, baseClient.Host) -} - -// ensure a custom domain that has already override with more than 2 dots can be targeted and expected http client settings are preserved -// issue-routing-tag: terraform/default -func TestUnitBuildClientConfigureFn_withDomainNameOverrideAndCorrectDomainName(t *testing.T) { - - prevEnvVar, hadPreviousEnvVar := os.LookupEnv(globalvar.DomainNameOverrideEnv) - if hadPreviousEnvVar { - defer os.Setenv(globalvar.DomainNameOverrideEnv, prevEnvVar) - } else { - defer os.Unsetenv(globalvar.DomainNameOverrideEnv) - } - - if hadPreviousEnvVar { - defer os.Setenv(globalvar.HasCorrectDomainNameEnv, prevEnvVar) - } else { - defer os.Unsetenv(globalvar.HasCorrectDomainNameEnv) - } - - os.Setenv(globalvar.DomainNameOverrideEnv, "oc.0r4-c10ud.com") - os.Setenv(globalvar.HasCorrectDomainNameEnv, "oc.0r4-c10ud.com") - assert.Equal(t, "oc.0r4-c10ud.com", utils.GetEnvSettingWithBlankDefault(globalvar.DomainNameOverrideEnv)) - assert.Equal(t, "oc.0r4-c10ud.com", utils.GetEnvSettingWithBlankDefault(globalvar.HasCorrectDomainNameEnv)) - configProvider := oci_common.DefaultConfigProvider() - httpClient := BuildHttpClient() - configureClientFn, err := BuildConfigureClientFn(configProvider, httpClient) - assert.NoError(t, err) - - baseClient := &oci_common.BaseClient{} - baseClient.Host = "https://svc.region.oc.0r4-c10ud.com" - err = configureClientFn(baseClient) - assert.NoError(t, err) - - // verify transport settings are unchanged - tr := httpClient.Transport.(*http.Transport) - assert.NotNil(t, tr.TLSClientConfig) - assert.Equal(t, uint16(tls.VersionTLS12), tr.TLSClientConfig.MinVersion, "expected min tls 1.2") - assert.NotNil(t, tr.Proxy, "expected http.ProxyFromEnvironment fn") - assert.Nil(t, tr.TLSClientConfig.RootCAs) - - // verify url has expected domain - assert.Equal(t, `https://svc.region.oc.0r4-c10ud.com`, baseClient.Host) - - // verify subdomains are preserved - baseClient = &oci_common.BaseClient{} - baseClient.Host = "avnzdivwaadfa-management.kms.us-phoenix-1.oraclecloud.com" - err = configureClientFn(baseClient) - assert.NoError(t, err) - assert.Equal(t, `avnzdivwaadfa-management.kms.us-phoenix-1.oc.0r4-c10ud.com`, baseClient.Host) - - // verify non-match preserves original url - baseClient = &oci_common.BaseClient{} - baseClient.Host = "DUMMY_ENDPOINT" - err = configureClientFn(baseClient) - assert.NoError(t, err) - assert.Equal(t, `DUMMY_ENDPOINT`, baseClient.Host) -} - // ensure use_obo_token env var results in `opc-obo-token` http header injection // issue-routing-tag: terraform/default func TestUnitBuildClientConfigureFn_interceptor(t *testing.T) { - prevEnvVar, hadPreviousEnvVar := os.LookupEnv("use_obo_token") - if hadPreviousEnvVar { - defer os.Setenv("use_obo_token", prevEnvVar) - } else { - defer os.Unsetenv("use_obo_token") - } - - os.Setenv("use_obo_token", "true") - os.Setenv(globalvar.OboTokenAttrName, "fake-token") - defer os.Unsetenv(globalvar.OboTokenAttrName) + t.Setenv("use_obo_token", "true") + t.Setenv(globalvar.OboTokenAttrName, "fake-token") assert.Equal(t, "true", utils.GetEnvSettingWithBlankDefault("use_obo_token")) configProvider := oci_common.DefaultConfigProvider() httpClient := BuildHttpClient() diff --git a/internal/provider/register_datasource.go b/internal/provider/register_datasource.go index 02514d1a864..cd6aa9e6e1c 100644 --- a/internal/provider/register_datasource.go +++ b/internal/provider/register_datasource.go @@ -11,6 +11,7 @@ import ( tf_ai_vision "github.com/oracle/terraform-provider-oci/internal/service/ai_vision" tf_analytics "github.com/oracle/terraform-provider-oci/internal/service/analytics" tf_announcements_service "github.com/oracle/terraform-provider-oci/internal/service/announcements_service" + tf_api_platform "github.com/oracle/terraform-provider-oci/internal/service/api_platform" tf_apiaccesscontrol "github.com/oracle/terraform-provider-oci/internal/service/apiaccesscontrol" tf_apigateway "github.com/oracle/terraform-provider-oci/internal/service/apigateway" tf_apm "github.com/oracle/terraform-provider-oci/internal/service/apm" @@ -153,6 +154,9 @@ func init() { if common.CheckForEnabledServices("announcementsservice") { tf_announcements_service.RegisterDatasource() } + if common.CheckForEnabledServices("apiplatform") { + tf_api_platform.RegisterDatasource() + } if common.CheckForEnabledServices("apiaccesscontrol") { tf_apiaccesscontrol.RegisterDatasource() } diff --git a/internal/provider/register_resource.go b/internal/provider/register_resource.go index 3b28b70b61a..02e378bafe8 100644 --- a/internal/provider/register_resource.go +++ b/internal/provider/register_resource.go @@ -11,6 +11,7 @@ import ( tf_ai_vision "github.com/oracle/terraform-provider-oci/internal/service/ai_vision" tf_analytics "github.com/oracle/terraform-provider-oci/internal/service/analytics" tf_announcements_service "github.com/oracle/terraform-provider-oci/internal/service/announcements_service" + tf_api_platform "github.com/oracle/terraform-provider-oci/internal/service/api_platform" tf_apiaccesscontrol "github.com/oracle/terraform-provider-oci/internal/service/apiaccesscontrol" tf_apigateway "github.com/oracle/terraform-provider-oci/internal/service/apigateway" tf_apm "github.com/oracle/terraform-provider-oci/internal/service/apm" @@ -153,6 +154,9 @@ func init() { if common.CheckForEnabledServices("announcementsservice") { tf_announcements_service.RegisterResource() } + if common.CheckForEnabledServices("apiplatform") { + tf_api_platform.RegisterResource() + } if common.CheckForEnabledServices("apiaccesscontrol") { tf_apiaccesscontrol.RegisterResource() } diff --git a/internal/resourcediscovery/export_compartment.go b/internal/resourcediscovery/export_compartment.go index d52e778f413..5dfe2df396c 100644 --- a/internal/resourcediscovery/export_compartment.go +++ b/internal/resourcediscovery/export_compartment.go @@ -13,6 +13,7 @@ import ( "runtime" "runtime/debug" "sort" + "strconv" "strings" "sync" "time" @@ -300,7 +301,13 @@ func RunExportCommand(args *tf_export.ExportCommandArgs) (err error, status Stat numCPU := runtime.NumCPU() MaxParallelFindResource = numCPU * 4 // max parallel chunks for state genation that can be executed in parallel - MaxParallelChunks = numCPU * 4 + MaxParallelChunks = numCPU * 2 // default value + if env := os.Getenv("TF_MAX_PARALLEL_CHUNKS"); env != "" { + if value, err := strconv.Atoi(env); err == nil && value > 0 { + MaxParallelChunks = value + utils.Debugf("[INFO] Found ENV Variable TF_MAX_PARALLEL_CHUNKS. Value - %d", MaxParallelChunks) + } + } utils.Debugf("[INFO] Setting MaxParalleFindResources=%d, MaxParallelChunks=%d", MaxParallelFindResource, MaxParallelChunks) ctx, err := createResourceDiscoveryContext(clients.(*tf_client.OracleClients), args, tenancyOcid) diff --git a/internal/service/api_platform/api_platform_api_platform_instance_data_source.go b/internal/service/api_platform/api_platform_api_platform_instance_data_source.go new file mode 100644 index 00000000000..14858f7e789 --- /dev/null +++ b/internal/service/api_platform/api_platform_api_platform_instance_data_source.go @@ -0,0 +1,118 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package api_platform + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_api_platform "github.com/oracle/oci-go-sdk/v65/apiplatform" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApiPlatformApiPlatformInstanceDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["api_platform_instance_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(ApiPlatformApiPlatformInstanceResource(), fieldMap, readSingularApiPlatformApiPlatformInstance) +} + +func readSingularApiPlatformApiPlatformInstance(d *schema.ResourceData, m interface{}) error { + sync := &ApiPlatformApiPlatformInstanceDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ApiPlatformClient() + + return tfresource.ReadResource(sync) +} + +type ApiPlatformApiPlatformInstanceDataSourceCrud struct { + D *schema.ResourceData + Client *oci_api_platform.ApiPlatformClient + Res *oci_api_platform.GetApiPlatformInstanceResponse +} + +func (s *ApiPlatformApiPlatformInstanceDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ApiPlatformApiPlatformInstanceDataSourceCrud) Get() error { + request := oci_api_platform.GetApiPlatformInstanceRequest{} + + if apiPlatformInstanceId, ok := s.D.GetOkExists("api_platform_instance_id"); ok { + tmp := apiPlatformInstanceId.(string) + request.ApiPlatformInstanceId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "api_platform") + + response, err := s.Client.GetApiPlatformInstance(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ApiPlatformApiPlatformInstanceDataSourceCrud) 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) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.IdcsApp != nil { + s.D.Set("idcs_app", []interface{}{IdcsAppToMap(s.Res.IdcsApp)}) + } else { + s.D.Set("idcs_app", nil) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.Name != nil { + s.D.Set("name", *s.Res.Name) + } + + 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()) + } + + if s.Res.Uris != nil { + s.D.Set("uris", []interface{}{UrisToMap(s.Res.Uris)}) + } else { + s.D.Set("uris", nil) + } + + return nil +} diff --git a/internal/service/api_platform/api_platform_api_platform_instance_resource.go b/internal/service/api_platform/api_platform_api_platform_instance_resource.go new file mode 100644 index 00000000000..c773f47c700 --- /dev/null +++ b/internal/service/api_platform/api_platform_api_platform_instance_resource.go @@ -0,0 +1,580 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package api_platform + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_api_platform "github.com/oracle/oci-go-sdk/v65/apiplatform" + oci_common "github.com/oracle/oci-go-sdk/v65/common" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApiPlatformApiPlatformInstanceResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: &schema.ResourceTimeout{ + Create: tfresource.GetTimeoutDuration("2h"), + Delete: tfresource.GetTimeoutDuration("2h"), + }, + Create: createApiPlatformApiPlatformInstance, + Read: readApiPlatformApiPlatformInstance, + Update: updateApiPlatformApiPlatformInstance, + Delete: deleteApiPlatformApiPlatformInstance, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "name": { + 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, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + + // Computed + "idcs_app": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "url": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + "uris": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "developers_portal_uri": { + Type: schema.TypeString, + Computed: true, + }, + "management_portal_uri": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func createApiPlatformApiPlatformInstance(d *schema.ResourceData, m interface{}) error { + sync := &ApiPlatformApiPlatformInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ApiPlatformClient() + + return tfresource.CreateResource(d, sync) +} + +func readApiPlatformApiPlatformInstance(d *schema.ResourceData, m interface{}) error { + sync := &ApiPlatformApiPlatformInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ApiPlatformClient() + + return tfresource.ReadResource(sync) +} + +func updateApiPlatformApiPlatformInstance(d *schema.ResourceData, m interface{}) error { + sync := &ApiPlatformApiPlatformInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ApiPlatformClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteApiPlatformApiPlatformInstance(d *schema.ResourceData, m interface{}) error { + sync := &ApiPlatformApiPlatformInstanceResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ApiPlatformClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type ApiPlatformApiPlatformInstanceResourceCrud struct { + tfresource.BaseCrud + Client *oci_api_platform.ApiPlatformClient + Res *oci_api_platform.ApiPlatformInstance + DisableNotFoundRetries bool +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) CreatedPending() []string { + return []string{ + string(oci_api_platform.ApiPlatformInstanceLifecycleStateCreating), + } +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_api_platform.ApiPlatformInstanceLifecycleStateActive), + } +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) DeletedPending() []string { + return []string{ + string(oci_api_platform.ApiPlatformInstanceLifecycleStateDeleting), + } +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_api_platform.ApiPlatformInstanceLifecycleStateDeleted), + } +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) Create() error { + request := oci_api_platform.CreateApiPlatformInstanceRequest{} + + 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 freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if name, ok := s.D.GetOkExists("name"); ok { + tmp := name.(string) + request.Name = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "api_platform") + + response, err := s.Client.CreateApiPlatformInstance(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + return s.getApiPlatformInstanceFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "api_platform"), oci_api_platform.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) getApiPlatformInstanceFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_api_platform.ActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + apiPlatformInstanceId, err := apiPlatformInstanceWaitForWorkRequest(workId, "apiplatforminstance", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) + + if err != nil { + return err + } + s.D.SetId(*apiPlatformInstanceId) + + return s.Get() +} + +func apiPlatformInstanceWorkRequestShouldRetryFunc(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, "api_platform", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_api_platform.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func apiPlatformInstanceWaitForWorkRequest(wId *string, entityType string, action oci_api_platform.ActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_api_platform.ApiPlatformClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "api_platform") + retryPolicy.ShouldRetryOperation = apiPlatformInstanceWorkRequestShouldRetryFunc(timeout) + + response := oci_api_platform.GetWorkRequestResponse{} + stateConf := &retry.StateChangeConf{ + Pending: []string{ + string(oci_api_platform.OperationStatusInProgress), + string(oci_api_platform.OperationStatusAccepted), + string(oci_api_platform.OperationStatusCanceling), + }, + Target: []string{ + string(oci_api_platform.OperationStatusSucceeded), + string(oci_api_platform.OperationStatusFailed), + string(oci_api_platform.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_api_platform.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_api_platform.OperationStatusFailed || response.Status == oci_api_platform.OperationStatusCanceled { + return nil, getErrorFromApiPlatformApiPlatformInstanceWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromApiPlatformApiPlatformInstanceWorkRequest(client *oci_api_platform.ApiPlatformClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_api_platform.ActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_api_platform.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 *ApiPlatformApiPlatformInstanceResourceCrud) Get() error { + request := oci_api_platform.GetApiPlatformInstanceRequest{} + + tmp := s.D.Id() + request.ApiPlatformInstanceId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "api_platform") + + response, err := s.Client.GetApiPlatformInstance(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ApiPlatformInstance + return nil +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) 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_api_platform.UpdateApiPlatformInstanceRequest{} + + tmp := s.D.Id() + request.ApiPlatformInstanceId = &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 freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "api_platform") + + response, err := s.Client.UpdateApiPlatformInstance(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ApiPlatformInstance + return nil +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) Delete() error { + request := oci_api_platform.DeleteApiPlatformInstanceRequest{} + + tmp := s.D.Id() + request.ApiPlatformInstanceId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "api_platform") + + response, err := s.Client.DeleteApiPlatformInstance(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := apiPlatformInstanceWaitForWorkRequest(workId, "apiplatforminstance", + oci_api_platform.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) + return delWorkRequestErr +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) 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) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.IdcsApp != nil { + s.D.Set("idcs_app", []interface{}{IdcsAppToMap(s.Res.IdcsApp)}) + } else { + s.D.Set("idcs_app", nil) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.Name != nil { + s.D.Set("name", *s.Res.Name) + } + + 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()) + } + + if s.Res.Uris != nil { + s.D.Set("uris", []interface{}{UrisToMap(s.Res.Uris)}) + } else { + s.D.Set("uris", nil) + } + + return nil +} + +func ApiPlatformInstanceSummaryToMap(obj oci_api_platform.ApiPlatformInstanceSummary) 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) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + if obj.Name != nil { + result["name"] = string(*obj.Name) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + return result +} + +func IdcsAppToMap(obj *oci_api_platform.IdcsApp) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Url != nil { + result["url"] = string(*obj.Url) + } + + return result +} + +func UrisToMap(obj *oci_api_platform.Uris) map[string]interface{} { + result := map[string]interface{}{} + + if obj.DevelopersPortalUri != nil { + result["developers_portal_uri"] = string(*obj.DevelopersPortalUri) + } + + if obj.ManagementPortalUri != nil { + result["management_portal_uri"] = string(*obj.ManagementPortalUri) + } + + return result +} + +func (s *ApiPlatformApiPlatformInstanceResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_api_platform.ChangeApiPlatformInstanceCompartmentRequest{} + + idTmp := s.D.Id() + changeCompartmentRequest.ApiPlatformInstanceId = &idTmp + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "api_platform") + + _, err := s.Client.ChangeApiPlatformInstanceCompartment(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/api_platform/api_platform_api_platform_instances_data_source.go b/internal/service/api_platform/api_platform_api_platform_instances_data_source.go new file mode 100644 index 00000000000..6a6996c3fb8 --- /dev/null +++ b/internal/service/api_platform/api_platform_api_platform_instances_data_source.go @@ -0,0 +1,144 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package api_platform + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_api_platform "github.com/oracle/oci-go-sdk/v65/apiplatform" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApiPlatformApiPlatformInstancesDataSource() *schema.Resource { + return &schema.Resource{ + Read: readApiPlatformApiPlatformInstances, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "name": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "api_platform_instance_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(ApiPlatformApiPlatformInstanceResource()), + }, + }, + }, + }, + }, + } +} + +func readApiPlatformApiPlatformInstances(d *schema.ResourceData, m interface{}) error { + sync := &ApiPlatformApiPlatformInstancesDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ApiPlatformClient() + + return tfresource.ReadResource(sync) +} + +type ApiPlatformApiPlatformInstancesDataSourceCrud struct { + D *schema.ResourceData + Client *oci_api_platform.ApiPlatformClient + Res *oci_api_platform.ListApiPlatformInstancesResponse +} + +func (s *ApiPlatformApiPlatformInstancesDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ApiPlatformApiPlatformInstancesDataSourceCrud) Get() error { + request := oci_api_platform.ListApiPlatformInstancesRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if name, ok := s.D.GetOkExists("name"); ok { + tmp := name.(string) + request.Name = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_api_platform.ApiPlatformInstanceLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "api_platform") + + response, err := s.Client.ListApiPlatformInstances(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListApiPlatformInstances(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 *ApiPlatformApiPlatformInstancesDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ApiPlatformApiPlatformInstancesDataSource-", ApiPlatformApiPlatformInstancesDataSource(), s.D)) + resources := []map[string]interface{}{} + apiPlatformInstance := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, ApiPlatformInstanceSummaryToMap(item)) + } + apiPlatformInstance["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, ApiPlatformApiPlatformInstancesDataSource().Schema["api_platform_instance_collection"].Elem.(*schema.Resource).Schema) + apiPlatformInstance["items"] = items + } + + resources = append(resources, apiPlatformInstance) + if err := s.D.Set("api_platform_instance_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/api_platform/api_platform_export.go b/internal/service/api_platform/api_platform_export.go new file mode 100644 index 00000000000..5c7fc19ea62 --- /dev/null +++ b/internal/service/api_platform/api_platform_export.go @@ -0,0 +1,32 @@ +package api_platform + +import ( + oci_api_platform "github.com/oracle/oci-go-sdk/v65/apiplatform" + + tf_export "github.com/oracle/terraform-provider-oci/internal/commonexport" +) + +func init() { + tf_export.RegisterCompartmentGraphs("api_platform", apiPlatformResourceGraph) +} + +// Custom overrides for generating composite IDs within the resource discovery framework + +// Hints for discovering and exporting this resource to configuration and state files +var exportApiPlatformApiPlatformInstanceHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_api_platform_api_platform_instance", + DatasourceClass: "oci_api_platform_api_platform_instances", + DatasourceItemsAttr: "api_platform_instance_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "api_platform_instance", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_api_platform.ApiPlatformInstanceLifecycleStateActive), + }, +} + +var apiPlatformResourceGraph = tf_export.TerraformResourceGraph{ + "oci_identity_compartment": { + {TerraformResourceHints: exportApiPlatformApiPlatformInstanceHints}, + }, +} diff --git a/internal/service/api_platform/register_datasource.go b/internal/service/api_platform/register_datasource.go new file mode 100644 index 00000000000..b8ecf09922a --- /dev/null +++ b/internal/service/api_platform/register_datasource.go @@ -0,0 +1,11 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package api_platform + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterDatasource() { + tfresource.RegisterDatasource("oci_api_platform_api_platform_instance", ApiPlatformApiPlatformInstanceDataSource()) + tfresource.RegisterDatasource("oci_api_platform_api_platform_instances", ApiPlatformApiPlatformInstancesDataSource()) +} diff --git a/internal/service/api_platform/register_resource.go b/internal/service/api_platform/register_resource.go new file mode 100644 index 00000000000..7ceef3009d8 --- /dev/null +++ b/internal/service/api_platform/register_resource.go @@ -0,0 +1,10 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package api_platform + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterResource() { + tfresource.RegisterResource("oci_api_platform_api_platform_instance", ApiPlatformApiPlatformInstanceResource()) +} diff --git a/internal/service/apigateway/apigateway_api_resource.go b/internal/service/apigateway/apigateway_api_resource.go index 29ee81e818e..e5979849ab4 100644 --- a/internal/service/apigateway/apigateway_api_resource.go +++ b/internal/service/apigateway/apigateway_api_resource.go @@ -61,6 +61,42 @@ func ApigatewayApiResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "locks": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "message": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "related_resource_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_lock_override": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, // Computed "lifecycle_details": { @@ -75,6 +111,11 @@ func ApigatewayApiResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -210,6 +251,23 @@ func (s *ApigatewayApiResourceCrud) Create() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if locks, ok := s.D.GetOkExists("locks"); ok { + interfaces := locks.([]interface{}) + tmp := make([]oci_apigateway.AddResourceLockDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "locks", stateDataIndex) + converted, err := s.mapToAddResourceLockDetails(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("locks") { + request.Locks = tmp + } + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.CreateApi(context.Background(), request) @@ -409,6 +467,11 @@ func (s *ApigatewayApiResourceCrud) Update() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.UpdateApi(context.Background(), request) @@ -430,6 +493,11 @@ func (s *ApigatewayApiResourceCrud) Delete() error { tmp := s.D.Id() request.ApiId = &tmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.DeleteApi(context.Background(), request) @@ -463,12 +531,22 @@ func (s *ApigatewayApiResourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + locks := []interface{}{} + for _, item := range s.Res.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + s.D.Set("locks", locks) + if s.Res.SpecificationType != nil { s.D.Set("specification_type", *s.Res.SpecificationType) } 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()) } @@ -486,6 +564,21 @@ func (s *ApigatewayApiResourceCrud) SetData() error { return nil } +func (s *ApigatewayApiResourceCrud) mapToAddResourceLockDetails(fieldKeyFormat string) (oci_apigateway.AddResourceLockDetails, error) { + result := oci_apigateway.AddResourceLockDetails{} + + if message, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "message")); ok { + tmp := message.(string) + result.Message = &tmp + } + + if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { + result.Type = oci_apigateway.AddResourceLockDetailsTypeEnum(type_.(string)) + } + + return result, nil +} + func ApiSummaryToMap(obj oci_apigateway.ApiSummary) map[string]interface{} { result := map[string]interface{}{} @@ -511,12 +604,22 @@ func ApiSummaryToMap(obj oci_apigateway.ApiSummary) map[string]interface{} { result["lifecycle_details"] = string(*obj.LifecycleDetails) } + locks := []interface{}{} + for _, item := range obj.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + result["locks"] = locks + if obj.SpecificationType != nil { result["specification_type"] = string(*obj.SpecificationType) } 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() } @@ -555,6 +658,11 @@ func (s *ApigatewayApiResourceCrud) updateCompartment(compartment interface{}) e compartmentTmp := compartment.(string) changeCompartmentRequest.CompartmentId = &compartmentTmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + changeCompartmentRequest.IsLockOverride = &tmp + } + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.ChangeApiCompartment(context.Background(), changeCompartmentRequest) diff --git a/internal/service/apigateway/apigateway_certificate_resource.go b/internal/service/apigateway/apigateway_certificate_resource.go index fd4771d4ae7..d96db4c835a 100644 --- a/internal/service/apigateway/apigateway_certificate_resource.go +++ b/internal/service/apigateway/apigateway_certificate_resource.go @@ -73,6 +73,42 @@ func ApigatewayCertificateResource() *schema.Resource { Computed: true, ForceNew: true, }, + "locks": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "message": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "related_resource_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_lock_override": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, // Computed "lifecycle_details": { @@ -90,6 +126,11 @@ func ApigatewayCertificateResource() *schema.Resource { Type: schema.TypeString, }, }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -213,6 +254,23 @@ func (s *ApigatewayCertificateResourceCrud) Create() error { request.IntermediateCertificates = &tmp } + if locks, ok := s.D.GetOkExists("locks"); ok { + interfaces := locks.([]interface{}) + tmp := make([]oci_apigateway.AddResourceLockDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "locks", stateDataIndex) + converted, err := s.mapToAddResourceLockDetails(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("locks") { + request.Locks = tmp + } + } + if privateKey, ok := s.D.GetOkExists("private_key"); ok { tmp := privateKey.(string) request.PrivateKey = &tmp @@ -411,6 +469,11 @@ func (s *ApigatewayCertificateResourceCrud) Update() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.UpdateCertificate(context.Background(), request) @@ -428,6 +491,11 @@ func (s *ApigatewayCertificateResourceCrud) Delete() error { tmp := s.D.Id() request.CertificateId = &tmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") _, err := s.Client.DeleteCertificate(context.Background(), request) @@ -461,10 +529,20 @@ func (s *ApigatewayCertificateResourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + locks := []interface{}{} + for _, item := range s.Res.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + s.D.Set("locks", locks) + s.D.Set("state", s.Res.LifecycleState) s.D.Set("subject_names", s.Res.SubjectNames) + 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()) } @@ -480,6 +558,21 @@ func (s *ApigatewayCertificateResourceCrud) SetData() error { return nil } +func (s *ApigatewayCertificateResourceCrud) mapToAddResourceLockDetails(fieldKeyFormat string) (oci_apigateway.AddResourceLockDetails, error) { + result := oci_apigateway.AddResourceLockDetails{} + + if message, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "message")); ok { + tmp := message.(string) + result.Message = &tmp + } + + if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { + result.Type = oci_apigateway.AddResourceLockDetailsTypeEnum(type_.(string)) + } + + return result, nil +} + func CertificateSummaryToMap(obj oci_apigateway.CertificateSummary) map[string]interface{} { result := map[string]interface{}{} @@ -505,10 +598,20 @@ func CertificateSummaryToMap(obj oci_apigateway.CertificateSummary) map[string]i result["lifecycle_details"] = string(*obj.LifecycleDetails) } + locks := []interface{}{} + for _, item := range obj.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + result["locks"] = locks + result["state"] = string(obj.LifecycleState) result["subject_names"] = obj.SubjectNames + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + if obj.TimeCreated != nil { result["time_created"] = obj.TimeCreated.String() } @@ -533,6 +636,11 @@ func (s *ApigatewayCertificateResourceCrud) updateCompartment(compartment interf compartmentTmp := compartment.(string) changeCompartmentRequest.CompartmentId = &compartmentTmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + changeCompartmentRequest.IsLockOverride = &tmp + } + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") _, err := s.Client.ChangeCertificateCompartment(context.Background(), changeCompartmentRequest) diff --git a/internal/service/apigateway/apigateway_deployment_resource.go b/internal/service/apigateway/apigateway_deployment_resource.go index 476e4f3b045..eaae067af69 100644 --- a/internal/service/apigateway/apigateway_deployment_resource.go +++ b/internal/service/apigateway/apigateway_deployment_resource.go @@ -2993,6 +2993,42 @@ func ApigatewayDeploymentResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "locks": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "message": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "related_resource_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_lock_override": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, // Computed "endpoint": { @@ -3007,6 +3043,11 @@ func ApigatewayDeploymentResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -3133,6 +3174,23 @@ func (s *ApigatewayDeploymentResourceCrud) Create() error { request.GatewayId = &tmp } + if locks, ok := s.D.GetOkExists("locks"); ok { + interfaces := locks.([]interface{}) + tmp := make([]oci_apigateway.AddResourceLockDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "locks", stateDataIndex) + converted, err := s.mapToAddResourceLockDetails(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("locks") { + request.Locks = tmp + } + } + if pathPrefix, ok := s.D.GetOkExists("path_prefix"); ok { tmp := pathPrefix.(string) request.PathPrefix = &tmp @@ -3341,6 +3399,11 @@ func (s *ApigatewayDeploymentResourceCrud) Update() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + if specification, ok := s.D.GetOkExists("specification"); ok { if tmpList := specification.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "specification", 0) @@ -3369,6 +3432,11 @@ func (s *ApigatewayDeploymentResourceCrud) Delete() error { tmp := s.D.Id() request.DeploymentId = &tmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.DeleteDeployment(context.Background(), request) @@ -3410,6 +3478,12 @@ func (s *ApigatewayDeploymentResourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + locks := []interface{}{} + for _, item := range s.Res.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + s.D.Set("locks", locks) + if s.Res.PathPrefix != nil { s.D.Set("path_prefix", *s.Res.PathPrefix) } @@ -3422,6 +3496,10 @@ func (s *ApigatewayDeploymentResourceCrud) SetData() error { 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()) } @@ -3454,6 +3532,21 @@ func AccessLogPolicyToMap(obj *oci_apigateway.AccessLogPolicy) map[string]interf return result } +func (s *ApigatewayDeploymentResourceCrud) mapToAddResourceLockDetails(fieldKeyFormat string) (oci_apigateway.AddResourceLockDetails, error) { + result := oci_apigateway.AddResourceLockDetails{} + + if message, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "message")); ok { + tmp := message.(string) + result.Message = &tmp + } + + if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { + result.Type = oci_apigateway.AddResourceLockDetailsTypeEnum(type_.(string)) + } + + return result, nil +} + func (s *ApigatewayDeploymentResourceCrud) mapToAdditionalValidationPolicy(fieldKeyFormat string) (oci_apigateway.AdditionalValidationPolicy, error) { result := oci_apigateway.AdditionalValidationPolicy{} @@ -5014,12 +5107,22 @@ func DeploymentSummaryToMap(obj oci_apigateway.DeploymentSummary) map[string]int result["lifecycle_details"] = string(*obj.LifecycleDetails) } + locks := []interface{}{} + for _, item := range obj.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + result["locks"] = locks + if obj.PathPrefix != nil { result["path_prefix"] = string(*obj.PathPrefix) } 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() } @@ -6746,6 +6849,11 @@ func (s *ApigatewayDeploymentResourceCrud) updateCompartment(compartment interfa idTmp := s.D.Id() changeCompartmentRequest.DeploymentId = &idTmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + changeCompartmentRequest.IsLockOverride = &tmp + } + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.ChangeDeploymentCompartment(context.Background(), changeCompartmentRequest) diff --git a/internal/service/apigateway/apigateway_gateway_resource.go b/internal/service/apigateway/apigateway_gateway_resource.go index 7a3816f5dc8..57a85267c80 100644 --- a/internal/service/apigateway/apigateway_gateway_resource.go +++ b/internal/service/apigateway/apigateway_gateway_resource.go @@ -106,6 +106,42 @@ func ApigatewayGatewayResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "locks": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "message": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "related_resource_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_lock_override": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, "network_security_group_ids": { Type: schema.TypeSet, Optional: true, @@ -232,6 +268,11 @@ func ApigatewayGatewayResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -367,6 +408,23 @@ func (s *ApigatewayGatewayResourceCrud) Create() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if locks, ok := s.D.GetOkExists("locks"); ok { + interfaces := locks.([]interface{}) + tmp := make([]oci_apigateway.AddResourceLockDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "locks", stateDataIndex) + converted, err := s.mapToAddResourceLockDetails(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("locks") { + request.Locks = tmp + } + } + if networkSecurityGroupIds, ok := s.D.GetOkExists("network_security_group_ids"); ok { set := networkSecurityGroupIds.(*schema.Set) interfaces := set.List() @@ -611,6 +669,11 @@ func (s *ApigatewayGatewayResourceCrud) Update() error { tmp := s.D.Id() request.GatewayId = &tmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + if networkSecurityGroupIds, ok := s.D.GetOkExists("network_security_group_ids"); ok { set := networkSecurityGroupIds.(*schema.Set) interfaces := set.List() @@ -653,6 +716,11 @@ func (s *ApigatewayGatewayResourceCrud) Delete() error { tmp := s.D.Id() request.GatewayId = &tmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.DeleteGateway(context.Background(), request) @@ -708,6 +776,12 @@ func (s *ApigatewayGatewayResourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + locks := []interface{}{} + for _, item := range s.Res.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + s.D.Set("locks", locks) + networkSecurityGroupIds := []interface{}{} for _, item := range s.Res.NetworkSecurityGroupIds { networkSecurityGroupIds = append(networkSecurityGroupIds, item) @@ -730,6 +804,10 @@ func (s *ApigatewayGatewayResourceCrud) SetData() error { 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()) } @@ -741,6 +819,41 @@ func (s *ApigatewayGatewayResourceCrud) SetData() error { return nil } +func (s *ApigatewayGatewayResourceCrud) mapToAddResourceLockDetails(fieldKeyFormat string) (oci_apigateway.AddResourceLockDetails, error) { + result := oci_apigateway.AddResourceLockDetails{} + + if message, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "message")); ok { + tmp := message.(string) + result.Message = &tmp + } + + if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { + result.Type = oci_apigateway.AddResourceLockDetailsTypeEnum(type_.(string)) + } + + return result, nil +} + +func ResourceLockToMap(obj oci_apigateway.ResourceLock) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Message != nil { + result["message"] = string(*obj.Message) + } + + if obj.RelatedResourceId != nil { + result["related_resource_id"] = string(*obj.RelatedResourceId) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + result["type"] = string(obj.Type) + + return result +} + func (s *ApigatewayGatewayResourceCrud) mapToCaBundle(fieldKeyFormat string) (oci_apigateway.CaBundle, error) { var baseObject oci_apigateway.CaBundle //discriminator @@ -824,6 +937,12 @@ func GatewaySummaryToMap(obj oci_apigateway.GatewaySummary, datasource bool) map result["lifecycle_details"] = string(*obj.LifecycleDetails) } + locks := []interface{}{} + for _, item := range obj.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + result["locks"] = locks + networkSecurityGroupIds := []interface{}{} for _, item := range obj.NetworkSecurityGroupIds { networkSecurityGroupIds = append(networkSecurityGroupIds, item) @@ -840,6 +959,10 @@ func GatewaySummaryToMap(obj oci_apigateway.GatewaySummary, datasource bool) map 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() } @@ -1028,6 +1151,11 @@ func (s *ApigatewayGatewayResourceCrud) updateCompartment(compartment interface{ idTmp := s.D.Id() changeCompartmentRequest.GatewayId = &idTmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + changeCompartmentRequest.IsLockOverride = &tmp + } + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.ChangeGatewayCompartment(context.Background(), changeCompartmentRequest) diff --git a/internal/service/apigateway/apigateway_subscriber_resource.go b/internal/service/apigateway/apigateway_subscriber_resource.go index 072d4a7d7bf..47b05c08a1d 100644 --- a/internal/service/apigateway/apigateway_subscriber_resource.go +++ b/internal/service/apigateway/apigateway_subscriber_resource.go @@ -84,6 +84,42 @@ func ApigatewaySubscriberResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "locks": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "message": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "related_resource_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_lock_override": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, // Computed "lifecycle_details": { @@ -94,6 +130,11 @@ func ApigatewaySubscriberResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -220,6 +261,23 @@ func (s *ApigatewaySubscriberResourceCrud) Create() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if locks, ok := s.D.GetOkExists("locks"); ok { + interfaces := locks.([]interface{}) + tmp := make([]oci_apigateway.AddResourceLockDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "locks", stateDataIndex) + converted, err := s.mapToAddResourceLockDetails(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("locks") { + request.Locks = tmp + } + } + if usagePlans, ok := s.D.GetOkExists("usage_plans"); ok { interfaces := usagePlans.([]interface{}) tmp := make([]string, len(interfaces)) @@ -439,6 +497,11 @@ func (s *ApigatewaySubscriberResourceCrud) Update() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + tmp := s.D.Id() request.SubscriberId = &tmp @@ -469,6 +532,11 @@ func (s *ApigatewaySubscriberResourceCrud) Update() error { func (s *ApigatewaySubscriberResourceCrud) Delete() error { request := oci_apigateway.DeleteSubscriberRequest{} + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + tmp := s.D.Id() request.SubscriberId = &tmp @@ -511,8 +579,18 @@ func (s *ApigatewaySubscriberResourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + locks := []interface{}{} + for _, item := range s.Res.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + s.D.Set("locks", locks) + 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()) } @@ -526,6 +604,21 @@ func (s *ApigatewaySubscriberResourceCrud) SetData() error { return nil } +func (s *ApigatewaySubscriberResourceCrud) mapToAddResourceLockDetails(fieldKeyFormat string) (oci_apigateway.AddResourceLockDetails, error) { + result := oci_apigateway.AddResourceLockDetails{} + + if message, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "message")); ok { + tmp := message.(string) + result.Message = &tmp + } + + if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { + result.Type = oci_apigateway.AddResourceLockDetailsTypeEnum(type_.(string)) + } + + return result, nil +} + func (s *ApigatewaySubscriberResourceCrud) mapToClient(fieldKeyFormat string) (oci_apigateway.Client, error) { result := oci_apigateway.Client{} @@ -597,8 +690,18 @@ func SubscriberSummaryToMap(obj oci_apigateway.SubscriberSummary) map[string]int result["lifecycle_details"] = string(*obj.LifecycleDetails) } + locks := []interface{}{} + for _, item := range obj.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + result["locks"] = locks + 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() } @@ -618,6 +721,11 @@ func (s *ApigatewaySubscriberResourceCrud) updateCompartment(compartment interfa compartmentTmp := compartment.(string) changeCompartmentRequest.CompartmentId = &compartmentTmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + changeCompartmentRequest.IsLockOverride = &tmp + } + idTmp := s.D.Id() changeCompartmentRequest.SubscriberId = &idTmp diff --git a/internal/service/apigateway/apigateway_usage_plan_resource.go b/internal/service/apigateway/apigateway_usage_plan_resource.go index 282c6a8e19a..04b55eb4999 100644 --- a/internal/service/apigateway/apigateway_usage_plan_resource.go +++ b/internal/service/apigateway/apigateway_usage_plan_resource.go @@ -152,6 +152,42 @@ func ApigatewayUsagePlanResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "locks": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "message": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "related_resource_id": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "is_lock_override": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, // Computed "lifecycle_details": { @@ -162,6 +198,11 @@ func ApigatewayUsagePlanResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -288,6 +329,23 @@ func (s *ApigatewayUsagePlanResourceCrud) Create() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if locks, ok := s.D.GetOkExists("locks"); ok { + interfaces := locks.([]interface{}) + tmp := make([]oci_apigateway.AddResourceLockDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "locks", stateDataIndex) + converted, err := s.mapToAddResourceLockDetails(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("locks") { + request.Locks = tmp + } + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apigateway") response, err := s.Client.CreateUsagePlan(context.Background(), request) @@ -494,6 +552,11 @@ func (s *ApigatewayUsagePlanResourceCrud) Update() error { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + tmp := s.D.Id() request.UsagePlanId = &tmp @@ -511,6 +574,11 @@ func (s *ApigatewayUsagePlanResourceCrud) Update() error { func (s *ApigatewayUsagePlanResourceCrud) Delete() error { request := oci_apigateway.DeleteUsagePlanRequest{} + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + request.IsLockOverride = &tmp + } + tmp := s.D.Id() request.UsagePlanId = &tmp @@ -553,8 +621,18 @@ func (s *ApigatewayUsagePlanResourceCrud) SetData() error { s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) } + locks := []interface{}{} + for _, item := range s.Res.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + s.D.Set("locks", locks) + 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()) } @@ -566,6 +644,21 @@ func (s *ApigatewayUsagePlanResourceCrud) SetData() error { return nil } +func (s *ApigatewayUsagePlanResourceCrud) mapToAddResourceLockDetails(fieldKeyFormat string) (oci_apigateway.AddResourceLockDetails, error) { + result := oci_apigateway.AddResourceLockDetails{} + + if message, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "message")); ok { + tmp := message.(string) + result.Message = &tmp + } + + if type_, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "type")); ok { + result.Type = oci_apigateway.AddResourceLockDetailsTypeEnum(type_.(string)) + } + + return result, nil +} + func (s *ApigatewayUsagePlanResourceCrud) mapToEntitlement(fieldKeyFormat string) (oci_apigateway.Entitlement, error) { result := oci_apigateway.Entitlement{} @@ -787,8 +880,18 @@ func UsagePlanSummaryToMap(obj oci_apigateway.UsagePlanSummary) map[string]inter result["lifecycle_details"] = string(*obj.LifecycleDetails) } + locks := []interface{}{} + for _, item := range obj.Locks { + locks = append(locks, ResourceLockToMap(item)) + } + result["locks"] = locks + 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() } @@ -806,6 +909,11 @@ func (s *ApigatewayUsagePlanResourceCrud) updateCompartment(compartment interfac compartmentTmp := compartment.(string) changeCompartmentRequest.CompartmentId = &compartmentTmp + if isLockOverride, ok := s.D.GetOkExists("is_lock_override"); ok { + tmp := isLockOverride.(bool) + changeCompartmentRequest.IsLockOverride = &tmp + } + idTmp := s.D.Id() changeCompartmentRequest.UsagePlanId = &idTmp diff --git a/internal/service/apm_config/apm_config_config_data_source.go b/internal/service/apm_config/apm_config_config_data_source.go index c23696d7d37..5d74a9c94f7 100644 --- a/internal/service/apm_config/apm_config_config_data_source.go +++ b/internal/service/apm_config/apm_config_config_data_source.go @@ -84,6 +84,52 @@ func (s *ApmConfigConfigDataSourceCrud) SetData() error { s.D.SetId(*s.Res.GetId()) switch v := (s.Res.Config).(type) { + case oci_apm_config.AgentConfig: + s.D.Set("config_type", "AGENT") + + if v.Config != nil { + s.D.Set("config", []interface{}{AgentConfigMapToMap(v.Config)}) + } else { + s.D.Set("config", nil) + } + + s.D.Set("match_agents_with_attribute_key", v.MatchAgentsWithAttributeKey) + + if v.MatchAgentsWithAttributeValue != nil { + s.D.Set("match_agents_with_attribute_value", *v.MatchAgentsWithAttributeValue) + } + + if v.Overrides != nil { + s.D.Set("overrides", []interface{}{AgentConfigOverridesToMap(v.Overrides)}) + } else { + s.D.Set("overrides", nil) + } + + if v.CreatedBy != nil { + s.D.Set("created_by", *v.CreatedBy) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + if v.Etag != nil { + s.D.Set("etag", *v.Etag) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + + if v.UpdatedBy != nil { + s.D.Set("updated_by", *v.UpdatedBy) + } case oci_apm_config.ApdexRules: s.D.Set("config_type", "APDEX") @@ -123,6 +169,64 @@ func (s *ApmConfigConfigDataSourceCrud) SetData() error { s.D.Set("time_updated", v.TimeUpdated.String()) } + if v.UpdatedBy != nil { + s.D.Set("updated_by", *v.UpdatedBy) + } + case oci_apm_config.MacsApmExtension: + s.D.Set("config_type", "MACS_APM_EXTENSION") + + if v.AgentVersion != nil { + s.D.Set("agent_version", *v.AgentVersion) + } + + if v.AttachInstallDir != nil { + s.D.Set("attach_install_dir", *v.AttachInstallDir) + } + + if v.DisplayName != nil { + s.D.Set("display_name", *v.DisplayName) + } + + if v.ManagementAgentId != nil { + s.D.Set("management_agent_id", *v.ManagementAgentId) + } + + s.D.Set("process_filter", v.ProcessFilter) + + if v.RunAsUser != nil { + s.D.Set("run_as_user", *v.RunAsUser) + } + + if v.ServiceName != nil { + s.D.Set("service_name", *v.ServiceName) + } + + if v.CreatedBy != nil { + s.D.Set("created_by", *v.CreatedBy) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + if v.DisplayName != nil { + s.D.Set("display_name", *v.DisplayName) + } + + if v.Etag != nil { + s.D.Set("etag", *v.Etag) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + if v.UpdatedBy != nil { s.D.Set("updated_by", *v.UpdatedBy) } diff --git a/internal/service/apm_config/apm_config_config_resource.go b/internal/service/apm_config/apm_config_config_resource.go index c9faf9fdd9f..4229ee32a5c 100644 --- a/internal/service/apm_config/apm_config_config_resource.go +++ b/internal/service/apm_config/apm_config_config_resource.go @@ -42,18 +42,71 @@ func ApmConfigConfigResource() *schema.Resource { Required: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ + "AGENT", "APDEX", + "MACS_APM_EXTENSION", "METRIC_GROUP", "OPTIONS", "SPAN_FILTER", }, true), }, - "display_name": { + + // Optional + "agent_version": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, }, + "attach_install_dir": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "config": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required - // Optional + // Optional + "config_map": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "file_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Optional + "body": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "content_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, "defined_tags": { Type: schema.TypeMap, Optional: true, @@ -90,6 +143,11 @@ func ApmConfigConfigResource() *schema.Resource { }, }, }, + "display_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "filter_id": { Type: schema.TypeString, Optional: true, @@ -111,6 +169,18 @@ func ApmConfigConfigResource() *schema.Resource { Optional: true, Computed: true, }, + "management_agent_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "match_agents_with_attribute_value": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "metrics": { Type: schema.TypeList, Optional: true, @@ -161,6 +231,55 @@ func ApmConfigConfigResource() *schema.Resource { Computed: true, DiffSuppressFunc: tfresource.JsonStringDiffSuppressFunction, }, + "overrides": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "override_list": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "agent_filter": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "override_map": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, + "process_filter": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "rules": { Type: schema.TypeList, Optional: true, @@ -210,6 +329,16 @@ func ApmConfigConfigResource() *schema.Resource { }, }, }, + "run_as_user": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "service_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, // Computed "created_by": { @@ -250,6 +379,13 @@ func ApmConfigConfigResource() *schema.Resource { }, }, }, + "match_agents_with_attribute_key": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -390,7 +526,56 @@ func (s *ApmConfigConfigResourceCrud) Delete() error { func (s *ApmConfigConfigResourceCrud) SetData() error { + s.D.Set("process_filter", nil) + s.D.Set("match_agents_with_attribute_key", nil) + switch v := (*s.Res).(type) { + case oci_apm_config.AgentConfig: + s.D.Set("config_type", "AGENT") + + if v.Config != nil { + s.D.Set("config", []interface{}{AgentConfigMapToMap(v.Config)}) + } else { + s.D.Set("config", nil) + } + + s.D.Set("match_agents_with_attribute_key", v.MatchAgentsWithAttributeKey) + + if v.MatchAgentsWithAttributeValue != nil { + s.D.Set("match_agents_with_attribute_value", *v.MatchAgentsWithAttributeValue) + } + + if v.Overrides != nil { + s.D.Set("overrides", []interface{}{AgentConfigOverridesToMap(v.Overrides)}) + } else { + s.D.Set("overrides", nil) + } + + if v.CreatedBy != nil { + s.D.Set("created_by", *v.CreatedBy) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + if v.Etag != nil { + s.D.Set("etag", *v.Etag) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + + if v.UpdatedBy != nil { + s.D.Set("updated_by", *v.UpdatedBy) + } case oci_apm_config.ApdexRules: s.D.Set("config_type", "APDEX") @@ -430,6 +615,60 @@ func (s *ApmConfigConfigResourceCrud) SetData() error { s.D.Set("time_updated", v.TimeUpdated.String()) } + if v.UpdatedBy != nil { + s.D.Set("updated_by", *v.UpdatedBy) + } + case oci_apm_config.MacsApmExtension: + s.D.Set("config_type", "MACS_APM_EXTENSION") + + if v.AgentVersion != nil { + s.D.Set("agent_version", *v.AgentVersion) + } + + if v.AttachInstallDir != nil { + s.D.Set("attach_install_dir", *v.AttachInstallDir) + } + + if v.DisplayName != nil { + s.D.Set("display_name", *v.DisplayName) + } + + if v.ManagementAgentId != nil { + s.D.Set("management_agent_id", *v.ManagementAgentId) + } + + s.D.Set("process_filter", v.ProcessFilter) + + if v.RunAsUser != nil { + s.D.Set("run_as_user", *v.RunAsUser) + } + + if v.ServiceName != nil { + s.D.Set("service_name", *v.ServiceName) + } + + if v.CreatedBy != nil { + s.D.Set("created_by", *v.CreatedBy) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + if v.Etag != nil { + s.D.Set("etag", *v.Etag) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + if v.UpdatedBy != nil { s.D.Set("updated_by", *v.UpdatedBy) } @@ -617,6 +856,107 @@ func parseConfigCompositeId(compositeId string) (configId string, apmDomainId st return } +func (s *ApmConfigConfigResourceCrud) mapToAgentConfigMap(fieldKeyFormat string) (oci_apm_config.AgentConfigMap, error) { + result := oci_apm_config.AgentConfigMap{} + result.ConfigMap = make(map[string]oci_apm_config.AgentConfigFile) + + if configMap, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "config_map")); ok { + for _, row := range configMap.([]interface{}) { + rowMap := tfresource.ObjectMapToStringMap(row.(map[string]interface{})) + rowFileName := rowMap["file_name"] + rowContentType := rowMap["content_type"] + rowBody := rowMap["body"] + result.ConfigMap[rowFileName] = oci_apm_config.AgentConfigFile{ContentType: &rowContentType, Body: &rowBody} + } + } + + return result, nil +} + +func AgentConfigMapToMap(obj *oci_apm_config.AgentConfigMap) map[string]interface{} { + result := map[string]interface{}{} + var resultConfigMap []interface{} + + configMap := obj.ConfigMap + + for fileName := range configMap { + body := configMap[fileName].Body + contentType := configMap[fileName].ContentType + temp := map[string]string{ + "file_name": fileName, + "body": *body, + "content_type": *contentType, + } + + resultConfigMap = append(resultConfigMap, temp) + } + + result["config_map"] = resultConfigMap + return result +} + +func (s *ApmConfigConfigResourceCrud) mapToAgentConfigOverride(fieldKeyFormat string) (oci_apm_config.AgentConfigOverride, error) { + result := oci_apm_config.AgentConfigOverride{} + + if agentFilter, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "agent_filter")); ok { + tmp := agentFilter.(string) + result.AgentFilter = &tmp + } + + if overrideMap, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "override_map")); ok { + result.OverrideMap = tfresource.ObjectMapToStringMap(overrideMap.(map[string]interface{})) + } + + return result, nil +} + +func AgentConfigOverrideToMap(obj oci_apm_config.AgentConfigOverride) map[string]interface{} { + result := map[string]interface{}{} + + if obj.AgentFilter != nil { + result["agent_filter"] = string(*obj.AgentFilter) + } + + result["override_map"] = obj.OverrideMap + + return result +} + +func (s *ApmConfigConfigResourceCrud) mapToAgentConfigOverrides(fieldKeyFormat string) (oci_apm_config.AgentConfigOverrides, error) { + result := oci_apm_config.AgentConfigOverrides{} + + if overrideList, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "override_list")); ok { + interfaces := overrideList.([]interface{}) + tmp := make([]oci_apm_config.AgentConfigOverride, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "override_list"), stateDataIndex) + converted, err := s.mapToAgentConfigOverride(fieldKeyFormatNextLevel) + if err != nil { + return result, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "override_list")) { + result.OverrideList = tmp + } + } + + return result, nil +} + +func AgentConfigOverridesToMap(obj *oci_apm_config.AgentConfigOverrides) map[string]interface{} { + result := map[string]interface{}{} + + overrideList := []interface{}{} + for _, item := range obj.OverrideList { + overrideList = append(overrideList, AgentConfigOverrideToMap(item)) + } + result["override_list"] = overrideList + + return result +} + func (s *ApmConfigConfigResourceCrud) mapToApdex(fieldKeyFormat string) (oci_apm_config.Apdex, error) { result := oci_apm_config.Apdex{} @@ -714,6 +1054,22 @@ func ConfigSummaryToMap(obj oci_apm_config.ConfigSummary) map[string]interface{} } switch v := (obj).(type) { + case oci_apm_config.AgentConfigSummary: + result["config_type"] = "AGENT" + + if v.Config != nil { + result["config"] = []interface{}{AgentConfigMapToMap(v.Config)} + } + + result["match_agents_with_attribute_key"] = v.MatchAgentsWithAttributeKey + + if v.MatchAgentsWithAttributeValue != nil { + result["match_agents_with_attribute_value"] = string(*v.MatchAgentsWithAttributeValue) + } + + if v.Overrides != nil { + result["overrides"] = []interface{}{AgentConfigOverridesToMap(v.Overrides)} + } case oci_apm_config.ApdexRulesSummary: result["config_type"] = "APDEX" @@ -726,6 +1082,34 @@ func ConfigSummaryToMap(obj oci_apm_config.ConfigSummary) map[string]interface{} rules = append(rules, ApdexToMap(item)) } result["rules"] = rules + case oci_apm_config.MacsApmExtensionSummary: + result["config_type"] = "MACS_APM_EXTENSION" + + if v.AgentVersion != nil { + result["agent_version"] = string(*v.AgentVersion) + } + + if v.AttachInstallDir != nil { + result["attach_install_dir"] = string(*v.AttachInstallDir) + } + + if v.DisplayName != nil { + result["display_name"] = string(*v.DisplayName) + } + + if v.ManagementAgentId != nil { + result["management_agent_id"] = string(*v.ManagementAgentId) + } + + result["process_filter"] = v.ProcessFilter + + if v.RunAsUser != nil { + result["run_as_user"] = string(*v.RunAsUser) + } + + if v.ServiceName != nil { + result["service_name"] = string(*v.ServiceName) + } case oci_apm_config.MetricGroupSummary: result["config_type"] = "METRIC_GROUP" @@ -928,6 +1312,51 @@ func (s *ApmConfigConfigResourceCrud) populateTopLevelPolymorphicCreateConfigReq configType = "" // default value } switch strings.ToLower(configType) { + case strings.ToLower("AGENT"): + details := oci_apm_config.CreateAgentConfigDetails{} + if config, ok := s.D.GetOkExists("config"); ok { + if tmpList := config.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "config", 0) + tmp, err := s.mapToAgentConfigMap(fieldKeyFormat) + if err != nil { + return err + } + details.Config = &tmp + } + } + if matchAgentsWithAttributeValue, ok := s.D.GetOkExists("match_agents_with_attribute_value"); ok { + tmp := matchAgentsWithAttributeValue.(string) + details.MatchAgentsWithAttributeValue = &tmp + } + if overrides, ok := s.D.GetOkExists("overrides"); ok { + if tmpList := overrides.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "overrides", 0) + tmp, err := s.mapToAgentConfigOverrides(fieldKeyFormat) + if err != nil { + return err + } + details.Overrides = &tmp + } + } + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if opcDryRun, ok := s.D.GetOkExists("opc_dry_run"); ok { + tmp := opcDryRun.(string) + request.OpcDryRun = &tmp + } + request.CreateConfigDetails = details case strings.ToLower("APDEX"): details := oci_apm_config.CreateApdexRulesDetails{} if displayName, ok := s.D.GetOkExists("display_name"); ok { @@ -973,6 +1402,67 @@ func (s *ApmConfigConfigResourceCrud) populateTopLevelPolymorphicCreateConfigReq request.OpcDryRun = &tmp } request.CreateConfigDetails = details + case strings.ToLower("MACS_APM_EXTENSION"): + details := oci_apm_config.CreateMacsApmExtensionDetails{} + if agentVersion, ok := s.D.GetOkExists("agent_version"); ok { + tmp := agentVersion.(string) + details.AgentVersion = &tmp + } + if attachInstallDir, ok := s.D.GetOkExists("attach_install_dir"); ok { + tmp := attachInstallDir.(string) + details.AttachInstallDir = &tmp + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if managementAgentId, ok := s.D.GetOkExists("management_agent_id"); ok { + tmp := managementAgentId.(string) + details.ManagementAgentId = &tmp + } + if processFilter, ok := s.D.GetOkExists("process_filter"); ok { + interfaces := processFilter.([]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("process_filter") { + details.ProcessFilter = tmp + } + } + if runAsUser, ok := s.D.GetOkExists("run_as_user"); ok { + tmp := runAsUser.(string) + details.RunAsUser = &tmp + } + if serviceName, ok := s.D.GetOkExists("service_name"); ok { + tmp := serviceName.(string) + details.ServiceName = &tmp + } + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if opcDryRun, ok := s.D.GetOkExists("opc_dry_run"); ok { + tmp := opcDryRun.(string) + request.OpcDryRun = &tmp + } + request.CreateConfigDetails = details case strings.ToLower("METRIC_GROUP"): details := oci_apm_config.CreateMetricGroupDetails{} if dimensions, ok := s.D.GetOkExists("dimensions"); ok { @@ -1156,6 +1646,47 @@ func (s *ApmConfigConfigResourceCrud) populateTopLevelPolymorphicUpdateConfigReq log.Printf("[WARN] populateTopLevelPolymorphicUpdateConfigRequest() unable to parse current ID: %s", s.D.Id()) } switch strings.ToLower(configType) { + case strings.ToLower("AGENT"): + details := oci_apm_config.UpdateAgentConfigDetails{} + if config, ok := s.D.GetOkExists("config"); ok { + if tmpList := config.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "config", 0) + tmp, err := s.mapToAgentConfigMap(fieldKeyFormat) + if err != nil { + return err + } + details.Config = &tmp + } + } + if overrides, ok := s.D.GetOkExists("overrides"); ok { + if tmpList := overrides.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "overrides", 0) + tmp, err := s.mapToAgentConfigOverrides(fieldKeyFormat) + if err != nil { + return err + } + details.Overrides = &tmp + } + } + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if opcDryRun, ok := s.D.GetOkExists("opc_dry_run"); ok { + tmp := opcDryRun.(string) + request.OpcDryRun = &tmp + } + request.UpdateConfigDetails = details case strings.ToLower("APDEX"): details := oci_apm_config.UpdateApdexRulesDetails{} if displayName, ok := s.D.GetOkExists("display_name"); ok { @@ -1197,6 +1728,63 @@ func (s *ApmConfigConfigResourceCrud) populateTopLevelPolymorphicUpdateConfigReq request.OpcDryRun = &tmp } request.UpdateConfigDetails = details + case strings.ToLower("MACS_APM_EXTENSION"): + details := oci_apm_config.UpdateMacsApmExtensionDetails{} + if agentVersion, ok := s.D.GetOkExists("agent_version"); ok { + tmp := agentVersion.(string) + details.AgentVersion = &tmp + } + if attachInstallDir, ok := s.D.GetOkExists("attach_install_dir"); ok { + tmp := attachInstallDir.(string) + details.AttachInstallDir = &tmp + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if processFilter, ok := s.D.GetOkExists("process_filter"); ok { + interfaces := processFilter.([]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("process_filter") { + details.ProcessFilter = tmp + } + } + if runAsUser, ok := s.D.GetOkExists("run_as_user"); ok { + tmp := runAsUser.(string) + details.RunAsUser = &tmp + } + if serviceName, ok := s.D.GetOkExists("service_name"); ok { + tmp := serviceName.(string) + details.ServiceName = &tmp + } + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if opcDryRun, ok := s.D.GetOkExists("opc_dry_run"); ok { + tmp := opcDryRun.(string) + request.OpcDryRun = &tmp + } + request.UpdateConfigDetails = details case strings.ToLower("METRIC_GROUP"): details := oci_apm_config.UpdateMetricGroupDetails{} if dimensions, ok := s.D.GetOkExists("dimensions"); ok { diff --git a/internal/service/apm_traces/apm_traces_attribute_auto_activate_status_data_source.go b/internal/service/apm_traces/apm_traces_attribute_auto_activate_status_data_source.go new file mode 100644 index 00000000000..5adca6374c2 --- /dev/null +++ b/internal/service/apm_traces/apm_traces_attribute_auto_activate_status_data_source.go @@ -0,0 +1,94 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package apm_traces + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_apm_traces "github.com/oracle/oci-go-sdk/v65/apmtraces" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApmTracesAttributeAutoActivateStatusDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularApmTracesAttributeAutoActivateStatus, + Schema: map[string]*schema.Schema{ + "apm_domain_id": { + Type: schema.TypeString, + Required: true, + }, + "data_key_type": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "data_key": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func readSingularApmTracesAttributeAutoActivateStatus(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesAttributeAutoActivateStatusDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).AttributesClient() + + return tfresource.ReadResource(sync) +} + +type ApmTracesAttributeAutoActivateStatusDataSourceCrud struct { + D *schema.ResourceData + Client *oci_apm_traces.AttributesClient + Res *oci_apm_traces.GetStatusAutoActivateResponse +} + +func (s *ApmTracesAttributeAutoActivateStatusDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ApmTracesAttributeAutoActivateStatusDataSourceCrud) Get() error { + request := oci_apm_traces.GetStatusAutoActivateRequest{} + + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &tmp + } + + if dataKeyType, ok := s.D.GetOkExists("data_key_type"); ok { + request.DataKeyType = oci_apm_traces.GetStatusAutoActivateDataKeyTypeEnum(dataKeyType.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "apm_traces") + + response, err := s.Client.GetStatusAutoActivate(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ApmTracesAttributeAutoActivateStatusDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ApmTracesAttributeAutoActivateStatusDataSource-", ApmTracesAttributeAutoActivateStatusDataSource(), s.D)) + + s.D.Set("data_key", s.Res.DataKey) + + s.D.Set("state", s.Res.State) + + return nil +} diff --git a/internal/service/apm_traces/apm_traces_export.go b/internal/service/apm_traces/apm_traces_export.go new file mode 100644 index 00000000000..4326c4f5b8f --- /dev/null +++ b/internal/service/apm_traces/apm_traces_export.go @@ -0,0 +1,47 @@ +package apm_traces + +import ( + "fmt" + + oci_apm_traces "github.com/oracle/oci-go-sdk/v65/apmtraces" + + tf_export "github.com/oracle/terraform-provider-oci/internal/commonexport" +) + +func init() { + exportApmTracesScheduledQueryHints.GetIdFn = getApmTracesScheduledQueryId + tf_export.RegisterCompartmentGraphs("apm_traces", apmTracesResourceGraph) +} + +// Custom overrides for generating composite IDs within the resource discovery framework + +func getApmTracesScheduledQueryId(resource *tf_export.OCIResource) (string, error) { + + scheduledQueryId, ok := resource.SourceAttributes["id"].(string) + if !ok { + return "", fmt.Errorf("[ERROR] unable to find scheduledQueryId for ApmTraces ScheduledQuery") + } + + apmDomainId, ok := resource.SourceAttributes["apm_domain_id"].(string) + if !ok { + return "", fmt.Errorf("[ERROR] unable to find apmDomainId for ApmConfig Config") + } + return GetScheduledQueryCompositeId(apmDomainId, scheduledQueryId), nil +} + +// Hints for discovering and exporting this resource to configuration and state files +var exportApmTracesScheduledQueryHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_apm_traces_scheduled_query", + DatasourceClass: "oci_apm_traces_scheduled_queries", + DatasourceItemsAttr: "scheduled_query_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "scheduled_query", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_apm_traces.LifecycleStatesActive), + }, +} + +var apmTracesResourceGraph = tf_export.TerraformResourceGraph{ + "oci_identity_compartment": {}, +} diff --git a/internal/service/apm_traces/apm_traces_log_data_source.go b/internal/service/apm_traces/apm_traces_log_data_source.go new file mode 100644 index 00000000000..6703767c8ed --- /dev/null +++ b/internal/service/apm_traces/apm_traces_log_data_source.go @@ -0,0 +1,245 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package apm_traces + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_apm_traces "github.com/oracle/oci-go-sdk/v65/apmtraces" + oci_common "github.com/oracle/oci-go-sdk/v65/common" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApmTracesLogDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularApmTracesLog, + Schema: map[string]*schema.Schema{ + "apm_domain_id": { + Type: schema.TypeString, + Required: true, + }, + "log_key": { + Type: schema.TypeString, + Required: true, + }, + "time_log_ended_less_than": { + Type: schema.TypeString, + Required: true, + }, + "time_log_started_greater_than_or_equal_to": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "attribute_metadata": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "attributes": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "attribute_name": { + Type: schema.TypeString, + Computed: true, + }, + "attribute_value": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "body": { + Type: schema.TypeString, + Computed: true, + }, + "event_name": { + Type: schema.TypeString, + Computed: true, + }, + "overflow_attributes": { + Type: schema.TypeString, + Computed: true, + }, + "severity_number": { + Type: schema.TypeInt, + Computed: true, + }, + "severity_text": { + Type: schema.TypeString, + Computed: true, + }, + "span_key": { + Type: schema.TypeString, + Computed: true, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_observed": { + Type: schema.TypeString, + Computed: true, + }, + "timestamp": { + Type: schema.TypeString, + Computed: true, + }, + "trace_flags": { + Type: schema.TypeInt, + Computed: true, + }, + "trace_key": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func readSingularApmTracesLog(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesLogDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).TraceClient() + + return tfresource.ReadResource(sync) +} + +type ApmTracesLogDataSourceCrud struct { + D *schema.ResourceData + Client *oci_apm_traces.TraceClient + Res *oci_apm_traces.GetLogResponse +} + +func (s *ApmTracesLogDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ApmTracesLogDataSourceCrud) Get() error { + request := oci_apm_traces.GetLogRequest{} + + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &tmp + } + + if logKey, ok := s.D.GetOkExists("log_key"); ok { + tmp := logKey.(string) + request.LogKey = &tmp + } + + if timeLogEndedLessThan, ok := s.D.GetOkExists("time_log_ended_less_than"); ok { + tmp, err := time.Parse(time.RFC3339, timeLogEndedLessThan.(string)) + if err != nil { + return err + } + request.TimeLogEndedLessThan = &oci_common.SDKTime{Time: tmp} + } + + if timeLogStartedGreaterThanOrEqualTo, ok := s.D.GetOkExists("time_log_started_greater_than_or_equal_to"); ok { + tmp, err := time.Parse(time.RFC3339, timeLogStartedGreaterThanOrEqualTo.(string)) + if err != nil { + return err + } + request.TimeLogStartedGreaterThanOrEqualTo = &oci_common.SDKTime{Time: tmp} + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "apm_traces") + + response, err := s.Client.GetLog(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ApmTracesLogDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ApmTracesLogDataSource-", ApmTracesLogDataSource(), s.D)) + + //s.D.Set("attribute_metadata", s.Res.AttributeMetadata) + + attributes := []interface{}{} + for _, item := range s.Res.Attributes { + attributes = append(attributes, AttributeToMap(item)) + } + s.D.Set("attributes", attributes) + + if s.Res.Body != nil { + s.D.Set("body", *s.Res.Body) + } + + if s.Res.EventName != nil { + s.D.Set("event_name", *s.Res.EventName) + } + + if s.Res.OverflowAttributes != nil { + s.D.Set("overflow_attributes", *s.Res.OverflowAttributes) + } + + if s.Res.SeverityNumber != nil { + s.D.Set("severity_number", *s.Res.SeverityNumber) + } + + if s.Res.SeverityText != nil { + s.D.Set("severity_text", *s.Res.SeverityText) + } + + if s.Res.SpanKey != nil { + s.D.Set("span_key", *s.Res.SpanKey) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeObserved != nil { + s.D.Set("time_observed", s.Res.TimeObserved.String()) + } + + if s.Res.Timestamp != nil { + s.D.Set("timestamp", s.Res.Timestamp.String()) + } + + if s.Res.TraceFlags != nil { + s.D.Set("trace_flags", *s.Res.TraceFlags) + } + + if s.Res.TraceKey != nil { + s.D.Set("trace_key", *s.Res.TraceKey) + } + + return nil +} + +func AttributeToMap(obj oci_apm_traces.Attribute) map[string]interface{} { + result := map[string]interface{}{} + + if obj.AttributeName != nil { + result["attribute_name"] = string(*obj.AttributeName) + } + + if obj.AttributeValue != nil { + result["attribute_value"] = string(*obj.AttributeValue) + } + + return result +} diff --git a/internal/service/apm_traces/apm_traces_scheduled_queries_data_source.go b/internal/service/apm_traces/apm_traces_scheduled_queries_data_source.go new file mode 100644 index 00000000000..295bbb7e584 --- /dev/null +++ b/internal/service/apm_traces/apm_traces_scheduled_queries_data_source.go @@ -0,0 +1,127 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package apm_traces + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_apm_traces "github.com/oracle/oci-go-sdk/v65/apmtraces" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApmTracesScheduledQueriesDataSource() *schema.Resource { + return &schema.Resource{ + Read: readApmTracesScheduledQueries, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "apm_domain_id": { + Type: schema.TypeString, + Required: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "scheduled_query_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(ApmTracesScheduledQueryResource()), + }, + }, + }, + }, + }, + } +} + +func readApmTracesScheduledQueries(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesScheduledQueriesDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ScheduledQueryClient() + + return tfresource.ReadResource(sync) +} + +type ApmTracesScheduledQueriesDataSourceCrud struct { + D *schema.ResourceData + Client *oci_apm_traces.ScheduledQueryClient + Res *oci_apm_traces.ListScheduledQueriesResponse +} + +func (s *ApmTracesScheduledQueriesDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ApmTracesScheduledQueriesDataSourceCrud) Get() error { + request := oci_apm_traces.ListScheduledQueriesRequest{} + + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "apm_traces") + + response, err := s.Client.ListScheduledQueries(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListScheduledQueries(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 *ApmTracesScheduledQueriesDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ApmTracesScheduledQueriesDataSource-", ApmTracesScheduledQueriesDataSource(), s.D)) + resources := []map[string]interface{}{} + scheduledQuery := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, ScheduledQuerySummaryToMap(item)) + } + scheduledQuery["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, ApmTracesScheduledQueriesDataSource().Schema["scheduled_query_collection"].Elem.(*schema.Resource).Schema) + scheduledQuery["items"] = items + } + + resources = append(resources, scheduledQuery) + if err := s.D.Set("scheduled_query_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/apm_traces/apm_traces_scheduled_query_data_source.go b/internal/service/apm_traces/apm_traces_scheduled_query_data_source.go new file mode 100644 index 00000000000..2d729126a4c --- /dev/null +++ b/internal/service/apm_traces/apm_traces_scheduled_query_data_source.go @@ -0,0 +1,138 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package apm_traces + +import ( + "context" + "log" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_apm_traces "github.com/oracle/oci-go-sdk/v65/apmtraces" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApmTracesScheduledQueryDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["apm_domain_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + fieldMap["scheduled_query_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(ApmTracesScheduledQueryResource(), fieldMap, readSingularApmTracesScheduledQuery) +} + +func readSingularApmTracesScheduledQuery(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesScheduledQueryDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ScheduledQueryClient() + + return tfresource.ReadResource(sync) +} + +type ApmTracesScheduledQueryDataSourceCrud struct { + D *schema.ResourceData + Client *oci_apm_traces.ScheduledQueryClient + Res *oci_apm_traces.GetScheduledQueryResponse +} + +func (s *ApmTracesScheduledQueryDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ApmTracesScheduledQueryDataSourceCrud) Get() error { + request := oci_apm_traces.GetScheduledQueryRequest{} + + if scheduledQueryId, ok := s.D.GetOkExists("scheduled_query_id"); ok { + tmp := scheduledQueryId.(string) + apmDomainId, scheduledQueryId, err := parseScheduledQueryCompositeId(tmp) + if err == nil { + request.ScheduledQueryId = &scheduledQueryId + request.ApmDomainId = &apmDomainId + } else { + log.Printf("[WARN] Get() unable to parse current ID: %s", tmp) + } + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "apm_traces") + + response, err := s.Client.GetScheduledQuery(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ApmTracesScheduledQueryDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.Id) + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.ScheduledQueryDescription != nil { + s.D.Set("scheduled_query_description", *s.Res.ScheduledQueryDescription) + } + + if s.Res.ScheduledQueryInstances != nil { + s.D.Set("scheduled_query_instances", *s.Res.ScheduledQueryInstances) + } + + if s.Res.ScheduledQueryMaximumRuntimeInSeconds != nil { + s.D.Set("scheduled_query_maximum_runtime_in_seconds", strconv.FormatInt(*s.Res.ScheduledQueryMaximumRuntimeInSeconds, 10)) + } + + if s.Res.ScheduledQueryName != nil { + s.D.Set("scheduled_query_name", *s.Res.ScheduledQueryName) + } + + if s.Res.ScheduledQueryNextRunInMs != nil { + s.D.Set("scheduled_query_next_run_in_ms", strconv.FormatInt(*s.Res.ScheduledQueryNextRunInMs, 10)) + } + + if s.Res.ScheduledQueryProcessingConfiguration != nil { + s.D.Set("scheduled_query_processing_configuration", []interface{}{ScheduledQueryProcessingConfigToMap(s.Res.ScheduledQueryProcessingConfiguration)}) + } else { + s.D.Set("scheduled_query_processing_configuration", nil) + } + + s.D.Set("scheduled_query_processing_sub_type", s.Res.ScheduledQueryProcessingSubType) + + s.D.Set("scheduled_query_processing_type", s.Res.ScheduledQueryProcessingType) + + s.D.Set("scheduled_query_retention_criteria", s.Res.ScheduledQueryRetentionCriteria) + + if s.Res.ScheduledQueryRetentionPeriodInMs != nil { + s.D.Set("scheduled_query_retention_period_in_ms", strconv.FormatInt(*s.Res.ScheduledQueryRetentionPeriodInMs, 10)) + } + + if s.Res.ScheduledQuerySchedule != nil { + s.D.Set("scheduled_query_schedule", *s.Res.ScheduledQuerySchedule) + } + + if s.Res.ScheduledQueryText != nil { + s.D.Set("scheduled_query_text", *s.Res.ScheduledQueryText) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + return nil +} diff --git a/internal/service/apm_traces/apm_traces_scheduled_query_resource.go b/internal/service/apm_traces/apm_traces_scheduled_query_resource.go new file mode 100644 index 00000000000..a90f397a9af --- /dev/null +++ b/internal/service/apm_traces/apm_traces_scheduled_query_resource.go @@ -0,0 +1,902 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package apm_traces + +import ( + "context" + "fmt" + "log" + "net/url" + "regexp" + "strconv" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_apm_traces "github.com/oracle/oci-go-sdk/v65/apmtraces" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ApmTracesScheduledQueryResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createApmTracesScheduledQuery, + Read: readApmTracesScheduledQuery, + Update: updateApmTracesScheduledQuery, + Delete: deleteApmTracesScheduledQuery, + Schema: map[string]*schema.Schema{ + // Required + "apm_domain_id": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + "opc_dry_run": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scheduled_query_description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scheduled_query_maximum_runtime_in_seconds": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: tfresource.ValidateInt64TypeString, + DiffSuppressFunc: tfresource.Int64StringDiffSuppressFunction, + }, + "scheduled_query_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scheduled_query_processing_configuration": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "custom_metric": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "name": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "compartment": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "is_anomaly_detection_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + "is_metric_published": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + "namespace": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "resource_group": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "unit": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + "object_storage": { + 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, + }, + "name_space": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "object_name_prefix": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + "streaming": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "stream_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, + "scheduled_query_processing_sub_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scheduled_query_processing_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scheduled_query_retention_criteria": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scheduled_query_retention_period_in_ms": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: tfresource.ValidateInt64TypeString, + DiffSuppressFunc: tfresource.Int64StringDiffSuppressFunction, + }, + "scheduled_query_schedule": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scheduled_query_text": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "scheduled_query_instances": { + Type: schema.TypeString, + Computed: true, + }, + "scheduled_query_next_run_in_ms": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + }, + } +} + +func createApmTracesScheduledQuery(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesScheduledQueryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ScheduledQueryClient() + + return tfresource.CreateResource(d, sync) +} + +func readApmTracesScheduledQuery(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesScheduledQueryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ScheduledQueryClient() + + return tfresource.ReadResource(sync) +} + +func updateApmTracesScheduledQuery(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesScheduledQueryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ScheduledQueryClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteApmTracesScheduledQuery(d *schema.ResourceData, m interface{}) error { + sync := &ApmTracesScheduledQueryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ScheduledQueryClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type ApmTracesScheduledQueryResourceCrud struct { + tfresource.BaseCrud + Client *oci_apm_traces.ScheduledQueryClient + Res *oci_apm_traces.ScheduledQuery + DisableNotFoundRetries bool +} + +func (s *ApmTracesScheduledQueryResourceCrud) ID() string { + return GetScheduledQueryCompositeId(s.D.Get("apm_domain_id").(string), *s.Res.Id) +} + +func (s *ApmTracesScheduledQueryResourceCrud) CreatedPending() []string { + return []string{ + string(oci_apm_traces.LifecycleStatesCreating), + } +} + +func (s *ApmTracesScheduledQueryResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_apm_traces.LifecycleStatesActive), + } +} + +func (s *ApmTracesScheduledQueryResourceCrud) DeletedPending() []string { + return []string{ + string(oci_apm_traces.LifecycleStatesDeleting), + } +} + +func (s *ApmTracesScheduledQueryResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_apm_traces.LifecycleStatesDeleted), + } +} + +func (s *ApmTracesScheduledQueryResourceCrud) Create() error { + request := oci_apm_traces.CreateScheduledQueryRequest{} + + if apmDomainId, ok := s.D.GetOkExists("apm_domain_id"); ok { + tmp := apmDomainId.(string) + request.ApmDomainId = &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 freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if opcDryRun, ok := s.D.GetOkExists("opc_dry_run"); ok { + tmp := opcDryRun.(string) + request.OpcDryRun = &tmp + } + + if scheduledQueryDescription, ok := s.D.GetOkExists("scheduled_query_description"); ok { + tmp := scheduledQueryDescription.(string) + request.ScheduledQueryDescription = &tmp + } + + if scheduledQueryMaximumRuntimeInSeconds, ok := s.D.GetOkExists("scheduled_query_maximum_runtime_in_seconds"); ok { + tmp := scheduledQueryMaximumRuntimeInSeconds.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return fmt.Errorf("unable to convert scheduledQueryMaximumRuntimeInSeconds string: %s to an int64 and encountered error: %v", tmp, err) + } + request.ScheduledQueryMaximumRuntimeInSeconds = &tmpInt64 + } + + if scheduledQueryName, ok := s.D.GetOkExists("scheduled_query_name"); ok { + tmp := scheduledQueryName.(string) + request.ScheduledQueryName = &tmp + } + + if scheduledQueryProcessingConfiguration, ok := s.D.GetOkExists("scheduled_query_processing_configuration"); ok { + if tmpList := scheduledQueryProcessingConfiguration.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "scheduled_query_processing_configuration", 0) + tmp, err := s.mapToScheduledQueryProcessingConfig(fieldKeyFormat) + if err != nil { + return err + } + request.ScheduledQueryProcessingConfiguration = &tmp + } + } + + if scheduledQueryProcessingSubType, ok := s.D.GetOkExists("scheduled_query_processing_sub_type"); ok { + request.ScheduledQueryProcessingSubType = oci_apm_traces.ScheduledQueryProcessingSubTypeEnum(scheduledQueryProcessingSubType.(string)) + } + + if scheduledQueryProcessingType, ok := s.D.GetOkExists("scheduled_query_processing_type"); ok { + request.ScheduledQueryProcessingType = oci_apm_traces.ScheduledQueryProcessingTypeEnum(scheduledQueryProcessingType.(string)) + } + + if scheduledQueryRetentionCriteria, ok := s.D.GetOkExists("scheduled_query_retention_criteria"); ok { + request.ScheduledQueryRetentionCriteria = oci_apm_traces.ScheduledQueryRetentionCriteriaEnum(scheduledQueryRetentionCriteria.(string)) + } + + if scheduledQueryRetentionPeriodInMs, ok := s.D.GetOkExists("scheduled_query_retention_period_in_ms"); ok { + tmp := scheduledQueryRetentionPeriodInMs.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return fmt.Errorf("unable to convert scheduledQueryRetentionPeriodInMs string: %s to an int64 and encountered error: %v", tmp, err) + } + request.ScheduledQueryRetentionPeriodInMs = &tmpInt64 + } + + if scheduledQuerySchedule, ok := s.D.GetOkExists("scheduled_query_schedule"); ok { + tmp := scheduledQuerySchedule.(string) + request.ScheduledQuerySchedule = &tmp + } + + if scheduledQueryText, ok := s.D.GetOkExists("scheduled_query_text"); ok { + tmp := scheduledQueryText.(string) + request.ScheduledQueryText = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apm_traces") + + response, err := s.Client.CreateScheduledQuery(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ScheduledQuery + return nil +} + +func (s *ApmTracesScheduledQueryResourceCrud) Get() error { + + request := oci_apm_traces.GetScheduledQueryRequest{} + + apmDomainId, scheduledQueryId, err := parseScheduledQueryCompositeId(s.D.Id()) + if err == nil { + request.ScheduledQueryId = &scheduledQueryId + request.ApmDomainId = &apmDomainId + } else { + log.Printf("[WARN] Get() unable to parse current ID: %s", s.D.Id()) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apm_traces") + + response, err := s.Client.GetScheduledQuery(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ScheduledQuery + return nil +} + +func (s *ApmTracesScheduledQueryResourceCrud) Update() error { + request := oci_apm_traces.UpdateScheduledQueryRequest{} + + apmDomainId, scheduledQueryId, err := parseScheduledQueryCompositeId(s.D.Id()) + if err == nil { + request.ScheduledQueryId = &scheduledQueryId + request.ApmDomainId = &apmDomainId + } else { + log.Printf("[WARN] Get() unable to parse current ID: %s", s.D.Id()) + } + + 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 freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if opcDryRun, ok := s.D.GetOkExists("opc_dry_run"); ok { + tmp := opcDryRun.(string) + request.OpcDryRun = &tmp + } + + if scheduledQueryDescription, ok := s.D.GetOkExists("scheduled_query_description"); ok { + tmp := scheduledQueryDescription.(string) + request.ScheduledQueryDescription = &tmp + } + + /*tmp := s.D.Id() + request.ScheduledQueryId = &tmp*/ + + if scheduledQueryMaximumRuntimeInSeconds, ok := s.D.GetOkExists("scheduled_query_maximum_runtime_in_seconds"); ok { + tmp := scheduledQueryMaximumRuntimeInSeconds.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return fmt.Errorf("unable to convert scheduledQueryMaximumRuntimeInSeconds string: %s to an int64 and encountered error: %v", tmp, err) + } + request.ScheduledQueryMaximumRuntimeInSeconds = &tmpInt64 + } + + if scheduledQueryName, ok := s.D.GetOkExists("scheduled_query_name"); ok { + tmp := scheduledQueryName.(string) + request.ScheduledQueryName = &tmp + } + + /*if scheduledQueryProcessingConfiguration, ok := s.D.GetOkExists("scheduled_query_processing_configuration"); ok { + if tmpList := scheduledQueryProcessingConfiguration.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "scheduled_query_processing_configuration", 0) + tmp, err := s.mapToScheduledQueryProcessingConfig(fieldKeyFormat) + if err != nil { + return err + } + request.ScheduledQueryProcessingConfiguration = &tmp + } + } + + if scheduledQueryProcessingSubType, ok := s.D.GetOkExists("scheduled_query_processing_sub_type"); ok { + request.ScheduledQueryProcessingSubType = oci_apm_traces.ScheduledQueryProcessingSubTypeEnum(scheduledQueryProcessingSubType.(string)) + } + + if scheduledQueryProcessingType, ok := s.D.GetOkExists("scheduled_query_processing_type"); ok { + request.ScheduledQueryProcessingType = oci_apm_traces.ScheduledQueryProcessingTypeEnum(scheduledQueryProcessingType.(string)) + } + + if scheduledQueryRetentionCriteria, ok := s.D.GetOkExists("scheduled_query_retention_criteria"); ok { + request.ScheduledQueryRetentionCriteria = oci_apm_traces.ScheduledQueryRetentionCriteriaEnum(scheduledQueryRetentionCriteria.(string)) + } + + if scheduledQueryRetentionPeriodInMs, ok := s.D.GetOkExists("scheduled_query_retention_period_in_ms"); ok { + tmp := scheduledQueryRetentionPeriodInMs.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return fmt.Errorf("unable to convert scheduledQueryRetentionPeriodInMs string: %s to an int64 and encountered error: %v", tmp, err) + } + request.ScheduledQueryRetentionPeriodInMs = &tmpInt64 + }*/ + + /*if scheduledQuerySchedule, ok := s.D.GetOkExists("scheduled_query_schedule"); ok { + tmp := scheduledQuerySchedule.(string) + request.ScheduledQuerySchedule = &tmp + }*/ + + /*if scheduledQueryText, ok := s.D.GetOkExists("scheduled_query_text"); ok { + tmp := scheduledQueryText.(string) + request.ScheduledQueryText = &tmp + }*/ + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apm_traces") + + response, err := s.Client.UpdateScheduledQuery(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ScheduledQuery + return nil +} + +func (s *ApmTracesScheduledQueryResourceCrud) Delete() error { + request := oci_apm_traces.DeleteScheduledQueryRequest{} + + if tmp := s.D.Id(); tmp != "" { + apmDomainId, scheduledQueryId, err := parseScheduledQueryCompositeId(s.D.Id()) + if err == nil { + request.ScheduledQueryId = &scheduledQueryId + request.ApmDomainId = &apmDomainId + } else { + log.Printf("[WARN] Get() unable to parse current ID: %s", s.D.Id()) + } + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "apm_traces") + + _, err := s.Client.DeleteScheduledQuery(context.Background(), request) + return err +} + +func (s *ApmTracesScheduledQueryResourceCrud) SetData() error { + + apmDomainId, scheduledQueryId, err := parseScheduledQueryCompositeId(s.D.Id()) + if err == nil { + } else { + log.Printf("[WARN] SetData() unable to parse current ID: %s and apmDomain ID: %s", scheduledQueryId, apmDomainId) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.ScheduledQueryDescription != nil { + s.D.Set("scheduled_query_description", *s.Res.ScheduledQueryDescription) + } + + if s.Res.ScheduledQueryInstances != nil { + s.D.Set("scheduled_query_instances", *s.Res.ScheduledQueryInstances) + } + + if s.Res.ScheduledQueryMaximumRuntimeInSeconds != nil { + s.D.Set("scheduled_query_maximum_runtime_in_seconds", strconv.FormatInt(*s.Res.ScheduledQueryMaximumRuntimeInSeconds, 10)) + } + + if s.Res.ScheduledQueryName != nil { + s.D.Set("scheduled_query_name", *s.Res.ScheduledQueryName) + } + + if s.Res.ScheduledQueryNextRunInMs != nil { + s.D.Set("scheduled_query_next_run_in_ms", strconv.FormatInt(*s.Res.ScheduledQueryNextRunInMs, 10)) + } + + if s.Res.ScheduledQueryProcessingConfiguration != nil { + s.D.Set("scheduled_query_processing_configuration", []interface{}{ScheduledQueryProcessingConfigToMap(s.Res.ScheduledQueryProcessingConfiguration)}) + } else { + s.D.Set("scheduled_query_processing_configuration", nil) + } + + s.D.Set("scheduled_query_processing_sub_type", s.Res.ScheduledQueryProcessingSubType) + + s.D.Set("scheduled_query_processing_type", s.Res.ScheduledQueryProcessingType) + + s.D.Set("scheduled_query_retention_criteria", s.Res.ScheduledQueryRetentionCriteria) + + if s.Res.ScheduledQueryRetentionPeriodInMs != nil { + s.D.Set("scheduled_query_retention_period_in_ms", strconv.FormatInt(*s.Res.ScheduledQueryRetentionPeriodInMs, 10)) + } + + if s.Res.ScheduledQuerySchedule != nil { + s.D.Set("scheduled_query_schedule", *s.Res.ScheduledQuerySchedule) + } + + if s.Res.ScheduledQueryText != nil { + s.D.Set("scheduled_query_text", *s.Res.ScheduledQueryText) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + return nil +} + +func GetScheduledQueryCompositeId(apmDomainId string, scheduledQueryId string) string { + apmDomainId = url.PathEscape(apmDomainId) + scheduledQueryId = url.PathEscape(scheduledQueryId) + compositeId := "scheduledQueries/" + scheduledQueryId + "/apmDomainId/" + apmDomainId + return compositeId +} + +func parseScheduledQueryCompositeId(compositeId string) (apmDomainId string, scheduledQueryId string, err error) { + parts := strings.Split(compositeId, "/") + match, _ := regexp.MatchString("scheduledQueries/.*/apmDomainId/.*", compositeId) + if !match || len(parts) != 4 { + err = fmt.Errorf("illegal compositeId %s encountered", compositeId) + return + } + scheduledQueryId, _ = url.PathUnescape(parts[1]) + apmDomainId, _ = url.PathUnescape(parts[3]) + + return +} + +func (s *ApmTracesScheduledQueryResourceCrud) mapToCustomMetric(fieldKeyFormat string) (oci_apm_traces.CustomMetric, error) { + result := oci_apm_traces.CustomMetric{} + + if compartment, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "compartment")); ok { + tmp := compartment.(string) + result.Compartment = &tmp + } + + if description, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "description")); ok { + tmp := description.(string) + result.Description = &tmp + } + + if isAnomalyDetectionEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_anomaly_detection_enabled")); ok { + tmp := isAnomalyDetectionEnabled.(bool) + result.IsAnomalyDetectionEnabled = &tmp + } + + if isMetricPublished, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_metric_published")); ok { + tmp := isMetricPublished.(bool) + result.IsMetricPublished = &tmp + } + + if name, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "name")); ok { + tmp := name.(string) + result.Name = &tmp + } + + if namespace, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "namespace")); ok { + tmp := namespace.(string) + result.Namespace = &tmp + } + + if resourceGroup, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "resource_group")); ok { + tmp := resourceGroup.(string) + result.ResourceGroup = &tmp + } + + if unit, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "unit")); ok { + tmp := unit.(string) + result.Unit = &tmp + } + + return result, nil +} + +func CustomMetricToMap(obj *oci_apm_traces.CustomMetric) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Compartment != nil { + result["compartment"] = string(*obj.Compartment) + } + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + if obj.IsAnomalyDetectionEnabled != nil { + result["is_anomaly_detection_enabled"] = bool(*obj.IsAnomalyDetectionEnabled) + } + + if obj.IsMetricPublished != nil { + result["is_metric_published"] = bool(*obj.IsMetricPublished) + } + + if obj.Name != nil { + result["name"] = string(*obj.Name) + } + + if obj.Namespace != nil { + result["namespace"] = string(*obj.Namespace) + } + + if obj.ResourceGroup != nil { + result["resource_group"] = string(*obj.ResourceGroup) + } + + if obj.Unit != nil { + result["unit"] = string(*obj.Unit) + } + + return result +} + +func (s *ApmTracesScheduledQueryResourceCrud) mapToObjectStorage(fieldKeyFormat string) (oci_apm_traces.ObjectStorage, error) { + result := oci_apm_traces.ObjectStorage{} + + if bucket, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "bucket")); ok { + tmp := bucket.(string) + result.BucketName = &tmp + } + + if nameSpace, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "name_space")); ok { + tmp := nameSpace.(string) + result.NameSpace = &tmp + } + + if objectNamePrefix, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "object_name_prefix")); ok { + tmp := objectNamePrefix.(string) + result.ObjectNamePrefix = &tmp + } + + return result, nil +} + +func ObjectStorageToMap(obj *oci_apm_traces.ObjectStorage) map[string]interface{} { + result := map[string]interface{}{} + + if obj.BucketName != nil { + result["bucket"] = string(*obj.BucketName) + } + + if obj.NameSpace != nil { + result["name_space"] = string(*obj.NameSpace) + } + + if obj.ObjectNamePrefix != nil { + result["object_name_prefix"] = string(*obj.ObjectNamePrefix) + } + + return result +} + +func (s *ApmTracesScheduledQueryResourceCrud) mapToScheduledQueryProcessingConfig(fieldKeyFormat string) (oci_apm_traces.ScheduledQueryProcessingConfig, error) { + result := oci_apm_traces.ScheduledQueryProcessingConfig{} + + if customMetric, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "custom_metric")); ok { + if tmpList := customMetric.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "custom_metric"), 0) + tmp, err := s.mapToCustomMetric(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert custom_metric, encountered error: %v", err) + } + result.CustomMetric = &tmp + } + } + + if objectStorage, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "object_storage")); ok { + if tmpList := objectStorage.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "object_storage"), 0) + tmp, err := s.mapToObjectStorage(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert object_storage, encountered error: %v", err) + } + result.ObjectStorage = &tmp + } + } + + if streaming, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "streaming")); ok { + if tmpList := streaming.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "streaming"), 0) + tmp, err := s.mapToStreaming(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert streaming, encountered error: %v", err) + } + result.Streaming = &tmp + } + } + + return result, nil +} + +func ScheduledQueryProcessingConfigToMap(obj *oci_apm_traces.ScheduledQueryProcessingConfig) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CustomMetric != nil { + result["custom_metric"] = []interface{}{CustomMetricToMap(obj.CustomMetric)} + } + + if obj.ObjectStorage != nil { + result["object_storage"] = []interface{}{ObjectStorageToMap(obj.ObjectStorage)} + } + + if obj.Streaming != nil { + result["streaming"] = []interface{}{StreamingToMap(obj.Streaming)} + } + + return result +} + +func ScheduledQuerySummaryToMap(obj oci_apm_traces.ScheduledQuerySummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.ScheduledQueryInstances != nil { + result["scheduled_query_instances"] = string(*obj.ScheduledQueryInstances) + } + + if obj.ScheduledQueryName != nil { + result["scheduled_query_name"] = string(*obj.ScheduledQueryName) + } + + if obj.ScheduledQueryNextRunInMs != nil { + result["scheduled_query_next_run_in_ms"] = strconv.FormatInt(*obj.ScheduledQueryNextRunInMs, 10) + } + + if obj.ScheduledQueryProcessingConfiguration != nil { + result["scheduled_query_processing_configuration"] = []interface{}{ScheduledQueryProcessingConfigToMap(obj.ScheduledQueryProcessingConfiguration)} + } + + result["scheduled_query_processing_sub_type"] = string(obj.ScheduledQueryProcessingSubType) + + result["scheduled_query_processing_type"] = string(obj.ScheduledQueryProcessingType) + + result["scheduled_query_retention_criteria"] = string(obj.ScheduledQueryRetentionCriteria) + + if obj.ScheduledQuerySchedule != nil { + result["scheduled_query_schedule"] = string(*obj.ScheduledQuerySchedule) + } + + if obj.ScheduledQueryText != nil { + result["scheduled_query_text"] = string(*obj.ScheduledQueryText) + } + + result["state"] = string(obj.LifecycleState) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + return result +} + +func (s *ApmTracesScheduledQueryResourceCrud) mapToStreaming(fieldKeyFormat string) (oci_apm_traces.Streaming, error) { + result := oci_apm_traces.Streaming{} + + if streamId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "stream_id")); ok { + tmp := streamId.(string) + result.StreamId = &tmp + } + + return result, nil +} + +func StreamingToMap(obj *oci_apm_traces.Streaming) map[string]interface{} { + result := map[string]interface{}{} + + if obj.StreamId != nil { + result["stream_id"] = string(*obj.StreamId) + } + + return result +} diff --git a/internal/service/apm_traces/register_datasource.go b/internal/service/apm_traces/register_datasource.go index 71e1307d596..0275a3d6453 100644 --- a/internal/service/apm_traces/register_datasource.go +++ b/internal/service/apm_traces/register_datasource.go @@ -6,7 +6,11 @@ package apm_traces import "github.com/oracle/terraform-provider-oci/internal/tfresource" func RegisterDatasource() { + tfresource.RegisterDatasource("oci_apm_traces_attribute_auto_activate_status", ApmTracesAttributeAutoActivateStatusDataSource()) + tfresource.RegisterDatasource("oci_apm_traces_log", ApmTracesLogDataSource()) tfresource.RegisterDatasource("oci_apm_traces_query_quick_picks", ApmTracesQueryQuickPicksDataSource()) + tfresource.RegisterDatasource("oci_apm_traces_scheduled_queries", ApmTracesScheduledQueriesDataSource()) + tfresource.RegisterDatasource("oci_apm_traces_scheduled_query", ApmTracesScheduledQueryDataSource()) tfresource.RegisterDatasource("oci_apm_traces_trace", ApmTracesTraceDataSource()) tfresource.RegisterDatasource("oci_apm_traces_trace_aggregated_snapshot_data", ApmTracesTraceAggregatedSnapshotDataDataSource()) tfresource.RegisterDatasource("oci_apm_traces_trace_snapshot_data", ApmTracesTraceSnapshotDataDataSource()) diff --git a/internal/service/apm_traces/register_resource.go b/internal/service/apm_traces/register_resource.go index df3c29c5d3a..21f28befef8 100644 --- a/internal/service/apm_traces/register_resource.go +++ b/internal/service/apm_traces/register_resource.go @@ -3,5 +3,8 @@ package apm_traces +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + func RegisterResource() { + tfresource.RegisterResource("oci_apm_traces_scheduled_query", ApmTracesScheduledQueryResource()) } diff --git a/internal/service/core/core_route_table_resource.go b/internal/service/core/core_route_table_resource.go index 7220a6b67c4..cdcc06bba75 100644 --- a/internal/service/core/core_route_table_resource.go +++ b/internal/service/core/core_route_table_resource.go @@ -444,6 +444,9 @@ func RouteRuleToMap(obj oci_core.RouteRule) map[string]interface{} { result["network_entity_id"] = string(*obj.NetworkEntityId) } + if obj.RouteType != "" { + result["route_type"] = string(obj.RouteType) + } return result } @@ -480,10 +483,14 @@ func routeRulesHashCodeForSets(v interface{}) int { buf.WriteString(fmt.Sprintf("%v-", networkEntityId)) } - if routeType, ok := m["route_type"]; ok && routeType != "" { - buf.WriteString(fmt.Sprintf("%v-", routeType)) + routeType := "" + if val, ok := m["route_type"]; ok && val != "" { + routeType = val.(string) } - + if routeType == "" { + routeType = "STATIC" // normalize default + } + buf.WriteString(fmt.Sprintf("%v-", routeType)) return utils.GetStringHashcode(buf.String()) } diff --git a/internal/service/core/core_vcn_resource.go b/internal/service/core/core_vcn_resource.go index 2a86bea646c..c5da838b113 100644 --- a/internal/service/core/core_vcn_resource.go +++ b/internal/service/core/core_vcn_resource.go @@ -597,10 +597,10 @@ func (s *CoreVcnResourceCrud) SetData() error { s.D.Set("security_attributes", tfresource.SecurityAttributesToMap(s.Res.SecurityAttributes)) - if s.Res.Ipv6CidrBlocks != nil && len(s.Res.Ipv6CidrBlocks) > 0 { + if (s.Res.Ipv6CidrBlocks != nil && len(s.Res.Ipv6CidrBlocks) > 0) || (s.Res.Ipv6PrivateCidrBlocks != nil && len(s.Res.Ipv6PrivateCidrBlocks) > 0) { s.D.Set("is_ipv6enabled", true) } else { - s.D.Set("is_ipv6enabled", nil) + s.D.Set("is_ipv6enabled", false) } s.D.Set("state", s.Res.LifecycleState) diff --git a/internal/service/database/database_autonomous_database_resource.go b/internal/service/database/database_autonomous_database_resource.go index e24d50cf290..762103e6841 100644 --- a/internal/service/database/database_autonomous_database_resource.go +++ b/internal/service/database/database_autonomous_database_resource.go @@ -2281,7 +2281,7 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) Update() error { } } - if secretId, ok := s.D.GetOkExists("secret_id"); ok && s.D.HasChange("secret_version_number") { + if secretId, ok := s.D.GetOkExists("secret_id"); ok && s.D.HasChange("secret_id") { tmp := secretId.(string) request.SecretId = &tmp if _, ok := s.D.GetOkExists("freeform_tags"); ok && !s.D.HasChange("freeform_tags") { @@ -6313,9 +6313,8 @@ func (s *DatabaseAutonomousDatabaseResourceCrud) validateSwitchoverDatabase() er newId := strings.ToLower(strings.TrimSpace(newIdRaw.(string))) if newId != "" { - _, dgRegionTypeExists := s.D.GetOkExists("dataguard_region_type") _, dgRoleExists := s.D.GetOkExists("role") - if !dgRegionTypeExists || !dgRoleExists { + if !dgRoleExists { return fmt.Errorf("Autonomous Data Guard not found in enabled state") } diff --git a/internal/service/datascience/datascience_export.go b/internal/service/datascience/datascience_export.go index f14ef25d839..69c21edd482 100644 --- a/internal/service/datascience/datascience_export.go +++ b/internal/service/datascience/datascience_export.go @@ -199,6 +199,33 @@ var exportDatascienceMlApplicationHints = &tf_export.TerraformResourceHints{ }, } +var exportDatascienceModelGroupVersionHistoryHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_datascience_model_group_version_history", + DatasourceClass: "oci_datascience_model_group_version_histories", + DatasourceItemsAttr: "model_group_version_histories", + ResourceAbbreviation: "model_group_version_history", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_datascience.ModelGroupVersionHistoryLifecycleStateActive), + }, +} + +var exportDatascienceModelGroupArtifactHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_datascience_model_group_artifact", + ResourceAbbreviation: "model_group_artifact", +} + +var exportDatascienceModelGroupHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_datascience_model_group", + DatasourceClass: "oci_datascience_model_groups", + DatasourceItemsAttr: "model_groups", + ResourceAbbreviation: "model_group", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_datascience.ModelGroupLifecycleStateActive), + }, +} + var datascienceResourceGraph = tf_export.TerraformResourceGraph{ "oci_identity_compartment": { {TerraformResourceHints: exportDatascienceProjectHints}, @@ -216,6 +243,8 @@ var datascienceResourceGraph = tf_export.TerraformResourceGraph{ {TerraformResourceHints: exportDatascienceMlApplicationImplementationHints}, {TerraformResourceHints: exportDatascienceMlApplicationInstanceHints}, {TerraformResourceHints: exportDatascienceMlApplicationHints}, + {TerraformResourceHints: exportDatascienceModelGroupVersionHistoryHints}, + {TerraformResourceHints: exportDatascienceModelGroupHints}, }, "oci_datascience_model": { { diff --git a/internal/service/datascience/datascience_job_resource.go b/internal/service/datascience/datascience_job_resource.go index 94e0c55970f..2ea49535de0 100644 --- a/internal/service/datascience/datascience_job_resource.go +++ b/internal/service/datascience/datascience_job_resource.go @@ -123,6 +123,11 @@ func DatascienceJobResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -1086,6 +1091,10 @@ func JobLogConfigurationDetailsToMap(obj *oci_datascience.JobLogConfigurationDet func (s *DatascienceJobResourceCrud) mapToJobShapeConfigDetails(fieldKeyFormat string) (oci_datascience.JobShapeConfigDetails, error) { result := oci_datascience.JobShapeConfigDetails{} + if cpuBaseline, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "cpu_baseline")); ok { + result.CpuBaseline = oci_datascience.JobShapeConfigDetailsCpuBaselineEnum(cpuBaseline.(string)) + } + if memoryInGBs, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "memory_in_gbs")); ok { tmp := float32(memoryInGBs.(float64)) result.MemoryInGBs = &tmp @@ -1102,6 +1111,8 @@ func (s *DatascienceJobResourceCrud) mapToJobShapeConfigDetails(fieldKeyFormat s func JobShapeConfigDetailsToMap(obj *oci_datascience.JobShapeConfigDetails) map[string]interface{} { result := map[string]interface{}{} + result["cpu_baseline"] = string(obj.CpuBaseline) + if obj.MemoryInGBs != nil { result["memory_in_gbs"] = float32(*obj.MemoryInGBs) } diff --git a/internal/service/datascience/datascience_job_run_resource.go b/internal/service/datascience/datascience_job_run_resource.go index e7ea8c83649..47efecf9029 100644 --- a/internal/service/datascience/datascience_job_run_resource.go +++ b/internal/service/datascience/datascience_job_run_resource.go @@ -257,6 +257,10 @@ func DatascienceJobRunResource() *schema.Resource { // Optional // Computed + "cpu_baseline": { + Type: schema.TypeString, + Computed: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Computed: true, @@ -845,6 +849,10 @@ func JobRunLogDetailsToMap(obj *oci_datascience.JobRunLogDetails) map[string]int func (s *DatascienceJobRunResourceCrud) mapToJobShapeConfigDetails(fieldKeyFormat string) (oci_datascience.JobShapeConfigDetails, error) { result := oci_datascience.JobShapeConfigDetails{} + if cpuBaseline, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "cpu_baseline")); ok { + result.CpuBaseline = oci_datascience.JobShapeConfigDetailsCpuBaselineEnum(cpuBaseline.(string)) + } + if memoryInGBs, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "memory_in_gbs")); ok { tmp := memoryInGBs.(float32) result.MemoryInGBs = &tmp diff --git a/internal/service/datascience/datascience_model_deployment_model_states_data_source.go b/internal/service/datascience/datascience_model_deployment_model_states_data_source.go new file mode 100644 index 00000000000..a6f0b7972e8 --- /dev/null +++ b/internal/service/datascience/datascience_model_deployment_model_states_data_source.go @@ -0,0 +1,222 @@ +// Copyright (c) 2017, 2024, 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 DatascienceModelDeploymentModelStatesDataSource() *schema.Resource { + return &schema.Resource{ + Read: readDatascienceModelDeploymentModelStates, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "inference_key": { + Type: schema.TypeString, + Optional: true, + }, + "model_deployment_id": { + Type: schema.TypeString, + Required: true, + }, + "model_id": { + Type: schema.TypeString, + Optional: true, + }, + "project_id": { + Type: schema.TypeString, + Optional: true, + }, + "model_deployment_model_states": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "inference_key": { + Type: schema.TypeString, + Computed: true, + }, + "model_id": { + Type: schema.TypeString, + Computed: true, + }, + "project_id": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + }, + }, + }, + }, + } +} + +func readDatascienceModelDeploymentModelStates(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelDeploymentModelStatesDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceModelDeploymentModelStatesDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.ListModelDeploymentModelStatesResponse +} + +func (s *DatascienceModelDeploymentModelStatesDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceModelDeploymentModelStatesDataSourceCrud) Get() error { + request := oci_datascience.ListModelDeploymentModelStatesRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if inferenceKey, ok := s.D.GetOkExists("inference_key"); ok { + tmp := inferenceKey.(string) + request.InferenceKey = &tmp + } + + if modelDeploymentId, ok := s.D.GetOkExists("model_id"); ok { + tmp := modelDeploymentId.(string) + request.ModelDeploymentId = &tmp + } + + if modelId, ok := s.D.GetOkExists("model_id"); ok { + tmp := modelId.(string) + request.ModelId = &tmp + } + + if projectId, ok := s.D.GetOkExists("project_id"); ok { + tmp := projectId.(string) + request.ProjectId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.ListModelDeploymentModelStates(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListModelDeploymentModelStates(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 *DatascienceModelDeploymentModelStatesDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("DatascienceModelDeploymentModelStatesDataSource-", DatascienceModelDeploymentModelStatesDataSource(), s.D)) + resources := []map[string]interface{}{} + + for _, r := range s.Res.Items { + modelDeploymentModelState := map[string]interface{}{} + + if r.DefinedTags != nil { + modelDeploymentModelState["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) + } + + if r.DisplayName != nil { + modelDeploymentModelState["display_name"] = *r.DisplayName + } + + modelDeploymentModelState["freeform_tags"] = r.FreeformTags + + if r.InferenceKey != nil { + modelDeploymentModelState["inference_key"] = *r.InferenceKey + } + + if r.ModelId != nil { + modelDeploymentModelState["model_id"] = *r.ModelId + } + + if r.ProjectId != nil { + modelDeploymentModelState["project_id"] = *r.ProjectId + } + + modelDeploymentModelState["state"] = r.State + + if r.SystemTags != nil { + modelDeploymentModelState["system_tags"] = tfresource.SystemTagsToMap(r.SystemTags) + } + + resources = append(resources, modelDeploymentModelState) + } + + if f, fOk := s.D.GetOkExists("filter"); fOk { + resources = tfresource.ApplyFilters(f.(*schema.Set), resources, DatascienceModelDeploymentModelStatesDataSource().Schema["model_deployment_model_states"].Elem.(*schema.Resource).Schema) + } + + if err := s.D.Set("model_deployment_model_states", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/datascience/datascience_model_deployment_resource.go b/internal/service/datascience/datascience_model_deployment_resource.go index 380b3ac6726..e36ca9de317 100644 --- a/internal/service/datascience/datascience_model_deployment_resource.go +++ b/internal/service/datascience/datascience_model_deployment_resource.go @@ -54,31 +54,386 @@ func DatascienceModelDeploymentResource() *schema.Resource { Required: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ + "MODEL_GROUP", "SINGLE_MODEL", }, true), }, + + // Optional + "environment_configuration_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "environment_configuration_type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "DEFAULT", + "OCIR_CONTAINER", + }, true), + }, + + // Optional + "cmd": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "entrypoint": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "environment_variables": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + Elem: schema.TypeString, + }, + "health_check_port": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "image": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "image_digest": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "server_port": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + "infrastructure_configuration_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "infrastructure_type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "INSTANCE_POOL", + }, true), + }, + "instance_configuration": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "instance_shape_name": { + Type: schema.TypeString, + Required: true, + }, + + // Optional + "model_deployment_instance_shape_config_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "memory_in_gbs": { + Type: schema.TypeFloat, + Optional: true, + Computed: true, + }, + "ocpus": { + Type: schema.TypeFloat, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + "private_endpoint_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "subnet_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + + // Optional + "bandwidth_mbps": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "maximum_bandwidth_mbps": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "scaling_policy": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "policy_type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "AUTOSCALING", + "FIXED_SIZE", + }, true), + }, + + // Optional + "auto_scaling_policies": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "auto_scaling_policy_type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "THRESHOLD", + }, true), + }, + "initial_instance_count": { + Type: schema.TypeInt, + Required: true, + }, + "maximum_instance_count": { + Type: schema.TypeInt, + Required: true, + }, + "minimum_instance_count": { + Type: schema.TypeInt, + Required: true, + }, + "rules": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "metric_expression_rule_type": { + Type: schema.TypeString, + Required: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "CUSTOM_EXPRESSION", + "PREDEFINED_EXPRESSION", + }, true), + }, + "scale_in_configuration": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "instance_count_adjustment": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "pending_duration": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "query": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scaling_configuration_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "threshold": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + "scale_out_configuration": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "instance_count_adjustment": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "pending_duration": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "query": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "scaling_configuration_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "threshold": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + + // Optional + "metric_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + + // Optional + + // Computed + }, + }, + }, + "cool_down_in_seconds": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "instance_count": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + "is_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, "model_configuration_details": { Type: schema.TypeList, - Required: true, + Optional: true, + Computed: true, MaxItems: 1, MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required + + // Optional + "bandwidth_mbps": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, "instance_configuration": { Type: schema.TypeList, - Required: true, + Optional: true, + Computed: true, MaxItems: 1, MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required + + // Optional "instance_shape_name": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, }, - - // Optional "model_deployment_instance_shape_config_details": { Type: schema.TypeList, Optional: true, @@ -125,19 +480,13 @@ func DatascienceModelDeploymentResource() *schema.Resource { }, }, }, - "model_id": { - Type: schema.TypeString, - Required: true, - }, - - // Optional - "bandwidth_mbps": { + "maximum_bandwidth_mbps": { Type: schema.TypeInt, Optional: true, Computed: true, }, - "maximum_bandwidth_mbps": { - Type: schema.TypeInt, + "model_id": { + Type: schema.TypeString, Optional: true, Computed: true, }, @@ -327,9 +676,7 @@ func DatascienceModelDeploymentResource() *schema.Resource { }, }, }, - - // Optional - "environment_configuration_details": { + "model_group_configuration_details": { Type: schema.TypeList, Optional: true, Computed: true, @@ -338,59 +685,13 @@ func DatascienceModelDeploymentResource() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required - "environment_configuration_type": { - Type: schema.TypeString, - Required: true, - DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, - ValidateFunc: validation.StringInSlice([]string{ - "DEFAULT", - "OCIR_CONTAINER", - }, true), - }, // Optional - "cmd": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "entrypoint": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - }, - }, - "environment_variables": { - Type: schema.TypeMap, - Optional: true, - Computed: true, - Elem: schema.TypeString, - }, - "health_check_port": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, - "image": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - "image_digest": { + "model_group_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "server_port": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - }, // Computed }, @@ -1289,6 +1590,135 @@ func CustomExpressionQueryScalingConfigurationToMap(obj *oci_datascience.CustomE return result } +func (s *DatascienceModelDeploymentResourceCrud) mapToInfrastructureConfigurationDetails(fieldKeyFormat string) (oci_datascience.InfrastructureConfigurationDetails, error) { + var baseObject oci_datascience.InfrastructureConfigurationDetails + //discriminator + infrastructureTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "infrastructure_type")) + var infrastructureType string + if ok { + infrastructureType = infrastructureTypeRaw.(string) + } else { + infrastructureType = "" // default value + } + switch strings.ToLower(infrastructureType) { + case strings.ToLower("INSTANCE_POOL"): + details := oci_datascience.UpdateInstancePoolInfrastructureConfigurationDetails{} + if bandwidthMbps, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "bandwidth_mbps")); ok { + tmp := bandwidthMbps.(int) + details.BandwidthMbps = &tmp + } + if instanceConfiguration, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "instance_configuration")); ok { + if tmpList := instanceConfiguration.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "instance_configuration"), 0) + tmp, err := s.mapToInstanceConfiguration(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert instance_configuration, encountered error: %v", err) + } + details.InstanceConfiguration = &tmp + } + } + if maximumBandwidthMbps, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "maximum_bandwidth_mbps")); ok { + tmp := maximumBandwidthMbps.(int) + details.MaximumBandwidthMbps = &tmp + } + if scalingPolicy, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "scaling_policy")); ok { + if tmpList := scalingPolicy.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "scaling_policy"), 0) + tmp, err := s.mapToScalingPolicy(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert scaling_policy, encountered error: %v", err) + } + details.ScalingPolicy = tmp + } + } + baseObject = details + default: + return nil, fmt.Errorf("unknown infrastructure_type '%v' was specified", infrastructureType) + } + return baseObject, nil +} + +func (s *DatascienceModelDeploymentResourceCrud) mapToUpdateInfrastructureConfigurationDetails(fieldKeyFormat string) (oci_datascience.UpdateInfrastructureConfigurationDetails, error) { + var baseObject oci_datascience.UpdateInfrastructureConfigurationDetails + //discriminator + infrastructureTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "infrastructure_type")) + var infrastructureType string + if ok { + infrastructureType = infrastructureTypeRaw.(string) + } else { + infrastructureType = "" // default value + } + switch strings.ToLower(infrastructureType) { + case strings.ToLower("INSTANCE_POOL"): + details := oci_datascience.UpdateInstancePoolInfrastructureConfigurationDetails{} + if bandwidthMbps, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "bandwidth_mbps")); ok { + tmp := bandwidthMbps.(int) + details.BandwidthMbps = &tmp + } + if instanceConfiguration, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "instance_configuration")); ok { + if tmpList := instanceConfiguration.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "instance_configuration"), 0) + tmp, err := s.mapToInstanceConfiguration(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert instance_configuration, encountered error: %v", err) + } + details.InstanceConfiguration = &tmp + } + } + if maximumBandwidthMbps, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "maximum_bandwidth_mbps")); ok { + tmp := maximumBandwidthMbps.(int) + details.MaximumBandwidthMbps = &tmp + } + if scalingPolicy, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "scaling_policy")); ok { + if tmpList := scalingPolicy.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "scaling_policy"), 0) + tmp, err := s.mapToScalingPolicy(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert scaling_policy, encountered error: %v", err) + } + details.ScalingPolicy = tmp + } + } + baseObject = details + default: + return nil, fmt.Errorf("unknown infrastructure_type '%v' was specified", infrastructureType) + } + return baseObject, nil +} + +func InfrastructureConfigurationDetailsToMap(obj *oci_datascience.InfrastructureConfigurationDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_datascience.UpdateInstancePoolInfrastructureConfigurationDetails: + result["infrastructure_type"] = "INSTANCE_POOL" + + if v.BandwidthMbps != nil { + result["bandwidth_mbps"] = int(*v.BandwidthMbps) + } + + if v.InstanceConfiguration != nil { + result["instance_configuration"] = []interface{}{InstanceConfigurationToMap(v.InstanceConfiguration)} + } + + if v.MaximumBandwidthMbps != nil { + result["maximum_bandwidth_mbps"] = int(*v.MaximumBandwidthMbps) + } + + if v.ScalingPolicy != nil { + scalingPolicyArray := []interface{}{} + if scalingPolicyMap := ScalingPolicyToMap(&v.ScalingPolicy); scalingPolicyMap != nil { + scalingPolicyArray = append(scalingPolicyArray, scalingPolicyMap) + } + result["scaling_policy"] = scalingPolicyArray + } + default: + log.Printf("[WARN] Received 'infrastructure_type' of unknown type %v", *obj) + return nil + } + + return result +} + func (s *DatascienceModelDeploymentResourceCrud) mapToInstanceConfiguration(fieldKeyFormat string) (oci_datascience.InstanceConfiguration, error) { result := oci_datascience.InstanceConfiguration{} @@ -1621,6 +2051,42 @@ func (s *DatascienceModelDeploymentResourceCrud) mapToModelDeploymentConfigurati deploymentType = "" // default value } switch strings.ToLower(deploymentType) { + case strings.ToLower("MODEL_GROUP"): + details := oci_datascience.UpdateModelGroupDeploymentConfigurationDetails{} + if environmentConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "environment_configuration_details")); ok { + if tmpList := environmentConfigurationDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "environment_configuration_details"), 0) + tmp, err := s.mapToUpdateModelDeploymentEnvironmentConfigurationDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert environment_configuration_details, encountered error: %v", err) + } + details.EnvironmentConfigurationDetails = tmp + } + } + if infrastructureConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "infrastructure_configuration_details")); ok { + if tmpList := infrastructureConfigurationDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "infrastructure_configuration_details"), 0) + tmp, err := s.mapToUpdateInfrastructureConfigurationDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert infrastructure_configuration_details, encountered error: %v", err) + } + details.InfrastructureConfigurationDetails = tmp + } + } + if modelGroupConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_group_configuration_details")); ok { + if tmpList := modelGroupConfigurationDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "model_group_configuration_details"), 0) + tmp, err := s.mapToUpdateModelGroupConfigurationDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert model_group_configuration_details, encountered error: %v", err) + } + details.ModelGroupConfigurationDetails = &tmp + } + } + if updateType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "update_type")); ok { + details.UpdateType = oci_datascience.UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum(updateType.(string)) + } + baseObject = details case strings.ToLower("SINGLE_MODEL"): details := oci_datascience.UpdateSingleModelDeploymentConfigurationDetails{} if environmentConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "environment_configuration_details")); ok { @@ -1661,6 +2127,42 @@ func (s *DatascienceModelDeploymentResourceCrud) mapToUpdateModelDeploymentConfi deploymentType = "" // default value } switch strings.ToLower(deploymentType) { + case strings.ToLower("MODEL_GROUP"): + details := oci_datascience.UpdateModelGroupDeploymentConfigurationDetails{} + if environmentConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "environment_configuration_details")); ok { + if tmpList := environmentConfigurationDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "environment_configuration_details"), 0) + tmp, err := s.mapToUpdateModelDeploymentEnvironmentConfigurationDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert environment_configuration_details, encountered error: %v", err) + } + details.EnvironmentConfigurationDetails = tmp + } + } + if infrastructureConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "infrastructure_configuration_details")); ok { + if tmpList := infrastructureConfigurationDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "infrastructure_configuration_details"), 0) + tmp, err := s.mapToUpdateInfrastructureConfigurationDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert infrastructure_configuration_details, encountered error: %v", err) + } + details.InfrastructureConfigurationDetails = tmp + } + } + if modelGroupConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_group_configuration_details")); ok { + if tmpList := modelGroupConfigurationDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "model_group_configuration_details"), 0) + tmp, err := s.mapToUpdateModelGroupConfigurationDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert model_group_configuration_details, encountered error: %v", err) + } + details.ModelGroupConfigurationDetails = &tmp + } + } + if updateType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "update_type")); ok { + details.UpdateType = oci_datascience.UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum(updateType.(string)) + } + baseObject = details case strings.ToLower("SINGLE_MODEL"): details := oci_datascience.UpdateSingleModelDeploymentConfigurationDetails{} if environmentConfigurationDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "environment_configuration_details")); ok { @@ -1693,6 +2195,31 @@ func (s *DatascienceModelDeploymentResourceCrud) mapToUpdateModelDeploymentConfi func ModelDeploymentConfigurationDetailsToMap(obj *oci_datascience.ModelDeploymentConfigurationDetails) map[string]interface{} { result := map[string]interface{}{} switch v := (*obj).(type) { + case oci_datascience.UpdateModelGroupDeploymentConfigurationDetails: + result["deployment_type"] = "MODEL_GROUP" + + if v.EnvironmentConfigurationDetails != nil { + environmentConfigurationDetailsArray := []interface{}{} + if environmentConfigurationDetailsMap := UpdateModelDeploymentEnvironmentConfigurationDetailsToMap(&v.EnvironmentConfigurationDetails); environmentConfigurationDetailsMap != nil { + environmentConfigurationDetailsArray = append(environmentConfigurationDetailsArray, environmentConfigurationDetailsMap) + } + result["environment_configuration_details"] = environmentConfigurationDetailsArray + } + + if v.InfrastructureConfigurationDetails != nil { + infrastructureConfigurationDetailsArray := []interface{}{} + if infrastructureConfigurationDetailsMap := UpdateInfrastructureConfigurationDetailsToMap(&v.InfrastructureConfigurationDetails); infrastructureConfigurationDetailsMap != nil { + infrastructureConfigurationDetailsArray = append(infrastructureConfigurationDetailsArray, infrastructureConfigurationDetailsMap) + } + result["infrastructure_configuration_details"] = infrastructureConfigurationDetailsArray + } + + if v.ModelGroupConfigurationDetails != nil { + result["model_group_configuration_details"] = []interface{}{UpdateModelGroupConfigurationDetailsToMap(v.ModelGroupConfigurationDetails)} + } + + result["update_type"] = string(v.UpdateType) + case oci_datascience.UpdateSingleModelDeploymentConfigurationDetails: case oci_datascience.SingleModelDeploymentConfigurationDetails: result["deployment_type"] = "SINGLE_MODEL" @@ -1955,6 +2482,38 @@ func ModelDeploymentSystemDataToMap(obj *oci_datascience.ModelDeploymentSystemDa return result } +func (s *DatascienceModelDeploymentResourceCrud) mapToModelGroupConfigurationDetails(fieldKeyFormat string) (oci_datascience.ModelGroupConfigurationDetails, error) { + result := oci_datascience.ModelGroupConfigurationDetails{} + + if modelGroupId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_group_id")); ok { + tmp := modelGroupId.(string) + result.ModelGroupId = &tmp + } + + return result, nil +} + +func (s *DatascienceModelDeploymentResourceCrud) mapToUpdateModelGroupConfigurationDetails(fieldKeyFormat string) (oci_datascience.UpdateModelGroupConfigurationDetails, error) { + result := oci_datascience.UpdateModelGroupConfigurationDetails{} + + if modelGroupId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_group_id")); ok { + tmp := modelGroupId.(string) + result.ModelGroupId = &tmp + } + + return result, nil +} + +func ModelGroupConfigurationDetailsToMap(obj *oci_datascience.ModelGroupConfigurationDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ModelGroupId != nil { + result["model_group_id"] = string(*obj.ModelGroupId) + } + + return result +} + func (s *DatascienceModelDeploymentResourceCrud) mapToPredefinedExpressionThresholdScalingConfiguration(fieldKeyFormat string) (oci_datascience.PredefinedExpressionThresholdScalingConfiguration, error) { result := oci_datascience.PredefinedExpressionThresholdScalingConfiguration{} @@ -2080,7 +2639,41 @@ func ScalingPolicyToMap(obj *oci_datascience.ScalingPolicy) map[string]interface return result } +func UpdateInfrastructureConfigurationDetailsToMap(obj *oci_datascience.UpdateInfrastructureConfigurationDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_datascience.UpdateInstancePoolInfrastructureConfigurationDetails: + result["infrastructure_type"] = "INSTANCE_POOL" + + if v.BandwidthMbps != nil { + result["bandwidth_mbps"] = int(*v.BandwidthMbps) + } + + if v.InstanceConfiguration != nil { + result["instance_configuration"] = []interface{}{InstanceConfigurationToMap(v.InstanceConfiguration)} + } + + if v.MaximumBandwidthMbps != nil { + result["maximum_bandwidth_mbps"] = int(*v.MaximumBandwidthMbps) + } + + if v.ScalingPolicy != nil { + scalingPolicyArray := []interface{}{} + if scalingPolicyMap := ScalingPolicyToMap(&v.ScalingPolicy); scalingPolicyMap != nil { + scalingPolicyArray = append(scalingPolicyArray, scalingPolicyMap) + } + result["scaling_policy"] = scalingPolicyArray + } + default: + log.Printf("[WARN] Received 'infrastructure_type' of unknown type %v", *obj) + return nil + } + + return result +} + func UpdateModelConfigurationDetailsToMap(obj *oci_datascience.ModelConfigurationDetails) map[string]interface{} { + result := map[string]interface{}{} if obj.BandwidthMbps != nil { @@ -2157,6 +2750,16 @@ func UpdateModelDeploymentEnvironmentConfigurationDetailsToMap(obj *oci_datascie return result } +func UpdateModelGroupConfigurationDetailsToMap(obj *oci_datascience.UpdateModelGroupConfigurationDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ModelGroupId != nil { + result["model_group_id"] = string(*obj.ModelGroupId) + } + + return result +} + func (s *DatascienceModelDeploymentResourceCrud) updateCompartment(compartment interface{}) error { changeCompartmentRequest := oci_datascience.ChangeModelDeploymentCompartmentRequest{} diff --git a/internal/service/datascience/datascience_model_group_artifact_content_data_source.go b/internal/service/datascience/datascience_model_group_artifact_content_data_source.go new file mode 100644 index 00000000000..8fb0e4c9e99 --- /dev/null +++ b/internal/service/datascience/datascience_model_group_artifact_content_data_source.go @@ -0,0 +1,83 @@ +// Copyright (c) 2017, 2024, 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 DatascienceModelGroupArtifactContentDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularDatascienceModelGroupArtifactContent, + Schema: map[string]*schema.Schema{ + "model_group_id": { + Type: schema.TypeString, + Required: true, + }, + "range": { + Type: schema.TypeString, + Optional: true, + }, + // Computed + }, + } +} + +func readSingularDatascienceModelGroupArtifactContent(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupArtifactContentDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceModelGroupArtifactContentDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.GetModelGroupArtifactContentResponse +} + +func (s *DatascienceModelGroupArtifactContentDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceModelGroupArtifactContentDataSourceCrud) Get() error { + request := oci_datascience.GetModelGroupArtifactContentRequest{} + + if modelGroupId, ok := s.D.GetOkExists("model_group_id"); ok { + tmp := modelGroupId.(string) + request.ModelGroupId = &tmp + } + + if range_, ok := s.D.GetOkExists("range"); ok { + tmp := range_.(string) + request.Range = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.GetModelGroupArtifactContent(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *DatascienceModelGroupArtifactContentDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("DatascienceModelGroupArtifactContentDataSource-", DatascienceModelGroupArtifactContentDataSource(), s.D)) + + return nil +} diff --git a/internal/service/datascience/datascience_model_group_artifact_resource.go b/internal/service/datascience/datascience_model_group_artifact_resource.go new file mode 100644 index 00000000000..7e8d45f1d92 --- /dev/null +++ b/internal/service/datascience/datascience_model_group_artifact_resource.go @@ -0,0 +1,128 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package datascience + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + "strconv" + + "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 DatascienceModelGroupArtifactResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createDatascienceModelGroupArtifact, + Read: readDatascienceModelGroupArtifact, + Delete: deleteDatascienceModelGroupArtifact, + Schema: map[string]*schema.Schema{ + // Required + "model_group_artifact": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "content_length": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: tfresource.ValidateInt64TypeString, + DiffSuppressFunc: tfresource.Int64StringDiffSuppressFunction, + }, + "model_group_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "content_disposition": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + } +} + +func createDatascienceModelGroupArtifact(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupArtifactResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.CreateResource(d, sync) +} + +func readDatascienceModelGroupArtifact(d *schema.ResourceData, m interface{}) error { + return nil +} + +func deleteDatascienceModelGroupArtifact(d *schema.ResourceData, m interface{}) error { + return nil +} + +type DatascienceModelGroupArtifactResourceCrud struct { + tfresource.BaseCrud + Client *oci_datascience.DataScienceClient + DisableNotFoundRetries bool +} + +func (s *DatascienceModelGroupArtifactResourceCrud) ID() string { + return "nil" +} + +func (s *DatascienceModelGroupArtifactResourceCrud) Create() error { + request := oci_datascience.CreateModelGroupArtifactRequest{} + + if modelGroupArtifact, ok := s.D.GetOkExists("model_group_artifact"); ok { + tmp := []byte(modelGroupArtifact.(string)) + request.ModelGroupArtifact = ioutil.NopCloser(bytes.NewReader(tmp)) + } + + if contentDisposition, ok := s.D.GetOkExists("content_disposition"); ok { + tmp := contentDisposition.(string) + request.ContentDisposition = &tmp + } + + if contentLength, ok := s.D.GetOkExists("content_length"); ok { + tmp := contentLength.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return fmt.Errorf("unable to convert content-length string: %s to an int64 and encountered error: %v", tmp, err) + } + request.ContentLength = &tmpInt64 + } + + if modelGroupId, ok := s.D.GetOkExists("model_group_id"); ok { + tmp := modelGroupId.(string) + request.ModelGroupId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + _, err := s.Client.CreateModelGroupArtifact(context.Background(), request) + if err != nil { + return err + } + + return nil +} + +func (s *DatascienceModelGroupArtifactResourceCrud) SetData() error { + return nil +} diff --git a/internal/service/datascience/datascience_model_group_data_source.go b/internal/service/datascience/datascience_model_group_data_source.go new file mode 100644 index 00000000000..bd89755177a --- /dev/null +++ b/internal/service/datascience/datascience_model_group_data_source.go @@ -0,0 +1,155 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package datascience + +import ( + "context" + "strconv" + + "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 DatascienceModelGroupDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["model_group_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(DatascienceModelGroupResource(), fieldMap, readSingularDatascienceModelGroup) +} + +func readSingularDatascienceModelGroup(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceModelGroupDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.GetModelGroupResponse +} + +func (s *DatascienceModelGroupDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceModelGroupDataSourceCrud) Get() error { + request := oci_datascience.GetModelGroupRequest{} + + if modelGroupId, ok := s.D.GetOkExists("model_group_id"); ok { + tmp := modelGroupId.(string) + request.ModelGroupId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.GetModelGroup(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *DatascienceModelGroupDataSourceCrud) 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.CreateType != nil { + s.D.Set("create_type", *s.Res.CreateType) + } + + if s.Res.CreatedBy != nil { + s.D.Set("created_by", *s.Res.CreatedBy) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.MemberModelEntries != nil { + s.D.Set("member_model_entries", []interface{}{MemberModelEntriesToMap(s.Res.MemberModelEntries)}) + } else { + s.D.Set("member_model_entries", nil) + } + + if s.Res.ModelGroupDetails != nil { + modelGroupDetailsArray := []interface{}{} + if modelGroupDetailsMap := ModelGroupDetailsToMap(&s.Res.ModelGroupDetails); modelGroupDetailsMap != nil { + modelGroupDetailsArray = append(modelGroupDetailsArray, modelGroupDetailsMap) + } + s.D.Set("model_group_details", modelGroupDetailsArray) + } else { + s.D.Set("model_group_details", nil) + } + + if s.Res.ModelGroupVersionHistoryId != nil { + s.D.Set("model_group_version_history_id", *s.Res.ModelGroupVersionHistoryId) + } + + if s.Res.ModelGroupVersionHistoryName != nil { + s.D.Set("model_group_version_history_name", *s.Res.ModelGroupVersionHistoryName) + } + + if s.Res.ProjectId != nil { + s.D.Set("project_id", *s.Res.ProjectId) + } + + if s.Res.SourceModelGroupId != nil { + s.D.Set("source_model_group_id", *s.Res.SourceModelGroupId) + } + + 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()) + } + + if s.Res.VersionId != nil { + s.D.Set("version_id", strconv.FormatInt(*s.Res.VersionId, 10)) + } + + if s.Res.VersionLabel != nil { + s.D.Set("version_label", *s.Res.VersionLabel) + } + + return nil +} diff --git a/internal/service/datascience/datascience_model_group_models_data_source.go b/internal/service/datascience/datascience_model_group_models_data_source.go new file mode 100644 index 00000000000..0e243b53a9a --- /dev/null +++ b/internal/service/datascience/datascience_model_group_models_data_source.go @@ -0,0 +1,273 @@ +// Copyright (c) 2017, 2024, 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 DatascienceModelGroupModelsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readDatascienceModelGroupModels, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "created_by": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "model_group_id": { + Type: schema.TypeString, + Required: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "model_group_models": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + + // Computed + "category": { + Type: schema.TypeString, + Computed: true, + }, + "compartment_id": { + Type: schema.TypeString, + Computed: true, + }, + "created_by": { + Type: schema.TypeString, + Computed: true, + }, + "defined_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "display_name": { + Type: schema.TypeString, + Computed: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "id": { + Type: schema.TypeString, + Computed: true, + }, + "is_model_by_reference": { + Type: schema.TypeBool, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "model_id": { + Type: schema.TypeString, + Computed: true, + }, + "project_id": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + }, + } +} + +func readDatascienceModelGroupModels(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupModelsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceModelGroupModelsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.ListModelGroupModelsResponse +} + +func (s *DatascienceModelGroupModelsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceModelGroupModelsDataSourceCrud) Get() error { + request := oci_datascience.ListModelGroupModelsRequest{} + + 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 displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if modelGroupId, ok := s.D.GetOkExists("model_group_id"); ok { + tmp := modelGroupId.(string) + request.ModelGroupId = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_datascience.ListModelGroupModelsLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.ListModelGroupModels(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListModelGroupModels(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 *DatascienceModelGroupModelsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("DatascienceModelGroupModelsDataSource-", DatascienceModelGroupModelsDataSource(), s.D)) + resources := []map[string]interface{}{} + + for _, r := range s.Res.Items { + modelGroupModel := map[string]interface{}{ + "compartment_id": *r.CompartmentId, + } + + modelGroupModel["category"] = r.Category + + if r.CreatedBy != nil { + modelGroupModel["created_by"] = *r.CreatedBy + } + + if r.DefinedTags != nil { + modelGroupModel["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) + } + + if r.DisplayName != nil { + modelGroupModel["display_name"] = *r.DisplayName + } + + modelGroupModel["freeform_tags"] = r.FreeformTags + + if r.Id != nil { + modelGroupModel["id"] = *r.Id + } + + if r.IsModelByReference != nil { + modelGroupModel["is_model_by_reference"] = *r.IsModelByReference + } + + if r.LifecycleDetails != nil { + modelGroupModel["lifecycle_details"] = *r.LifecycleDetails + } + + if r.ModelId != nil { + modelGroupModel["model_id"] = *r.ModelId + } + + if r.ProjectId != nil { + modelGroupModel["project_id"] = *r.ProjectId + } + + modelGroupModel["state"] = r.LifecycleState + + if r.SystemTags != nil { + modelGroupModel["system_tags"] = tfresource.SystemTagsToMap(r.SystemTags) + } + + if r.TimeCreated != nil { + modelGroupModel["time_created"] = r.TimeCreated.String() + } + + if r.TimeUpdated != nil { + modelGroupModel["time_updated"] = r.TimeUpdated.String() + } + + resources = append(resources, modelGroupModel) + } + + if f, fOk := s.D.GetOkExists("filter"); fOk { + resources = tfresource.ApplyFilters(f.(*schema.Set), resources, DatascienceModelGroupModelsDataSource().Schema["model_group_models"].Elem.(*schema.Resource).Schema) + } + + if err := s.D.Set("model_group_models", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/datascience/datascience_model_group_resource.go b/internal/service/datascience/datascience_model_group_resource.go new file mode 100644 index 00000000000..f9d1a9c0970 --- /dev/null +++ b/internal/service/datascience/datascience_model_group_resource.go @@ -0,0 +1,1545 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package datascience + +import ( + "context" + "fmt" + "log" + "strconv" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_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 DatascienceModelGroupResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createDatascienceModelGroup, + Read: readDatascienceModelGroup, + Update: updateDatascienceModelGroup, + Delete: deleteDatascienceModelGroup, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "create_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "CLONE", + "CREATE", + }, true), + }, + "project_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, + }, + "member_model_entries": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "member_model_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "inference_key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "model_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, + "model_group_clone_source_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "model_group_clone_source_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "MODEL_GROUP", + "MODEL_GROUP_VERSION_HISTORY", + }, true), + }, + "source_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "modify_model_group_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + ForceNew: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + ForceNew: true, + Elem: schema.TypeString, + }, + "model_group_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "HETEROGENEOUS", + "HOMOGENEOUS", + "STACKED", + }, true), + }, + + // Optional + "base_model_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "custom_metadata_list": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "category": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, + "model_group_version_history_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "version_label": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "patch_model_group_member_model_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "items": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "operation": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "INSERT", + "REMOVE", + }, true), + }, + "values": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "model_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "inference_key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + + // Optional + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, + "model_group_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "HETEROGENEOUS", + "HOMOGENEOUS", + "STACKED", + }, true), + }, + + // Optional + "base_model_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "custom_metadata_list": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "category": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "description": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "value": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + + // Computed + }, + }, + }, + "model_group_version_history_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "version_label": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "created_by": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "model_group_version_history_name": { + Type: schema.TypeString, + Computed: true, + }, + "source_model_group_id": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + "version_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createDatascienceModelGroup(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.CreateResource(d, sync) +} + +func readDatascienceModelGroup(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +func updateDatascienceModelGroup(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteDatascienceModelGroup(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type DatascienceModelGroupResourceCrud struct { + tfresource.BaseCrud + Client *oci_datascience.DataScienceClient + Res *oci_datascience.ModelGroup + DisableNotFoundRetries bool +} + +func (s *DatascienceModelGroupResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *DatascienceModelGroupResourceCrud) CreatedPending() []string { + return []string{ + string(oci_datascience.ModelGroupLifecycleStateCreating), + } +} + +func (s *DatascienceModelGroupResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_datascience.ModelGroupLifecycleStateActive), + } +} + +func (s *DatascienceModelGroupResourceCrud) DeletedPending() []string { + return []string{ + string(oci_datascience.ModelGroupLifecycleStateDeleting), + } +} + +func (s *DatascienceModelGroupResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_datascience.ModelGroupLifecycleStateDeleted), + } +} + +func (s *DatascienceModelGroupResourceCrud) Create() error { + request := oci_datascience.CreateModelGroupRequest{} + err := s.populateTopLevelPolymorphicCreateModelGroupRequest(&request) + if err != nil { + return err + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.CreateModelGroup(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + return s.getModelGroupFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience"), oci_datascience.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *DatascienceModelGroupResourceCrud) getModelGroupFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_datascience.WorkRequestResourceActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + modelGroupId, err := modelGroupWaitForWorkRequest(workId, "model-group", + 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, modelGroupId) + _, 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(*modelGroupId) + + return s.Get() +} + +func modelGroupWorkRequestShouldRetryFunc(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 modelGroupWaitForWorkRequest(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 = modelGroupWorkRequestShouldRetryFunc(timeout) + + response := oci_datascience.GetWorkRequestResponse{} + stateConf := &retry.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, getErrorFromDatascienceModelGroupWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromDatascienceModelGroupWorkRequest(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 *DatascienceModelGroupResourceCrud) Get() error { + request := oci_datascience.GetModelGroupRequest{} + + tmp := s.D.Id() + request.ModelGroupId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.GetModelGroup(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ModelGroup + return nil +} + +func (s *DatascienceModelGroupResourceCrud) 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.UpdateModelGroupRequest{} + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + tmp := s.D.Id() + request.ModelGroupId = &tmp + + if modelGroupVersionHistoryId, ok := s.D.GetOkExists("model_group_version_history_id"); ok { + tmp := modelGroupVersionHistoryId.(string) + request.ModelGroupVersionHistoryId = &tmp + } + + if versionLabel, ok := s.D.GetOkExists("version_label"); ok { + tmp := versionLabel.(string) + request.VersionLabel = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.UpdateModelGroup(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ModelGroup + return nil +} + +func (s *DatascienceModelGroupResourceCrud) Delete() error { + request := oci_datascience.DeleteModelGroupRequest{} + + tmp := s.D.Id() + request.ModelGroupId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.DeleteModelGroup(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := modelGroupWaitForWorkRequest(workId, "model-group", + oci_datascience.WorkRequestResourceActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) + return delWorkRequestErr +} + +func (s *DatascienceModelGroupResourceCrud) SetData() error { + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.CreateType != nil { + s.D.Set("create_type", *s.Res.CreateType) + } + + if s.Res.CreatedBy != nil { + s.D.Set("created_by", *s.Res.CreatedBy) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.MemberModelEntries != nil { + s.D.Set("member_model_entries", []interface{}{MemberModelEntriesToMap(s.Res.MemberModelEntries)}) + } else { + s.D.Set("member_model_entries", nil) + } + + if s.Res.ModelGroupDetails != nil { + modelGroupDetailsArray := []interface{}{} + if modelGroupDetailsMap := ModelGroupDetailsToMap(&s.Res.ModelGroupDetails); modelGroupDetailsMap != nil { + modelGroupDetailsArray = append(modelGroupDetailsArray, modelGroupDetailsMap) + } + s.D.Set("model_group_details", modelGroupDetailsArray) + } else { + s.D.Set("model_group_details", nil) + } + + if s.Res.ModelGroupVersionHistoryId != nil { + s.D.Set("model_group_version_history_id", *s.Res.ModelGroupVersionHistoryId) + } + + if s.Res.ModelGroupVersionHistoryName != nil { + s.D.Set("model_group_version_history_name", *s.Res.ModelGroupVersionHistoryName) + } + + if s.Res.ProjectId != nil { + s.D.Set("project_id", *s.Res.ProjectId) + } + + if s.Res.SourceModelGroupId != nil { + s.D.Set("source_model_group_id", *s.Res.SourceModelGroupId) + } + + 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()) + } + + if s.Res.VersionId != nil { + s.D.Set("version_id", strconv.FormatInt(*s.Res.VersionId, 10)) + } + + if s.Res.VersionLabel != nil { + s.D.Set("version_label", *s.Res.VersionLabel) + } + + return nil +} + +func (s *DatascienceModelGroupResourceCrud) mapToCustomMetadata(fieldKeyFormat string) (oci_datascience.CustomMetadata, error) { + result := oci_datascience.CustomMetadata{} + + if category, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "category")); ok { + tmp := category.(string) + result.Category = &tmp + } + + if description, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "description")); ok { + tmp := description.(string) + result.Description = &tmp + } + + if key, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "key")); ok { + tmp := key.(string) + result.Key = &tmp + } + + if value, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "value")); ok { + tmp := value.(string) + result.Value = &tmp + } + + return result, nil +} + +func CustomMetadataToMap(obj oci_datascience.CustomMetadata) map[string]interface{} { + result := map[string]interface{}{} + + if obj.Category != nil { + result["category"] = string(*obj.Category) + } + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + if obj.Key != nil { + result["key"] = string(*obj.Key) + } + + if obj.Value != nil { + result["value"] = string(*obj.Value) + } + + return result +} + +func (s *DatascienceModelGroupResourceCrud) mapToMemberModelDetails(fieldKeyFormat string) (oci_datascience.MemberModelDetails, error) { + result := oci_datascience.MemberModelDetails{} + + if inferenceKey, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "inference_key")); ok { + tmp := inferenceKey.(string) + result.InferenceKey = &tmp + } + + if modelId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_id")); ok { + tmp := modelId.(string) + result.ModelId = &tmp + } + + return result, nil +} + +func MemberModelDetailsToMap(obj oci_datascience.MemberModelDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.InferenceKey != nil { + result["inference_key"] = string(*obj.InferenceKey) + } + + if obj.ModelId != nil { + result["model_id"] = string(*obj.ModelId) + } + + return result +} + +func (s *DatascienceModelGroupResourceCrud) mapToMemberModelEntries(fieldKeyFormat string) (oci_datascience.MemberModelEntries, error) { + result := oci_datascience.MemberModelEntries{} + + if memberModelDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "member_model_details")); ok { + interfaces := memberModelDetails.([]interface{}) + tmp := make([]oci_datascience.MemberModelDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "member_model_details"), stateDataIndex) + converted, err := s.mapToMemberModelDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "member_model_details")) { + result.MemberModelDetails = tmp + } + } + + return result, nil +} + +func MemberModelEntriesToMap(obj *oci_datascience.MemberModelEntries) map[string]interface{} { + result := map[string]interface{}{} + + memberModelDetails := []interface{}{} + for _, item := range obj.MemberModelDetails { + memberModelDetails = append(memberModelDetails, MemberModelDetailsToMap(item)) + } + result["member_model_details"] = memberModelDetails + + return result +} + +func (s *DatascienceModelGroupResourceCrud) mapToModelGroupCloneSourceDetails(fieldKeyFormat string) (oci_datascience.ModelGroupCloneSourceDetails, error) { + var baseObject oci_datascience.ModelGroupCloneSourceDetails + //discriminator + modelGroupCloneSourceTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_group_clone_source_type")) + var modelGroupCloneSourceType string + if ok { + modelGroupCloneSourceType = modelGroupCloneSourceTypeRaw.(string) + } else { + modelGroupCloneSourceType = "" // default value + } + switch strings.ToLower(modelGroupCloneSourceType) { + case strings.ToLower("MODEL_GROUP"): + details := oci_datascience.CloneCreateFromModelGroupDetails{} + if modifyModelGroupDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "modify_model_group_details")); ok { + if tmpList := modifyModelGroupDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "modify_model_group_details"), 0) + tmp, err := s.mapToModifyModelGroupDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert modify_model_group_details, encountered error: %v", err) + } + details.ModifyModelGroupDetails = &tmp + } + } + if patchModelGroupMemberModelDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "patch_model_group_member_model_details")); ok { + if tmpList := patchModelGroupMemberModelDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "patch_model_group_member_model_details"), 0) + tmp, err := s.mapToPatchModelGroupMemberModelDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert patch_model_group_member_model_details, encountered error: %v", err) + } + details.PatchModelGroupMemberModelDetails = &tmp + } + } + if sourceId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_id")); ok { + tmp := sourceId.(string) + details.SourceId = &tmp + } + baseObject = details + case strings.ToLower("MODEL_GROUP_VERSION_HISTORY"): + details := oci_datascience.CloneCreateFromModelGroupVersionHistoryDetails{} + if modifyModelGroupDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "modify_model_group_details")); ok { + if tmpList := modifyModelGroupDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "modify_model_group_details"), 0) + tmp, err := s.mapToModifyModelGroupDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert modify_model_group_details, encountered error: %v", err) + } + details.ModifyModelGroupDetails = &tmp + } + } + if patchModelGroupMemberModelDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "patch_model_group_member_model_details")); ok { + if tmpList := patchModelGroupMemberModelDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "patch_model_group_member_model_details"), 0) + tmp, err := s.mapToPatchModelGroupMemberModelDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, fmt.Errorf("unable to convert patch_model_group_member_model_details, encountered error: %v", err) + } + details.PatchModelGroupMemberModelDetails = &tmp + } + } + if sourceId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "source_id")); ok { + tmp := sourceId.(string) + details.SourceId = &tmp + } + baseObject = details + default: + return nil, fmt.Errorf("unknown model_group_clone_source_type '%v' was specified", modelGroupCloneSourceType) + } + return baseObject, nil +} + +func ModelGroupCloneSourceDetailsToMap(obj *oci_datascience.ModelGroupCloneSourceDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_datascience.CloneCreateFromModelGroupDetails: + result["model_group_clone_source_type"] = "MODEL_GROUP" + + if v.ModifyModelGroupDetails != nil { + result["modify_model_group_details"] = []interface{}{ModifyModelGroupDetailsToMap(v.ModifyModelGroupDetails)} + } + + if v.PatchModelGroupMemberModelDetails != nil { + result["patch_model_group_member_model_details"] = []interface{}{PatchModelGroupMemberModelDetailsToMap(v.PatchModelGroupMemberModelDetails)} + } + + if v.SourceId != nil { + result["source_id"] = string(*v.SourceId) + } + case oci_datascience.CloneCreateFromModelGroupVersionHistoryDetails: + result["model_group_clone_source_type"] = "MODEL_GROUP_VERSION_HISTORY" + + if v.ModifyModelGroupDetails != nil { + result["modify_model_group_details"] = []interface{}{ModifyModelGroupDetailsToMap(v.ModifyModelGroupDetails)} + } + + if v.PatchModelGroupMemberModelDetails != nil { + result["patch_model_group_member_model_details"] = []interface{}{PatchModelGroupMemberModelDetailsToMap(v.PatchModelGroupMemberModelDetails)} + } + + if v.SourceId != nil { + result["source_id"] = string(*v.SourceId) + } + default: + log.Printf("[WARN] Received 'model_group_clone_source_type' of unknown type %v", *obj) + return nil + } + + return result +} + +func (s *DatascienceModelGroupResourceCrud) mapToModelGroupDetails(fieldKeyFormat string) (oci_datascience.ModelGroupDetails, error) { + var baseObject oci_datascience.ModelGroupDetails + //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("HETEROGENEOUS"): + details := oci_datascience.HeterogeneousModelGroupDetails{} + if customMetadataList, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "custom_metadata_list")); ok { + interfaces := customMetadataList.([]interface{}) + tmp := make([]oci_datascience.CustomMetadata, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "custom_metadata_list"), stateDataIndex) + converted, err := s.mapToCustomMetadata(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "custom_metadata_list")) { + details.CustomMetadataList = tmp + } + } + baseObject = details + case strings.ToLower("HOMOGENEOUS"): + details := oci_datascience.HomogeneousModelGroupDetails{} + if customMetadataList, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "custom_metadata_list")); ok { + interfaces := customMetadataList.([]interface{}) + tmp := make([]oci_datascience.CustomMetadata, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "custom_metadata_list"), stateDataIndex) + converted, err := s.mapToCustomMetadata(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "custom_metadata_list")) { + details.CustomMetadataList = tmp + } + } + baseObject = details + case strings.ToLower("STACKED"): + details := oci_datascience.StackedModelGroupDetails{} + if baseModelId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "base_model_id")); ok { + tmp := baseModelId.(string) + details.BaseModelId = &tmp + } + if customMetadataList, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "custom_metadata_list")); ok { + interfaces := customMetadataList.([]interface{}) + tmp := make([]oci_datascience.CustomMetadata, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "custom_metadata_list"), stateDataIndex) + converted, err := s.mapToCustomMetadata(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "custom_metadata_list")) { + details.CustomMetadataList = tmp + } + } + baseObject = details + default: + return nil, fmt.Errorf("unknown type '%v' was specified", type_) + } + return baseObject, nil +} + +func ModelGroupDetailsToMap(obj *oci_datascience.ModelGroupDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_datascience.HeterogeneousModelGroupDetails: + result["type"] = "HETEROGENEOUS" + case oci_datascience.HomogeneousModelGroupDetails: + result["type"] = "HOMOGENEOUS" + case oci_datascience.StackedModelGroupDetails: + result["type"] = "STACKED" + + if v.BaseModelId != nil { + result["base_model_id"] = string(*v.BaseModelId) + } + default: + log.Printf("[WARN] Received 'type' of unknown type %v", *obj) + return nil + } + + return result +} + +func (s *DatascienceModelGroupResourceCrud) mapToModifyModelGroupDetails(fieldKeyFormat string) (oci_datascience.ModifyModelGroupDetails, error) { + result := oci_datascience.ModifyModelGroupDetails{} + + if definedTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "defined_tags")); ok { + tmp, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return result, fmt.Errorf("unable to convert defined_tags, encountered error: %v", err) + } + result.DefinedTags = tmp + } + + if description, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "description")); ok { + tmp := description.(string) + result.Description = &tmp + } + + if displayName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "display_name")); ok { + tmp := displayName.(string) + result.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "freeform_tags")); ok { + result.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if modelGroupDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_group_details")); ok { + if tmpList := modelGroupDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "model_group_details"), 0) + tmp, err := s.mapToModelGroupDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert model_group_details, encountered error: %v", err) + } + result.ModelGroupDetails = tmp + } + } + + if modelGroupVersionHistoryId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_group_version_history_id")); ok { + tmp := modelGroupVersionHistoryId.(string) + result.ModelGroupVersionHistoryId = &tmp + } + + if versionLabel, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "version_label")); ok { + tmp := versionLabel.(string) + result.VersionLabel = &tmp + } + + return result, nil +} + +func ModifyModelGroupDetailsToMap(obj *oci_datascience.ModifyModelGroupDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + if obj.DisplayName != nil { + result["display_name"] = string(*obj.DisplayName) + } + + result["freeform_tags"] = obj.FreeformTags + + if obj.ModelGroupDetails != nil { + modelGroupDetailsArray := []interface{}{} + if modelGroupDetailsMap := ModelGroupDetailsToMap(&obj.ModelGroupDetails); modelGroupDetailsMap != nil { + modelGroupDetailsArray = append(modelGroupDetailsArray, modelGroupDetailsMap) + } + result["model_group_details"] = modelGroupDetailsArray + } + + if obj.ModelGroupVersionHistoryId != nil { + result["model_group_version_history_id"] = string(*obj.ModelGroupVersionHistoryId) + } + + if obj.VersionLabel != nil { + result["version_label"] = string(*obj.VersionLabel) + } + + return result +} + +func (s *DatascienceModelGroupResourceCrud) mapToPatchInstruction(fieldKeyFormat string) (oci_datascience.PatchInstruction, error) { + var baseObject oci_datascience.PatchInstruction + //discriminator + operationRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "operation")) + var operation string + if ok { + operation = operationRaw.(string) + } else { + operation = "" // default value + } + switch strings.ToLower(operation) { + case strings.ToLower("INSERT"): + details := oci_datascience.PatchInsertNewMemberModels{} + if values, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "values")); ok { + interfaces := values.([]interface{}) + tmp := make([]oci_datascience.MemberModelDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "values"), stateDataIndex) + converted, err := s.mapToMemberModelDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "values")) { + details.Values = tmp + } + } + baseObject = details + case strings.ToLower("REMOVE"): + details := oci_datascience.PatchRemoveMemberModels{} + if values, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "values")); ok { + interfaces := values.([]interface{}) + tmp := make([]oci_datascience.MemberModelDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "values"), stateDataIndex) + converted, err := s.mapToMemberModelDetails(fieldKeyFormatNextLevel) + if err != nil { + return details, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "values")) { + details.Values = tmp + } + } + baseObject = details + default: + return nil, fmt.Errorf("unknown operation '%v' was specified", operation) + } + return baseObject, nil +} + +func PatchInstructionToMap(obj oci_datascience.PatchInstruction) map[string]interface{} { + result := map[string]interface{}{} + switch v := (obj).(type) { + case oci_datascience.PatchInsertNewMemberModels: + result["operation"] = "INSERT" + + values := []interface{}{} + for _, item := range v.Values { + values = append(values, MemberModelDetailsToMap(item)) + } + result["values"] = values + case oci_datascience.PatchRemoveMemberModels: + result["operation"] = "REMOVE" + + values := []interface{}{} + for _, item := range v.Values { + values = append(values, MemberModelDetailsToMap(item)) + } + result["values"] = values + default: + log.Printf("[WARN] Received 'operation' of unknown type %v", obj) + return nil + } + + return result +} + +func (s *DatascienceModelGroupResourceCrud) mapToPatchModelGroupMemberModelDetails(fieldKeyFormat string) (oci_datascience.PatchModelGroupMemberModelDetails, error) { + result := oci_datascience.PatchModelGroupMemberModelDetails{} + + if items, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "items")); ok { + interfaces := items.([]interface{}) + tmp := make([]oci_datascience.PatchInstruction, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "items"), stateDataIndex) + converted, err := s.mapToPatchInstruction(fieldKeyFormatNextLevel) + if err != nil { + return result, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "items")) { + result.Items = tmp + } + } + + return result, nil +} + +func PatchModelGroupMemberModelDetailsToMap(obj *oci_datascience.PatchModelGroupMemberModelDetails) map[string]interface{} { + result := map[string]interface{}{} + + items := []interface{}{} + for _, item := range obj.Items { + items = append(items, PatchInstructionToMap(item)) + } + result["items"] = items + + return result +} + +func (s *DatascienceModelGroupResourceCrud) populateTopLevelPolymorphicCreateModelGroupRequest(request *oci_datascience.CreateModelGroupRequest) error { + //discriminator + createTypeRaw, ok := s.D.GetOkExists("create_type") + var createType string + if ok { + createType = createTypeRaw.(string) + } else { + createType = "" // default value + } + switch strings.ToLower(createType) { + case strings.ToLower("CLONE"): + details := oci_datascience.CloneModelGroupDetails{} + if modelGroupCloneSourceDetails, ok := s.D.GetOkExists("model_group_clone_source_details"); ok { + if tmpList := modelGroupCloneSourceDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "model_group_clone_source_details", 0) + tmp, err := s.mapToModelGroupCloneSourceDetails(fieldKeyFormat) + if err != nil { + return err + } + details.ModelGroupCloneSourceDetails = tmp + } + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + details.CompartmentId = &tmp + } + if projectId, ok := s.D.GetOkExists("project_id"); ok { + tmp := projectId.(string) + details.ProjectId = &tmp + } + request.CreateBaseModelGroupDetails = details + case strings.ToLower("CREATE"): + details := oci_datascience.CreateModelGroupDetails{} + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + details.Description = &tmp + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if memberModelEntries, ok := s.D.GetOkExists("member_model_entries"); ok { + if tmpList := memberModelEntries.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "member_model_entries", 0) + tmp, err := s.mapToMemberModelEntries(fieldKeyFormat) + if err != nil { + return err + } + details.MemberModelEntries = &tmp + } + } + if modelGroupDetails, ok := s.D.GetOkExists("model_group_details"); ok { + if tmpList := modelGroupDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "model_group_details", 0) + tmp, err := s.mapToModelGroupDetails(fieldKeyFormat) + if err != nil { + return err + } + details.ModelGroupDetails = tmp + } + } + if modelGroupVersionHistoryId, ok := s.D.GetOkExists("model_group_version_history_id"); ok { + tmp := modelGroupVersionHistoryId.(string) + details.ModelGroupVersionHistoryId = &tmp + } + if versionLabel, ok := s.D.GetOkExists("version_label"); ok { + tmp := versionLabel.(string) + details.VersionLabel = &tmp + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + details.CompartmentId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + details.Description = &tmp + } + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + details.DisplayName = &tmp + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if modelGroupVersionHistoryId, ok := s.D.GetOkExists("model_group_version_history_id"); ok { + tmp := modelGroupVersionHistoryId.(string) + details.ModelGroupVersionHistoryId = &tmp + } + if projectId, ok := s.D.GetOkExists("project_id"); ok { + tmp := projectId.(string) + details.ProjectId = &tmp + } + if versionLabel, ok := s.D.GetOkExists("version_label"); ok { + tmp := versionLabel.(string) + details.VersionLabel = &tmp + } + request.CreateBaseModelGroupDetails = details + default: + return fmt.Errorf("unknown create_type '%v' was specified", createType) + } + return nil +} + +func (s *DatascienceModelGroupResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_datascience.ChangeModelGroupCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.ModelGroupId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + _, err := s.Client.ChangeModelGroupCompartment(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/datascience/datascience_model_group_version_histories_data_source.go b/internal/service/datascience/datascience_model_group_version_histories_data_source.go new file mode 100644 index 00000000000..ac9ef02799d --- /dev/null +++ b/internal/service/datascience/datascience_model_group_version_histories_data_source.go @@ -0,0 +1,196 @@ +// Copyright (c) 2017, 2024, 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 DatascienceModelGroupVersionHistoriesDataSource() *schema.Resource { + return &schema.Resource{ + Read: readDatascienceModelGroupVersionHistories, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "created_by": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "project_id": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "model_group_version_histories": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(DatascienceModelGroupVersionHistoryResource()), + }, + }, + } +} + +func readDatascienceModelGroupVersionHistories(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupVersionHistoriesDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceModelGroupVersionHistoriesDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.ListModelGroupVersionHistoriesResponse +} + +func (s *DatascienceModelGroupVersionHistoriesDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceModelGroupVersionHistoriesDataSourceCrud) Get() error { + request := oci_datascience.ListModelGroupVersionHistoriesRequest{} + + 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 displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if projectId, ok := s.D.GetOkExists("project_id"); ok { + tmp := projectId.(string) + request.ProjectId = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_datascience.ListModelGroupVersionHistoriesLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.ListModelGroupVersionHistories(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListModelGroupVersionHistories(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 *DatascienceModelGroupVersionHistoriesDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("DatascienceModelGroupVersionHistoriesDataSource-", DatascienceModelGroupVersionHistoriesDataSource(), s.D)) + resources := []map[string]interface{}{} + + for _, r := range s.Res.Items { + modelGroupVersionHistory := map[string]interface{}{ + "compartment_id": *r.CompartmentId, + } + + if r.CreatedBy != nil { + modelGroupVersionHistory["created_by"] = *r.CreatedBy + } + + if r.DefinedTags != nil { + modelGroupVersionHistory["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) + } + + if r.DisplayName != nil { + modelGroupVersionHistory["display_name"] = *r.DisplayName + } + + modelGroupVersionHistory["freeform_tags"] = r.FreeformTags + + if r.Id != nil { + modelGroupVersionHistory["id"] = *r.Id + } + + if r.LatestModelGroupId != nil { + modelGroupVersionHistory["latest_model_group_id"] = *r.LatestModelGroupId + } + + if r.LifecycleDetails != nil { + modelGroupVersionHistory["lifecycle_details"] = *r.LifecycleDetails + } + + if r.ProjectId != nil { + modelGroupVersionHistory["project_id"] = *r.ProjectId + } + + modelGroupVersionHistory["state"] = r.LifecycleState + + if r.SystemTags != nil { + modelGroupVersionHistory["system_tags"] = tfresource.SystemTagsToMap(r.SystemTags) + } + + if r.TimeCreated != nil { + modelGroupVersionHistory["time_created"] = r.TimeCreated.String() + } + + if r.TimeUpdated != nil { + modelGroupVersionHistory["time_updated"] = r.TimeUpdated.String() + } + + resources = append(resources, modelGroupVersionHistory) + } + + if f, fOk := s.D.GetOkExists("filter"); fOk { + resources = tfresource.ApplyFilters(f.(*schema.Set), resources, DatascienceModelGroupVersionHistoriesDataSource().Schema["model_group_version_histories"].Elem.(*schema.Resource).Schema) + } + + if err := s.D.Set("model_group_version_histories", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/datascience/datascience_model_group_version_history_data_source.go b/internal/service/datascience/datascience_model_group_version_history_data_source.go new file mode 100644 index 00000000000..3dcd57bb4c5 --- /dev/null +++ b/internal/service/datascience/datascience_model_group_version_history_data_source.go @@ -0,0 +1,118 @@ +// Copyright (c) 2017, 2024, 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 DatascienceModelGroupVersionHistoryDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["model_group_version_history_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(DatascienceModelGroupVersionHistoryResource(), fieldMap, readSingularDatascienceModelGroupVersionHistory) +} + +func readSingularDatascienceModelGroupVersionHistory(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupVersionHistoryDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceModelGroupVersionHistoryDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.GetModelGroupVersionHistoryResponse +} + +func (s *DatascienceModelGroupVersionHistoryDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceModelGroupVersionHistoryDataSourceCrud) Get() error { + request := oci_datascience.GetModelGroupVersionHistoryRequest{} + + if modelGroupVersionHistoryId, ok := s.D.GetOkExists("model_group_version_history_id"); ok { + tmp := modelGroupVersionHistoryId.(string) + request.ModelGroupVersionHistoryId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.GetModelGroupVersionHistory(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *DatascienceModelGroupVersionHistoryDataSourceCrud) 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) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LatestModelGroupId != nil { + s.D.Set("latest_model_group_id", *s.Res.LatestModelGroupId) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.ProjectId != nil { + s.D.Set("project_id", *s.Res.ProjectId) + } + + 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/datascience/datascience_model_group_version_history_resource.go b/internal/service/datascience/datascience_model_group_version_history_resource.go new file mode 100644 index 00000000000..d1cb0acb477 --- /dev/null +++ b/internal/service/datascience/datascience_model_group_version_history_resource.go @@ -0,0 +1,512 @@ +// Copyright (c) 2017, 2024, 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/retry" + "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 DatascienceModelGroupVersionHistoryResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createDatascienceModelGroupVersionHistory, + Read: readDatascienceModelGroupVersionHistory, + Update: updateDatascienceModelGroupVersionHistory, + Delete: deleteDatascienceModelGroupVersionHistory, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "project_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, + }, + "latest_model_group_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "created_by": { + Type: schema.TypeString, + Computed: true, + }, + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createDatascienceModelGroupVersionHistory(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupVersionHistoryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.CreateResource(d, sync) +} + +func readDatascienceModelGroupVersionHistory(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupVersionHistoryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +func updateDatascienceModelGroupVersionHistory(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupVersionHistoryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteDatascienceModelGroupVersionHistory(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupVersionHistoryResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type DatascienceModelGroupVersionHistoryResourceCrud struct { + tfresource.BaseCrud + Client *oci_datascience.DataScienceClient + Res *oci_datascience.ModelGroupVersionHistory + DisableNotFoundRetries bool +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) CreatedPending() []string { + return []string{} +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_datascience.ModelGroupVersionHistoryLifecycleStateActive), + } +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) DeletedPending() []string { + return []string{ + string(oci_datascience.ModelGroupVersionHistoryLifecycleStateDeleting), + } +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_datascience.ModelGroupVersionHistoryLifecycleStateDeleted), + } +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) Create() error { + request := oci_datascience.CreateModelGroupVersionHistoryRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + request.DefinedTags = convertedDefinedTags + } + + if description, ok := s.D.GetOkExists("description"); ok { + tmp := description.(string) + request.Description = &tmp + } + + if displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if latestModelGroupId, ok := s.D.GetOkExists("latest_model_group_id"); ok { + tmp := latestModelGroupId.(string) + request.LatestModelGroupId = &tmp + } + + if projectId, ok := s.D.GetOkExists("project_id"); ok { + tmp := projectId.(string) + request.ProjectId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.CreateModelGroupVersionHistory(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ModelGroupVersionHistory + return nil +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) getModelGroupVersionHistoryFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_datascience.WorkRequestResourceActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + modelGroupVersionHistoryId, err := modelGroupVersionHistoryWaitForWorkRequest(workId, "modelgroupversionhistory", + 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, modelGroupVersionHistoryId) + _, 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(*modelGroupVersionHistoryId) + + return s.Get() +} + +func modelGroupVersionHistoryWorkRequestShouldRetryFunc(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 modelGroupVersionHistoryWaitForWorkRequest(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 = modelGroupVersionHistoryWorkRequestShouldRetryFunc(timeout) + + response := oci_datascience.GetWorkRequestResponse{} + stateConf := &retry.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, getErrorFromDatascienceModelGroupVersionHistoryWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromDatascienceModelGroupVersionHistoryWorkRequest(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 *DatascienceModelGroupVersionHistoryResourceCrud) Get() error { + request := oci_datascience.GetModelGroupVersionHistoryRequest{} + + tmp := s.D.Id() + request.ModelGroupVersionHistoryId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.GetModelGroupVersionHistory(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ModelGroupVersionHistory + return nil +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) 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.UpdateModelGroupVersionHistoryRequest{} + + 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 latestModelGroupId, ok := s.D.GetOkExists("latest_model_group_id"); ok { + tmp := latestModelGroupId.(string) + request.LatestModelGroupId = &tmp + } + + tmp := s.D.Id() + request.ModelGroupVersionHistoryId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.UpdateModelGroupVersionHistory(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.ModelGroupVersionHistory + return nil +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) Delete() error { + request := oci_datascience.DeleteModelGroupVersionHistoryRequest{} + + tmp := s.D.Id() + request.ModelGroupVersionHistoryId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + response, err := s.Client.DeleteModelGroupVersionHistory(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := modelGroupVersionHistoryWaitForWorkRequest(workId, "modelgroupversionhistory", + oci_datascience.WorkRequestResourceActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) + return delWorkRequestErr +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) 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) + } + + if s.Res.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) + } + + if s.Res.Description != nil { + s.D.Set("description", *s.Res.Description) + } + + if s.Res.DisplayName != nil { + s.D.Set("display_name", *s.Res.DisplayName) + } + + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LatestModelGroupId != nil { + s.D.Set("latest_model_group_id", *s.Res.LatestModelGroupId) + } + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + if s.Res.ProjectId != nil { + s.D.Set("project_id", *s.Res.ProjectId) + } + + s.D.Set("state", s.Res.LifecycleState) + + if s.Res.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) + } + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.TimeUpdated != nil { + s.D.Set("time_updated", s.Res.TimeUpdated.String()) + } + + return nil +} + +func (s *DatascienceModelGroupVersionHistoryResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_datascience.ChangeModelGroupVersionHistoryCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.ModelGroupVersionHistoryId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "datascience") + + _, err := s.Client.ChangeModelGroupVersionHistoryCompartment(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/datascience/datascience_model_groups_data_source.go b/internal/service/datascience/datascience_model_groups_data_source.go new file mode 100644 index 00000000000..10bd1c9a9b9 --- /dev/null +++ b/internal/service/datascience/datascience_model_groups_data_source.go @@ -0,0 +1,228 @@ +// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package datascience + +import ( + "context" + "strconv" + + "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 DatascienceModelGroupsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readDatascienceModelGroups, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "created_by": { + Type: schema.TypeString, + Optional: true, + }, + "display_name": { + Type: schema.TypeString, + Optional: true, + }, + "id": { + Type: schema.TypeString, + Optional: true, + }, + "model_group_version_history_id": { + Type: schema.TypeString, + Optional: true, + }, + "project_id": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeString, + Optional: true, + }, + "model_groups": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(DatascienceModelGroupResource()), + }, + }, + } +} + +func readDatascienceModelGroups(d *schema.ResourceData, m interface{}) error { + sync := &DatascienceModelGroupsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DataScienceClient() + + return tfresource.ReadResource(sync) +} + +type DatascienceModelGroupsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_datascience.DataScienceClient + Res *oci_datascience.ListModelGroupsResponse +} + +func (s *DatascienceModelGroupsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *DatascienceModelGroupsDataSourceCrud) Get() error { + request := oci_datascience.ListModelGroupsRequest{} + + 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 displayName, ok := s.D.GetOkExists("display_name"); ok { + tmp := displayName.(string) + request.DisplayName = &tmp + } + + if id, ok := s.D.GetOkExists("id"); ok { + tmp := id.(string) + request.Id = &tmp + } + + if modelGroupVersionHistoryId, ok := s.D.GetOkExists("model_group_version_history_id"); ok { + tmp := modelGroupVersionHistoryId.(string) + request.ModelGroupVersionHistoryId = &tmp + } + + if projectId, ok := s.D.GetOkExists("project_id"); ok { + tmp := projectId.(string) + request.ProjectId = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + request.LifecycleState = oci_datascience.ListModelGroupsLifecycleStateEnum(state.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "datascience") + + response, err := s.Client.ListModelGroups(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListModelGroups(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 *DatascienceModelGroupsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("DatascienceModelGroupsDataSource-", DatascienceModelGroupsDataSource(), s.D)) + resources := []map[string]interface{}{} + + for _, r := range s.Res.Items { + modelGroup := map[string]interface{}{ + "compartment_id": *r.CompartmentId, + } + + if r.CreatedBy != nil { + modelGroup["created_by"] = *r.CreatedBy + } + + if r.DefinedTags != nil { + modelGroup["defined_tags"] = tfresource.DefinedTagsToMap(r.DefinedTags) + } + + if r.DisplayName != nil { + modelGroup["display_name"] = *r.DisplayName + } + + modelGroup["freeform_tags"] = r.FreeformTags + + if r.Id != nil { + modelGroup["id"] = *r.Id + } + + if r.LifecycleDetails != nil { + modelGroup["lifecycle_details"] = *r.LifecycleDetails + } + + if r.ModelGroupDetails != nil { + modelGroupDetailsArray := []interface{}{} + if modelGroupDetailsMap := ModelGroupDetailsToMap(&r.ModelGroupDetails); modelGroupDetailsMap != nil { + modelGroupDetailsArray = append(modelGroupDetailsArray, modelGroupDetailsMap) + } + modelGroup["model_group_details"] = modelGroupDetailsArray + } else { + modelGroup["model_group_details"] = nil + } + + if r.ModelGroupVersionHistoryId != nil { + modelGroup["model_group_version_history_id"] = *r.ModelGroupVersionHistoryId + } + + if r.ModelGroupVersionHistoryName != nil { + modelGroup["model_group_version_history_name"] = *r.ModelGroupVersionHistoryName + } + + if r.ProjectId != nil { + modelGroup["project_id"] = *r.ProjectId + } + + modelGroup["state"] = r.LifecycleState + + if r.SystemTags != nil { + modelGroup["system_tags"] = tfresource.SystemTagsToMap(r.SystemTags) + } + + if r.TimeCreated != nil { + modelGroup["time_created"] = r.TimeCreated.String() + } + + if r.TimeUpdated != nil { + modelGroup["time_updated"] = r.TimeUpdated.String() + } + + if r.VersionId != nil { + modelGroup["version_id"] = strconv.FormatInt(*r.VersionId, 10) + } + + if r.VersionLabel != nil { + modelGroup["version_label"] = *r.VersionLabel + } + + resources = append(resources, modelGroup) + } + + if f, fOk := s.D.GetOkExists("filter"); fOk { + resources = tfresource.ApplyFilters(f.(*schema.Set), resources, DatascienceModelGroupsDataSource().Schema["model_groups"].Elem.(*schema.Resource).Schema) + } + + if err := s.D.Set("model_groups", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/datascience/datascience_notebook_session_resource.go b/internal/service/datascience/datascience_notebook_session_resource.go index 08756af8cbf..2d4a1e0cdd5 100644 --- a/internal/service/datascience/datascience_notebook_session_resource.go +++ b/internal/service/datascience/datascience_notebook_session_resource.go @@ -93,6 +93,12 @@ func DatascienceNotebookSessionResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -162,6 +168,11 @@ func DatascienceNotebookSessionResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -935,6 +946,10 @@ func NotebookSessionRuntimeConfigDetailsToMap(obj *oci_datascience.NotebookSessi func (s *DatascienceNotebookSessionResourceCrud) mapToNotebookSessionShapeConfigDetails(fieldKeyFormat string) (oci_datascience.NotebookSessionShapeConfigDetails, error) { result := oci_datascience.NotebookSessionShapeConfigDetails{} + if cpuBaseline, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "cpu_baseline")); ok { + result.CpuBaseline = oci_datascience.NotebookSessionShapeConfigDetailsCpuBaselineEnum(cpuBaseline.(string)) + } + if memoryInGBs, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "memory_in_gbs")); ok { tmp := float32(memoryInGBs.(float64)) result.MemoryInGBs = &tmp @@ -951,6 +966,8 @@ func (s *DatascienceNotebookSessionResourceCrud) mapToNotebookSessionShapeConfig func NotebookSessionShapeConfigDetailsToMap(obj *oci_datascience.NotebookSessionShapeConfigDetails) map[string]interface{} { result := map[string]interface{}{} + result["cpu_baseline"] = string(obj.CpuBaseline) + if obj.MemoryInGBs != nil { result["memory_in_gbs"] = float32(*obj.MemoryInGBs) } diff --git a/internal/service/datascience/datascience_pipeline_resource.go b/internal/service/datascience/datascience_pipeline_resource.go index 5d662e14f88..4a81850f380 100644 --- a/internal/service/datascience/datascience_pipeline_resource.go +++ b/internal/service/datascience/datascience_pipeline_resource.go @@ -227,6 +227,11 @@ func DatasciencePipelineResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -258,6 +263,11 @@ func DatasciencePipelineResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -320,6 +330,11 @@ func DatasciencePipelineResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -556,6 +571,11 @@ func DatasciencePipelineResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -1699,6 +1719,10 @@ func (s *DatasciencePipelineResourceCrud) mapToPipelineLogConfigurationDetails(f func (s *DatasciencePipelineResourceCrud) mapToPipelineShapeConfigDetails(fieldKeyFormat string) (oci_datascience.PipelineShapeConfigDetails, error) { result := oci_datascience.PipelineShapeConfigDetails{} + if cpuBaseline, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "cpu_baseline")); ok { + result.CpuBaseline = oci_datascience.PipelineShapeConfigDetailsCpuBaselineEnum(cpuBaseline.(string)) + } + if memoryInGBs, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "memory_in_gbs")); ok { tmp := float32(memoryInGBs.(float64)) result.MemoryInGBs = &tmp @@ -1712,20 +1736,6 @@ func (s *DatasciencePipelineResourceCrud) mapToPipelineShapeConfigDetails(fieldK return result, nil } -// func PipelineShapeConfigDetailsToMap(obj *oci_datascience.PipelineShapeConfigDetails) map[string]interface{} { -// result := map[string]interface{}{} - -// if obj.MemoryInGBs != nil { -// result["memory_in_gbs"] = float32(*obj.MemoryInGBs) -// } - -// if obj.Ocpus != nil { -// result["ocpus"] = float32(*obj.Ocpus) -// } - -// return result -// } - func (s *DatasciencePipelineResourceCrud) mapToPipelineStepConfigurationDetails(fieldKeyFormat string) (oci_datascience.PipelineStepConfigurationDetails, error) { result := oci_datascience.PipelineStepConfigurationDetails{} diff --git a/internal/service/datascience/datascience_pipeline_run_resource.go b/internal/service/datascience/datascience_pipeline_run_resource.go index bcb850fe752..e5fe8333235 100644 --- a/internal/service/datascience/datascience_pipeline_run_resource.go +++ b/internal/service/datascience/datascience_pipeline_run_resource.go @@ -311,6 +311,12 @@ func DatasciencePipelineRunResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -346,6 +352,12 @@ func DatasciencePipelineRunResource() *schema.Resource { // Required // Optional + "cpu_baseline": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "memory_in_gbs": { Type: schema.TypeFloat, Optional: true, @@ -1164,6 +1176,10 @@ func PipelineRunLogDetailsToMap(obj *oci_datascience.PipelineRunLogDetails) map[ func (s *DatasciencePipelineRunResourceCrud) mapToPipelineShapeConfigDetails(fieldKeyFormat string) (oci_datascience.PipelineShapeConfigDetails, error) { result := oci_datascience.PipelineShapeConfigDetails{} + if cpuBaseline, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "cpu_baseline")); ok { + result.CpuBaseline = oci_datascience.PipelineShapeConfigDetailsCpuBaselineEnum(cpuBaseline.(string)) + } + if memoryInGBs, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "memory_in_gbs")); ok { tmp := float32(memoryInGBs.(float64)) result.MemoryInGBs = &tmp @@ -1180,6 +1196,8 @@ func (s *DatasciencePipelineRunResourceCrud) mapToPipelineShapeConfigDetails(fie func PipelineShapeConfigDetailsToMap(obj *oci_datascience.PipelineShapeConfigDetails) map[string]interface{} { result := map[string]interface{}{} + result["cpu_baseline"] = string(obj.CpuBaseline) + if obj.MemoryInGBs != nil { result["memory_in_gbs"] = float32(*obj.MemoryInGBs) } diff --git a/internal/service/datascience/register_datasource.go b/internal/service/datascience/register_datasource.go index 1965a702390..e8384f81405 100644 --- a/internal/service/datascience/register_datasource.go +++ b/internal/service/datascience/register_datasource.go @@ -25,8 +25,15 @@ func RegisterDatasource() { tfresource.RegisterDatasource("oci_datascience_model_custom_metadata_artifact_content", DatascienceModelCustomMetadataArtifactContentDataSource()) tfresource.RegisterDatasource("oci_datascience_model_defined_metadata_artifact_content", DatascienceModelDefinedMetadataArtifactContentDataSource()) tfresource.RegisterDatasource("oci_datascience_model_deployment", DatascienceModelDeploymentDataSource()) + tfresource.RegisterDatasource("oci_datascience_model_deployment_model_states", DatascienceModelDeploymentModelStatesDataSource()) tfresource.RegisterDatasource("oci_datascience_model_deployment_shapes", DatascienceModelDeploymentShapesDataSource()) tfresource.RegisterDatasource("oci_datascience_model_deployments", DatascienceModelDeploymentsDataSource()) + tfresource.RegisterDatasource("oci_datascience_model_group", DatascienceModelGroupDataSource()) + tfresource.RegisterDatasource("oci_datascience_model_group_artifact_content", DatascienceModelGroupArtifactContentDataSource()) + tfresource.RegisterDatasource("oci_datascience_model_group_models", DatascienceModelGroupModelsDataSource()) + tfresource.RegisterDatasource("oci_datascience_model_group_version_histories", DatascienceModelGroupVersionHistoriesDataSource()) + tfresource.RegisterDatasource("oci_datascience_model_group_version_history", DatascienceModelGroupVersionHistoryDataSource()) + tfresource.RegisterDatasource("oci_datascience_model_groups", DatascienceModelGroupsDataSource()) tfresource.RegisterDatasource("oci_datascience_model_provenance", DatascienceModelProvenanceDataSource()) tfresource.RegisterDatasource("oci_datascience_model_version_set", DatascienceModelVersionSetDataSource()) tfresource.RegisterDatasource("oci_datascience_model_version_sets", DatascienceModelVersionSetsDataSource()) diff --git a/internal/service/datascience/register_resource.go b/internal/service/datascience/register_resource.go index 3b968916c37..e9d4d695090 100644 --- a/internal/service/datascience/register_resource.go +++ b/internal/service/datascience/register_resource.go @@ -16,6 +16,9 @@ func RegisterResource() { tfresource.RegisterResource("oci_datascience_model_custom_metadata_artifact", DatascienceModelCustomMetadataArtifactResource()) tfresource.RegisterResource("oci_datascience_model_defined_metadata_artifact", DatascienceModelDefinedMetadataArtifactResource()) tfresource.RegisterResource("oci_datascience_model_deployment", DatascienceModelDeploymentResource()) + tfresource.RegisterResource("oci_datascience_model_group", DatascienceModelGroupResource()) + tfresource.RegisterResource("oci_datascience_model_group_artifact", DatascienceModelGroupArtifactResource()) + tfresource.RegisterResource("oci_datascience_model_group_version_history", DatascienceModelGroupVersionHistoryResource()) tfresource.RegisterResource("oci_datascience_model_provenance", DatascienceModelProvenanceResource()) tfresource.RegisterResource("oci_datascience_model_version_set", DatascienceModelVersionSetResource()) tfresource.RegisterResource("oci_datascience_model_artifact_export", DatascienceModelArtifactExportResource()) diff --git a/internal/service/dns/dns_zones_data_source.go b/internal/service/dns/dns_zones_data_source.go index be03fcaaffc..c323abf9e93 100644 --- a/internal/service/dns/dns_zones_data_source.go +++ b/internal/service/dns/dns_zones_data_source.go @@ -205,7 +205,7 @@ func (s *DnsZonesDataSourceCrud) Get() error { } s.Res.Items = append(s.Res.Items, listResponse.Items...) - request.Page = s.Res.OpcNextPage + request.Page = listResponse.OpcNextPage for request.Page != nil { listResponse, err = s.Client.ListZones(context.Background(), request) diff --git a/internal/service/management_dashboard/management_dashboard_management_dashboards_import_resource.go b/internal/service/management_dashboard/management_dashboard_management_dashboards_import_resource.go index ce9d0ec0117..e3da0449ca2 100644 --- a/internal/service/management_dashboard/management_dashboard_management_dashboards_import_resource.go +++ b/internal/service/management_dashboard/management_dashboard_management_dashboards_import_resource.go @@ -40,6 +40,24 @@ func ManagementDashboardManagementDashboardsImportResource() *schema.Resource { ForceNew: true, ConflictsWith: []string{"import_details_file"}, }, + "override_dashboard_compartment_ocid": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "override_same_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "override_saved_search_compartment_ocid": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, }, } } @@ -84,6 +102,23 @@ func (s *ManagementDashboardManagementDashboardsImportResourceCrud) Create() err request.ManagementDashboardImportDetails = importDetailsObj } + if overrideDashboardCompartmentOcid, ok := s.D.GetOkExists("override_dashboard_compartment_ocid"); ok { + tmp := overrideDashboardCompartmentOcid.(string) + request.OverrideDashboardCompartmentOcid = &tmp + } + + if overrideSameName, ok := s.D.GetOkExists("override_same_name"); ok { + tmp := overrideSameName.(string) + request.OverrideSameName = &tmp + } + + if overrideSavedSearchCompartmentOcid, ok := s.D.GetOkExists("override_saved_search_compartment_ocid"); ok { + tmp := overrideSavedSearchCompartmentOcid.(string) + request.OverrideSavedSearchCompartmentOcid = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "management_dashboard") + if importDetailsFilePath, ok := s.D.GetOkExists("import_details_file"); ok { flag = true importDetailsFileData, err := ioutil.ReadFile(importDetailsFilePath.(string)) @@ -105,9 +140,10 @@ func (s *ManagementDashboardManagementDashboardsImportResourceCrud) Create() err request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "management_dashboard") - _, err := s.Client.ImportDashboard(context.Background(), request) + response, err := s.Client.ImportDashboard(context.Background(), request) if err != nil { - return err + return fmt.Errorf("response: %s \n error: %s", response, err) + } return nil diff --git a/internal/service/opsi/opsi_database_insight_data_source.go b/internal/service/opsi/opsi_database_insight_data_source.go index ed5d03e15d8..398a563275a 100644 --- a/internal/service/opsi/opsi_database_insight_data_source.go +++ b/internal/service/opsi/opsi_database_insight_data_source.go @@ -75,7 +75,6 @@ func (s *OpsiDatabaseInsightDataSourceCrud) SetData() error { } else { s.D.Set("connection_details", nil) } - log.Printf("[DEBUG] in data source setData") if v.CredentialDetails != nil { credentialDetailsArray := []interface{}{} if credentialDetailsMap := CredentialDetailsToMap(&v.CredentialDetails); credentialDetailsMap != nil { @@ -284,6 +283,102 @@ func (s *OpsiDatabaseInsightDataSourceCrud) SetData() error { s.D.Set("time_created", v.TimeCreated.String()) } + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + case oci_opsi.MacsManagedAutonomousDatabaseInsight: + s.D.Set("entity_source", "MACS_MANAGED_AUTONOMOUS_DATABASE") + + if v.ConnectionCredentialDetails != nil { + connectionCredentialDetailsArray := []interface{}{} + if connectionCredentialDetailsMap := CredentialDetailsToMap(&v.ConnectionCredentialDetails); connectionCredentialDetailsMap != nil { + connectionCredentialDetailsArray = append(connectionCredentialDetailsArray, connectionCredentialDetailsMap) + } + s.D.Set("connection_credential_details", connectionCredentialDetailsArray) + } else { + s.D.Set("connection_credential_details", nil) + } + + if v.ConnectionDetails != nil { + s.D.Set("connection_details", []interface{}{ConnectionDetailsToMap(v.ConnectionDetails)}) + } else { + s.D.Set("connection_details", nil) + } + + if v.DatabaseDisplayName != nil { + s.D.Set("database_display_name", *v.DatabaseDisplayName) + } + + if v.DatabaseName != nil { + s.D.Set("database_name", *v.DatabaseName) + } + + if v.DatabaseResourceType != nil { + s.D.Set("database_resource_type", *v.DatabaseResourceType) + } + + if v.ManagementAgentId != nil { + s.D.Set("management_agent_id", *v.ManagementAgentId) + } + + if v.ParentId != nil { + s.D.Set("parent_id", *v.ParentId) + } + + if v.RootId != nil { + s.D.Set("root_id", *v.RootId) + } + + if v.CompartmentId != nil { + s.D.Set("compartment_id", *v.CompartmentId) + } + + if v.Id != nil { + s.D.SetId(*v.Id) + } + + if v.DatabaseConnectionStatusDetails != nil { + s.D.Set("database_connection_status_details", *v.DatabaseConnectionStatusDetails) + } + + if v.DatabaseId != nil { + s.D.Set("database_id", *v.DatabaseId) + } + + if v.DatabaseType != nil { + s.D.Set("database_type", *v.DatabaseType) + } + + if v.DatabaseVersion != nil { + s.D.Set("database_version", *v.DatabaseVersion) + } + + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } + + s.D.Set("freeform_tags", v.FreeformTags) + + if v.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *v.LifecycleDetails) + } + + if v.ProcessorCount != nil { + s.D.Set("processor_count", *v.ProcessorCount) + } + + s.D.Set("state", v.LifecycleState) + + s.D.Set("status", v.Status) + + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) + } + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } diff --git a/internal/service/opsi/opsi_database_insight_resource.go b/internal/service/opsi/opsi_database_insight_resource.go index 1d4f4f820b6..71a211c3ca8 100644 --- a/internal/service/opsi/opsi_database_insight_resource.go +++ b/internal/service/opsi/opsi_database_insight_resource.go @@ -10,15 +10,15 @@ import ( "strings" "time" - "github.com/oracle/terraform-provider-oci/internal/client" - "github.com/oracle/terraform-provider-oci/internal/tfresource" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/retry" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" oci_common "github.com/oracle/oci-go-sdk/v65/common" oci_opsi "github.com/oracle/oci-go-sdk/v65/opsi" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" ) func OpsiDatabaseInsightResource() *schema.Resource { @@ -42,15 +42,19 @@ func OpsiDatabaseInsightResource() *schema.Resource { Required: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ + "AUTONOMOUS_DATABASE", "EM_MANAGED_EXTERNAL_DATABASE", "EXTERNAL_MYSQL_DATABASE_SYSTEM", + "MACS_MANAGED_AUTONOMOUS_DATABASE", "MACS_MANAGED_CLOUD_DATABASE", + "MACS_MANAGED_EXTERNAL_DATABASE", "MDS_MYSQL_DATABASE_SYSTEM", "PE_COMANAGED_DATABASE", - "AUTONOMOUS_DATABASE", }, true), }, + // Optional + // credential detailf for MACS Managed resource "connection_credential_details": { Type: schema.TypeList, Computed: true, @@ -61,20 +65,26 @@ func OpsiDatabaseInsightResource() *schema.Resource { Schema: map[string]*schema.Schema{ // Required "credential_type": { - Type: schema.TypeString, - Required: true, - //ForceNew: true, + Type: schema.TypeString, + Required: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ + "CREDENTIALS_BY_NAMED_CREDS", "CREDENTIALS_BY_SOURCE", "CREDENTIALS_BY_VAULT", }, true), }, + // Optional "credential_source_name": { Type: schema.TypeString, Optional: true, }, + "named_credential_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "password_secret_id": { Type: schema.TypeString, Optional: true, @@ -89,6 +99,8 @@ func OpsiDatabaseInsightResource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + + // Computed }, }, }, @@ -96,10 +108,13 @@ func OpsiDatabaseInsightResource() *schema.Resource { Type: schema.TypeList, Computed: true, Optional: true, + ForceNew: true, MaxItems: 1, MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + // Required + // Optional "host_name": { Type: schema.TypeString, @@ -110,13 +125,12 @@ func OpsiDatabaseInsightResource() *schema.Resource { Type: schema.TypeList, Computed: true, Optional: true, + ForceNew: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required // Optional - - // Computed "host_ip": { Type: schema.TypeString, Optional: true, @@ -127,6 +141,8 @@ func OpsiDatabaseInsightResource() *schema.Resource { Optional: true, Computed: true, }, + + // Computed }, }, }, @@ -145,21 +161,25 @@ func OpsiDatabaseInsightResource() *schema.Resource { Optional: true, Computed: true, }, + + // Computed }, }, }, + // Credential detail for other resources "credential_details": { Type: schema.TypeList, Optional: true, + Computed: true, + ForceNew: true, MaxItems: 1, MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required "credential_type": { - Type: schema.TypeString, - Required: true, - //ForceNew: true, + Type: schema.TypeString, + Required: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ "CREDENTIALS_BY_IAM", @@ -172,35 +192,32 @@ func OpsiDatabaseInsightResource() *schema.Resource { "credential_source_name": { Type: schema.TypeString, Optional: true, - //Computed: true, - //ForceNew: true, }, - "password_secret_id": { + "named_credential_id": { Type: schema.TypeString, Optional: true, - //Computed: true, - //ForceNew: true, + }, + "password_secret_id": { + Type: schema.TypeString, + Optional: true, Sensitive: true, }, "role": { Type: schema.TypeString, Optional: true, Computed: true, - //ForceNew: true, }, "user_name": { Type: schema.TypeString, Optional: true, - //Computed: true, - //ForceNew: true, }, "wallet_secret_id": { Type: schema.TypeString, Optional: true, Sensitive: true, - //Computed: true, - //ForceNew: true, }, + + // Computed }, }, }, @@ -242,6 +259,7 @@ func OpsiDatabaseInsightResource() *schema.Resource { }, "system_tags": { Type: schema.TypeMap, + Optional: true, Computed: true, Elem: schema.TypeString, }, @@ -279,13 +297,10 @@ func OpsiDatabaseInsightResource() *schema.Resource { Type: schema.TypeBool, Optional: true, Computed: true, - //ForceNew: true, }, "management_agent_id": { Type: schema.TypeString, Optional: true, - //Computed: true, - //ForceNew: true, }, "opsi_private_endpoint_id": { Type: schema.TypeString, @@ -305,7 +320,6 @@ func OpsiDatabaseInsightResource() *schema.Resource { Computed: true, Optional: true, }, - "status": { Type: schema.TypeString, Computed: true, @@ -316,8 +330,6 @@ func OpsiDatabaseInsightResource() *schema.Resource { Computed: true, Optional: true, }, - - // Computed "database_display_name": { Type: schema.TypeString, Computed: true, @@ -477,6 +489,7 @@ func (s *OpsiDatabaseInsightResourceCrud) Create() error { } // Wait until it finishes + // This is our special logic to disable resource first then to be deleted. databaseInsightId, err := databaseInsightWaitForWorkRequest(workId, "opsi", oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries, s.Client) @@ -510,7 +523,7 @@ func (s *OpsiDatabaseInsightResourceCrud) Create() error { } } - return s.Get() + return s.getDatabaseInsightFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) } func (s *OpsiDatabaseInsightResourceCrud) getDatabaseInsightFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, @@ -646,9 +659,7 @@ func (s *OpsiDatabaseInsightResourceCrud) Get() error { } func (s *OpsiDatabaseInsightResourceCrud) Update() error { - if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { - log.Printf("[DEBUG] Running Update moviing compartment (%s)", compartment) oldRaw, newRaw := s.D.GetChange("compartment_id") if newRaw != "" && oldRaw != "" { err := s.updateCompartment(compartment) @@ -657,6 +668,8 @@ func (s *OpsiDatabaseInsightResourceCrud) Update() error { } } } + + // Special logic to call update api for connection/credential details etc. entitySourceRaw, ok := s.D.GetOkExists("entity_source") var entitySource string if ok { @@ -689,6 +702,18 @@ func (s *OpsiDatabaseInsightResourceCrud) Update() error { } } + if strings.ToLower(entitySource) == strings.ToLower("MACS_MANAGED_AUTONOMOUS_DATABASE") { + // For MACS_MANAGED_AUTONOMOUS_DATABASE + changeAdbConnRequest := oci_opsi.ChangeMacsManagedAutonomousDatabaseInsightConnectionRequest{} + hasChanged := s.populateChangeMacsAdbConnectionDetailsRequest(&changeAdbConnRequest) + if hasChanged { + err := s.updateMacsAdbConnectionDetails(&changeAdbConnRequest) + if err != nil { + return err + } + } + } + // For AUTONOMOUS_DATABASE if strings.ToLower(entitySource) == strings.ToLower("AUTONOMOUS_DATABASE") { updateAdbFullFeatureRequest := oci_opsi.ChangeAutonomousDatabaseInsightAdvancedFeaturesRequest{} @@ -714,7 +739,6 @@ func (s *OpsiDatabaseInsightResourceCrud) Update() error { } } } - request := oci_opsi.UpdateDatabaseInsightRequest{} err := s.populateTopLevelPolymorphicUpdateDatabaseInsightRequest(&request) if err != nil { @@ -729,7 +753,8 @@ func (s *OpsiDatabaseInsightResourceCrud) Update() error { } workId := response.OpcWorkRequestId - // Wait until it finishes + + // speical logic to disable resource databaseInsightId, err := databaseInsightWaitForWorkRequest(workId, "opsi", oci_opsi.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries, s.Client) @@ -799,6 +824,7 @@ func (s *OpsiDatabaseInsightResourceCrud) Update() error { } return s.Get() + } func (s *OpsiDatabaseInsightResourceCrud) Delete() error { @@ -822,6 +848,7 @@ func (s *OpsiDatabaseInsightResourceCrud) Delete() error { return disableWorkRequestErr } } + request := oci_opsi.DeleteDatabaseInsightRequest{} tmp := s.D.Id() @@ -844,6 +871,8 @@ func (s *OpsiDatabaseInsightResourceCrud) Delete() error { func (s *OpsiDatabaseInsightResourceCrud) SetData() error { switch v := (*s.Res).(type) { case oci_opsi.AutonomousDatabaseInsight: + s.D.Set("entity_source", "AUTONOMOUS_DATABASE") + if v.ConnectionDetails != nil { s.D.Set("connection_details", []interface{}{ConnectionDetailsToMap(v.ConnectionDetails)}) } else { @@ -876,10 +905,18 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("database_type", *v.DatabaseType) } + if v.DatabaseVersion != nil { + s.D.Set("database_version", *v.DatabaseVersion) + } + if v.DatabaseResourceType != nil { s.D.Set("database_resource_type", *v.DatabaseResourceType) } + if v.IsAdvancedFeaturesEnabled != nil { + s.D.Set("is_advanced_features_enabled", *v.IsAdvancedFeaturesEnabled) + } + if v.OpsiPrivateEndpointId != nil { s.D.Set("opsi_private_endpoint_id", *v.OpsiPrivateEndpointId) } @@ -902,8 +939,8 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("lifecycle_details", *v.LifecycleDetails) } - if v.ProcessorCount != nil { - s.D.Set("processor_count", *v.ProcessorCount) + if v.OpsiPrivateEndpointId != nil { + s.D.Set("opsi_private_endpoint_id", *v.OpsiPrivateEndpointId) } s.D.Set("state", v.LifecycleState) @@ -921,7 +958,6 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } - case oci_opsi.EmManagedExternalDatabaseInsight: s.D.Set("entity_source", "EM_MANAGED_EXTERNAL_DATABASE") @@ -969,6 +1005,10 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("enterprise_manager_bridge_id", *v.EnterpriseManagerBridgeId) } + if v.ExadataInsightId != nil { + s.D.Set("exadata_insight_id", *v.ExadataInsightId) + } + s.D.Set("freeform_tags", v.FreeformTags) if v.LifecycleDetails != nil { @@ -979,10 +1019,6 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("processor_count", *v.ProcessorCount) } - if v.ExadataInsightId != nil { - s.D.Set("exadata_insight_id", *v.ExadataInsightId) - } - s.D.Set("state", v.LifecycleState) s.D.Set("status", v.Status) @@ -1058,8 +1094,8 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } - case oci_opsi.MacsManagedCloudDatabaseInsight: - s.D.Set("entity_source", "MACS_MANAGED_CLOUD_DATABASE") + case oci_opsi.MacsManagedAutonomousDatabaseInsight: + s.D.Set("entity_source", "MACS_MANAGED_AUTONOMOUS_DATABASE") if v.ConnectionCredentialDetails != nil { connectionCredentialDetailsArray := []interface{}{} @@ -1081,10 +1117,6 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("database_display_name", *v.DatabaseDisplayName) } - if v.DatabaseId != nil { - s.D.Set("database_id", *v.DatabaseId) - } - if v.DatabaseName != nil { s.D.Set("database_name", *v.DatabaseName) } @@ -1154,9 +1186,24 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } + case oci_opsi.MacsManagedCloudDatabaseInsight: + s.D.Set("entity_source", "MACS_MANAGED_CLOUD_DATABASE") + + if v.ConnectionCredentialDetails != nil { + connectionCredentialDetailsArray := []interface{}{} + if connectionCredentialDetailsMap := CredentialDetailsToMap(&v.ConnectionCredentialDetails); connectionCredentialDetailsMap != nil { + connectionCredentialDetailsArray = append(connectionCredentialDetailsArray, connectionCredentialDetailsMap) + } + s.D.Set("connection_credential_details", connectionCredentialDetailsArray) + } else { + s.D.Set("connection_credential_details", nil) + } - case oci_opsi.MdsMySqlDatabaseInsight: - s.D.Set("entity_source", "MDS_MYSQL_DATABASE_SYSTEM") + if v.ConnectionDetails != nil { + s.D.Set("connection_details", []interface{}{ConnectionDetailsToMap(v.ConnectionDetails)}) + } else { + s.D.Set("connection_details", nil) + } if v.DatabaseDisplayName != nil { s.D.Set("database_display_name", *v.DatabaseDisplayName) @@ -1174,12 +1221,16 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("database_resource_type", *v.DatabaseResourceType) } - if v.IsHeatWaveClusterAttached != nil { - s.D.Set("is_heat_wave_cluster_attached", *v.IsHeatWaveClusterAttached) + if v.ManagementAgentId != nil { + s.D.Set("management_agent_id", *v.ManagementAgentId) } - if v.IsHighlyAvailable != nil { - s.D.Set("is_highly_available", *v.IsHighlyAvailable) + if v.ParentId != nil { + s.D.Set("parent_id", *v.ParentId) + } + + if v.RootId != nil { + s.D.Set("root_id", *v.RootId) } if v.CompartmentId != nil { @@ -1227,28 +1278,29 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } - case oci_opsi.PeComanagedDatabaseInsight: - s.D.Set("entity_source", "PE_COMANAGED_DATABASE") + case oci_opsi.MacsManagedExternalDatabaseInsight: + s.D.Set("entity_source", "MACS_MANAGED_EXTERNAL_DATABASE") - if v.CredentialDetails != nil { - credentialDetailsArray := []interface{}{} - if credentialDetailsMap := CredentialDetailsToMap(&v.CredentialDetails); credentialDetailsMap != nil { - credentialDetailsArray = append(credentialDetailsArray, credentialDetailsMap) + if v.ConnectionCredentialDetails != nil { + connectionCredentialDetailsArray := []interface{}{} + if connectionCredentialDetailsMap := CredentialDetailsToMap(&v.ConnectionCredentialDetails); connectionCredentialDetailsMap != nil { + connectionCredentialDetailsArray = append(connectionCredentialDetailsArray, connectionCredentialDetailsMap) } - s.D.Set("credential_details", credentialDetailsArray) + s.D.Set("connection_credential_details", connectionCredentialDetailsArray) } else { - s.D.Set("credential_details", nil) + s.D.Set("connection_credential_details", nil) } + if v.ConnectionDetails != nil { - connectionDetailsArray := []interface{}{} - if connectionDetailsMap := PeComanagedDatabaseConnectionDetailsToMap(v.ConnectionDetails); connectionDetailsMap != nil { - connectionDetailsArray = append(connectionDetailsArray, connectionDetailsMap) - } - s.D.Set("connection_details", connectionDetailsArray) + s.D.Set("connection_details", []interface{}{ConnectionDetailsToMap(v.ConnectionDetails)}) } else { s.D.Set("connection_details", nil) } + if v.ConnectorId != nil { + s.D.Set("connector_id", *v.ConnectorId) + } + if v.DatabaseDisplayName != nil { s.D.Set("database_display_name", *v.DatabaseDisplayName) } @@ -1265,16 +1317,8 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("database_resource_type", *v.DatabaseResourceType) } - if v.OpsiPrivateEndpointId != nil { - s.D.Set("opsi_private_endpoint_id", *v.OpsiPrivateEndpointId) - } - - if v.ParentId != nil { - s.D.Set("parent_id", *v.ParentId) - } - - if v.RootId != nil { - s.D.Set("root_id", *v.RootId) + if v.ManagementAgentId != nil { + s.D.Set("management_agent_id", *v.ManagementAgentId) } if v.CompartmentId != nil { @@ -1293,6 +1337,10 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { s.D.Set("database_type", *v.DatabaseType) } + if v.DatabaseVersion != nil { + s.D.Set("database_version", *v.DatabaseVersion) + } + if v.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) } @@ -1322,587 +1370,486 @@ func (s *OpsiDatabaseInsightResourceCrud) SetData() error { if v.TimeUpdated != nil { s.D.Set("time_updated", v.TimeUpdated.String()) } - default: - log.Printf("[WARN] Received 'entity_source' of unknown type %v", *s.Res) - return nil - } - return nil -} + case oci_opsi.MdsMySqlDatabaseInsight: + s.D.Set("entity_source", "MDS_MYSQL_DATABASE_SYSTEM") -func (s *OpsiDatabaseInsightResourceCrud) mapToConnectionDetails(fieldKeyFormat string) (oci_opsi.ConnectionDetails, error) { - result := oci_opsi.ConnectionDetails{} + if v.DatabaseDisplayName != nil { + s.D.Set("database_display_name", *v.DatabaseDisplayName) + } - if hostName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "host_name")); ok { - tmp := hostName.(string) - result.HostName = &tmp - } + if v.DatabaseId != nil { + s.D.Set("database_id", *v.DatabaseId) + } - if port, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "port")); ok { - tmp := port.(int) - result.Port = &tmp - } + if v.DatabaseName != nil { + s.D.Set("database_name", *v.DatabaseName) + } - if protocol, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "protocol")); ok { - result.Protocol = oci_opsi.ConnectionDetailsProtocolEnum(protocol.(string)) - } + if v.DatabaseResourceType != nil { + s.D.Set("database_resource_type", *v.DatabaseResourceType) + } - if serviceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "service_name")); ok { - tmp := serviceName.(string) - result.ServiceName = &tmp - } + if v.IsHeatWaveClusterAttached != nil { + s.D.Set("is_heat_wave_cluster_attached", *v.IsHeatWaveClusterAttached) + } - return result, nil -} + if v.IsHighlyAvailable != nil { + s.D.Set("is_highly_available", *v.IsHighlyAvailable) + } -func ConnectionDetailsToMap(obj *oci_opsi.ConnectionDetails) map[string]interface{} { - result := map[string]interface{}{} + if v.CompartmentId != nil { + s.D.Set("compartment_id", *v.CompartmentId) + } - if obj.HostName != nil { - result["host_name"] = string(*obj.HostName) - } + if v.DatabaseConnectionStatusDetails != nil { + s.D.Set("database_connection_status_details", *v.DatabaseConnectionStatusDetails) + } - if obj.Port != nil { - result["port"] = int(*obj.Port) - } + if v.DatabaseId != nil { + s.D.Set("database_id", *v.DatabaseId) + } - result["protocol"] = string(obj.Protocol) + if v.DatabaseType != nil { + s.D.Set("database_type", *v.DatabaseType) + } - log.Printf("[DEBUG] populate for updating (%s)", result["protocol"]) + if v.DatabaseVersion != nil { + s.D.Set("database_version", *v.DatabaseVersion) + } - if obj.ServiceName != nil { - result["service_name"] = string(*obj.ServiceName) - } + if v.DefinedTags != nil { + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) + } - return result -} + s.D.Set("freeform_tags", v.FreeformTags) -func (s *OpsiDatabaseInsightResourceCrud) mapToCredentialDetails(fieldKeyFormat string) (oci_opsi.CredentialDetails, error) { - var baseObject oci_opsi.CredentialDetails - //discriminator - credentialTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_type")) - var credentialType string - if ok { - credentialType = credentialTypeRaw.(string) - } else { - credentialType = "" // default value - } - switch strings.ToLower(credentialType) { - case strings.ToLower("CREDENTIALS_BY_IAM"): - details := oci_opsi.CredentialByIam{} - if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { - tmp := credentialSourceName.(string) - details.CredentialSourceName = &tmp + if v.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *v.LifecycleDetails) } - baseObject = details - case strings.ToLower("CREDENTIALS_BY_SOURCE"): - details := oci_opsi.CredentialsBySource{} - if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { - tmp := credentialSourceName.(string) - details.CredentialSourceName = &tmp + + if v.ProcessorCount != nil { + s.D.Set("processor_count", *v.ProcessorCount) } - baseObject = details - case strings.ToLower("CREDENTIALS_BY_VAULT"): - details := oci_opsi.CredentialByVault{} - if passwordSecretId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "password_secret_id")); ok { - tmp := passwordSecretId.(string) - log.Printf("[INFO] In mapToCredentialDetails password secrete id %s", tmp) - details.PasswordSecretId = &tmp - } - if role, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "role")); ok { - details.Role = oci_opsi.CredentialByVaultRoleEnum(role.(string)) - } - if userName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "user_name")); ok { - tmp := userName.(string) - details.UserName = &tmp - } - if walletSecretId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "wallet_secret_id")); ok { - tmp := walletSecretId.(string) - details.WalletSecretId = &tmp - } - baseObject = details - default: - return nil, fmt.Errorf("unknown credential_type '%v' was specified", credentialType) - } - return baseObject, nil -} -func CredentialDetailsToMap(obj *oci_opsi.CredentialDetails) map[string]interface{} { - result := map[string]interface{}{} - switch v := (*obj).(type) { - case oci_opsi.CredentialByIam: - result["credential_type"] = "CREDENTIALS_BY_IAM" - case oci_opsi.CredentialsBySource: - result["credential_type"] = "CREDENTIALS_BY_SOURCE" - case oci_opsi.CredentialByVault: - result["credential_type"] = "CREDENTIALS_BY_VAULT" - - if v.PasswordSecretId != nil { - result["password_secret_id"] = string(*v.PasswordSecretId) - } - result["role"] = string(v.Role) + s.D.Set("state", v.LifecycleState) - if v.UserName != nil { - result["user_name"] = string(*v.UserName) - } + s.D.Set("status", v.Status) - if v.WalletSecretId != nil { - result["wallet_secret_id"] = string(*v.WalletSecretId) + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) } - default: - log.Printf("[WARN] Received 'credential_type' of unknown type %T", v) - return nil - } - - return result -} - -func DatabaseInsightSummaryToMap(obj oci_opsi.DatabaseInsightSummary) map[string]interface{} { - result := map[string]interface{}{} - - switch v := (obj).(type) { - case oci_opsi.AutonomousDatabaseInsightSummary: - result["entity_source"] = "AUTONOMOUS_DATABASE" - if v.Id != nil { - result["id"] = string(*v.Id) + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) } - if v.DatabaseId != nil { - result["database_id"] = string(*v.DatabaseId) + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) } + case oci_opsi.PeComanagedDatabaseInsight: + s.D.Set("entity_source", "PE_COMANAGED_DATABASE") - if v.CompartmentId != nil { - result["compartment_id"] = string(*v.CompartmentId) + if v.ConnectionDetails != nil { + s.D.Set("connection_details", []interface{}{PeComanagedDatabaseConnectionDetailsToMap(v.ConnectionDetails)}) + } else { + s.D.Set("connection_details", nil) } - if v.DatabaseName != nil { - result["database_name"] = string(*v.DatabaseName) + if v.CredentialDetails != nil { + credentialDetailsArray := []interface{}{} + if credentialDetailsMap := CredentialDetailsToMap(&v.CredentialDetails); credentialDetailsMap != nil { + credentialDetailsArray = append(credentialDetailsArray, credentialDetailsMap) + } + s.D.Set("credential_details", credentialDetailsArray) + } else { + s.D.Set("credential_details", nil) } if v.DatabaseDisplayName != nil { - result["database_display_name"] = string(*v.DatabaseDisplayName) - } - - if v.DatabaseType != nil { - result["database_type"] = string(*v.DatabaseType) - } - - if v.DatabaseVersion != nil { - result["database_version"] = string(*v.DatabaseVersion) - } - - if v.LifecycleDetails != nil { - result["lifecycle_details"] = string(*v.LifecycleDetails) - } - - result["state"] = string(v.LifecycleState) - - result["status"] = string(v.Status) - - if v.TimeCreated != nil { - result["time_created"] = v.TimeCreated.String() - } - - if v.TimeUpdated != nil { - result["time_updated"] = v.TimeUpdated.String() + s.D.Set("database_display_name", *v.DatabaseDisplayName) } - if v.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(v.SystemTags) + if v.DatabaseId != nil { + s.D.Set("database_id", *v.DatabaseId) } - result["freeform_tags"] = v.FreeformTags - - if v.DefinedTags != nil { - result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) + if v.DatabaseName != nil { + s.D.Set("database_name", *v.DatabaseName) } if v.DatabaseResourceType != nil { - result["database_resource_type"] = string(*v.DatabaseResourceType) + s.D.Set("database_resource_type", *v.DatabaseResourceType) } - if v.IsAdvancedFeaturesEnabled != nil { - result["is_advanced_features_enabled"] = bool(*v.IsAdvancedFeaturesEnabled) + if v.OpsiPrivateEndpointId != nil { + s.D.Set("opsi_private_endpoint_id", *v.OpsiPrivateEndpointId) } - case oci_opsi.EmManagedExternalDatabaseInsightSummary: - result["entity_source"] = "EM_MANAGED_EXTERNAL_DATABASE" - if v.Id != nil { - result["id"] = string(*v.Id) + if v.ParentId != nil { + s.D.Set("parent_id", *v.ParentId) } - if v.DatabaseId != nil { - result["database_id"] = string(*v.DatabaseId) + if v.RootId != nil { + s.D.Set("root_id", *v.RootId) } if v.CompartmentId != nil { - result["compartment_id"] = string(*v.CompartmentId) + s.D.Set("compartment_id", *v.CompartmentId) } - if v.DatabaseName != nil { - result["database_name"] = string(*v.DatabaseName) + if v.DatabaseConnectionStatusDetails != nil { + s.D.Set("database_connection_status_details", *v.DatabaseConnectionStatusDetails) } - if v.DatabaseDisplayName != nil { - result["database_display_name"] = string(*v.DatabaseDisplayName) + if v.DatabaseId != nil { + s.D.Set("database_id", *v.DatabaseId) } if v.DatabaseType != nil { - result["database_type"] = string(*v.DatabaseType) + s.D.Set("database_type", *v.DatabaseType) } if v.DatabaseVersion != nil { - result["database_version"] = string(*v.DatabaseVersion) - } - - if v.LifecycleDetails != nil { - result["lifecycle_details"] = string(*v.LifecycleDetails) - } - - if v.ProcessorCount != nil { - result["processor_count"] = fmt.Sprint(*v.ProcessorCount) - } - - if v.DatabaseHostNames != nil { - result["database_host_names"] = v.DatabaseHostNames - } - - result["state"] = string(v.LifecycleState) - - result["status"] = string(v.Status) - - if v.TimeCreated != nil { - result["time_created"] = v.TimeCreated.String() - } - - if v.TimeUpdated != nil { - result["time_updated"] = v.TimeUpdated.String() - } - - if v.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(v.SystemTags) + s.D.Set("database_version", *v.DatabaseVersion) } - result["freeform_tags"] = v.FreeformTags - if v.DefinedTags != nil { - result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) - } - - if v.EnterpriseManagerBridgeId != nil { - result["enterprise_manager_bridge_id"] = string(*v.EnterpriseManagerBridgeId) + s.D.Set("defined_tags", tfresource.DefinedTagsToMap(v.DefinedTags)) } - if v.EnterpriseManagerEntityDisplayName != nil { - result["enterprise_manager_entity_display_name"] = string(*v.EnterpriseManagerEntityDisplayName) - } + s.D.Set("freeform_tags", v.FreeformTags) - if v.EnterpriseManagerEntityIdentifier != nil { - result["enterprise_manager_entity_identifier"] = string(*v.EnterpriseManagerEntityIdentifier) + if v.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *v.LifecycleDetails) } - if v.EnterpriseManagerEntityName != nil { - result["enterprise_manager_entity_name"] = string(*v.EnterpriseManagerEntityName) + if v.OpsiPrivateEndpointId != nil { + s.D.Set("opsi_private_endpoint_id", *v.OpsiPrivateEndpointId) } - if v.EnterpriseManagerEntityType != nil { - result["enterprise_manager_entity_type"] = string(*v.EnterpriseManagerEntityType) + if v.ProcessorCount != nil { + s.D.Set("processor_count", *v.ProcessorCount) } - if v.EnterpriseManagerIdentifier != nil { - result["enterprise_manager_identifier"] = string(*v.EnterpriseManagerIdentifier) - } + s.D.Set("state", v.LifecycleState) - if v.ExadataInsightId != nil { - result["exadata_insight_id"] = string(*v.ExadataInsightId) - } - case oci_opsi.MacsManagedCloudDatabaseInsightSummary: - result["entity_source"] = "MACS_MANAGED_CLOUD_DATABASE" - if v.Id != nil { - result["id"] = string(*v.Id) - } + s.D.Set("status", v.Status) - if v.DatabaseId != nil { - result["database_id"] = string(*v.DatabaseId) + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) } - if v.CompartmentId != nil { - result["compartment_id"] = string(*v.CompartmentId) + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) } - if v.DatabaseName != nil { - result["database_name"] = string(*v.DatabaseName) + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) } + default: + log.Printf("[WARN] Received 'entity_source' of unknown type %v", *s.Res) + return nil + } + return nil +} - if v.DatabaseDisplayName != nil { - result["database_display_name"] = string(*v.DatabaseDisplayName) - } +func (s *OpsiDatabaseInsightResourceCrud) ChangeExternalMysqlDatabaseInsightConnection(updateRequest *oci_opsi.ChangeExternalMysqlDatabaseInsightConnectionRequest) error { + idTmp := s.D.Id() + updateRequest.DatabaseInsightId = &idTmp - if v.DatabaseType != nil { - result["database_type"] = string(*v.DatabaseType) - } + updateRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") - if v.DatabaseVersion != nil { - result["database_version"] = string(*v.DatabaseVersion) - } + response, err := s.Client.ChangeExternalMysqlDatabaseInsightConnection(context.Background(), *updateRequest) + log.Printf("Running Update after change EXTERNAL_MYSQL_DATABASE_SYSTEM") + if err != nil { + return err + } - if v.LifecycleDetails != nil { - result["lifecycle_details"] = string(*v.LifecycleDetails) - } + workId := response.OpcWorkRequestId + return s.getDatabaseInsightFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} - if v.ProcessorCount != nil { - result["processor_count"] = fmt.Sprint(*v.ProcessorCount) - } +func (s *OpsiDatabaseInsightResourceCrud) mapToConnectionDetails(fieldKeyFormat string) (oci_opsi.ConnectionDetails, error) { + result := oci_opsi.ConnectionDetails{} - if v.DatabaseHostNames != nil { - result["database_host_names"] = v.DatabaseHostNames - } + if hostName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "host_name")); ok { + tmp := hostName.(string) + result.HostName = &tmp + } - result["state"] = string(v.LifecycleState) + if port, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "port")); ok { + tmp := port.(int) + result.Port = &tmp + } - result["status"] = string(v.Status) + if protocol, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "protocol")); ok { + result.Protocol = oci_opsi.ConnectionDetailsProtocolEnum(protocol.(string)) + } - if v.TimeCreated != nil { - result["time_created"] = v.TimeCreated.String() - } + if serviceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "service_name")); ok { + tmp := serviceName.(string) + result.ServiceName = &tmp + } - if v.TimeUpdated != nil { - result["time_updated"] = v.TimeUpdated.String() - } + return result, nil +} - if v.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(v.SystemTags) - } +func ConnectionDetailsToMap(obj *oci_opsi.ConnectionDetails) map[string]interface{} { + result := map[string]interface{}{} - result["freeform_tags"] = v.FreeformTags + if obj.HostName != nil { + result["host_name"] = string(*obj.HostName) + } - if v.DefinedTags != nil { - result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) - } + if obj.Port != nil { + result["port"] = int(*obj.Port) + } - if v.DatabaseResourceType != nil { - result["database_resource_type"] = string(*v.DatabaseResourceType) - } + result["protocol"] = string(obj.Protocol) - if v.ManagementAgentId != nil { - result["management_agent_id"] = string(*v.ManagementAgentId) - } + if obj.ServiceName != nil { + result["service_name"] = string(*obj.ServiceName) + } - if v.ParentId != nil { - result["parent_id"] = string(*v.ParentId) - } + return result +} - if v.RootId != nil { - result["root_id"] = string(*v.RootId) +func (s *OpsiDatabaseInsightResourceCrud) mapToCredentialDetails(fieldKeyFormat string) (oci_opsi.CredentialDetails, error) { + var baseObject oci_opsi.CredentialDetails + //discriminator + credentialTypeRaw, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_type")) + var credentialType string + if ok { + credentialType = credentialTypeRaw.(string) + } else { + credentialType = "" // default value + } + switch strings.ToLower(credentialType) { + case strings.ToLower("CREDENTIALS_BY_IAM"): + details := oci_opsi.CredentialByIam{} + if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { + tmp := credentialSourceName.(string) + details.CredentialSourceName = &tmp } - - case oci_opsi.PeComanagedDatabaseInsightSummary: - result["entity_source"] = "PE_COMANAGED_DATABASE" - if v.Id != nil { - result["id"] = string(*v.Id) + baseObject = details + case strings.ToLower("CREDENTIALS_BY_NAMED_CREDS"): + details := oci_opsi.CredentialByNamedCredentials{} + if namedCredentialId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "named_credential_id")); ok { + tmp := namedCredentialId.(string) + details.NamedCredentialId = &tmp } - - if v.DatabaseId != nil { - result["database_id"] = string(*v.DatabaseId) + if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { + tmp := credentialSourceName.(string) + details.CredentialSourceName = &tmp } - - if v.CompartmentId != nil { - result["compartment_id"] = string(*v.CompartmentId) + baseObject = details + case strings.ToLower("CREDENTIALS_BY_SOURCE"): + details := oci_opsi.CredentialsBySource{} + if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { + tmp := credentialSourceName.(string) + details.CredentialSourceName = &tmp } - - if v.DatabaseName != nil { - result["database_name"] = string(*v.DatabaseName) + baseObject = details + case strings.ToLower("CREDENTIALS_BY_VAULT"): + details := oci_opsi.CredentialByVault{} + if passwordSecretId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "password_secret_id")); ok { + tmp := passwordSecretId.(string) + details.PasswordSecretId = &tmp } - - if v.DatabaseDisplayName != nil { - result["database_display_name"] = string(*v.DatabaseDisplayName) + if role, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "role")); ok { + details.Role = oci_opsi.CredentialByVaultRoleEnum(role.(string)) } - - if v.DatabaseType != nil { - result["database_type"] = string(*v.DatabaseType) + if userName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "user_name")); ok { + tmp := userName.(string) + details.UserName = &tmp } - - if v.DatabaseVersion != nil { - result["database_version"] = string(*v.DatabaseVersion) + if walletSecretId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "wallet_secret_id")); ok { + tmp := walletSecretId.(string) + details.WalletSecretId = &tmp } - - if v.LifecycleDetails != nil { - result["lifecycle_details"] = string(*v.LifecycleDetails) + if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { + tmp := credentialSourceName.(string) + details.CredentialSourceName = &tmp } + baseObject = details + default: + return nil, fmt.Errorf("unknown credential_type '%v' was specified", credentialType) + } + return baseObject, nil +} - result["state"] = string(v.LifecycleState) - - result["status"] = string(v.Status) - - if v.TimeCreated != nil { - result["time_created"] = v.TimeCreated.String() - } +func CredentialDetailsToMap(obj *oci_opsi.CredentialDetails) map[string]interface{} { + result := map[string]interface{}{} + switch v := (*obj).(type) { + case oci_opsi.CredentialByIam: + result["credential_type"] = "CREDENTIALS_BY_IAM" + case oci_opsi.CredentialByNamedCredentials: + result["credential_type"] = "CREDENTIALS_BY_NAMED_CREDS" - if v.TimeUpdated != nil { - result["time_updated"] = v.TimeUpdated.String() + if v.NamedCredentialId != nil { + result["named_credential_id"] = string(*v.NamedCredentialId) } + case oci_opsi.CredentialsBySource: + result["credential_type"] = "CREDENTIALS_BY_SOURCE" + case oci_opsi.CredentialByVault: + result["credential_type"] = "CREDENTIALS_BY_VAULT" - if v.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(v.SystemTags) + if v.PasswordSecretId != nil { + result["password_secret_id"] = string(*v.PasswordSecretId) } - result["freeform_tags"] = v.FreeformTags + result["role"] = string(v.Role) - if v.DefinedTags != nil { - result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) + if v.UserName != nil { + result["user_name"] = string(*v.UserName) } - case oci_opsi.MdsMySqlDatabaseInsightSummary: - result["entity_source"] = "MDS_MYSQL_DATABASE_SYSTEM" - if v.Id != nil { - result["id"] = string(*v.Id) + if v.WalletSecretId != nil { + result["wallet_secret_id"] = string(*v.WalletSecretId) } + default: + log.Printf("[WARN] Received 'credential_type' of unknown type %v", *obj) + return nil + } - if v.DatabaseId != nil { - result["database_id"] = string(*v.DatabaseId) - } + return result +} - if v.CompartmentId != nil { - result["compartment_id"] = string(*v.CompartmentId) - } +func DatabaseInsightSummaryToMap(obj oci_opsi.DatabaseInsightSummary) map[string]interface{} { + result := map[string]interface{}{} + switch v := (obj).(type) { + case oci_opsi.AutonomousDatabaseInsightSummary: + result["entity_source"] = "AUTONOMOUS_DATABASE" - if v.DatabaseName != nil { - result["database_name"] = string(*v.DatabaseName) + if v.DatabaseResourceType != nil { + result["database_resource_type"] = string(*v.DatabaseResourceType) } - if v.DatabaseDisplayName != nil { - result["database_display_name"] = string(*v.DatabaseDisplayName) + if v.IsAdvancedFeaturesEnabled != nil { + result["is_advanced_features_enabled"] = bool(*v.IsAdvancedFeaturesEnabled) } + case oci_opsi.EmManagedExternalDatabaseInsightSummary: + result["entity_source"] = "EM_MANAGED_EXTERNAL_DATABASE" - if v.DatabaseType != nil { - result["database_type"] = string(*v.DatabaseType) + if v.EnterpriseManagerBridgeId != nil { + result["enterprise_manager_bridge_id"] = string(*v.EnterpriseManagerBridgeId) } - if v.DatabaseVersion != nil { - result["database_version"] = string(*v.DatabaseVersion) + if v.EnterpriseManagerEntityDisplayName != nil { + result["enterprise_manager_entity_display_name"] = string(*v.EnterpriseManagerEntityDisplayName) } - if v.DatabaseHostNames != nil { - result["database_host_names"] = v.DatabaseHostNames + if v.EnterpriseManagerEntityIdentifier != nil { + result["enterprise_manager_entity_identifier"] = string(*v.EnterpriseManagerEntityIdentifier) } - if v.LifecycleDetails != nil { - result["lifecycle_details"] = string(*v.LifecycleDetails) + if v.EnterpriseManagerEntityName != nil { + result["enterprise_manager_entity_name"] = string(*v.EnterpriseManagerEntityName) } - //if v.ProcessorCount != nil { - // result["processor_count"] = fmt.Sprint(*v.ProcessorCount) - //} - - result["state"] = string(v.LifecycleState) - - result["status"] = string(v.Status) - - if v.TimeCreated != nil { - result["time_created"] = v.TimeCreated.String() + if v.EnterpriseManagerEntityType != nil { + result["enterprise_manager_entity_type"] = string(*v.EnterpriseManagerEntityType) } - if v.TimeUpdated != nil { - result["time_updated"] = v.TimeUpdated.String() + if v.EnterpriseManagerIdentifier != nil { + result["enterprise_manager_identifier"] = string(*v.EnterpriseManagerIdentifier) } - if v.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(v.SystemTags) + if v.ExadataInsightId != nil { + result["exadata_insight_id"] = string(*v.ExadataInsightId) } + case oci_opsi.ExternalMysqlDatabaseInsightSummary: + result["entity_source"] = "EXTERNAL_MYSQL_DATABASE_SYSTEM" - result["freeform_tags"] = v.FreeformTags - - if v.DefinedTags != nil { - result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) + if v.AgentId != nil { + result["agent_id"] = string(*v.AgentId) } - if v.DatabaseConnectionStatusDetails != nil { - result["database_connection_status_details"] = string(*v.DatabaseConnectionStatusDetails) + if v.DatabaseConnectorId != nil { + result["database_connector_id"] = string(*v.DatabaseConnectorId) } if v.DatabaseResourceType != nil { result["database_resource_type"] = string(*v.DatabaseResourceType) } + case oci_opsi.MacsManagedAutonomousDatabaseInsightSummary: + result["entity_source"] = "MACS_MANAGED_AUTONOMOUS_DATABASE" - case oci_opsi.ExternalMysqlDatabaseInsightSummary: - result["entity_source"] = "EXTERNAL_MYSQL_DATABASE_SYSTEM" - - if v.Id != nil { - result["id"] = string(*v.Id) - } - - if v.DatabaseId != nil { - result["database_id"] = string(*v.DatabaseId) - } - - if v.CompartmentId != nil { - result["compartment_id"] = string(*v.CompartmentId) + if v.DatabaseResourceType != nil { + result["database_resource_type"] = string(*v.DatabaseResourceType) } + log.Printf("[DEBUG] Running SummaryMap, DatabaseType (%s)", *v.DatabaseType) - if v.AgentId != nil { - result["agent_id"] = string(*v.AgentId) + if v.ManagementAgentId != nil { + result["management_agent_id"] = string(*v.ManagementAgentId) } - if v.DatabaseConnectorId != nil { - result["database_connector_id"] = string(*v.DatabaseConnectorId) + if v.ParentId != nil { + result["parent_id"] = string(*v.ParentId) } - if v.DatabaseName != nil { - result["database_name"] = string(*v.DatabaseName) + if v.RootId != nil { + result["root_id"] = string(*v.RootId) } + case oci_opsi.MacsManagedCloudDatabaseInsightSummary: + result["entity_source"] = "MACS_MANAGED_CLOUD_DATABASE" - if v.DatabaseDisplayName != nil { - result["database_display_name"] = string(*v.DatabaseDisplayName) + if v.DatabaseResourceType != nil { + result["database_resource_type"] = string(*v.DatabaseResourceType) } - if v.DatabaseType != nil { - result["database_type"] = string(*v.DatabaseType) + if v.ManagementAgentId != nil { + result["management_agent_id"] = string(*v.ManagementAgentId) } - if v.DatabaseVersion != nil { - result["database_version"] = string(*v.DatabaseVersion) + if v.ParentId != nil { + result["parent_id"] = string(*v.ParentId) } - if v.DatabaseHostNames != nil { - result["database_host_names"] = v.DatabaseHostNames + if v.RootId != nil { + result["root_id"] = string(*v.RootId) } + case oci_opsi.MacsManagedExternalDatabaseInsightSummary: + result["entity_source"] = "MACS_MANAGED_EXTERNAL_DATABASE" - if v.LifecycleDetails != nil { - result["lifecycle_details"] = string(*v.LifecycleDetails) + if v.ConnectorId != nil { + result["connector_id"] = string(*v.ConnectorId) } - result["state"] = string(v.LifecycleState) - - result["status"] = string(v.Status) - - if v.TimeCreated != nil { - result["time_created"] = v.TimeCreated.String() + if v.DatabaseResourceType != nil { + result["database_resource_type"] = string(*v.DatabaseResourceType) } - if v.TimeUpdated != nil { - result["time_updated"] = v.TimeUpdated.String() + if v.ManagementAgentId != nil { + result["management_agent_id"] = string(*v.ManagementAgentId) } + case oci_opsi.MdsMySqlDatabaseInsightSummary: + result["entity_source"] = "MDS_MYSQL_DATABASE_SYSTEM" - if v.SystemTags != nil { - result["system_tags"] = tfresource.SystemTagsToMap(v.SystemTags) + if v.DatabaseResourceType != nil { + result["database_resource_type"] = string(*v.DatabaseResourceType) } + case oci_opsi.PeComanagedDatabaseInsightSummary: + result["entity_source"] = "PE_COMANAGED_DATABASE" - result["freeform_tags"] = v.FreeformTags - - if v.DefinedTags != nil { - result["defined_tags"] = tfresource.DefinedTagsToMap(v.DefinedTags) + if v.DatabaseResourceType != nil { + result["database_resource_type"] = string(*v.DatabaseResourceType) } - if v.DatabaseConnectionStatusDetails != nil { - result["database_connection_status_details"] = string(*v.DatabaseConnectionStatusDetails) + if v.OpsiPrivateEndpointId != nil { + result["opsi_private_endpoint_id"] = string(*v.OpsiPrivateEndpointId) } - if v.DatabaseResourceType != nil { - result["database_resource_type"] = string(*v.DatabaseResourceType) + if v.ParentId != nil { + result["parent_id"] = string(*v.ParentId) } + if v.RootId != nil { + result["root_id"] = string(*v.RootId) + } default: log.Printf("[WARN] Received 'entity_source' of unknown type %v", obj) + return nil } return result @@ -1988,6 +1935,12 @@ func PeComanagedDatabaseHostDetailsToMap(obj oci_opsi.PeComanagedDatabaseHostDet return result } +/*func (s *OpsiDatabaseInsightResourceCrud) mapToobject(fieldKeyFormat string) (oci_opsi.Object, error) { + result := oci_opsi.Object{} + + return result, nil +}*/ + func (s *OpsiDatabaseInsightResourceCrud) populateChangePeComanagedDatabaseInsightRequest(updateRequest *oci_opsi.ChangePeComanagedDatabaseInsightRequest) bool { hasChanged := false @@ -2086,6 +2039,41 @@ func (s *OpsiDatabaseInsightResourceCrud) populateChangeMacsCloudConnectionDetai return hasChanged } +func (s *OpsiDatabaseInsightResourceCrud) populateChangeMacsAdbConnectionDetailsRequest(updateRequest *oci_opsi.ChangeMacsManagedAutonomousDatabaseInsightConnectionRequest) bool { + hasChanged := false + if connectionCredentialDetails, ok := s.D.GetOkExists("connection_credential_details"); ok { + if s.D.HasChange("connection_credential_details.0.named_credential_id") { + hasChanged = true + } + if tmpList := connectionCredentialDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "connection_credential_details", 0) + tmp, err := s.mapToCredentialDetails(fieldKeyFormat) + if err != nil { + return false + } + updateRequest.ConnectionCredentialDetails = tmp + } + } + if connectionDetails, ok := s.D.GetOkExists("connection_details"); ok { + if tmpList := connectionDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "connection_details", 0) + tmp, err := s.mapToConnectionDetails(fieldKeyFormat) + if err != nil { + return false + } + updateRequest.ConnectionDetails = &tmp + } + } + if managementAgentId, ok := s.D.GetOkExists("management_agent_id"); ok { + if s.D.HasChange("management_agent_id") { + hasChanged = true + } + tmp := managementAgentId.(string) + updateRequest.ManagementAgentId = &tmp + } + return hasChanged +} + func (s *OpsiDatabaseInsightResourceCrud) populateChangeExternalMysqlDatabaseInsightConnectionRequest(updateRequest *oci_opsi.ChangeExternalMysqlDatabaseInsightConnectionRequest) bool { hasChanged := false if databaseConnectorId, ok := s.D.GetOkExists("database_connector_id"); ok { @@ -2101,7 +2089,6 @@ func (s *OpsiDatabaseInsightResourceCrud) populateChangeExternalMysqlDatabaseIns func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatabaseInsightRequest(request *oci_opsi.CreateDatabaseInsightRequest) error { //discriminator entitySourceRaw, ok := s.D.GetOkExists("entity_source") - var entitySource string if ok { entitySource = entitySourceRaw.(string) @@ -2147,11 +2134,17 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab tmp := opsiPrivateEndpointId.(string) details.OpsiPrivateEndpointId = &tmp } - if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { tmp := compartmentId.(string) details.CompartmentId = &tmp } + if systemTags, ok := s.D.GetOkExists("system_tags"); ok { + convertedSystemTags, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) + if err != nil { + return err + } + details.SystemTags = convertedSystemTags + } if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) if err != nil { @@ -2162,14 +2155,10 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } - if systemTags, ok := s.D.GetOkExists("system_tags"); ok { - convertedSystemTags, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) - if err != nil { - return err - } - details.SystemTags = convertedSystemTags + if opsiPrivateEndpointId, ok := s.D.GetOkExists("opsi_private_endpoint_id"); ok { + tmp := opsiPrivateEndpointId.(string) + details.OpsiPrivateEndpointId = &tmp } - request.CreateDatabaseInsightDetails = details case strings.ToLower("EM_MANAGED_EXTERNAL_DATABASE"): details := oci_opsi.CreateEmManagedExternalDatabaseInsightDetails{} @@ -2225,8 +2214,73 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } request.CreateDatabaseInsightDetails = details + case strings.ToLower("MACS_MANAGED_AUTONOMOUS_DATABASE"): + details := oci_opsi.CreateMacsManagedAutonomousDatabaseInsightDetails{} + if connectionCredentialDetails, ok := s.D.GetOkExists("connection_credential_details"); ok { + if tmpList := connectionCredentialDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "connection_credential_details", 0) + tmp, err := s.mapToCredentialDetails(fieldKeyFormat) + if err != nil { + return err + } + details.ConnectionCredentialDetails = tmp + } + } + if connectionDetails, ok := s.D.GetOkExists("connection_details"); ok { + if tmpList := connectionDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "connection_details", 0) + tmp, err := s.mapToConnectionDetails(fieldKeyFormat) + if err != nil { + return err + } + details.ConnectionDetails = &tmp + } + } + if databaseId, ok := s.D.GetOkExists("database_id"); ok { + tmp := databaseId.(string) + details.DatabaseId = &tmp + } + if databaseResourceType, ok := s.D.GetOkExists("database_resource_type"); ok { + tmp := databaseResourceType.(string) + details.DatabaseResourceType = &tmp + } + if deploymentType, ok := s.D.GetOkExists("deployment_type"); ok { + details.DeploymentType = oci_opsi.CreateMacsManagedAutonomousDatabaseInsightDetailsDeploymentTypeEnum(deploymentType.(string)) + } + if managementAgentId, ok := s.D.GetOkExists("management_agent_id"); ok { + tmp := managementAgentId.(string) + details.ManagementAgentId = &tmp + } + if systemTags, ok := s.D.GetOkExists("system_tags"); ok { + convertedSystemTags, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) + if err != nil { + return err + } + details.SystemTags = convertedSystemTags + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + details.CompartmentId = &tmp + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + if systemTags, ok := s.D.GetOkExists("system_tags"); ok { + convertedSystemTags, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) + if err != nil { + return err + } + details.SystemTags = convertedSystemTags + } + request.CreateDatabaseInsightDetails = details case strings.ToLower("MACS_MANAGED_CLOUD_DATABASE"): - log.Printf("[DEBUG] populate MACS Cloud database .... ") details := oci_opsi.CreateMacsManagedCloudDatabaseInsightDetails{} if connectionCredentialDetails, ok := s.D.GetOkExists("connection_credential_details"); ok { if tmpList := connectionCredentialDetails.([]interface{}); len(tmpList) > 0 { @@ -2285,9 +2339,6 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab } details.DefinedTags = convertedDefinedTags } - if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { - details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) - } if systemTags, ok := s.D.GetOkExists("system_tags"); ok { convertedSystemTags, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) if err != nil { @@ -2306,6 +2357,10 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab tmp := compartmentId.(string) details.CompartmentId = &tmp } + if databaseId, ok := s.D.GetOkExists("database_id"); ok { + tmp := databaseId.(string) + details.DatabaseId = &tmp + } if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) if err != nil { @@ -2319,7 +2374,6 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab request.CreateDatabaseInsightDetails = details case strings.ToLower("PE_COMANAGED_DATABASE"): details := oci_opsi.CreatePeComanagedDatabaseInsightDetails{} - if connectionDetails, ok := s.D.GetOkExists("connection_details"); ok { if tmpList := connectionDetails.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "connection_details", 0) @@ -2348,6 +2402,10 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab tmp := databaseResourceType.(string) details.DatabaseResourceType = &tmp } + if dbmPrivateEndpointId, ok := s.D.GetOkExists("dbm_private_endpoint_id"); ok { + tmp := dbmPrivateEndpointId.(string) + details.DbmPrivateEndpointId = &tmp + } if deploymentType, ok := s.D.GetOkExists("deployment_type"); ok { details.DeploymentType = oci_opsi.CreatePeComanagedDatabaseInsightDetailsDeploymentTypeEnum(deploymentType.(string)) } @@ -2355,14 +2413,17 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab tmp := opsiPrivateEndpointId.(string) details.OpsiPrivateEndpointId = &tmp } - if dbmPrivateEndpointId, ok := s.D.GetOkExists("dbm_private_endpoint_id"); ok { - tmp := dbmPrivateEndpointId.(string) - details.DbmPrivateEndpointId = &tmp - } if serviceName, ok := s.D.GetOkExists("service_name"); ok { tmp := serviceName.(string) details.ServiceName = &tmp } + if systemTags, ok := s.D.GetOkExists("system_tags"); ok { + convertedSystemTags, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) + if err != nil { + return err + } + details.SystemTags = convertedSystemTags + } if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { tmp := compartmentId.(string) details.CompartmentId = &tmp @@ -2377,13 +2438,6 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicCreateDatab if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } - if systemTags, ok := s.D.GetOkExists("system_tags"); ok { - convertedSystemTags, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) - if err != nil { - return err - } - details.SystemTags = convertedSystemTags - } request.CreateDatabaseInsightDetails = details default: return fmt.Errorf("unknown entity_source '%v' was specified", entitySource) @@ -2400,10 +2454,9 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicUpdateDatab } else { entitySource = "" // default value } - log.Printf("[DEBUG] populate for updating (%s)", entitySourceRaw) switch strings.ToLower(entitySource) { - case strings.ToLower("EM_MANAGED_EXTERNAL_DATABASE"): - details := oci_opsi.UpdateEmManagedExternalDatabaseInsightDetails{} + case strings.ToLower("AUTONOMOUS_DATABASE"): + details := oci_opsi.UpdateAutonomousDatabaseInsightDetails{} tmp := s.D.Id() request.DatabaseInsightId = &tmp if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { @@ -2417,8 +2470,8 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicUpdateDatab details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } request.UpdateDatabaseInsightDetails = details - case strings.ToLower("MACS_MANAGED_CLOUD_DATABASE"): - details := oci_opsi.UpdateMacsManagedCloudDatabaseInsightDetails{} + case strings.ToLower("EM_MANAGED_EXTERNAL_DATABASE"): + details := oci_opsi.UpdateEmManagedExternalDatabaseInsightDetails{} tmp := s.D.Id() request.DatabaseInsightId = &tmp if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { @@ -2447,8 +2500,8 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicUpdateDatab details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } request.UpdateDatabaseInsightDetails = details - case strings.ToLower("PE_COMANAGED_DATABASE"): - details := oci_opsi.UpdatePeComanagedDatabaseInsightDetails{} + case strings.ToLower("MACS_MANAGED_AUTONOMOUS_DATABASE"): + details := oci_opsi.UpdateMacsManagedAutonomousDatabaseInsightDetails{} tmp := s.D.Id() request.DatabaseInsightId = &tmp if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { @@ -2462,8 +2515,23 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicUpdateDatab details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } request.UpdateDatabaseInsightDetails = details - case strings.ToLower("AUTONOMOUS_DATABASE"): - details := oci_opsi.UpdateAutonomousDatabaseInsightDetails{} + case strings.ToLower("MACS_MANAGED_CLOUD_DATABASE"): + details := oci_opsi.UpdateMacsManagedCloudDatabaseInsightDetails{} + tmp := s.D.Id() + request.DatabaseInsightId = &tmp + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + request.UpdateDatabaseInsightDetails = details + case strings.ToLower("MACS_MANAGED_EXTERNAL_DATABASE"): + details := oci_opsi.UpdateMacsManagedExternalDatabaseInsightDetails{} tmp := s.D.Id() request.DatabaseInsightId = &tmp if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { @@ -2492,6 +2560,21 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicUpdateDatab details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } request.UpdateDatabaseInsightDetails = details + case strings.ToLower("PE_COMANAGED_DATABASE"): + details := oci_opsi.UpdatePeComanagedDatabaseInsightDetails{} + tmp := s.D.Id() + request.DatabaseInsightId = &tmp + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + request.UpdateDatabaseInsightDetails = details default: return fmt.Errorf("unknown entity_source '%v' was specified", entitySource) } @@ -2635,6 +2718,50 @@ func (s *OpsiDatabaseInsightResourceCrud) populateTopLevelPolymorphicEnableDatab if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } + + request.EnableDatabaseInsightDetails = details + case strings.ToLower("MACS_MANAGED_AUTONOMOUS_DATABASE"): + details := oci_opsi.EnableMacsManagedAutonomousDatabaseInsightDetails{} + if managementAgentId, ok := s.D.GetOkExists("management_agent_id"); ok { + tmp := managementAgentId.(string) + details.ManagementAgentId = &tmp + } + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + details.CompartmentId = &tmp + } + + if connectionCredentialDetails, ok := s.D.GetOkExists("connection_credential_details"); ok { + if tmpList := connectionCredentialDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "connection_credential_details", 0) + tmp, err := s.mapToCredentialDetails(fieldKeyFormat) + if err != nil { + return err + } + details.ConnectionCredentialDetails = tmp + } + } + if connectionDetails, ok := s.D.GetOkExists("connection_details"); ok { + if tmpList := connectionDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "connection_details", 0) + tmp, err := s.mapToConnectionDetails(fieldKeyFormat) + if err != nil { + return err + } + details.ConnectionDetails = &tmp + } + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { + convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return err + } + details.DefinedTags = convertedDefinedTags + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { + details.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + request.EnableDatabaseInsightDetails = details case strings.ToLower("MDS_MYSQL_DATABASE_SYSTEM"): details := oci_opsi.EnableMdsMySqlDatabaseInsightDetails{} @@ -2687,27 +2814,23 @@ func (s *OpsiDatabaseInsightResourceCrud) updatePecomanagedDetails(updateRequest return s.getDatabaseInsightFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } -func (s *OpsiDatabaseInsightResourceCrud) ChangeExternalMysqlDatabaseInsightConnection(updateRequest *oci_opsi.ChangeExternalMysqlDatabaseInsightConnectionRequest) error { +func (s *OpsiDatabaseInsightResourceCrud) updateConnectionDetails(changeConnectionRequest *oci_opsi.ChangeMacsManagedCloudDatabaseInsightConnectionRequest) error { idTmp := s.D.Id() - updateRequest.DatabaseInsightId = &idTmp - - updateRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") - - response, err := s.Client.ChangeExternalMysqlDatabaseInsightConnection(context.Background(), *updateRequest) - log.Printf("Running Update after change EXTERNAL_MYSQL_DATABASE_SYSTEM") + changeConnectionRequest.DatabaseInsightId = &idTmp + changeConnectionRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") + response, err := s.Client.ChangeMacsManagedCloudDatabaseInsightConnection(context.Background(), *changeConnectionRequest) if err != nil { return err } - workId := response.OpcWorkRequestId return s.getDatabaseInsightFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) } -func (s *OpsiDatabaseInsightResourceCrud) updateConnectionDetails(changeConnectionRequest *oci_opsi.ChangeMacsManagedCloudDatabaseInsightConnectionRequest) error { +func (s *OpsiDatabaseInsightResourceCrud) updateMacsAdbConnectionDetails(changeAdbConnectionRequest *oci_opsi.ChangeMacsManagedAutonomousDatabaseInsightConnectionRequest) error { idTmp := s.D.Id() - changeConnectionRequest.DatabaseInsightId = &idTmp - changeConnectionRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") - response, err := s.Client.ChangeMacsManagedCloudDatabaseInsightConnection(context.Background(), *changeConnectionRequest) + changeAdbConnectionRequest.DatabaseInsightId = &idTmp + changeAdbConnectionRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") + response, err := s.Client.ChangeMacsManagedAutonomousDatabaseInsightConnection(context.Background(), *changeAdbConnectionRequest) if err != nil { return err } diff --git a/internal/service/opsi/opsi_database_insights_data_source.go b/internal/service/opsi/opsi_database_insights_data_source.go index 8127cdc8e4e..f03571cafe9 100644 --- a/internal/service/opsi/opsi_database_insights_data_source.go +++ b/internal/service/opsi/opsi_database_insights_data_source.go @@ -237,7 +237,6 @@ func (s *OpsiDatabaseInsightsDataSourceCrud) SetData() error { if s.Res == nil { return nil } - s.D.SetId(tfresource.GenerateDataSourceHashID("OpsiDatabaseInsightsDataSource-", OpsiDatabaseInsightsDataSource(), s.D)) resources := []map[string]interface{}{} databaseInsight := map[string]interface{}{} @@ -245,13 +244,12 @@ func (s *OpsiDatabaseInsightsDataSourceCrud) SetData() error { items := []interface{}{} for _, item := range s.Res.Items { result := DatabaseInsightSummaryToMap(item) + items = append(items, DatabaseInsightSummaryToMap(item)) if len(result) != 0 { items = append(items, result) } - } databaseInsight["items"] = items - if f, fOk := s.D.GetOkExists("filter"); fOk { items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, OpsiDatabaseInsightsDataSource().Schema["database_insights_collection"].Elem.(*schema.Resource).Schema) databaseInsight["items"] = items diff --git a/internal/service/opsi/opsi_exadata_insight_resource.go b/internal/service/opsi/opsi_exadata_insight_resource.go index f9166b485d0..ab6ef325ab5 100644 --- a/internal/service/opsi/opsi_exadata_insight_resource.go +++ b/internal/service/opsi/opsi_exadata_insight_resource.go @@ -116,6 +116,263 @@ func OpsiExadataInsightResource() *schema.Resource { Optional: true, Computed: true, }, + "member_autonomous_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "compartment_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "connection_credential_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "credential_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "CREDENTIALS_BY_IAM", + "CREDENTIALS_BY_NAMED_CREDS", + "CREDENTIALS_BY_SOURCE", + "CREDENTIALS_BY_VAULT", + }, true), + }, + + // Optional + "credential_source_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "named_credential_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "password_secret_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Sensitive: true, + }, + "role": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "user_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "wallet_secret_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "connection_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + + // Optional + "host_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "port": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + }, + "protocol": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "service_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "credential_details": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "credential_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "CREDENTIALS_BY_IAM", + "CREDENTIALS_BY_NAMED_CREDS", + "CREDENTIALS_BY_SOURCE", + "CREDENTIALS_BY_VAULT", + }, true), + }, + + // Optional + "credential_source_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "named_credential_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "password_secret_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Sensitive: true, + }, + "role": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "user_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "wallet_secret_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, + "database_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "database_resource_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "defined_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + ForceNew: true, + DiffSuppressFunc: tfresource.DefinedTagsDiffSuppressFunction, + Elem: schema.TypeString, + }, + "deployment_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "entity_source": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "freeform_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + ForceNew: true, + Elem: schema.TypeString, + }, + "is_advanced_features_enabled": { + Type: schema.TypeBool, + Optional: true, + Computed: true, + ForceNew: true, + }, + "management_agent_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "opsi_private_endpoint_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "system_tags": { + Type: schema.TypeMap, + Optional: true, + Computed: true, + ForceNew: true, + Elem: schema.TypeString, + }, + + // Computed + }, + }, + }, "member_database_details": { Type: schema.TypeList, Optional: true, @@ -147,6 +404,7 @@ func OpsiExadataInsightResource() *schema.Resource { ForceNew: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ + "CREDENTIALS_BY_NAMED_CREDS", "CREDENTIALS_BY_SOURCE", "CREDENTIALS_BY_VAULT", }, true), @@ -159,6 +417,12 @@ func OpsiExadataInsightResource() *schema.Resource { Computed: true, ForceNew: true, }, + "named_credential_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "password_secret_id": { Type: schema.TypeString, Optional: true, @@ -267,6 +531,7 @@ func OpsiExadataInsightResource() *schema.Resource { ForceNew: true, DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, ValidateFunc: validation.StringInSlice([]string{ + "CREDENTIALS_BY_IAM", "CREDENTIALS_BY_SOURCE", "CREDENTIALS_BY_VAULT", }, true), @@ -279,6 +544,12 @@ func OpsiExadataInsightResource() *schema.Resource { Computed: true, ForceNew: true, }, + "named_credential_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, "password_secret_id": { Type: schema.TypeString, Optional: true, @@ -1050,98 +1321,196 @@ func (s *OpsiExadataInsightResourceCrud) SetData() error { s.D.Set("lifecycle_details", *v.LifecycleDetails) } - s.D.Set("state", v.LifecycleState) + s.D.Set("state", v.LifecycleState) + + s.D.Set("status", v.Status) + + if v.SystemTags != nil { + s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) + } + + if v.TimeCreated != nil { + s.D.Set("time_created", v.TimeCreated.String()) + } + + if v.TimeUpdated != nil { + s.D.Set("time_updated", v.TimeUpdated.String()) + } + default: + log.Printf("[WARN] Received 'entity_source' of unknown type %v", *s.Res) + return nil + } + return nil +} + +func (s *OpsiExadataInsightResourceCrud) mapToConnectionDetails(fieldKeyFormat string) (oci_opsi.ConnectionDetails, error) { + result := oci_opsi.ConnectionDetails{} + + if hostName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "host_name")); ok { + tmp := hostName.(string) + result.HostName = &tmp + } + + if port, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "port")); ok { + tmp := port.(int) + result.Port = &tmp + } + + if protocol, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "protocol")); ok { + result.Protocol = oci_opsi.ConnectionDetailsProtocolEnum(protocol.(string)) + } + + if serviceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "service_name")); ok { + tmp := serviceName.(string) + result.ServiceName = &tmp + } + + return result, nil +} + +func (s *OpsiExadataInsightResourceCrud) mapToCreateEmManagedExternalExadataMemberEntityDetails(fieldKeyFormat string) (oci_opsi.CreateEmManagedExternalExadataMemberEntityDetails, error) { + result := oci_opsi.CreateEmManagedExternalExadataMemberEntityDetails{} + + if compartmentId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "compartment_id")); ok { + tmp := compartmentId.(string) + result.CompartmentId = &tmp + } + + if enterpriseManagerEntityIdentifier, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "enterprise_manager_entity_identifier")); ok { + tmp := enterpriseManagerEntityIdentifier.(string) + result.EnterpriseManagerEntityIdentifier = &tmp + } + + return result, nil +} + +func CreateEmManagedExternalExadataMemberEntityDetailsToMap(obj oci_opsi.CreateEmManagedExternalExadataMemberEntityDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.EnterpriseManagerEntityIdentifier != nil { + result["enterprise_manager_entity_identifier"] = string(*obj.EnterpriseManagerEntityIdentifier) + } + + return result +} + +func (s *OpsiExadataInsightResourceCrud) mapToCreateMacsManagedAutonomousDatabaseInsightDetails(fieldKeyFormat string) (oci_opsi.CreateMacsManagedAutonomousDatabaseInsightDetails, error) { + result := oci_opsi.CreateMacsManagedAutonomousDatabaseInsightDetails{} - s.D.Set("status", v.Status) + if compartmentId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "compartment_id")); ok { + tmp := compartmentId.(string) + result.CompartmentId = &tmp + } - if v.SystemTags != nil { - s.D.Set("system_tags", tfresource.SystemTagsToMap(v.SystemTags)) + if connectionCredentialDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "connection_credential_details")); ok { + if tmpList := connectionCredentialDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "connection_credential_details"), 0) + tmp, err := s.mapToCredentialDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert connection_credential_details, encountered error: %v", err) + } + result.ConnectionCredentialDetails = tmp } + } - if v.TimeCreated != nil { - s.D.Set("time_created", v.TimeCreated.String()) + if connectionDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "connection_details")); ok { + if tmpList := connectionDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "connection_details"), 0) + tmp, err := s.mapToConnectionDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert connection_details, encountered error: %v", err) + } + result.ConnectionDetails = &tmp } + } - if v.TimeUpdated != nil { - s.D.Set("time_updated", v.TimeUpdated.String()) - } - default: - log.Printf("[WARN] Received 'entity_source' of unknown type %v", *s.Res) - return nil + if databaseId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "database_id")); ok { + tmp := databaseId.(string) + result.DatabaseId = &tmp } - return nil -} -func (s *OpsiExadataInsightResourceCrud) mapToConnectionDetails(fieldKeyFormat string) (oci_opsi.ConnectionDetails, error) { - result := oci_opsi.ConnectionDetails{} + if databaseResourceType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "database_resource_type")); ok { + tmp := databaseResourceType.(string) + result.DatabaseResourceType = &tmp + } - if hostName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "host_name")); ok { - tmp := hostName.(string) - result.HostName = &tmp + if definedTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "defined_tags")); ok { + tmp, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return result, fmt.Errorf("unable to convert defined_tags, encountered error: %v", err) + } + result.DefinedTags = tmp } - if port, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "port")); ok { - tmp := port.(int) - result.Port = &tmp + if deploymentType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "deployment_type")); ok { + result.DeploymentType = oci_opsi.CreateMacsManagedAutonomousDatabaseInsightDetailsDeploymentTypeEnum(deploymentType.(string)) } - if protocol, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "protocol")); ok { - result.Protocol = oci_opsi.ConnectionDetailsProtocolEnum(protocol.(string)) + if freeformTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "freeform_tags")); ok { + result.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } - if serviceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "service_name")); ok { - tmp := serviceName.(string) - result.ServiceName = &tmp + if managementAgentId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "management_agent_id")); ok { + tmp := managementAgentId.(string) + result.ManagementAgentId = &tmp + } + + if systemTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "system_tags")); ok { + tmp, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) + if err != nil { + return result, fmt.Errorf("unable to convert system_tags, encountered error: %v", err) + } + result.SystemTags = tmp } return result, nil } -/*func ConnectionDetailsToMap(obj *oci_opsi.ConnectionDetails) map[string]interface{} { +func CreateMacsManagedAutonomousDatabaseInsightDetailsToMap(obj oci_opsi.CreateMacsManagedAutonomousDatabaseInsightDetails) map[string]interface{} { result := map[string]interface{}{} - if obj.HostName != nil { - result["host_name"] = string(*obj.HostName) + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) } - if obj.Port != nil { - result["port"] = int(*obj.Port) + if obj.ConnectionCredentialDetails != nil { + connectionCredentialDetailsArray := []interface{}{} + if connectionCredentialDetailsMap := CredentialDetailsToMap(&obj.ConnectionCredentialDetails); connectionCredentialDetailsMap != nil { + connectionCredentialDetailsArray = append(connectionCredentialDetailsArray, connectionCredentialDetailsMap) + } + result["connection_credential_details"] = connectionCredentialDetailsArray } - result["protocol"] = string(obj.Protocol) - - if obj.ServiceName != nil { - result["service_name"] = string(*obj.ServiceName) + if obj.ConnectionDetails != nil { + result["connection_details"] = []interface{}{ConnectionDetailsToMap(obj.ConnectionDetails)} } - return result -}*/ - -func (s *OpsiExadataInsightResourceCrud) mapToCreateEmManagedExternalExadataMemberEntityDetails(fieldKeyFormat string) (oci_opsi.CreateEmManagedExternalExadataMemberEntityDetails, error) { - result := oci_opsi.CreateEmManagedExternalExadataMemberEntityDetails{} + if obj.DatabaseId != nil { + result["database_id"] = string(*obj.DatabaseId) + } - if compartmentId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "compartment_id")); ok { - tmp := compartmentId.(string) - result.CompartmentId = &tmp + if obj.DatabaseResourceType != nil { + result["database_resource_type"] = string(*obj.DatabaseResourceType) } - if enterpriseManagerEntityIdentifier, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "enterprise_manager_entity_identifier")); ok { - tmp := enterpriseManagerEntityIdentifier.(string) - result.EnterpriseManagerEntityIdentifier = &tmp + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) } - return result, nil -} + result["deployment_type"] = string(obj.DeploymentType) -func CreateEmManagedExternalExadataMemberEntityDetailsToMap(obj oci_opsi.CreateEmManagedExternalExadataMemberEntityDetails) map[string]interface{} { - result := map[string]interface{}{} + result["freeform_tags"] = obj.FreeformTags - if obj.CompartmentId != nil { - result["compartment_id"] = string(*obj.CompartmentId) + if obj.ManagementAgentId != nil { + result["management_agent_id"] = string(*obj.ManagementAgentId) } - if obj.EnterpriseManagerEntityIdentifier != nil { - result["enterprise_manager_entity_identifier"] = string(*obj.EnterpriseManagerEntityIdentifier) + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) } return result @@ -1273,6 +1642,23 @@ func (s *OpsiExadataInsightResourceCrud) mapToCreateMacsManagedCloudExadataVmclu result.CompartmentId = &tmp } + if memberAutonomousDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "member_autonomous_details")); ok { + interfaces := memberAutonomousDetails.([]interface{}) + tmp := make([]oci_opsi.CreateMacsManagedAutonomousDatabaseInsightDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "member_autonomous_details"), stateDataIndex) + converted, err := s.mapToCreateMacsManagedAutonomousDatabaseInsightDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "member_autonomous_details")) { + result.MemberAutonomousDetails = tmp + } + } + if memberDatabaseDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "member_database_details")); ok { interfaces := memberDatabaseDetails.([]interface{}) tmp := make([]oci_opsi.CreateMacsManagedCloudDatabaseInsightDetails, len(interfaces)) @@ -1305,14 +1691,18 @@ func CreateMacsManagedCloudExadataVmclusterDetailsToMap(obj oci_opsi.CreateMacsM result["compartment_id"] = string(*obj.CompartmentId) } + memberAutonomousDetails := []interface{}{} + for _, item := range obj.MemberAutonomousDetails { + memberAutonomousDetails = append(memberAutonomousDetails, CreateMacsManagedAutonomousDatabaseInsightDetailsToMap(item)) + } + result["member_autonomous_details"] = memberAutonomousDetails + memberDatabaseDetails := []interface{}{} for _, item := range obj.MemberDatabaseDetails { memberDatabaseDetails = append(memberDatabaseDetails, CreateMacsManagedCloudDatabaseInsightDetailsToMap(item)) } result["member_database_details"] = memberDatabaseDetails - //result["vm_cluster_type"] = string(obj.VmClusterType) - if obj.VmclusterId != nil { result["vmcluster_id"] = string(*obj.VmclusterId) } @@ -1320,6 +1710,113 @@ func CreateMacsManagedCloudExadataVmclusterDetailsToMap(obj oci_opsi.CreateMacsM return result } +func (s *OpsiExadataInsightResourceCrud) mapToCreateAutonomousDatabaseInsightDetails(fieldKeyFormat string) (oci_opsi.CreateAutonomousDatabaseInsightDetails, error) { + result := oci_opsi.CreateAutonomousDatabaseInsightDetails{} + + if compartmentId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "compartment_id")); ok { + tmp := compartmentId.(string) + result.CompartmentId = &tmp + } + + if connectionDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "connection_details")); ok { + if tmpList := connectionDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "connection_details"), 0) + tmp, err := s.mapToConnectionDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert connection_details, encountered error: %v", err) + } + result.ConnectionDetails = &tmp + } + } + + if credentialDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_details")); ok { + if tmpList := credentialDetails.([]interface{}); len(tmpList) > 0 { + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "credential_details"), 0) + tmp, err := s.mapToCredentialDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, fmt.Errorf("unable to convert credential_details, encountered error: %v", err) + } + result.CredentialDetails = tmp + } + } + + if databaseId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "database_id")); ok { + tmp := databaseId.(string) + result.DatabaseId = &tmp + } + + if databaseResourceType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "database_resource_type")); ok { + tmp := databaseResourceType.(string) + result.DatabaseResourceType = &tmp + } + + if definedTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "defined_tags")); ok { + tmp, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) + if err != nil { + return result, fmt.Errorf("unable to convert defined_tags, encountered error: %v", err) + } + result.DefinedTags = tmp + } + + if freeformTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "freeform_tags")); ok { + result.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) + } + + if isAdvancedFeaturesEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_advanced_features_enabled")); ok { + tmp := isAdvancedFeaturesEnabled.(bool) + result.IsAdvancedFeaturesEnabled = &tmp + } + + if opsiPrivateEndpointId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "opsi_private_endpoint_id")); ok { + tmp := opsiPrivateEndpointId.(string) + result.OpsiPrivateEndpointId = &tmp + } + + if systemTags, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "system_tags")); ok { + tmp, err := tfresource.MapToSystemTags(systemTags.(map[string]interface{})) + if err != nil { + return result, fmt.Errorf("unable to convert system_tags, encountered error: %v", err) + } + result.SystemTags = tmp + } + + return result, nil +} + +func CreateAutonomousDatabaseInsightDetailsToMap(obj oci_opsi.CreateAutonomousDatabaseInsightDetails) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.ConnectionDetails != nil { + result["connection_details"] = []interface{}{ConnectionDetailsToMap(obj.ConnectionDetails)} + } + + if obj.CredentialDetails != nil { + credentialDetailsArray := []interface{}{} + if credentialDetailsMap := CredentialDetailsToMap(&obj.CredentialDetails); credentialDetailsMap != nil { + credentialDetailsArray = append(credentialDetailsArray, credentialDetailsMap) + } + result["credential_details"] = credentialDetailsArray + } + + if obj.DatabaseId != nil { + result["database_id"] = string(*obj.DatabaseId) + } + + if obj.DatabaseResourceType != nil { + result["database_resource_type"] = string(*obj.DatabaseResourceType) + } + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + return result +} + func (s *OpsiExadataInsightResourceCrud) mapToCreatePeComanagedDatabaseInsightDetails(fieldKeyFormat string) (oci_opsi.CreatePeComanagedDatabaseInsightDetails, error) { result := oci_opsi.CreatePeComanagedDatabaseInsightDetails{} @@ -1470,6 +1967,23 @@ func (s *OpsiExadataInsightResourceCrud) mapToCreatePeComanagedExadataVmclusterD result.DbmPrivateEndpointId = &tmp } + if memberAutonomousDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "member_autonomous_details")); ok { + interfaces := memberAutonomousDetails.([]interface{}) + tmp := make([]oci_opsi.CreateAutonomousDatabaseInsightDetails, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "member_autonomous_details"), stateDataIndex) + converted, err := s.mapToCreateAutonomousDatabaseInsightDetails(fieldKeyFormatNextLevel) + if err != nil { + return result, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "member_autonomous_details")) { + result.MemberAutonomousDetails = tmp + } + } + if memberDatabaseDetails, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "member_database_details")); ok { interfaces := memberDatabaseDetails.([]interface{}) tmp := make([]oci_opsi.CreatePeComanagedDatabaseInsightDetails, len(interfaces)) @@ -1492,6 +2006,10 @@ func (s *OpsiExadataInsightResourceCrud) mapToCreatePeComanagedExadataVmclusterD result.OpsiPrivateEndpointId = &tmp } + if vmClusterType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "vm_cluster_type")); ok { + result.VmClusterType = oci_opsi.ExadataVmClusterTypeEnum(vmClusterType.(string)) + } + if vmclusterId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "vmcluster_id")); ok { tmp := vmclusterId.(string) result.VmclusterId = &tmp @@ -1511,6 +2029,12 @@ func CreatePeComanagedExadataVmclusterDetailsToMap(obj oci_opsi.CreatePeComanage result["dbm_private_endpoint_id"] = string(*obj.DbmPrivateEndpointId) } + memberAutonomousDetails := []interface{}{} + for _, item := range obj.MemberAutonomousDetails { + memberAutonomousDetails = append(memberAutonomousDetails, CreateAutonomousDatabaseInsightDetailsToMap(item)) + } + result["member_autonomous_details"] = memberAutonomousDetails + memberDatabaseDetails := []interface{}{} for _, item := range obj.MemberDatabaseDetails { memberDatabaseDetails = append(memberDatabaseDetails, CreatePeComanagedDatabaseInsightDetailsToMap(item)) @@ -1521,6 +2045,8 @@ func CreatePeComanagedExadataVmclusterDetailsToMap(obj oci_opsi.CreatePeComanage result["opsi_private_endpoint_id"] = string(*obj.OpsiPrivateEndpointId) } + result["vm_cluster_type"] = string(obj.VmClusterType) + if obj.VmclusterId != nil { result["vmcluster_id"] = string(*obj.VmclusterId) } @@ -1539,6 +2065,13 @@ func (s *OpsiExadataInsightResourceCrud) mapToCredentialDetails(fieldKeyFormat s credentialType = "" // default value } switch strings.ToLower(credentialType) { + case strings.ToLower("CREDENTIALS_BY_NAMED_CREDS"): + details := oci_opsi.CredentialByNamedCredentials{} + if namedCredentialId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "named_credential_id")); ok { + tmp := namedCredentialId.(string) + details.NamedCredentialId = &tmp + } + baseObject = details case strings.ToLower("CREDENTIALS_BY_SOURCE"): details := oci_opsi.CredentialsBySource{} if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { @@ -1563,10 +2096,6 @@ func (s *OpsiExadataInsightResourceCrud) mapToCredentialDetails(fieldKeyFormat s tmp := walletSecretId.(string) details.WalletSecretId = &tmp } - if credentialSourceName, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "credential_source_name")); ok { - tmp := credentialSourceName.(string) - details.CredentialSourceName = &tmp - } baseObject = details default: return nil, fmt.Errorf("unknown credential_type '%v' was specified", credentialType) diff --git a/internal/service/psql/psql_configuration_data_source.go b/internal/service/psql/psql_configuration_data_source.go index 1888afecefd..0f4171aa18d 100644 --- a/internal/service/psql/psql_configuration_data_source.go +++ b/internal/service/psql/psql_configuration_data_source.go @@ -70,6 +70,8 @@ func (s *PsqlConfigurationDataSourceCrud) SetData() error { s.D.Set("compartment_id", *s.Res.CompartmentId) } + s.D.Set("compatible_shapes", s.Res.CompatibleShapes) + s.D.Set("config_type", s.Res.ConfigType) if s.Res.ConfigurationDetails != nil { @@ -82,6 +84,10 @@ func (s *PsqlConfigurationDataSourceCrud) SetData() error { s.D.Set("db_version", *s.Res.DbVersion) } + if s.Res.DefaultConfigId != nil { + s.D.Set("default_config_id", *s.Res.DefaultConfigId) + } + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } diff --git a/internal/service/psql/psql_configuration_resource.go b/internal/service/psql/psql_configuration_resource.go index 89983560e03..e56074d2b9a 100644 --- a/internal/service/psql/psql_configuration_resource.go +++ b/internal/service/psql/psql_configuration_resource.go @@ -80,13 +80,17 @@ func PsqlConfigurationResource() *schema.Resource { Type: schema.TypeString, Required: true, }, - "shape": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, // Optional + "compatible_shapes": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + ConflictsWith: []string{"shape"}, + }, "defined_tags": { Type: schema.TypeMap, Optional: true, @@ -123,6 +127,13 @@ func PsqlConfigurationResource() *schema.Resource { Computed: true, ForceNew: true, }, + "shape": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"compatible_shapes"}, + }, "system_tags": { Type: schema.TypeMap, Optional: true, @@ -194,6 +205,10 @@ func PsqlConfigurationResource() *schema.Resource { }, }, }, + "default_config_id": { + Type: schema.TypeString, + Computed: true, + }, "lifecycle_details": { Type: schema.TypeString, Computed: true, @@ -284,6 +299,19 @@ func (s *PsqlConfigurationResourceCrud) Create() error { request.CompartmentId = &tmp } + if compatibleShapes, ok := s.D.GetOkExists("compatible_shapes"); ok { + interfaces := compatibleShapes.([]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("compatible_shapes") { + request.CompatibleShapes = tmp + } + } + if dbConfigurationOverrides, ok := s.D.GetOkExists("db_configuration_overrides"); ok { if tmpList := dbConfigurationOverrides.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "db_configuration_overrides", 0) @@ -390,6 +418,19 @@ func (s *PsqlConfigurationResourceCrud) Update() error { } request := oci_psql.UpdateConfigurationRequest{} + if compatibleShapes, ok := s.D.GetOkExists("compatible_shapes"); ok { + interfaces := compatibleShapes.([]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("compatible_shapes") { + request.CompatibleShapes = tmp + } + } + tmp := s.D.Id() request.ConfigurationId = &tmp @@ -443,6 +484,8 @@ func (s *PsqlConfigurationResourceCrud) SetData() error { s.D.Set("compartment_id", *s.Res.CompartmentId) } + s.D.Set("compatible_shapes", s.Res.CompatibleShapes) + s.D.Set("config_type", s.Res.ConfigType) if s.Res.ConfigurationDetails != nil { @@ -455,6 +498,10 @@ func (s *PsqlConfigurationResourceCrud) SetData() error { s.D.Set("db_version", *s.Res.DbVersion) } + if s.Res.DefaultConfigId != nil { + s.D.Set("default_config_id", *s.Res.DefaultConfigId) + } + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } @@ -590,10 +637,16 @@ func ConfigurationSummaryToMap(obj oci_psql.ConfigurationSummary) map[string]int result["compartment_id"] = string(*obj.CompartmentId) } + result["compatible_shapes"] = obj.CompatibleShapes + if obj.DbVersion != nil { result["db_version"] = string(*obj.DbVersion) } + if obj.DefaultConfigId != nil { + result["default_config_id"] = string(*obj.DefaultConfigId) + } + if obj.DefinedTags != nil { result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) } diff --git a/internal/service/psql/psql_configurations_data_source.go b/internal/service/psql/psql_configurations_data_source.go index d875be9a198..c4e8a6a9ab9 100644 --- a/internal/service/psql/psql_configurations_data_source.go +++ b/internal/service/psql/psql_configurations_data_source.go @@ -38,9 +38,18 @@ func PsqlConfigurationsDataSource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "instance_memory_size_in_gbs": { + Type: schema.TypeInt, + Optional: true, + }, + "instance_ocpu_count": { + Type: schema.TypeInt, + Optional: true, + }, "shape": { Type: schema.TypeString, Optional: true, + Computed: true, }, "state": { Type: schema.TypeString, @@ -109,6 +118,16 @@ func (s *PsqlConfigurationsDataSourceCrud) Get() error { request.DisplayName = &tmp } + if instanceMemorySizeInGBs, ok := s.D.GetOkExists("instance_memory_size_in_gbs"); ok { + tmp := instanceMemorySizeInGBs.(int) + request.InstanceMemorySizeInGBs = &tmp + } + + if instanceOcpuCount, ok := s.D.GetOkExists("instance_ocpu_count"); ok { + tmp := instanceOcpuCount.(int) + request.InstanceOcpuCount = &tmp + } + if shape, ok := s.D.GetOkExists("shape"); ok { tmp := shape.(string) request.Shape = &tmp diff --git a/internal/service/psql/psql_default_configuration_data_source.go b/internal/service/psql/psql_default_configuration_data_source.go index 2eb722c20d2..a02ad38d09d 100644 --- a/internal/service/psql/psql_default_configuration_data_source.go +++ b/internal/service/psql/psql_default_configuration_data_source.go @@ -22,6 +22,15 @@ func PsqlDefaultConfigurationDataSource() *schema.Resource { Required: true, }, // Computed + "compatible_shapes": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + ConflictsWith: []string{"shape"}, + }, "configuration_details": { Type: schema.TypeList, Computed: true, @@ -105,8 +114,10 @@ func PsqlDefaultConfigurationDataSource() *schema.Resource { Computed: true, }, "shape": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ConflictsWith: []string{"compatible_shapes"}, }, "state": { Type: schema.TypeString, @@ -164,6 +175,8 @@ func (s *PsqlDefaultConfigurationDataSourceCrud) SetData() error { s.D.SetId(*s.Res.Id) + s.D.Set("compatible_shapes", s.Res.CompatibleShapes) + if s.Res.ConfigurationDetails != nil { s.D.Set("configuration_details", []interface{}{DefaultConfigurationDetailsToMap(s.Res.ConfigurationDetails)}) } else { diff --git a/internal/service/psql/psql_default_configurations_data_source.go b/internal/service/psql/psql_default_configurations_data_source.go index 2c55ad1599c..7a6f734fa0f 100644 --- a/internal/service/psql/psql_default_configurations_data_source.go +++ b/internal/service/psql/psql_default_configurations_data_source.go @@ -30,9 +30,18 @@ func PsqlDefaultConfigurationsDataSource() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "instance_memory_size_in_gbs": { + Type: schema.TypeInt, + Optional: true, + }, + "instance_ocpu_count": { + Type: schema.TypeInt, + Optional: true, + }, "shape": { Type: schema.TypeString, Optional: true, + Computed: true, }, "state": { Type: schema.TypeString, @@ -53,6 +62,14 @@ func PsqlDefaultConfigurationsDataSource() *schema.Resource { // Optional // Computed + "compatible_shapes": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, "configuration_details": { Type: schema.TypeList, Computed: true, @@ -197,6 +214,16 @@ func (s *PsqlDefaultConfigurationsDataSourceCrud) Get() error { request.DisplayName = &tmp } + if instanceMemorySizeInGBs, ok := s.D.GetOkExists("instance_memory_size_in_gbs"); ok { + tmp := instanceMemorySizeInGBs.(int) + request.InstanceMemorySizeInGBs = &tmp + } + + if instanceOcpuCount, ok := s.D.GetOkExists("instance_ocpu_count"); ok { + tmp := instanceOcpuCount.(int) + request.InstanceOcpuCount = &tmp + } + if shape, ok := s.D.GetOkExists("shape"); ok { tmp := shape.(string) request.Shape = &tmp @@ -306,6 +333,8 @@ func DefaultConfigurationDetailsToMap(obj *oci_psql.DefaultConfigurationDetails) func DefaultConfigurationSummaryToMap(obj oci_psql.DefaultConfigurationSummary) map[string]interface{} { result := map[string]interface{}{} + result["compatible_shapes"] = obj.CompatibleShapes + if obj.DbVersion != nil { result["db_version"] = string(*obj.DbVersion) } diff --git a/internal/service/vault/vault_secret_data_source.go b/internal/service/vault/vault_secret_data_source.go index 040a59b92d4..0dae0e4ef96 100644 --- a/internal/service/vault/vault_secret_data_source.go +++ b/internal/service/vault/vault_secret_data_source.go @@ -89,6 +89,10 @@ func (s *VaultSecretDataSourceCrud) SetData() error { s.D.Set("is_auto_generation_enabled", *s.Res.IsAutoGenerationEnabled) } + if s.Res.IsReplica != nil { + s.D.Set("is_replica", *s.Res.IsReplica) + } + if s.Res.KeyId != nil { s.D.Set("key_id", *s.Res.KeyId) } @@ -107,6 +111,12 @@ func (s *VaultSecretDataSourceCrud) SetData() error { s.D.Set("next_rotation_time", s.Res.NextRotationTime.String()) } + if s.Res.ReplicationConfig != nil { + s.D.Set("replication_config", []interface{}{ReplicationConfigToMap(s.Res.ReplicationConfig)}) + } else { + s.D.Set("replication_config", nil) + } + if s.Res.RotationConfig != nil { s.D.Set("rotation_config", []interface{}{RotationConfigToMap(s.Res.RotationConfig)}) } else { @@ -135,6 +145,12 @@ func (s *VaultSecretDataSourceCrud) SetData() error { } s.D.Set("secret_rules", secretRules) + if s.Res.SourceRegionInformation != nil { + s.D.Set("source_region_information", []interface{}{SourceRegionInformationToMap(s.Res.SourceRegionInformation)}) + } else { + s.D.Set("source_region_information", nil) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeCreated != nil { diff --git a/internal/service/vault/vault_secret_resource.go b/internal/service/vault/vault_secret_resource.go index b05557eb067..90478afbf34 100644 --- a/internal/service/vault/vault_secret_resource.go +++ b/internal/service/vault/vault_secret_resource.go @@ -85,6 +85,40 @@ func VaultSecretResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "replication_config": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "replication_targets": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "target_key_id": { + Type: schema.TypeString, + Required: true, + }, + "target_region": { + Type: schema.TypeString, + Required: true, + }, + "target_vault_id": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "is_write_forward_enabled": { + Type: schema.TypeBool, + Optional: true, + }, + }, + }, + }, "rotation_config": { Type: schema.TypeList, Optional: true, @@ -93,7 +127,6 @@ func VaultSecretResource() *schema.Resource { MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - // Required "target_system_details": { Type: schema.TypeList, Required: true, @@ -101,7 +134,6 @@ func VaultSecretResource() *schema.Resource { MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - // Required "target_system_type": { Type: schema.TypeString, Required: true, @@ -111,8 +143,6 @@ func VaultSecretResource() *schema.Resource { "FUNCTION", }, true), }, - - // Optional "adb_id": { Type: schema.TypeString, Optional: true, @@ -123,13 +153,9 @@ func VaultSecretResource() *schema.Resource { Optional: true, Computed: true, }, - - // Computed }, }, }, - - // Optional "is_scheduled_rotation_enabled": { Type: schema.TypeBool, Optional: true, @@ -140,8 +166,6 @@ func VaultSecretResource() *schema.Resource { Optional: true, Computed: true, }, - - // Computed }, }, }, @@ -153,7 +177,6 @@ func VaultSecretResource() *schema.Resource { MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - // Required "content_type": { Type: schema.TypeString, Required: true, @@ -162,8 +185,6 @@ func VaultSecretResource() *schema.Resource { "BASE64", }, true), }, - - // Optional "content": { Type: schema.TypeString, Optional: true, @@ -177,8 +198,6 @@ func VaultSecretResource() *schema.Resource { Optional: true, Computed: true, }, - - // Computed }, }, }, @@ -190,7 +209,6 @@ func VaultSecretResource() *schema.Resource { MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - // Required "generation_template": { Type: schema.TypeString, Required: true, @@ -205,8 +223,6 @@ func VaultSecretResource() *schema.Resource { "SSH_KEY", }, true), }, - - // Optional "passphrase_length": { Type: schema.TypeInt, Optional: true, @@ -215,8 +231,6 @@ func VaultSecretResource() *schema.Resource { Type: schema.TypeString, Optional: true, }, - - // Computed }, }, }, @@ -226,7 +240,6 @@ func VaultSecretResource() *schema.Resource { Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - // Required "rule_type": { Type: schema.TypeString, Required: true, @@ -236,8 +249,6 @@ func VaultSecretResource() *schema.Resource { "SECRET_REUSE_RULE", }, true), }, - - // Optional "is_enforced_on_deleted_secret_versions": { Type: schema.TypeBool, Optional: true, @@ -259,13 +270,9 @@ func VaultSecretResource() *schema.Resource { Computed: true, DiffSuppressFunc: tfresource.TimeDiffSuppressFunction, }, - - // Computed }, }, }, - - // Computed "current_version_number": { Type: schema.TypeString, Computed: true, @@ -274,6 +281,10 @@ func VaultSecretResource() *schema.Resource { Type: schema.TypeBool, Computed: true, }, + "is_replica": { + Type: schema.TypeBool, + Computed: true, + }, "last_rotation_time": { Type: schema.TypeString, Computed: true, @@ -290,6 +301,26 @@ func VaultSecretResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "source_region_information": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source_key_id": { + Type: schema.TypeString, + Computed: true, + }, + "source_region": { + Type: schema.TypeString, + Computed: true, + }, + "source_vault_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, "state": { Type: schema.TypeString, Computed: true, @@ -423,6 +454,17 @@ func (s *VaultSecretResourceCrud) Create() error { request.Metadata = metadata.(map[string]interface{}) } + if replicationConfig, ok := s.D.GetOkExists("replication_config"); ok { + if tmpList := replicationConfig.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "replication_config", 0) + tmp, err := s.mapToReplicationConfig(fieldKeyFormat) + if err != nil { + return err + } + request.ReplicationConfig = &tmp + } + } + if rotationConfig, ok := s.D.GetOkExists("rotation_config"); ok { if tmpList := rotationConfig.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "rotation_config", 0) @@ -512,6 +554,10 @@ func (s *VaultSecretResourceCrud) Get() error { } func (s *VaultSecretResourceCrud) Update() error { + val, ok := s.D.GetOkExists("is_replica") + if ok && val.(bool) { + return fmt.Errorf("Write forwarding for replica secrets is not allowed through Terraform. Please use SDK/CLI/Console to perform write forwarding on replica secrets") + } if compartment, ok := s.D.GetOkExists("compartment_id"); ok && s.D.HasChange("compartment_id") { oldRaw, newRaw := s.D.GetChange("compartment_id") if newRaw != "" && oldRaw != "" { @@ -558,6 +604,17 @@ func (s *VaultSecretResourceCrud) Update() error { request.Metadata = metadata.(map[string]interface{}) } + if replicationConfig, ok := s.D.GetOkExists("replication_config"); ok { + if tmpList := replicationConfig.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "replication_config", 0) + tmp, err := s.mapToReplicationConfig(fieldKeyFormat) + if err != nil { + return err + } + request.ReplicationConfig = &tmp + } + } + if rotationConfig, ok := s.D.GetOkExists("rotation_config"); ok { if tmpList := rotationConfig.([]interface{}); len(tmpList) > 0 { fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "rotation_config", 0) @@ -623,13 +680,15 @@ func (s *VaultSecretResourceCrud) Update() error { } func (s *VaultSecretResourceCrud) Delete() error { - request := oci_vault.ScheduleSecretDeletionRequest{} + val, ok := s.D.GetOkExists("is_replica") + if ok && val.(bool) { + return fmt.Errorf("Write forwarding for replica secrets is not allowed through Terraform. Please use SDK/CLI/Console to perform write forwarding on replica secrets") + } + request := oci_vault.ScheduleSecretDeletionRequest{} tmp := s.D.Id() request.SecretId = &tmp - request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "vault") - _, err := s.Client.ScheduleSecretDeletion(context.Background(), request) return err } @@ -657,6 +716,10 @@ func (s *VaultSecretResourceCrud) SetData() error { s.D.Set("is_auto_generation_enabled", *s.Res.IsAutoGenerationEnabled) } + if s.Res.IsReplica != nil { + s.D.Set("is_replica", *s.Res.IsReplica) + } + if s.Res.KeyId != nil { s.D.Set("key_id", *s.Res.KeyId) } @@ -675,6 +738,12 @@ func (s *VaultSecretResourceCrud) SetData() error { s.D.Set("next_rotation_time", s.Res.NextRotationTime.String()) } + if s.Res.ReplicationConfig != nil { + s.D.Set("replication_config", []interface{}{ReplicationConfigToMap(s.Res.ReplicationConfig)}) + } else { + s.D.Set("replication_config", nil) + } + if s.Res.RotationConfig != nil { s.D.Set("rotation_config", []interface{}{RotationConfigToMap(s.Res.RotationConfig)}) } else { @@ -703,6 +772,12 @@ func (s *VaultSecretResourceCrud) SetData() error { } s.D.Set("secret_rules", secretRules) + if s.Res.SourceRegionInformation != nil { + s.D.Set("source_region_information", []interface{}{SourceRegionInformationToMap(s.Res.SourceRegionInformation)}) + } else { + s.D.Set("source_region_information", nil) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TimeCreated != nil { @@ -724,6 +799,89 @@ func (s *VaultSecretResourceCrud) SetData() error { return nil } +func (s *VaultSecretResourceCrud) mapToReplicationConfig(fieldKeyFormat string) (oci_vault.ReplicationConfig, error) { + result := oci_vault.ReplicationConfig{} + + if isWriteForwardEnabled, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "is_write_forward_enabled")); ok { + tmp := isWriteForwardEnabled.(bool) + result.IsWriteForwardEnabled = &tmp + } + + if replicationTargets, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "replication_targets")); ok { + interfaces := replicationTargets.([]interface{}) + tmp := make([]oci_vault.ReplicationTarget, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormatNextLevel := fmt.Sprintf("%s.%d.%%s", fmt.Sprintf(fieldKeyFormat, "replication_targets"), stateDataIndex) + converted, err := s.mapToReplicationTarget(fieldKeyFormatNextLevel) + if err != nil { + return result, err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange(fmt.Sprintf(fieldKeyFormat, "replication_targets")) { + result.ReplicationTargets = tmp + } + } + + return result, nil +} + +func ReplicationConfigToMap(obj *oci_vault.ReplicationConfig) map[string]interface{} { + result := map[string]interface{}{} + + if obj.IsWriteForwardEnabled != nil { + result["is_write_forward_enabled"] = bool(*obj.IsWriteForwardEnabled) + } + + replicationTargets := []interface{}{} + for _, item := range obj.ReplicationTargets { + replicationTargets = append(replicationTargets, ReplicationTargetToMap(item)) + } + result["replication_targets"] = replicationTargets + + return result +} + +func (s *VaultSecretResourceCrud) mapToReplicationTarget(fieldKeyFormat string) (oci_vault.ReplicationTarget, error) { + result := oci_vault.ReplicationTarget{} + + if targetKeyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "target_key_id")); ok { + tmp := targetKeyId.(string) + result.TargetKeyId = &tmp + } + + if targetRegion, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "target_region")); ok { + tmp := targetRegion.(string) + result.TargetRegion = &tmp + } + + if targetVaultId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "target_vault_id")); ok { + tmp := targetVaultId.(string) + result.TargetVaultId = &tmp + } + + return result, nil +} + +func ReplicationTargetToMap(obj oci_vault.ReplicationTarget) map[string]interface{} { + result := map[string]interface{}{} + + if obj.TargetKeyId != nil { + result["target_key_id"] = string(*obj.TargetKeyId) + } + + if obj.TargetRegion != nil { + result["target_region"] = string(*obj.TargetRegion) + } + + if obj.TargetVaultId != nil { + result["target_vault_id"] = string(*obj.TargetVaultId) + } + + return result +} + func (s *VaultSecretResourceCrud) mapToRotationConfig(fieldKeyFormat string) (oci_vault.RotationConfig, error) { result := oci_vault.RotationConfig{} @@ -988,6 +1146,24 @@ func SecretRuleToMap(obj oci_vault.SecretRule) map[string]interface{} { return result } +func SourceRegionInformationToMap(obj *oci_vault.SourceRegionInformation) map[string]interface{} { + result := map[string]interface{}{} + + if obj.SourceKeyId != nil { + result["source_key_id"] = string(*obj.SourceKeyId) + } + + if obj.SourceRegion != nil { + result["source_region"] = string(*obj.SourceRegion) + } + + if obj.SourceVaultId != nil { + result["source_vault_id"] = string(*obj.SourceVaultId) + } + + return result +} + func (s *VaultSecretResourceCrud) mapToTargetSystemDetails(fieldKeyFormat string) (oci_vault.TargetSystemDetails, error) { var baseObject oci_vault.TargetSystemDetails //discriminator diff --git a/internal/service/vault/vault_secrets_data_source.go b/internal/service/vault/vault_secrets_data_source.go index 5b48b09a13c..8714f9b14f6 100644 --- a/internal/service/vault/vault_secrets_data_source.go +++ b/internal/service/vault/vault_secrets_data_source.go @@ -137,6 +137,10 @@ func (s *VaultSecretsDataSourceCrud) SetData() error { secret["is_auto_generation_enabled"] = *r.IsAutoGenerationEnabled } + if r.IsReplica != nil { + secret["is_replica"] = *r.IsReplica + } + if r.KeyId != nil { secret["key_id"] = *r.KeyId } @@ -153,6 +157,12 @@ func (s *VaultSecretsDataSourceCrud) SetData() error { secret["next_rotation_time"] = r.NextRotationTime.String() } + if r.ReplicationConfig != nil { + secret["replication_config"] = []interface{}{ReplicationConfigToMap(r.ReplicationConfig)} + } else { + secret["replication_config"] = nil + } + if r.RotationConfig != nil { secret["rotation_config"] = []interface{}{RotationConfigToMap(r.RotationConfig)} } else { @@ -175,6 +185,12 @@ func (s *VaultSecretsDataSourceCrud) SetData() error { secret["secret_name"] = *r.SecretName } + if r.SourceRegionInformation != nil { + secret["source_region_information"] = []interface{}{SourceRegionInformationToMap(r.SourceRegionInformation)} + } else { + secret["source_region_information"] = nil + } + secret["state"] = r.LifecycleState if r.SystemTags != nil { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_api_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_api_lock_request_response.go new file mode 100644 index 00000000000..570199d63cf --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_api_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddApiLockRequest wrapper for the AddApiLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddApiLock.go.html to see an example of how to use AddApiLockRequest. +type AddApiLockRequest struct { + + // The ocid of the API. + ApiId *string `mandatory:"true" contributesTo:"path" name:"apiId"` + + // AddResourceLockDetails body parameter + AddResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AddApiLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddApiLockRequest) 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 AddApiLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddApiLockRequest) 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 AddApiLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddApiLockResponse wrapper for the AddApiLock operation +type AddApiLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Api instance + Api `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"` + + // etag for the returned Api resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response AddApiLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddApiLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_certificate_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_certificate_lock_request_response.go new file mode 100644 index 00000000000..4079947e877 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_certificate_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddCertificateLockRequest wrapper for the AddCertificateLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddCertificateLock.go.html to see an example of how to use AddCertificateLockRequest. +type AddCertificateLockRequest struct { + + // The ocid of the certificate. + CertificateId *string `mandatory:"true" contributesTo:"path" name:"certificateId"` + + // AddResourceLockDetails body parameter + AddResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AddCertificateLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddCertificateLockRequest) 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 AddCertificateLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddCertificateLockRequest) 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 AddCertificateLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddCertificateLockResponse wrapper for the AddCertificateLock operation +type AddCertificateLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Certificate instance + Certificate `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"` + + // etag for the returned Certificate resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response AddCertificateLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddCertificateLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_deployment_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_deployment_lock_request_response.go new file mode 100644 index 00000000000..c2aacca2e84 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_deployment_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddDeploymentLockRequest wrapper for the AddDeploymentLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddDeploymentLock.go.html to see an example of how to use AddDeploymentLockRequest. +type AddDeploymentLockRequest struct { + + // The ocid of the deployment. + DeploymentId *string `mandatory:"true" contributesTo:"path" name:"deploymentId"` + + // AddResourceLockDetails body parameter + AddResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AddDeploymentLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddDeploymentLockRequest) 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 AddDeploymentLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddDeploymentLockRequest) 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 AddDeploymentLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddDeploymentLockResponse wrapper for the AddDeploymentLock operation +type AddDeploymentLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Deployment instance + Deployment `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"` + + // etag for the returned Deployment resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response AddDeploymentLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddDeploymentLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_gateway_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_gateway_lock_request_response.go new file mode 100644 index 00000000000..4ccb6dcbb26 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_gateway_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddGatewayLockRequest wrapper for the AddGatewayLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddGatewayLock.go.html to see an example of how to use AddGatewayLockRequest. +type AddGatewayLockRequest struct { + + // The ocid of the gateway. + GatewayId *string `mandatory:"true" contributesTo:"path" name:"gatewayId"` + + // AddResourceLockDetails body parameter + AddResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AddGatewayLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddGatewayLockRequest) 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 AddGatewayLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddGatewayLockRequest) 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 AddGatewayLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddGatewayLockResponse wrapper for the AddGatewayLock operation +type AddGatewayLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Gateway instance + Gateway `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"` + + // etag for the returned Gateway resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response AddGatewayLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddGatewayLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_resource_lock_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_resource_lock_details.go new file mode 100644 index 00000000000..0d164e70a0f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_resource_lock_details.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AddResourceLockDetails Used to add a resource lock. +// Resource locks are used to prevent certain APIs from being called for the resource. +// A full lock prevents both updating the resource and deleting the resource. A delete +// lock prevents deleting the resource. +type AddResourceLockDetails struct { + + // Type of the lock. + Type AddResourceLockDetailsTypeEnum `mandatory:"true" json:"type"` + + // A message added by the creator of the lock. This is typically used to give an + // indication of why the resource is locked. + Message *string `mandatory:"false" json:"message"` +} + +func (m AddResourceLockDetails) 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 AddResourceLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingAddResourceLockDetailsTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetAddResourceLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddResourceLockDetailsTypeEnum Enum with underlying type: string +type AddResourceLockDetailsTypeEnum string + +// Set of constants representing the allowable values for AddResourceLockDetailsTypeEnum +const ( + AddResourceLockDetailsTypeFull AddResourceLockDetailsTypeEnum = "FULL" + AddResourceLockDetailsTypeDelete AddResourceLockDetailsTypeEnum = "DELETE" +) + +var mappingAddResourceLockDetailsTypeEnum = map[string]AddResourceLockDetailsTypeEnum{ + "FULL": AddResourceLockDetailsTypeFull, + "DELETE": AddResourceLockDetailsTypeDelete, +} + +var mappingAddResourceLockDetailsTypeEnumLowerCase = map[string]AddResourceLockDetailsTypeEnum{ + "full": AddResourceLockDetailsTypeFull, + "delete": AddResourceLockDetailsTypeDelete, +} + +// GetAddResourceLockDetailsTypeEnumValues Enumerates the set of values for AddResourceLockDetailsTypeEnum +func GetAddResourceLockDetailsTypeEnumValues() []AddResourceLockDetailsTypeEnum { + values := make([]AddResourceLockDetailsTypeEnum, 0) + for _, v := range mappingAddResourceLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetAddResourceLockDetailsTypeEnumStringValues Enumerates the set of values in String for AddResourceLockDetailsTypeEnum +func GetAddResourceLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingAddResourceLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingAddResourceLockDetailsTypeEnum(val string) (AddResourceLockDetailsTypeEnum, bool) { + enum, ok := mappingAddResourceLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_sdk_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_sdk_lock_request_response.go new file mode 100644 index 00000000000..70caa781f82 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_sdk_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddSdkLockRequest wrapper for the AddSdkLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddSdkLock.go.html to see an example of how to use AddSdkLockRequest. +type AddSdkLockRequest struct { + + // The ocid of the SDK. + SdkId *string `mandatory:"true" contributesTo:"path" name:"sdkId"` + + // AddResourceLockDetails body parameter + AddResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AddSdkLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddSdkLockRequest) 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 AddSdkLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddSdkLockRequest) 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 AddSdkLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddSdkLockResponse wrapper for the AddSdkLock operation +type AddSdkLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Sdk instance + Sdk `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"` + + // etag for the returned Sdk resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response AddSdkLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddSdkLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_subscriber_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_subscriber_lock_request_response.go new file mode 100644 index 00000000000..319490a2564 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_subscriber_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddSubscriberLockRequest wrapper for the AddSubscriberLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddSubscriberLock.go.html to see an example of how to use AddSubscriberLockRequest. +type AddSubscriberLockRequest struct { + + // The ocid of the subscriber. + SubscriberId *string `mandatory:"true" contributesTo:"path" name:"subscriberId"` + + // AddResourceLockDetails body parameter + AddResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AddSubscriberLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddSubscriberLockRequest) 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 AddSubscriberLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddSubscriberLockRequest) 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 AddSubscriberLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddSubscriberLockResponse wrapper for the AddSubscriberLock operation +type AddSubscriberLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Subscriber instance + Subscriber `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"` + + // etag for the returned Subscriber resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response AddSubscriberLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddSubscriberLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_usage_plan_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_usage_plan_lock_request_response.go new file mode 100644 index 00000000000..671ca4b8b86 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/add_usage_plan_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// AddUsagePlanLockRequest wrapper for the AddUsagePlanLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddUsagePlanLock.go.html to see an example of how to use AddUsagePlanLockRequest. +type AddUsagePlanLockRequest struct { + + // The ocid of the usage plan. + UsagePlanId *string `mandatory:"true" contributesTo:"path" name:"usagePlanId"` + + // AddResourceLockDetails body parameter + AddResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request AddUsagePlanLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request AddUsagePlanLockRequest) 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 AddUsagePlanLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request AddUsagePlanLockRequest) 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 AddUsagePlanLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// AddUsagePlanLockResponse wrapper for the AddUsagePlanLock operation +type AddUsagePlanLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The UsagePlan instance + UsagePlan `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"` + + // etag for the returned UsagePlan resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response AddUsagePlanLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response AddUsagePlanLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api.go index 8a3cfe47549..351db462f30 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api.go @@ -38,6 +38,9 @@ type Api struct { // The time this resource was last updated. An RFC3339 formatted datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // The current state of the API. LifecycleState ApiLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` @@ -70,6 +73,10 @@ type Api struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m Api) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api_summary.go index 922d916ddaf..317e971acea 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/api_summary.go @@ -38,6 +38,9 @@ type ApiSummary struct { // The time this resource was last updated. An RFC3339 formatted datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // The current state of the API. LifecycleState ApiSummaryLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` @@ -70,6 +73,10 @@ type ApiSummary struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m ApiSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_client.go index 7d281be4181..e06879abeed 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_client.go @@ -93,6 +93,177 @@ func (client *ApiGatewayClient) ConfigurationProvider() *common.ConfigurationPro return client.config } +// AddApiLock Adds a lock to a Api resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddApiLock.go.html to see an example of how to use AddApiLock API. +func (client ApiGatewayClient) AddApiLock(ctx context.Context, request AddApiLockRequest) (response AddApiLockResponse, 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.addApiLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddApiLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddApiLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddApiLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddApiLockResponse") + } + return +} + +// addApiLock implements the OCIOperation interface (enables retrying operations) +func (client ApiGatewayClient) addApiLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/apis/{apiId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddApiLockResponse + 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/api-gateway/20190501/Api/AddApiLock" + err = common.PostProcessServiceError(err, "ApiGateway", "AddApiLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// AddCertificateLock Adds a lock to a Certificate resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddCertificateLock.go.html to see an example of how to use AddCertificateLock API. +func (client ApiGatewayClient) AddCertificateLock(ctx context.Context, request AddCertificateLockRequest) (response AddCertificateLockResponse, 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.addCertificateLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddCertificateLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddCertificateLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddCertificateLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddCertificateLockResponse") + } + return +} + +// addCertificateLock implements the OCIOperation interface (enables retrying operations) +func (client ApiGatewayClient) addCertificateLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/certificates/{certificateId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddCertificateLockResponse + 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/api-gateway/20190501/Certificate/AddCertificateLock" + err = common.PostProcessServiceError(err, "ApiGateway", "AddCertificateLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// AddSdkLock Adds a lock to a Sdk resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddSdkLock.go.html to see an example of how to use AddSdkLock API. +func (client ApiGatewayClient) AddSdkLock(ctx context.Context, request AddSdkLockRequest) (response AddSdkLockResponse, 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.addSdkLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddSdkLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddSdkLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddSdkLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddSdkLockResponse") + } + return +} + +// addSdkLock implements the OCIOperation interface (enables retrying operations) +func (client ApiGatewayClient) addSdkLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/sdks/{sdkId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddSdkLockResponse + 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/api-gateway/20190501/Sdk/AddSdkLock" + err = common.PostProcessServiceError(err, "ApiGateway", "AddSdkLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeApiCompartment Changes the API compartment. // // # See also @@ -1156,6 +1327,177 @@ func (client ApiGatewayClient) listSdks(ctx context.Context, request common.OCIR return response, err } +// RemoveApiLock Removes a lock from a Api resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveApiLock.go.html to see an example of how to use RemoveApiLock API. +func (client ApiGatewayClient) RemoveApiLock(ctx context.Context, request RemoveApiLockRequest) (response RemoveApiLockResponse, 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.removeApiLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveApiLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveApiLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveApiLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveApiLockResponse") + } + return +} + +// removeApiLock implements the OCIOperation interface (enables retrying operations) +func (client ApiGatewayClient) removeApiLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/apis/{apiId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveApiLockResponse + 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/api-gateway/20190501/Api/RemoveApiLock" + err = common.PostProcessServiceError(err, "ApiGateway", "RemoveApiLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveCertificateLock Removes a lock from a Certificate resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveCertificateLock.go.html to see an example of how to use RemoveCertificateLock API. +func (client ApiGatewayClient) RemoveCertificateLock(ctx context.Context, request RemoveCertificateLockRequest) (response RemoveCertificateLockResponse, 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.removeCertificateLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveCertificateLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveCertificateLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveCertificateLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveCertificateLockResponse") + } + return +} + +// removeCertificateLock implements the OCIOperation interface (enables retrying operations) +func (client ApiGatewayClient) removeCertificateLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/certificates/{certificateId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveCertificateLockResponse + 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/api-gateway/20190501/Certificate/RemoveCertificateLock" + err = common.PostProcessServiceError(err, "ApiGateway", "RemoveCertificateLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// RemoveSdkLock Removes a lock from a Sdk resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveSdkLock.go.html to see an example of how to use RemoveSdkLock API. +func (client ApiGatewayClient) RemoveSdkLock(ctx context.Context, request RemoveSdkLockRequest) (response RemoveSdkLockResponse, 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.removeSdkLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveSdkLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveSdkLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveSdkLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveSdkLockResponse") + } + return +} + +// removeSdkLock implements the OCIOperation interface (enables retrying operations) +func (client ApiGatewayClient) removeSdkLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/sdks/{sdkId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveSdkLockResponse + 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/api-gateway/20190501/Sdk/RemoveSdkLock" + err = common.PostProcessServiceError(err, "ApiGateway", "RemoveSdkLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateApi Updates the API with the given identifier. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_deployment_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_deployment_client.go index 421ce29237f..b9d7bc4175b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_deployment_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_deployment_client.go @@ -93,6 +93,63 @@ func (client *DeploymentClient) ConfigurationProvider() *common.ConfigurationPro return client.config } +// AddDeploymentLock Adds a lock to a Deployment resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddDeploymentLock.go.html to see an example of how to use AddDeploymentLock API. +func (client DeploymentClient) AddDeploymentLock(ctx context.Context, request AddDeploymentLockRequest) (response AddDeploymentLockResponse, 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.addDeploymentLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddDeploymentLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddDeploymentLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddDeploymentLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddDeploymentLockResponse") + } + return +} + +// addDeploymentLock implements the OCIOperation interface (enables retrying operations) +func (client DeploymentClient) addDeploymentLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/deployments/{deploymentId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddDeploymentLockResponse + 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/api-gateway/20190501/Deployment/AddDeploymentLock" + err = common.PostProcessServiceError(err, "Deployment", "AddDeploymentLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeDeploymentCompartment Changes the deployment compartment. // // # See also @@ -391,6 +448,63 @@ func (client DeploymentClient) listDeployments(ctx context.Context, request comm return response, err } +// RemoveDeploymentLock Removes a lock from a Deployment resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveDeploymentLock.go.html to see an example of how to use RemoveDeploymentLock API. +func (client DeploymentClient) RemoveDeploymentLock(ctx context.Context, request RemoveDeploymentLockRequest) (response RemoveDeploymentLockResponse, 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.removeDeploymentLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveDeploymentLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveDeploymentLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveDeploymentLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveDeploymentLockResponse") + } + return +} + +// removeDeploymentLock implements the OCIOperation interface (enables retrying operations) +func (client DeploymentClient) removeDeploymentLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/deployments/{deploymentId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveDeploymentLockResponse + 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/api-gateway/20190501/Deployment/RemoveDeploymentLock" + err = common.PostProcessServiceError(err, "Deployment", "RemoveDeploymentLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateDeployment Updates the deployment with the given identifier. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_gateway_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_gateway_client.go index 0d8c1568bc1..cb008e5ccfc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_gateway_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_gateway_client.go @@ -93,6 +93,63 @@ func (client *GatewayClient) ConfigurationProvider() *common.ConfigurationProvid return client.config } +// AddGatewayLock Adds a lock to a Gateway resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddGatewayLock.go.html to see an example of how to use AddGatewayLock API. +func (client GatewayClient) AddGatewayLock(ctx context.Context, request AddGatewayLockRequest) (response AddGatewayLockResponse, 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.addGatewayLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddGatewayLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddGatewayLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddGatewayLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddGatewayLockResponse") + } + return +} + +// addGatewayLock implements the OCIOperation interface (enables retrying operations) +func (client GatewayClient) addGatewayLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/gateways/{gatewayId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddGatewayLockResponse + 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/api-gateway/20190501/Gateway/AddGatewayLock" + err = common.PostProcessServiceError(err, "Gateway", "AddGatewayLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeGatewayCompartment Changes the gateway compartment. // // # See also @@ -391,6 +448,63 @@ func (client GatewayClient) listGateways(ctx context.Context, request common.OCI return response, err } +// RemoveGatewayLock Removes a lock from a Gateway resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveGatewayLock.go.html to see an example of how to use RemoveGatewayLock API. +func (client GatewayClient) RemoveGatewayLock(ctx context.Context, request RemoveGatewayLockRequest) (response RemoveGatewayLockResponse, 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.removeGatewayLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveGatewayLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveGatewayLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveGatewayLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveGatewayLockResponse") + } + return +} + +// removeGatewayLock implements the OCIOperation interface (enables retrying operations) +func (client GatewayClient) removeGatewayLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/gateways/{gatewayId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveGatewayLockResponse + 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/api-gateway/20190501/Gateway/RemoveGatewayLock" + err = common.PostProcessServiceError(err, "Gateway", "RemoveGatewayLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateGateway Updates the gateway with the given identifier. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_subscribers_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_subscribers_client.go index 2da14c14d16..02ed44f520a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_subscribers_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_subscribers_client.go @@ -93,6 +93,63 @@ func (client *SubscribersClient) ConfigurationProvider() *common.ConfigurationPr return client.config } +// AddSubscriberLock Adds a lock to a Subscriber resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddSubscriberLock.go.html to see an example of how to use AddSubscriberLock API. +func (client SubscribersClient) AddSubscriberLock(ctx context.Context, request AddSubscriberLockRequest) (response AddSubscriberLockResponse, 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.addSubscriberLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddSubscriberLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddSubscriberLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddSubscriberLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddSubscriberLockResponse") + } + return +} + +// addSubscriberLock implements the OCIOperation interface (enables retrying operations) +func (client SubscribersClient) addSubscriberLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/subscribers/{subscriberId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddSubscriberLockResponse + 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/api-gateway/20190501/Subscriber/AddSubscriberLock" + err = common.PostProcessServiceError(err, "Subscribers", "AddSubscriberLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeSubscriberCompartment Changes the subscriber compartment. // // # See also @@ -391,6 +448,63 @@ func (client SubscribersClient) listSubscribers(ctx context.Context, request com return response, err } +// RemoveSubscriberLock Removes a lock from a Subscriber resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveSubscriberLock.go.html to see an example of how to use RemoveSubscriberLock API. +func (client SubscribersClient) RemoveSubscriberLock(ctx context.Context, request RemoveSubscriberLockRequest) (response RemoveSubscriberLockResponse, 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.removeSubscriberLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveSubscriberLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveSubscriberLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveSubscriberLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveSubscriberLockResponse") + } + return +} + +// removeSubscriberLock implements the OCIOperation interface (enables retrying operations) +func (client SubscribersClient) removeSubscriberLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/subscribers/{subscriberId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveSubscriberLockResponse + 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/api-gateway/20190501/Subscriber/RemoveSubscriberLock" + err = common.PostProcessServiceError(err, "Subscribers", "RemoveSubscriberLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateSubscriber Updates the subscriber with the given identifier. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_usageplans_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_usageplans_client.go index d43fe14e40e..bf2889e3d56 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_usageplans_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/apigateway_usageplans_client.go @@ -93,6 +93,63 @@ func (client *UsagePlansClient) ConfigurationProvider() *common.ConfigurationPro return client.config } +// AddUsagePlanLock Adds a lock to a UsagePlan resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/AddUsagePlanLock.go.html to see an example of how to use AddUsagePlanLock API. +func (client UsagePlansClient) AddUsagePlanLock(ctx context.Context, request AddUsagePlanLockRequest) (response AddUsagePlanLockResponse, 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.addUsagePlanLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = AddUsagePlanLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = AddUsagePlanLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(AddUsagePlanLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into AddUsagePlanLockResponse") + } + return +} + +// addUsagePlanLock implements the OCIOperation interface (enables retrying operations) +func (client UsagePlansClient) addUsagePlanLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/usagePlans/{usagePlanId}/actions/addLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response AddUsagePlanLockResponse + 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/api-gateway/20190501/UsagePlan/AddUsagePlanLock" + err = common.PostProcessServiceError(err, "UsagePlans", "AddUsagePlanLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeUsagePlanCompartment Changes the usage plan compartment. // // # See also @@ -391,6 +448,63 @@ func (client UsagePlansClient) listUsagePlans(ctx context.Context, request commo return response, err } +// RemoveUsagePlanLock Removes a lock from a UsagePlan resource. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveUsagePlanLock.go.html to see an example of how to use RemoveUsagePlanLock API. +func (client UsagePlansClient) RemoveUsagePlanLock(ctx context.Context, request RemoveUsagePlanLockRequest) (response RemoveUsagePlanLockResponse, 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.removeUsagePlanLock, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = RemoveUsagePlanLockResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = RemoveUsagePlanLockResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(RemoveUsagePlanLockResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into RemoveUsagePlanLockResponse") + } + return +} + +// removeUsagePlanLock implements the OCIOperation interface (enables retrying operations) +func (client UsagePlansClient) removeUsagePlanLock(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/usagePlans/{usagePlanId}/actions/removeLock", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response RemoveUsagePlanLockResponse + 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/api-gateway/20190501/UsagePlan/RemoveUsagePlanLock" + err = common.PostProcessServiceError(err, "UsagePlans", "RemoveUsagePlanLock", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateUsagePlan Updates the usage plan with the given identifier. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate.go index e10810a7054..df265b7bea4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate.go @@ -53,6 +53,9 @@ type Certificate struct { // The time this resource was last updated. An RFC3339 formatted datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // The current state of the certificate. LifecycleState CertificateLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` @@ -72,6 +75,10 @@ type Certificate struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m Certificate) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate_summary.go index 3ddb28cae7d..6c365c80549 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/certificate_summary.go @@ -44,6 +44,9 @@ type CertificateSummary struct { // The time this resource was last updated. An RFC3339 formatted datetime string. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // The current state of the certificate. LifecycleState CertificateLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` @@ -63,6 +66,10 @@ type CertificateSummary struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m CertificateSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_api_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_api_compartment_request_response.go index 2a8c9578c9b..4eedd525ece 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_api_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_api_compartment_request_response.go @@ -41,6 +41,9 @@ type ChangeApiCompartmentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/change_certificate_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_certificate_compartment_request_response.go index 1d83f3d3bca..75f7ddf7a8d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_certificate_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_certificate_compartment_request_response.go @@ -41,6 +41,9 @@ type ChangeCertificateCompartmentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/change_deployment_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_deployment_compartment_request_response.go index 2b86fdecbc8..70f1a51f1ea 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_deployment_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_deployment_compartment_request_response.go @@ -41,6 +41,9 @@ type ChangeDeploymentCompartmentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/change_gateway_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_gateway_compartment_request_response.go index fefdb7baf66..0c5c7e2398c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_gateway_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_gateway_compartment_request_response.go @@ -41,6 +41,9 @@ type ChangeGatewayCompartmentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/change_subscriber_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_subscriber_compartment_request_response.go index 7f552a90797..27c166375b9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_subscriber_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_subscriber_compartment_request_response.go @@ -41,6 +41,9 @@ type ChangeSubscriberCompartmentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/change_usage_plan_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_usage_plan_compartment_request_response.go index ab7f7a44189..3a6bac21633 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_usage_plan_compartment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/change_usage_plan_compartment_request_response.go @@ -41,6 +41,9 @@ type ChangeUsagePlanCompartmentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/create_api_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_api_details.go index aa4e75640ff..00955bde639 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_api_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_api_details.go @@ -41,6 +41,9 @@ type CreateApiDetails struct { // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // Locks associated with this resource. + Locks []AddResourceLockDetails `mandatory:"false" json:"locks"` + // API Specification content in json or yaml format Content *string `mandatory:"false" json:"content"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_certificate_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_certificate_details.go index 9618fd25a88..d35b8a83302 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_certificate_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_certificate_details.go @@ -49,6 +49,9 @@ type CreateCertificateDetails struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Locks associated with this resource. + Locks []AddResourceLockDetails `mandatory:"false" json:"locks"` } func (m CreateCertificateDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_deployment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_deployment_details.go index a85a07bb79c..0c8fcef8fd3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_deployment_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_deployment_details.go @@ -40,6 +40,9 @@ type CreateDeploymentDetails struct { // Example: `My new resource` DisplayName *string `mandatory:"false" json:"displayName"` + // Locks associated with this resource. + Locks []AddResourceLockDetails `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_gateway_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_gateway_details.go index af57ce62490..b28cbed757a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_gateway_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_gateway_details.go @@ -42,11 +42,15 @@ type CreateGatewayDetails struct { // An array of Network Security Groups OCIDs associated with this API Gateway. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` - // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource which can be + // empty string. CertificateId *string `mandatory:"false" json:"certificateId"` ResponseCacheDetails ResponseCacheDetails `mandatory:"false" json:"responseCacheDetails"` + // Locks associated with this resource. + Locks []AddResourceLockDetails `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -89,6 +93,7 @@ func (m *CreateGatewayDetails) UnmarshalJSON(data []byte) (e error) { NetworkSecurityGroupIds []string `json:"networkSecurityGroupIds"` CertificateId *string `json:"certificateId"` ResponseCacheDetails responsecachedetails `json:"responseCacheDetails"` + Locks []AddResourceLockDetails `json:"locks"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` CaBundles []cabundle `json:"caBundles"` @@ -118,6 +123,8 @@ func (m *CreateGatewayDetails) UnmarshalJSON(data []byte) (e error) { m.ResponseCacheDetails = nil } + m.Locks = make([]AddResourceLockDetails, len(model.Locks)) + copy(m.Locks, model.Locks) m.FreeformTags = model.FreeformTags m.DefinedTags = model.DefinedTags diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_sdk_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_sdk_details.go index 06de9dad3d1..2933242f0ab 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_sdk_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_sdk_details.go @@ -31,6 +31,9 @@ type CreateSdkDetails struct { // Example: `My new resource` DisplayName *string `mandatory:"false" json:"displayName"` + // Locks associated with this resource. + Locks []AddResourceLockDetails `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_subscriber_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_subscriber_details.go index e6363cc8d1e..59136b3aa73 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_subscriber_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_subscriber_details.go @@ -36,6 +36,9 @@ type CreateSubscriberDetails struct { // Example: `My new resource` DisplayName *string `mandatory:"false" json:"displayName"` + // Locks associated with this resource. + Locks []AddResourceLockDetails `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_usage_plan_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_usage_plan_details.go index 5305f8b6aa3..2c8d4183605 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_usage_plan_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/create_usage_plan_details.go @@ -32,6 +32,9 @@ type CreateUsagePlanDetails struct { // Example: `My new resource` DisplayName *string `mandatory:"false" json:"displayName"` + // Locks associated with this resource. + Locks []AddResourceLockDetails `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_api_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_api_request_response.go index 30ff2bc105f..91b3946c4fc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_api_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_api_request_response.go @@ -31,6 +31,9 @@ type DeleteApiRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/delete_certificate_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_certificate_request_response.go index 500e7ab6e42..9052edbb640 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_certificate_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_certificate_request_response.go @@ -31,6 +31,9 @@ type DeleteCertificateRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/delete_deployment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_deployment_request_response.go index 703e2766bd1..3d54437dda9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_deployment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_deployment_request_response.go @@ -31,6 +31,9 @@ type DeleteDeploymentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/delete_gateway_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_gateway_request_response.go index 5590e26e5ea..76cabe6afe6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_gateway_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_gateway_request_response.go @@ -31,6 +31,9 @@ type DeleteGatewayRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/delete_sdk_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_sdk_request_response.go index 5a248960093..1835184163f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_sdk_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_sdk_request_response.go @@ -31,6 +31,9 @@ type DeleteSdkRequest struct { // provide matches the resource's current etag value. IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/delete_subscriber_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_subscriber_request_response.go index e20c3a1ff5c..c445efe952a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_subscriber_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_subscriber_request_response.go @@ -31,6 +31,9 @@ type DeleteSubscriberRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/delete_usage_plan_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_usage_plan_request_response.go index 46cb5c3f3be..9a52571678c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_usage_plan_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/delete_usage_plan_request_response.go @@ -31,6 +31,9 @@ type DeleteUsagePlanRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/deployment.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/deployment.go index 6e8fb90953d..52cb7f85ac8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/deployment.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/deployment.go @@ -62,6 +62,9 @@ type Deployment struct { // resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -73,6 +76,10 @@ type Deployment struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m Deployment) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/deployment_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/deployment_summary.go index d741e2b2212..90b0dc918cc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/deployment_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/deployment_summary.go @@ -58,6 +58,9 @@ type DeploymentSummary struct { // resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -69,6 +72,10 @@ type DeploymentSummary struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m DeploymentSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway.go index 14267fe6e60..3d4175ce208 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway.go @@ -60,6 +60,9 @@ type Gateway struct { // resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // The hostname for APIs deployed on the gateway. Hostname *string `mandatory:"false" json:"hostname"` @@ -83,6 +86,10 @@ type Gateway struct { // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + // An array of CA bundles that should be used on the Gateway for TLS validation. CaBundles []CaBundle `mandatory:"false" json:"caBundles"` } @@ -119,12 +126,14 @@ func (m *Gateway) UnmarshalJSON(data []byte) (e error) { TimeUpdated *common.SDKTime `json:"timeUpdated"` LifecycleState GatewayLifecycleStateEnum `json:"lifecycleState"` LifecycleDetails *string `json:"lifecycleDetails"` + Locks []ResourceLock `json:"locks"` Hostname *string `json:"hostname"` CertificateId *string `json:"certificateId"` IpAddresses []IpAddress `json:"ipAddresses"` ResponseCacheDetails responsecachedetails `json:"responseCacheDetails"` FreeformTags map[string]string `json:"freeformTags"` DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` CaBundles []cabundle `json:"caBundles"` Id *string `json:"id"` CompartmentId *string `json:"compartmentId"` @@ -150,6 +159,8 @@ func (m *Gateway) UnmarshalJSON(data []byte) (e error) { m.LifecycleDetails = model.LifecycleDetails + m.Locks = make([]ResourceLock, len(model.Locks)) + copy(m.Locks, model.Locks) m.Hostname = model.Hostname m.CertificateId = model.CertificateId @@ -170,6 +181,8 @@ func (m *Gateway) UnmarshalJSON(data []byte) (e error) { m.DefinedTags = model.DefinedTags + m.SystemTags = model.SystemTags + m.CaBundles = make([]CaBundle, len(model.CaBundles)) for i, n := range model.CaBundles { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway_summary.go index ba374e3816d..9fb6329b53e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/gateway_summary.go @@ -58,6 +58,9 @@ type GatewaySummary struct { // resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // The hostname for the APIs deployed on the gateway. Hostname *string `mandatory:"false" json:"hostname"` @@ -75,6 +78,10 @@ type GatewaySummary struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m GatewaySummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/header_validation_request_policy.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/header_validation_request_policy.go index 487e0724db9..27cf6a9d67f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/header_validation_request_policy.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/header_validation_request_policy.go @@ -28,6 +28,7 @@ type HeaderValidationRequestPolicy struct { // `DISABLED` type turns the validation off. ValidationMode HeaderValidationRequestPolicyValidationModeEnum `mandatory:"false" json:"validationMode,omitempty"` + // The List of Headers Headers []HeaderValidationItem `mandatory:"false" json:"headers"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/http_backend.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/http_backend.go index ff4660ce586..19e719b9e6f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/http_backend.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/http_backend.go @@ -20,6 +20,8 @@ import ( // HttpBackend Send the request to an HTTP backend. type HttpBackend struct { + + // The url of the HTTP Backend Url *string `mandatory:"true" json:"url"` // Defines a timeout for establishing a connection with a proxied server. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/list_sdks_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/list_sdks_request_response.go index 6b31a8c9d82..8de2f2fdbd9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/list_sdks_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/list_sdks_request_response.go @@ -18,7 +18,7 @@ import ( // Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/ListSdks.go.html to see an example of how to use ListSdksRequest. type ListSdksRequest struct { - // The ocid of the SDK. + // The ocid of the SDK. This value must be present unless apiId is present. SdkId *string `mandatory:"false" contributesTo:"query" name:"sdkId"` // A user-friendly name. Does not have to be unique, and it's changeable. @@ -44,7 +44,7 @@ type ListSdksRequest struct { // sensitive. SortBy ListSdksSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` - // The ocid of the API. + // The ocid of the API. This value must be present unless sdkId is present. ApiId *string `mandatory:"false" contributesTo:"query" name:"apiId"` // The client request id for tracing. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/o_auth2_logout_backend.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/o_auth2_logout_backend.go index 8db677a5fd5..58684c74c1f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/o_auth2_logout_backend.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/o_auth2_logout_backend.go @@ -20,6 +20,8 @@ import ( // OAuth2LogoutBackend Backend which when called triggers OAuth2 logout. type OAuth2LogoutBackend struct { + + // A list of allowed post-logout URLs to which a request can be redirected after revoke access AllowedPostLogoutUris []string `mandatory:"false" json:"allowedPostLogoutUris"` // Defines a state that should be shared on redirecting to postLogout URL. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/query_parameter_validation_request_policy.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/query_parameter_validation_request_policy.go index fe1956e4c0c..3370ab5dedd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/query_parameter_validation_request_policy.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/query_parameter_validation_request_policy.go @@ -28,6 +28,7 @@ type QueryParameterValidationRequestPolicy struct { // `DISABLED` type turns the validation off. ValidationMode QueryParameterValidationRequestPolicyValidationModeEnum `mandatory:"false" json:"validationMode,omitempty"` + // The List of Query Parameters Parameters []QueryParameterValidationItem `mandatory:"false" json:"parameters"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_api_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_api_lock_request_response.go new file mode 100644 index 00000000000..dda476e14a2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_api_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveApiLockRequest wrapper for the RemoveApiLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveApiLock.go.html to see an example of how to use RemoveApiLockRequest. +type RemoveApiLockRequest struct { + + // The ocid of the API. + ApiId *string `mandatory:"true" contributesTo:"path" name:"apiId"` + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveApiLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveApiLockRequest) 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 RemoveApiLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveApiLockRequest) 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 RemoveApiLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveApiLockResponse wrapper for the RemoveApiLock operation +type RemoveApiLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Api instance + Api `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"` + + // etag for the returned Api resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response RemoveApiLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveApiLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_certificate_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_certificate_lock_request_response.go new file mode 100644 index 00000000000..781d8f7798b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_certificate_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveCertificateLockRequest wrapper for the RemoveCertificateLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveCertificateLock.go.html to see an example of how to use RemoveCertificateLockRequest. +type RemoveCertificateLockRequest struct { + + // The ocid of the certificate. + CertificateId *string `mandatory:"true" contributesTo:"path" name:"certificateId"` + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveCertificateLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveCertificateLockRequest) 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 RemoveCertificateLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveCertificateLockRequest) 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 RemoveCertificateLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveCertificateLockResponse wrapper for the RemoveCertificateLock operation +type RemoveCertificateLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Certificate instance + Certificate `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"` + + // etag for the returned Certificate resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response RemoveCertificateLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveCertificateLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_deployment_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_deployment_lock_request_response.go new file mode 100644 index 00000000000..eefdd1c80a4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_deployment_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveDeploymentLockRequest wrapper for the RemoveDeploymentLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveDeploymentLock.go.html to see an example of how to use RemoveDeploymentLockRequest. +type RemoveDeploymentLockRequest struct { + + // The ocid of the deployment. + DeploymentId *string `mandatory:"true" contributesTo:"path" name:"deploymentId"` + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveDeploymentLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveDeploymentLockRequest) 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 RemoveDeploymentLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveDeploymentLockRequest) 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 RemoveDeploymentLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveDeploymentLockResponse wrapper for the RemoveDeploymentLock operation +type RemoveDeploymentLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Deployment instance + Deployment `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"` + + // etag for the returned Deployment resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response RemoveDeploymentLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveDeploymentLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_gateway_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_gateway_lock_request_response.go new file mode 100644 index 00000000000..9ab7de2ea50 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_gateway_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveGatewayLockRequest wrapper for the RemoveGatewayLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveGatewayLock.go.html to see an example of how to use RemoveGatewayLockRequest. +type RemoveGatewayLockRequest struct { + + // The ocid of the gateway. + GatewayId *string `mandatory:"true" contributesTo:"path" name:"gatewayId"` + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveGatewayLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveGatewayLockRequest) 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 RemoveGatewayLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveGatewayLockRequest) 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 RemoveGatewayLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveGatewayLockResponse wrapper for the RemoveGatewayLock operation +type RemoveGatewayLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Gateway instance + Gateway `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"` + + // etag for the returned Gateway resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response RemoveGatewayLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveGatewayLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_resource_lock_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_resource_lock_details.go new file mode 100644 index 00000000000..95a3a2a170f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_resource_lock_details.go @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RemoveResourceLockDetails Used to remove a resource lock. +// Resource locks are used to prevent certain APIs from being called for the resource. +// A full lock prevents both updating the resource and deleting the resource. A delete +// lock prevents deleting the resource. +type RemoveResourceLockDetails struct { + + // Type of the lock. + Type RemoveResourceLockDetailsTypeEnum `mandatory:"true" json:"type"` +} + +func (m RemoveResourceLockDetails) 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 RemoveResourceLockDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRemoveResourceLockDetailsTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetRemoveResourceLockDetailsTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveResourceLockDetailsTypeEnum Enum with underlying type: string +type RemoveResourceLockDetailsTypeEnum string + +// Set of constants representing the allowable values for RemoveResourceLockDetailsTypeEnum +const ( + RemoveResourceLockDetailsTypeFull RemoveResourceLockDetailsTypeEnum = "FULL" + RemoveResourceLockDetailsTypeDelete RemoveResourceLockDetailsTypeEnum = "DELETE" +) + +var mappingRemoveResourceLockDetailsTypeEnum = map[string]RemoveResourceLockDetailsTypeEnum{ + "FULL": RemoveResourceLockDetailsTypeFull, + "DELETE": RemoveResourceLockDetailsTypeDelete, +} + +var mappingRemoveResourceLockDetailsTypeEnumLowerCase = map[string]RemoveResourceLockDetailsTypeEnum{ + "full": RemoveResourceLockDetailsTypeFull, + "delete": RemoveResourceLockDetailsTypeDelete, +} + +// GetRemoveResourceLockDetailsTypeEnumValues Enumerates the set of values for RemoveResourceLockDetailsTypeEnum +func GetRemoveResourceLockDetailsTypeEnumValues() []RemoveResourceLockDetailsTypeEnum { + values := make([]RemoveResourceLockDetailsTypeEnum, 0) + for _, v := range mappingRemoveResourceLockDetailsTypeEnum { + values = append(values, v) + } + return values +} + +// GetRemoveResourceLockDetailsTypeEnumStringValues Enumerates the set of values in String for RemoveResourceLockDetailsTypeEnum +func GetRemoveResourceLockDetailsTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingRemoveResourceLockDetailsTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRemoveResourceLockDetailsTypeEnum(val string) (RemoveResourceLockDetailsTypeEnum, bool) { + enum, ok := mappingRemoveResourceLockDetailsTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_sdk_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_sdk_lock_request_response.go new file mode 100644 index 00000000000..bbbf29edd31 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_sdk_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveSdkLockRequest wrapper for the RemoveSdkLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveSdkLock.go.html to see an example of how to use RemoveSdkLockRequest. +type RemoveSdkLockRequest struct { + + // The ocid of the SDK. + SdkId *string `mandatory:"true" contributesTo:"path" name:"sdkId"` + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveSdkLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveSdkLockRequest) 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 RemoveSdkLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveSdkLockRequest) 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 RemoveSdkLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveSdkLockResponse wrapper for the RemoveSdkLock operation +type RemoveSdkLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Sdk instance + Sdk `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"` + + // etag for the returned Sdk resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response RemoveSdkLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveSdkLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_subscriber_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_subscriber_lock_request_response.go new file mode 100644 index 00000000000..3f0ee77a43d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_subscriber_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveSubscriberLockRequest wrapper for the RemoveSubscriberLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveSubscriberLock.go.html to see an example of how to use RemoveSubscriberLockRequest. +type RemoveSubscriberLockRequest struct { + + // The ocid of the subscriber. + SubscriberId *string `mandatory:"true" contributesTo:"path" name:"subscriberId"` + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveSubscriberLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveSubscriberLockRequest) 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 RemoveSubscriberLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveSubscriberLockRequest) 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 RemoveSubscriberLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveSubscriberLockResponse wrapper for the RemoveSubscriberLock operation +type RemoveSubscriberLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The Subscriber instance + Subscriber `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"` + + // etag for the returned Subscriber resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response RemoveSubscriberLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveSubscriberLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_usage_plan_lock_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_usage_plan_lock_request_response.go new file mode 100644 index 00000000000..51d5600d753 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/remove_usage_plan_lock_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// RemoveUsagePlanLockRequest wrapper for the RemoveUsagePlanLock operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apigateway/RemoveUsagePlanLock.go.html to see an example of how to use RemoveUsagePlanLockRequest. +type RemoveUsagePlanLockRequest struct { + + // The ocid of the usage plan. + UsagePlanId *string `mandatory:"true" contributesTo:"path" name:"usagePlanId"` + + // RemoveResourceLockDetails body parameter + RemoveResourceLockDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` + // parameter to the value of the etag from a previous GET or POST response for that resource. The resource + // will be updated or deleted only if the etag you provide matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request RemoveUsagePlanLockRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request RemoveUsagePlanLockRequest) 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 RemoveUsagePlanLockRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request RemoveUsagePlanLockRequest) 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 RemoveUsagePlanLockRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// RemoveUsagePlanLockResponse wrapper for the RemoveUsagePlanLock operation +type RemoveUsagePlanLockResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The UsagePlan instance + UsagePlan `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"` + + // etag for the returned UsagePlan resource. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response RemoveUsagePlanLockResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response RemoveUsagePlanLockResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/resource_lock.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/resource_lock.go new file mode 100644 index 00000000000..9d8d9466b05 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/resource_lock.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// API Gateway API +// +// API for the API Gateway service. Use this API to manage gateways, deployments, and related items. +// For more information, see +// Overview of API Gateway (https://docs.oracle.com/iaas/Content/APIGateway/Concepts/apigatewayoverview.htm). +// + +package apigateway + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ResourceLock Resource locks are used to prevent certain APIs from being called for the resource. +// A full lock prevents both updating the resource and deleting the resource. A delete +// lock prevents deleting the resource. +type ResourceLock struct { + + // Type of the lock. + Type ResourceLockTypeEnum `mandatory:"true" json:"type"` + + // The id of the resource that is locking this resource. Indicates that deleting this resource will remove the lock. + RelatedResourceId *string `mandatory:"false" json:"relatedResourceId"` + + // A message added by the creator of the lock. This is typically used to give an + // indication of why the resource is locked. + Message *string `mandatory:"false" json:"message"` + + // When the lock was created. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` +} + +func (m ResourceLock) 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 ResourceLock) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingResourceLockTypeEnum(string(m.Type)); !ok && m.Type != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Type: %s. Supported values are: %s.", m.Type, strings.Join(GetResourceLockTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ResourceLockTypeEnum Enum with underlying type: string +type ResourceLockTypeEnum string + +// Set of constants representing the allowable values for ResourceLockTypeEnum +const ( + ResourceLockTypeFull ResourceLockTypeEnum = "FULL" + ResourceLockTypeDelete ResourceLockTypeEnum = "DELETE" +) + +var mappingResourceLockTypeEnum = map[string]ResourceLockTypeEnum{ + "FULL": ResourceLockTypeFull, + "DELETE": ResourceLockTypeDelete, +} + +var mappingResourceLockTypeEnumLowerCase = map[string]ResourceLockTypeEnum{ + "full": ResourceLockTypeFull, + "delete": ResourceLockTypeDelete, +} + +// GetResourceLockTypeEnumValues Enumerates the set of values for ResourceLockTypeEnum +func GetResourceLockTypeEnumValues() []ResourceLockTypeEnum { + values := make([]ResourceLockTypeEnum, 0) + for _, v := range mappingResourceLockTypeEnum { + values = append(values, v) + } + return values +} + +// GetResourceLockTypeEnumStringValues Enumerates the set of values in String for ResourceLockTypeEnum +func GetResourceLockTypeEnumStringValues() []string { + return []string{ + "FULL", + "DELETE", + } +} + +// GetMappingResourceLockTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingResourceLockTypeEnum(val string) (ResourceLockTypeEnum, bool) { + enum, ok := mappingResourceLockTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk.go index 9b4c1f1c40e..8e5edd35a8d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk.go @@ -63,6 +63,9 @@ type Sdk struct { // resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -75,6 +78,10 @@ type Sdk struct { // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + // Additional optional configurations passed. // The applicable config keys are listed under "parameters" when "/sdkLanguageTypes" is called. // Example: `{"configName": "configValue"}` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk_summary.go index 63bb43645ed..1f597c94423 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/sdk_summary.go @@ -44,6 +44,9 @@ type SdkSummary struct { // The current state of the SDK. LifecycleState SdkLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -55,6 +58,10 @@ type SdkSummary struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m SdkSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber.go index 6e3d3876765..83ea5b5e614 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber.go @@ -53,6 +53,9 @@ type Subscriber struct { // resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -64,6 +67,10 @@ type Subscriber struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m Subscriber) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber_summary.go index 51909282a23..2b024d3dc65 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/subscriber_summary.go @@ -53,6 +53,9 @@ type SubscriberSummary struct { // resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -64,6 +67,10 @@ type SubscriberSummary struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m SubscriberSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_api_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_api_request_response.go index 97629be9084..56b525613e4 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_api_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_api_request_response.go @@ -34,6 +34,9 @@ type UpdateApiRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/update_certificate_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_certificate_request_response.go index 6e1c469ae76..88d2efbde56 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_certificate_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_certificate_request_response.go @@ -34,6 +34,9 @@ type UpdateCertificateRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/update_deployment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_deployment_request_response.go index 945d2a52c87..083d39e6005 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_deployment_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_deployment_request_response.go @@ -34,6 +34,9 @@ type UpdateDeploymentRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/update_gateway_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_gateway_details.go index fdc5ed29716..cc78bc1f449 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_gateway_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_gateway_details.go @@ -29,7 +29,8 @@ type UpdateGatewayDetails struct { // An array of Network Security Groups OCIDs associated with this API Gateway. NetworkSecurityGroupIds []string `mandatory:"false" json:"networkSecurityGroupIds"` - // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource. + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource which can be + // empty string. CertificateId *string `mandatory:"false" json:"certificateId"` ResponseCacheDetails ResponseCacheDetails `mandatory:"false" json:"responseCacheDetails"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_gateway_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_gateway_request_response.go index 9c7b4e54bbc..3fb8f0df07c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_gateway_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_gateway_request_response.go @@ -34,6 +34,9 @@ type UpdateGatewayRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/update_sdk_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_sdk_request_response.go index 19ea76cb61a..8ba13844403 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_sdk_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_sdk_request_response.go @@ -34,6 +34,9 @@ type UpdateSdkRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/update_subscriber_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_subscriber_request_response.go index 7f0bb944394..dcacb522450 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_subscriber_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_subscriber_request_response.go @@ -34,6 +34,9 @@ type UpdateSubscriberRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/update_usage_plan_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_usage_plan_request_response.go index 255ea38b613..b4cebb82b4c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_usage_plan_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/update_usage_plan_request_response.go @@ -34,6 +34,9 @@ type UpdateUsagePlanRequest struct { // The client request id for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Whether to override locks (if any exist). + IsLockOverride *bool `mandatory:"false" contributesTo:"query" name:"isLockOverride"` + // 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/apigateway/usage_plan.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/usage_plan.go index 2f1a9664276..6e2514b0e78 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/usage_plan.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/usage_plan.go @@ -49,6 +49,9 @@ type UsagePlan struct { // For example, can be used to provide actionable information for a resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -60,6 +63,10 @@ type UsagePlan struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m UsagePlan) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/usage_plan_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/usage_plan_summary.go index 984a0bb6c36..8203906ed95 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/usage_plan_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apigateway/usage_plan_summary.go @@ -49,6 +49,9 @@ type UsagePlanSummary struct { // For example, can be used to provide actionable information for a resource in a Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + // Locks associated with this resource. + Locks []ResourceLock `mandatory:"false" json:"locks"` + // Free-form tags for this resource. Each tag is a simple key-value pair // with no predefined name, type, or namespace. For more information, see // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). @@ -60,6 +63,10 @@ type UsagePlanSummary struct { // Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). // Example: `{"Operations": {"CostCenter": "42"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m UsagePlanSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/action_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/action_type.go new file mode 100644 index 00000000000..510d16136fc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/action_type.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "strings" +) + +// ActionTypeEnum Enum with underlying type: string +type ActionTypeEnum string + +// Set of constants representing the allowable values for ActionTypeEnum +const ( + ActionTypeCreated ActionTypeEnum = "CREATED" + ActionTypeUpdated ActionTypeEnum = "UPDATED" + ActionTypeDeleted ActionTypeEnum = "DELETED" + ActionTypeInProgress ActionTypeEnum = "IN_PROGRESS" + ActionTypeRelated ActionTypeEnum = "RELATED" + ActionTypeFailed ActionTypeEnum = "FAILED" +) + +var mappingActionTypeEnum = map[string]ActionTypeEnum{ + "CREATED": ActionTypeCreated, + "UPDATED": ActionTypeUpdated, + "DELETED": ActionTypeDeleted, + "IN_PROGRESS": ActionTypeInProgress, + "RELATED": ActionTypeRelated, + "FAILED": ActionTypeFailed, +} + +var mappingActionTypeEnumLowerCase = map[string]ActionTypeEnum{ + "created": ActionTypeCreated, + "updated": ActionTypeUpdated, + "deleted": ActionTypeDeleted, + "in_progress": ActionTypeInProgress, + "related": ActionTypeRelated, + "failed": ActionTypeFailed, +} + +// GetActionTypeEnumValues Enumerates the set of values for ActionTypeEnum +func GetActionTypeEnumValues() []ActionTypeEnum { + values := make([]ActionTypeEnum, 0) + for _, v := range mappingActionTypeEnum { + values = append(values, v) + } + return values +} + +// GetActionTypeEnumStringValues Enumerates the set of values in String for ActionTypeEnum +func GetActionTypeEnumStringValues() []string { + return []string{ + "CREATED", + "UPDATED", + "DELETED", + "IN_PROGRESS", + "RELATED", + "FAILED", + } +} + +// GetMappingActionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingActionTypeEnum(val string) (ActionTypeEnum, bool) { + enum, ok := mappingActionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance.go new file mode 100644 index 00000000000..00374d18776 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance.go @@ -0,0 +1,140 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApiPlatformInstance A Logical Entity that can be used to create, manage, secure, and advertise APIs to connect to new or existing services +type ApiPlatformInstance struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + Id *string `mandatory:"true" json:"id"` + + // A regionally unique, non-changeable instance name provided by the user during instance creation + Name *string `mandatory:"true" json:"name"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the instance was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the instance + LifecycleState ApiPlatformInstanceLifecycleStateEnum `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:"true" 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:"true" json:"definedTags"` + + // User-provided changeable and non-unique description of the instance + Description *string `mandatory:"false" json:"description"` + + IdcsApp *IdcsApp `mandatory:"false" json:"idcsApp"` + + Uris *Uris `mandatory:"false" json:"uris"` + + // The date and time the instance was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the instance in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ApiPlatformInstance) 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 ApiPlatformInstance) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingApiPlatformInstanceLifecycleStateEnum(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(GetApiPlatformInstanceLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ApiPlatformInstanceLifecycleStateEnum Enum with underlying type: string +type ApiPlatformInstanceLifecycleStateEnum string + +// Set of constants representing the allowable values for ApiPlatformInstanceLifecycleStateEnum +const ( + ApiPlatformInstanceLifecycleStateCreating ApiPlatformInstanceLifecycleStateEnum = "CREATING" + ApiPlatformInstanceLifecycleStateUpdating ApiPlatformInstanceLifecycleStateEnum = "UPDATING" + ApiPlatformInstanceLifecycleStateActive ApiPlatformInstanceLifecycleStateEnum = "ACTIVE" + ApiPlatformInstanceLifecycleStateDeleting ApiPlatformInstanceLifecycleStateEnum = "DELETING" + ApiPlatformInstanceLifecycleStateDeleted ApiPlatformInstanceLifecycleStateEnum = "DELETED" + ApiPlatformInstanceLifecycleStateFailed ApiPlatformInstanceLifecycleStateEnum = "FAILED" +) + +var mappingApiPlatformInstanceLifecycleStateEnum = map[string]ApiPlatformInstanceLifecycleStateEnum{ + "CREATING": ApiPlatformInstanceLifecycleStateCreating, + "UPDATING": ApiPlatformInstanceLifecycleStateUpdating, + "ACTIVE": ApiPlatformInstanceLifecycleStateActive, + "DELETING": ApiPlatformInstanceLifecycleStateDeleting, + "DELETED": ApiPlatformInstanceLifecycleStateDeleted, + "FAILED": ApiPlatformInstanceLifecycleStateFailed, +} + +var mappingApiPlatformInstanceLifecycleStateEnumLowerCase = map[string]ApiPlatformInstanceLifecycleStateEnum{ + "creating": ApiPlatformInstanceLifecycleStateCreating, + "updating": ApiPlatformInstanceLifecycleStateUpdating, + "active": ApiPlatformInstanceLifecycleStateActive, + "deleting": ApiPlatformInstanceLifecycleStateDeleting, + "deleted": ApiPlatformInstanceLifecycleStateDeleted, + "failed": ApiPlatformInstanceLifecycleStateFailed, +} + +// GetApiPlatformInstanceLifecycleStateEnumValues Enumerates the set of values for ApiPlatformInstanceLifecycleStateEnum +func GetApiPlatformInstanceLifecycleStateEnumValues() []ApiPlatformInstanceLifecycleStateEnum { + values := make([]ApiPlatformInstanceLifecycleStateEnum, 0) + for _, v := range mappingApiPlatformInstanceLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetApiPlatformInstanceLifecycleStateEnumStringValues Enumerates the set of values in String for ApiPlatformInstanceLifecycleStateEnum +func GetApiPlatformInstanceLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "UPDATING", + "ACTIVE", + "DELETING", + "DELETED", + "FAILED", + } +} + +// GetMappingApiPlatformInstanceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingApiPlatformInstanceLifecycleStateEnum(val string) (ApiPlatformInstanceLifecycleStateEnum, bool) { + enum, ok := mappingApiPlatformInstanceLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance_collection.go new file mode 100644 index 00000000000..6673180dd7f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApiPlatformInstanceCollection Results of a search. Contains both InstanceSummary items and other information, such as metadata. +type ApiPlatformInstanceCollection struct { + + // List of APIP instances + Items []ApiPlatformInstanceSummary `mandatory:"true" json:"items"` +} + +func (m ApiPlatformInstanceCollection) 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 ApiPlatformInstanceCollection) 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/apiplatform/api_platform_instance_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance_summary.go new file mode 100644 index 00000000000..273ee737f51 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/api_platform_instance_summary.go @@ -0,0 +1,75 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ApiPlatformInstanceSummary Summary information about an instance +type ApiPlatformInstanceSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + Id *string `mandatory:"true" json:"id"` + + // A regionally unique, non-changeable instance name provided by the user during creation + Name *string `mandatory:"true" json:"name"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The date and time the instance was created, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339). + // Example: `2016-08-25T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The current state of the instance + LifecycleState ApiPlatformInstanceLifecycleStateEnum `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:"true" 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:"true" json:"definedTags"` + + // The date and time the instance was updated, in the format defined by RFC 3339 (https://tools.ietf.org/html/rfc3339) + // Example: `2016-08-25T21:10:29.600Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // A message that describes the current state of the Instance in more detail. For example, + // can be used to provide actionable information for a resource in the Failed state. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ApiPlatformInstanceSummary) 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 ApiPlatformInstanceSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingApiPlatformInstanceLifecycleStateEnum(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(GetApiPlatformInstanceLifecycleStateEnumStringValues(), ","))) + } + + 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/apiplatform/apiplatform_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/apiplatform_client.go new file mode 100644 index 00000000000..aef1ae0df97 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/apiplatform_client.go @@ -0,0 +1,683 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +// ApiPlatformClient a client for ApiPlatform +type ApiPlatformClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewApiPlatformClientWithConfigurationProvider Creates a new default ApiPlatform client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewApiPlatformClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client ApiPlatformClient, err error) { + if enabled := common.CheckForEnabledServices("apiplatform"); !enabled { + return client, fmt.Errorf("the Developer Tool configuration disabled this service, this behavior is controlled by OciSdkEnabledServicesMap variables. Please check if your local developer-tool-configuration.json file configured the service you're targeting or contact the cloud provider on the availability of this service") + } + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newApiPlatformClientFromBaseClient(baseClient, provider) +} + +// NewApiPlatformClientWithOboToken Creates a new default ApiPlatform 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 NewApiPlatformClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client ApiPlatformClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newApiPlatformClientFromBaseClient(baseClient, configProvider) +} + +func newApiPlatformClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client ApiPlatformClient, err error) { + // ApiPlatform service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("ApiPlatform")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = ApiPlatformClient{BaseClient: baseClient} + client.BasePath = "20240829" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *ApiPlatformClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("apiplatform", "https://apip.{region}.ocp.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *ApiPlatformClient) 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 *ApiPlatformClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// ChangeApiPlatformInstanceCompartment Moves an API Platform Instance into a different compartment within the same tenancy. For information about moving resources between +// compartments, see Moving Resources to a Different Compartment (https://docs.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes). +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ChangeApiPlatformInstanceCompartment.go.html to see an example of how to use ChangeApiPlatformInstanceCompartment API. +// A default retry strategy applies to this operation ChangeApiPlatformInstanceCompartment() +func (client ApiPlatformClient) ChangeApiPlatformInstanceCompartment(ctx context.Context, request ChangeApiPlatformInstanceCompartmentRequest) (response ChangeApiPlatformInstanceCompartmentResponse, 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.changeApiPlatformInstanceCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeApiPlatformInstanceCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeApiPlatformInstanceCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeApiPlatformInstanceCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeApiPlatformInstanceCompartmentResponse") + } + return +} + +// changeApiPlatformInstanceCompartment implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) changeApiPlatformInstanceCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/apiPlatformInstances/{apiPlatformInstanceId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeApiPlatformInstanceCompartmentResponse + 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, "ApiPlatform", "ChangeApiPlatformInstanceCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateApiPlatformInstance Creates an API Platform Instance +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/CreateApiPlatformInstance.go.html to see an example of how to use CreateApiPlatformInstance API. +// A default retry strategy applies to this operation CreateApiPlatformInstance() +func (client ApiPlatformClient) CreateApiPlatformInstance(ctx context.Context, request CreateApiPlatformInstanceRequest) (response CreateApiPlatformInstanceResponse, 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.createApiPlatformInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateApiPlatformInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateApiPlatformInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateApiPlatformInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateApiPlatformInstanceResponse") + } + return +} + +// createApiPlatformInstance implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) createApiPlatformInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/apiPlatformInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateApiPlatformInstanceResponse + 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, "ApiPlatform", "CreateApiPlatformInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteApiPlatformInstance Deletes an API Platform Instance +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/DeleteApiPlatformInstance.go.html to see an example of how to use DeleteApiPlatformInstance API. +// A default retry strategy applies to this operation DeleteApiPlatformInstance() +func (client ApiPlatformClient) DeleteApiPlatformInstance(ctx context.Context, request DeleteApiPlatformInstanceRequest) (response DeleteApiPlatformInstanceResponse, 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.deleteApiPlatformInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteApiPlatformInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteApiPlatformInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteApiPlatformInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteApiPlatformInstanceResponse") + } + return +} + +// deleteApiPlatformInstance implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) deleteApiPlatformInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/apiPlatformInstances/{apiPlatformInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteApiPlatformInstanceResponse + 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, "ApiPlatform", "DeleteApiPlatformInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetApiPlatformInstance Gets information about an API Platform Instance +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/GetApiPlatformInstance.go.html to see an example of how to use GetApiPlatformInstance API. +// A default retry strategy applies to this operation GetApiPlatformInstance() +func (client ApiPlatformClient) GetApiPlatformInstance(ctx context.Context, request GetApiPlatformInstanceRequest) (response GetApiPlatformInstanceResponse, 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.getApiPlatformInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetApiPlatformInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetApiPlatformInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetApiPlatformInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetApiPlatformInstanceResponse") + } + return +} + +// getApiPlatformInstance implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) getApiPlatformInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/apiPlatformInstances/{apiPlatformInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetApiPlatformInstanceResponse + 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, "ApiPlatform", "GetApiPlatformInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetWorkRequest Gets the details of a work request. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/GetWorkRequest.go.html to see an example of how to use GetWorkRequest API. +// A default retry strategy applies to this operation GetWorkRequest() +func (client ApiPlatformClient) GetWorkRequest(ctx context.Context, request GetWorkRequestRequest) (response GetWorkRequestResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.getWorkRequest, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetWorkRequestResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetWorkRequestResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetWorkRequestResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetWorkRequestResponse") + } + return +} + +// getWorkRequest implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) getWorkRequest(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetWorkRequestResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ApiPlatform", "GetWorkRequest", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListApiPlatformInstances Gets a list of API Platform Instances +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListApiPlatformInstances.go.html to see an example of how to use ListApiPlatformInstances API. +// A default retry strategy applies to this operation ListApiPlatformInstances() +func (client ApiPlatformClient) ListApiPlatformInstances(ctx context.Context, request ListApiPlatformInstancesRequest) (response ListApiPlatformInstancesResponse, 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.listApiPlatformInstances, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListApiPlatformInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListApiPlatformInstancesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListApiPlatformInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListApiPlatformInstancesResponse") + } + return +} + +// listApiPlatformInstances implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) listApiPlatformInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/apiPlatformInstances", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListApiPlatformInstancesResponse + 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, "ApiPlatform", "ListApiPlatformInstances", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestErrors Lists the errors for a work request. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrors API. +// A default retry strategy applies to this operation ListWorkRequestErrors() +func (client ApiPlatformClient) ListWorkRequestErrors(ctx context.Context, request ListWorkRequestErrorsRequest) (response ListWorkRequestErrorsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestErrors, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestErrorsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestErrorsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestErrorsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestErrorsResponse") + } + return +} + +// listWorkRequestErrors implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) listWorkRequestErrors(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/errors", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestErrorsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ApiPlatform", "ListWorkRequestErrors", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequestLogs Lists the logs for a work request. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogs API. +// A default retry strategy applies to this operation ListWorkRequestLogs() +func (client ApiPlatformClient) ListWorkRequestLogs(ctx context.Context, request ListWorkRequestLogsRequest) (response ListWorkRequestLogsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequestLogs, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestLogsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestLogsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestLogsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestLogsResponse") + } + return +} + +// listWorkRequestLogs implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) listWorkRequestLogs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests/{workRequestId}/logs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestLogsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ApiPlatform", "ListWorkRequestLogs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListWorkRequests Lists the work requests in a compartment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListWorkRequests.go.html to see an example of how to use ListWorkRequests API. +// A default retry strategy applies to this operation ListWorkRequests() +func (client ApiPlatformClient) ListWorkRequests(ctx context.Context, request ListWorkRequestsRequest) (response ListWorkRequestsResponse, err error) { + var ociResponse common.OCIResponse + policy := common.DefaultRetryPolicy() + if client.RetryPolicy() != nil { + policy = *client.RetryPolicy() + } + if request.RetryPolicy() != nil { + policy = *request.RetryPolicy() + } + ociResponse, err = common.Retry(ctx, request, client.listWorkRequests, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListWorkRequestsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListWorkRequestsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListWorkRequestsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListWorkRequestsResponse") + } + return +} + +// listWorkRequests implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) listWorkRequests(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/workRequests", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListWorkRequestsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "" + err = common.PostProcessServiceError(err, "ApiPlatform", "ListWorkRequests", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateApiPlatformInstance Updates an API Platform Instance +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/UpdateApiPlatformInstance.go.html to see an example of how to use UpdateApiPlatformInstance API. +// A default retry strategy applies to this operation UpdateApiPlatformInstance() +func (client ApiPlatformClient) UpdateApiPlatformInstance(ctx context.Context, request UpdateApiPlatformInstanceRequest) (response UpdateApiPlatformInstanceResponse, 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.updateApiPlatformInstance, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateApiPlatformInstanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateApiPlatformInstanceResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateApiPlatformInstanceResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateApiPlatformInstanceResponse") + } + return +} + +// updateApiPlatformInstance implements the OCIOperation interface (enables retrying operations) +func (client ApiPlatformClient) updateApiPlatformInstance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/apiPlatformInstances/{apiPlatformInstanceId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateApiPlatformInstanceResponse + 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, "ApiPlatform", "UpdateApiPlatformInstance", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/change_api_platform_instance_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/change_api_platform_instance_compartment_details.go new file mode 100644 index 00000000000..628743b4c63 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/change_api_platform_instance_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeApiPlatformInstanceCompartmentDetails The configuration details for the move operation +type ChangeApiPlatformInstanceCompartmentDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to move the instance to. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeApiPlatformInstanceCompartmentDetails) 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 ChangeApiPlatformInstanceCompartmentDetails) 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/apiplatform/change_api_platform_instance_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/change_api_platform_instance_compartment_request_response.go new file mode 100644 index 00000000000..3bc98a8eab3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/change_api_platform_instance_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeApiPlatformInstanceCompartmentRequest wrapper for the ChangeApiPlatformInstanceCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ChangeApiPlatformInstanceCompartment.go.html to see an example of how to use ChangeApiPlatformInstanceCompartmentRequest. +type ChangeApiPlatformInstanceCompartmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + ApiPlatformInstanceId *string `mandatory:"true" contributesTo:"path" name:"apiPlatformInstanceId"` + + // The information to be updated. + ChangeApiPlatformInstanceCompartmentDetails `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 running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ChangeApiPlatformInstanceCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeApiPlatformInstanceCompartmentRequest) 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 ChangeApiPlatformInstanceCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeApiPlatformInstanceCompartmentRequest) 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 ChangeApiPlatformInstanceCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeApiPlatformInstanceCompartmentResponse wrapper for the ChangeApiPlatformInstanceCompartment operation +type ChangeApiPlatformInstanceCompartmentResponse 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 ChangeApiPlatformInstanceCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeApiPlatformInstanceCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/create_api_platform_instance_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/create_api_platform_instance_details.go new file mode 100644 index 00000000000..d9b585d49f7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/create_api_platform_instance_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateApiPlatformInstanceDetails The data to create an instance +type CreateApiPlatformInstanceDetails struct { + + // A regionally unique, non-changeable instance name provided by the user during creation + Name *string `mandatory:"true" json:"name"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the instance in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // User-provided changeable and non-unique description of the instance + 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 CreateApiPlatformInstanceDetails) 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 CreateApiPlatformInstanceDetails) 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/apiplatform/create_api_platform_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/create_api_platform_instance_request_response.go new file mode 100644 index 00000000000..c39399d99bc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/create_api_platform_instance_request_response.go @@ -0,0 +1,113 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateApiPlatformInstanceRequest wrapper for the CreateApiPlatformInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/CreateApiPlatformInstance.go.html to see an example of how to use CreateApiPlatformInstanceRequest. +type CreateApiPlatformInstanceRequest struct { + + // Details for the new API Platform Instance + CreateApiPlatformInstanceDetails `contributesTo:"body"` + + // A token that uniquely identifies a request so it can be retried in case of a timeout or + // server error without risk of running that same action again. Retry tokens expire after 24 + // hours, but can be invalidated before then due to conflicting operations. For example, if a resource + // has been deleted and removed from the system, then a retry of the original creation request + // might be rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CreateApiPlatformInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateApiPlatformInstanceRequest) 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 CreateApiPlatformInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateApiPlatformInstanceRequest) 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 CreateApiPlatformInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateApiPlatformInstanceResponse wrapper for the CreateApiPlatformInstance operation +type CreateApiPlatformInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ApiPlatformInstance instance + ApiPlatformInstance `presentIn:"body"` + + // URL for the created API Platform Instance. The OCID is generated after this request is sent. + Location *string `presentIn:"header" name:"location"` + + // Same as location. + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CreateApiPlatformInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateApiPlatformInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/delete_api_platform_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/delete_api_platform_instance_request_response.go new file mode 100644 index 00000000000..6ca55dbc2d5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/delete_api_platform_instance_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteApiPlatformInstanceRequest wrapper for the DeleteApiPlatformInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/DeleteApiPlatformInstance.go.html to see an example of how to use DeleteApiPlatformInstanceRequest. +type DeleteApiPlatformInstanceRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + ApiPlatformInstanceId *string `mandatory:"true" contributesTo:"path" name:"apiPlatformInstanceId"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request DeleteApiPlatformInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteApiPlatformInstanceRequest) 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 DeleteApiPlatformInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteApiPlatformInstanceRequest) 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 DeleteApiPlatformInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteApiPlatformInstanceResponse wrapper for the DeleteApiPlatformInstance operation +type DeleteApiPlatformInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + // Use GetWorkRequest with this ID to track the status of the request. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteApiPlatformInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteApiPlatformInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/get_api_platform_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/get_api_platform_instance_request_response.go new file mode 100644 index 00000000000..c070d62c96d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/get_api_platform_instance_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetApiPlatformInstanceRequest wrapper for the GetApiPlatformInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/GetApiPlatformInstance.go.html to see an example of how to use GetApiPlatformInstanceRequest. +type GetApiPlatformInstanceRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + ApiPlatformInstanceId *string `mandatory:"true" contributesTo:"path" name:"apiPlatformInstanceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetApiPlatformInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetApiPlatformInstanceRequest) 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 GetApiPlatformInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetApiPlatformInstanceRequest) 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 GetApiPlatformInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetApiPlatformInstanceResponse wrapper for the GetApiPlatformInstance operation +type GetApiPlatformInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ApiPlatformInstance instance + ApiPlatformInstance `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 GetApiPlatformInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetApiPlatformInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/get_work_request_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/get_work_request_request_response.go new file mode 100644 index 00000000000..436a2d72835 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/get_work_request_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetWorkRequestRequest wrapper for the GetWorkRequest operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/GetWorkRequest.go.html to see an example of how to use GetWorkRequestRequest. +type GetWorkRequestRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetWorkRequestRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetWorkRequestRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request GetWorkRequestRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetWorkRequestRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request GetWorkRequestRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetWorkRequestResponse wrapper for the GetWorkRequest operation +type GetWorkRequestResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The WorkRequest instance + WorkRequest `presentIn:"body"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // A decimal number representing the number of seconds the client should wait before polling this endpoint again. + RetryAfter *int `presentIn:"header" name:"retry-after"` +} + +func (response GetWorkRequestResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetWorkRequestResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/idcs_app.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/idcs_app.go new file mode 100644 index 00000000000..15781bc0b76 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/idcs_app.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// IdcsApp IDCS app associated with the instance, that can be used to manage the roles of the users +type IdcsApp struct { + + // IDCS URL of the app + Url *string `mandatory:"true" json:"url"` +} + +func (m IdcsApp) 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 IdcsApp) 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/apiplatform/list_api_platform_instances_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_api_platform_instances_request_response.go new file mode 100644 index 00000000000..93091933bc3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_api_platform_instances_request_response.go @@ -0,0 +1,217 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListApiPlatformInstancesRequest wrapper for the ListApiPlatformInstances operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListApiPlatformInstances.go.html to see an example of how to use ListApiPlatformInstancesRequest. +type ListApiPlatformInstancesRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // A filter to return only resources that match the given lifecycle state. The + // state value is case-insensitive. + LifecycleState ApiPlatformInstanceLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // A filter to return only resources that match the given name exactly + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListApiPlatformInstancesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. You can provide only one sort order. Default order for `timeCreated` + // is descending. Default order for `name` is ascending. + SortBy ListApiPlatformInstancesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListApiPlatformInstancesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListApiPlatformInstancesRequest) 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 ListApiPlatformInstancesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListApiPlatformInstancesRequest) 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 ListApiPlatformInstancesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingApiPlatformInstanceLifecycleStateEnum(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(GetApiPlatformInstanceLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListApiPlatformInstancesSortOrderEnum(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(GetListApiPlatformInstancesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListApiPlatformInstancesSortByEnum(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(GetListApiPlatformInstancesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListApiPlatformInstancesResponse wrapper for the ListApiPlatformInstances operation +type ListApiPlatformInstancesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of ApiPlatformInstanceCollection instances + ApiPlatformInstanceCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListApiPlatformInstancesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListApiPlatformInstancesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListApiPlatformInstancesSortOrderEnum Enum with underlying type: string +type ListApiPlatformInstancesSortOrderEnum string + +// Set of constants representing the allowable values for ListApiPlatformInstancesSortOrderEnum +const ( + ListApiPlatformInstancesSortOrderAsc ListApiPlatformInstancesSortOrderEnum = "ASC" + ListApiPlatformInstancesSortOrderDesc ListApiPlatformInstancesSortOrderEnum = "DESC" +) + +var mappingListApiPlatformInstancesSortOrderEnum = map[string]ListApiPlatformInstancesSortOrderEnum{ + "ASC": ListApiPlatformInstancesSortOrderAsc, + "DESC": ListApiPlatformInstancesSortOrderDesc, +} + +var mappingListApiPlatformInstancesSortOrderEnumLowerCase = map[string]ListApiPlatformInstancesSortOrderEnum{ + "asc": ListApiPlatformInstancesSortOrderAsc, + "desc": ListApiPlatformInstancesSortOrderDesc, +} + +// GetListApiPlatformInstancesSortOrderEnumValues Enumerates the set of values for ListApiPlatformInstancesSortOrderEnum +func GetListApiPlatformInstancesSortOrderEnumValues() []ListApiPlatformInstancesSortOrderEnum { + values := make([]ListApiPlatformInstancesSortOrderEnum, 0) + for _, v := range mappingListApiPlatformInstancesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListApiPlatformInstancesSortOrderEnumStringValues Enumerates the set of values in String for ListApiPlatformInstancesSortOrderEnum +func GetListApiPlatformInstancesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListApiPlatformInstancesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListApiPlatformInstancesSortOrderEnum(val string) (ListApiPlatformInstancesSortOrderEnum, bool) { + enum, ok := mappingListApiPlatformInstancesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListApiPlatformInstancesSortByEnum Enum with underlying type: string +type ListApiPlatformInstancesSortByEnum string + +// Set of constants representing the allowable values for ListApiPlatformInstancesSortByEnum +const ( + ListApiPlatformInstancesSortByName ListApiPlatformInstancesSortByEnum = "name" + ListApiPlatformInstancesSortByTimecreated ListApiPlatformInstancesSortByEnum = "timeCreated" +) + +var mappingListApiPlatformInstancesSortByEnum = map[string]ListApiPlatformInstancesSortByEnum{ + "name": ListApiPlatformInstancesSortByName, + "timeCreated": ListApiPlatformInstancesSortByTimecreated, +} + +var mappingListApiPlatformInstancesSortByEnumLowerCase = map[string]ListApiPlatformInstancesSortByEnum{ + "name": ListApiPlatformInstancesSortByName, + "timecreated": ListApiPlatformInstancesSortByTimecreated, +} + +// GetListApiPlatformInstancesSortByEnumValues Enumerates the set of values for ListApiPlatformInstancesSortByEnum +func GetListApiPlatformInstancesSortByEnumValues() []ListApiPlatformInstancesSortByEnum { + values := make([]ListApiPlatformInstancesSortByEnum, 0) + for _, v := range mappingListApiPlatformInstancesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListApiPlatformInstancesSortByEnumStringValues Enumerates the set of values in String for ListApiPlatformInstancesSortByEnum +func GetListApiPlatformInstancesSortByEnumStringValues() []string { + return []string{ + "name", + "timeCreated", + } +} + +// GetMappingListApiPlatformInstancesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListApiPlatformInstancesSortByEnum(val string) (ListApiPlatformInstancesSortByEnum, bool) { + enum, ok := mappingListApiPlatformInstancesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_request_errors_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_request_errors_request_response.go new file mode 100644 index 00000000000..b88fa98a2ef --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_request_errors_request_response.go @@ -0,0 +1,199 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestErrorsRequest wrapper for the ListWorkRequestErrors operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListWorkRequestErrors.go.html to see an example of how to use ListWorkRequestErrorsRequest. +type ListWorkRequestErrorsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for `timestamp` is descending. + SortBy ListWorkRequestErrorsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestErrorsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestErrorsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestErrorsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestErrorsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestErrorsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestErrorsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestErrorsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestErrorsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestErrorsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestErrorsResponse wrapper for the ListWorkRequestErrors operation +type ListWorkRequestErrorsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestErrorCollection instances + WorkRequestErrorCollection `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestErrorsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestErrorsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestErrorsSortByEnum Enum with underlying type: string +type ListWorkRequestErrorsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortByEnum +const ( + ListWorkRequestErrorsSortByTimestamp ListWorkRequestErrorsSortByEnum = "timestamp" +) + +var mappingListWorkRequestErrorsSortByEnum = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +var mappingListWorkRequestErrorsSortByEnumLowerCase = map[string]ListWorkRequestErrorsSortByEnum{ + "timestamp": ListWorkRequestErrorsSortByTimestamp, +} + +// GetListWorkRequestErrorsSortByEnumValues Enumerates the set of values for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumValues() []ListWorkRequestErrorsSortByEnum { + values := make([]ListWorkRequestErrorsSortByEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortByEnum +func GetListWorkRequestErrorsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestErrorsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortByEnum(val string) (ListWorkRequestErrorsSortByEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestErrorsSortOrderEnum Enum with underlying type: string +type ListWorkRequestErrorsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestErrorsSortOrderEnum +const ( + ListWorkRequestErrorsSortOrderAsc ListWorkRequestErrorsSortOrderEnum = "ASC" + ListWorkRequestErrorsSortOrderDesc ListWorkRequestErrorsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestErrorsSortOrderEnum = map[string]ListWorkRequestErrorsSortOrderEnum{ + "ASC": ListWorkRequestErrorsSortOrderAsc, + "DESC": ListWorkRequestErrorsSortOrderDesc, +} + +var mappingListWorkRequestErrorsSortOrderEnumLowerCase = map[string]ListWorkRequestErrorsSortOrderEnum{ + "asc": ListWorkRequestErrorsSortOrderAsc, + "desc": ListWorkRequestErrorsSortOrderDesc, +} + +// GetListWorkRequestErrorsSortOrderEnumValues Enumerates the set of values for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumValues() []ListWorkRequestErrorsSortOrderEnum { + values := make([]ListWorkRequestErrorsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestErrorsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestErrorsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestErrorsSortOrderEnum +func GetListWorkRequestErrorsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestErrorsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestErrorsSortOrderEnum(val string) (ListWorkRequestErrorsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestErrorsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_request_logs_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_request_logs_request_response.go new file mode 100644 index 00000000000..228aecc6d4f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_request_logs_request_response.go @@ -0,0 +1,199 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestLogsRequest wrapper for the ListWorkRequestLogs operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListWorkRequestLogs.go.html to see an example of how to use ListWorkRequestLogsRequest. +type ListWorkRequestLogsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"true" contributesTo:"path" name:"workRequestId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The field to sort by. Only one sort order may be provided. Default order for `timestamp` is descending. + SortBy ListWorkRequestLogsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestLogsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestLogsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestLogsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestLogsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestLogsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestLogsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestLogsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestLogsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestLogsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestLogsResponse wrapper for the ListWorkRequestLogs operation +type ListWorkRequestLogsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestLogEntryCollection instances + WorkRequestLogEntryCollection `presentIn:"body"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ListWorkRequestLogsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestLogsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestLogsSortByEnum Enum with underlying type: string +type ListWorkRequestLogsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortByEnum +const ( + ListWorkRequestLogsSortByTimestamp ListWorkRequestLogsSortByEnum = "timestamp" +) + +var mappingListWorkRequestLogsSortByEnum = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +var mappingListWorkRequestLogsSortByEnumLowerCase = map[string]ListWorkRequestLogsSortByEnum{ + "timestamp": ListWorkRequestLogsSortByTimestamp, +} + +// GetListWorkRequestLogsSortByEnumValues Enumerates the set of values for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumValues() []ListWorkRequestLogsSortByEnum { + values := make([]ListWorkRequestLogsSortByEnum, 0) + for _, v := range mappingListWorkRequestLogsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortByEnum +func GetListWorkRequestLogsSortByEnumStringValues() []string { + return []string{ + "timestamp", + } +} + +// GetMappingListWorkRequestLogsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortByEnum(val string) (ListWorkRequestLogsSortByEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestLogsSortOrderEnum Enum with underlying type: string +type ListWorkRequestLogsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestLogsSortOrderEnum +const ( + ListWorkRequestLogsSortOrderAsc ListWorkRequestLogsSortOrderEnum = "ASC" + ListWorkRequestLogsSortOrderDesc ListWorkRequestLogsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestLogsSortOrderEnum = map[string]ListWorkRequestLogsSortOrderEnum{ + "ASC": ListWorkRequestLogsSortOrderAsc, + "DESC": ListWorkRequestLogsSortOrderDesc, +} + +var mappingListWorkRequestLogsSortOrderEnumLowerCase = map[string]ListWorkRequestLogsSortOrderEnum{ + "asc": ListWorkRequestLogsSortOrderAsc, + "desc": ListWorkRequestLogsSortOrderDesc, +} + +// GetListWorkRequestLogsSortOrderEnumValues Enumerates the set of values for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumValues() []ListWorkRequestLogsSortOrderEnum { + values := make([]ListWorkRequestLogsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestLogsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestLogsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestLogsSortOrderEnum +func GetListWorkRequestLogsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestLogsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestLogsSortOrderEnum(val string) (ListWorkRequestLogsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestLogsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_requests_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_requests_request_response.go new file mode 100644 index 00000000000..78144033c37 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/list_work_requests_request_response.go @@ -0,0 +1,277 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListWorkRequestsRequest wrapper for the ListWorkRequests operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/ListWorkRequests.go.html to see an example of how to use ListWorkRequestsRequest. +type ListWorkRequestsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the asynchronous work request. + WorkRequestId *string `mandatory:"false" contributesTo:"query" name:"workRequestId"` + + // A filter to return only the resources that match the given lifecycle state. + Status ListWorkRequestsStatusEnum `mandatory:"false" contributesTo:"query" name:"status" omitEmpty:"true"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the resource affected by the work request. + ResourceId *string `mandatory:"false" contributesTo:"query" name:"resourceId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // For list pagination. The value of the opc-next-page response header from the previous + // "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // For list pagination. The maximum number of results per page, or items to return in a + // paginated "List" call. For important details about how pagination works, see + // List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListWorkRequestsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The field to sort by. Only one sort order may be provided. Default order for `timeAccepted` is descending. + SortBy ListWorkRequestsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListWorkRequestsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListWorkRequestsRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + + _, err := request.ValidateEnumValue() + if err != nil { + return http.Request{}, err + } + return common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) +} + +// BinaryRequestBody implements the OCIRequest interface +func (request ListWorkRequestsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListWorkRequestsRequest) RetryPolicy() *common.RetryPolicy { + return request.RequestMetadata.RetryPolicy +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (request ListWorkRequestsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListWorkRequestsStatusEnum(string(request.Status)); !ok && request.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", request.Status, strings.Join(GetListWorkRequestsStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortOrderEnum(string(request.SortOrder)); !ok && request.SortOrder != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortOrder: %s. Supported values are: %s.", request.SortOrder, strings.Join(GetListWorkRequestsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListWorkRequestsSortByEnum(string(request.SortBy)); !ok && request.SortBy != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SortBy: %s. Supported values are: %s.", request.SortBy, strings.Join(GetListWorkRequestsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListWorkRequestsResponse wrapper for the ListWorkRequests operation +type ListWorkRequestsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of WorkRequestSummaryCollection instances + WorkRequestSummaryCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For list pagination. When this header appears in the response, additional pages of results remain. For + // important details about how pagination works, see List Pagination (https://docs.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListWorkRequestsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListWorkRequestsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListWorkRequestsStatusEnum Enum with underlying type: string +type ListWorkRequestsStatusEnum string + +// Set of constants representing the allowable values for ListWorkRequestsStatusEnum +const ( + ListWorkRequestsStatusAccepted ListWorkRequestsStatusEnum = "ACCEPTED" + ListWorkRequestsStatusInProgress ListWorkRequestsStatusEnum = "IN_PROGRESS" + ListWorkRequestsStatusWaiting ListWorkRequestsStatusEnum = "WAITING" + ListWorkRequestsStatusNeedsAttention ListWorkRequestsStatusEnum = "NEEDS_ATTENTION" + ListWorkRequestsStatusFailed ListWorkRequestsStatusEnum = "FAILED" + ListWorkRequestsStatusSucceeded ListWorkRequestsStatusEnum = "SUCCEEDED" + ListWorkRequestsStatusCanceling ListWorkRequestsStatusEnum = "CANCELING" + ListWorkRequestsStatusCanceled ListWorkRequestsStatusEnum = "CANCELED" +) + +var mappingListWorkRequestsStatusEnum = map[string]ListWorkRequestsStatusEnum{ + "ACCEPTED": ListWorkRequestsStatusAccepted, + "IN_PROGRESS": ListWorkRequestsStatusInProgress, + "WAITING": ListWorkRequestsStatusWaiting, + "NEEDS_ATTENTION": ListWorkRequestsStatusNeedsAttention, + "FAILED": ListWorkRequestsStatusFailed, + "SUCCEEDED": ListWorkRequestsStatusSucceeded, + "CANCELING": ListWorkRequestsStatusCanceling, + "CANCELED": ListWorkRequestsStatusCanceled, +} + +var mappingListWorkRequestsStatusEnumLowerCase = map[string]ListWorkRequestsStatusEnum{ + "accepted": ListWorkRequestsStatusAccepted, + "in_progress": ListWorkRequestsStatusInProgress, + "waiting": ListWorkRequestsStatusWaiting, + "needs_attention": ListWorkRequestsStatusNeedsAttention, + "failed": ListWorkRequestsStatusFailed, + "succeeded": ListWorkRequestsStatusSucceeded, + "canceling": ListWorkRequestsStatusCanceling, + "canceled": ListWorkRequestsStatusCanceled, +} + +// GetListWorkRequestsStatusEnumValues Enumerates the set of values for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumValues() []ListWorkRequestsStatusEnum { + values := make([]ListWorkRequestsStatusEnum, 0) + for _, v := range mappingListWorkRequestsStatusEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsStatusEnumStringValues Enumerates the set of values in String for ListWorkRequestsStatusEnum +func GetListWorkRequestsStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingListWorkRequestsStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsStatusEnum(val string) (ListWorkRequestsStatusEnum, bool) { + enum, ok := mappingListWorkRequestsStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortOrderEnum Enum with underlying type: string +type ListWorkRequestsSortOrderEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortOrderEnum +const ( + ListWorkRequestsSortOrderAsc ListWorkRequestsSortOrderEnum = "ASC" + ListWorkRequestsSortOrderDesc ListWorkRequestsSortOrderEnum = "DESC" +) + +var mappingListWorkRequestsSortOrderEnum = map[string]ListWorkRequestsSortOrderEnum{ + "ASC": ListWorkRequestsSortOrderAsc, + "DESC": ListWorkRequestsSortOrderDesc, +} + +var mappingListWorkRequestsSortOrderEnumLowerCase = map[string]ListWorkRequestsSortOrderEnum{ + "asc": ListWorkRequestsSortOrderAsc, + "desc": ListWorkRequestsSortOrderDesc, +} + +// GetListWorkRequestsSortOrderEnumValues Enumerates the set of values for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumValues() []ListWorkRequestsSortOrderEnum { + values := make([]ListWorkRequestsSortOrderEnum, 0) + for _, v := range mappingListWorkRequestsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortOrderEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortOrderEnum +func GetListWorkRequestsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListWorkRequestsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortOrderEnum(val string) (ListWorkRequestsSortOrderEnum, bool) { + enum, ok := mappingListWorkRequestsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListWorkRequestsSortByEnum Enum with underlying type: string +type ListWorkRequestsSortByEnum string + +// Set of constants representing the allowable values for ListWorkRequestsSortByEnum +const ( + ListWorkRequestsSortByTimeaccepted ListWorkRequestsSortByEnum = "timeAccepted" +) + +var mappingListWorkRequestsSortByEnum = map[string]ListWorkRequestsSortByEnum{ + "timeAccepted": ListWorkRequestsSortByTimeaccepted, +} + +var mappingListWorkRequestsSortByEnumLowerCase = map[string]ListWorkRequestsSortByEnum{ + "timeaccepted": ListWorkRequestsSortByTimeaccepted, +} + +// GetListWorkRequestsSortByEnumValues Enumerates the set of values for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumValues() []ListWorkRequestsSortByEnum { + values := make([]ListWorkRequestsSortByEnum, 0) + for _, v := range mappingListWorkRequestsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListWorkRequestsSortByEnumStringValues Enumerates the set of values in String for ListWorkRequestsSortByEnum +func GetListWorkRequestsSortByEnumStringValues() []string { + return []string{ + "timeAccepted", + } +} + +// GetMappingListWorkRequestsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListWorkRequestsSortByEnum(val string) (ListWorkRequestsSortByEnum, bool) { + enum, ok := mappingListWorkRequestsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/operation_status.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/operation_status.go new file mode 100644 index 00000000000..9ece032fed7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/operation_status.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "strings" +) + +// OperationStatusEnum Enum with underlying type: string +type OperationStatusEnum string + +// Set of constants representing the allowable values for OperationStatusEnum +const ( + OperationStatusAccepted OperationStatusEnum = "ACCEPTED" + OperationStatusInProgress OperationStatusEnum = "IN_PROGRESS" + OperationStatusWaiting OperationStatusEnum = "WAITING" + OperationStatusNeedsAttention OperationStatusEnum = "NEEDS_ATTENTION" + OperationStatusFailed OperationStatusEnum = "FAILED" + OperationStatusSucceeded OperationStatusEnum = "SUCCEEDED" + OperationStatusCanceling OperationStatusEnum = "CANCELING" + OperationStatusCanceled OperationStatusEnum = "CANCELED" +) + +var mappingOperationStatusEnum = map[string]OperationStatusEnum{ + "ACCEPTED": OperationStatusAccepted, + "IN_PROGRESS": OperationStatusInProgress, + "WAITING": OperationStatusWaiting, + "NEEDS_ATTENTION": OperationStatusNeedsAttention, + "FAILED": OperationStatusFailed, + "SUCCEEDED": OperationStatusSucceeded, + "CANCELING": OperationStatusCanceling, + "CANCELED": OperationStatusCanceled, +} + +var mappingOperationStatusEnumLowerCase = map[string]OperationStatusEnum{ + "accepted": OperationStatusAccepted, + "in_progress": OperationStatusInProgress, + "waiting": OperationStatusWaiting, + "needs_attention": OperationStatusNeedsAttention, + "failed": OperationStatusFailed, + "succeeded": OperationStatusSucceeded, + "canceling": OperationStatusCanceling, + "canceled": OperationStatusCanceled, +} + +// GetOperationStatusEnumValues Enumerates the set of values for OperationStatusEnum +func GetOperationStatusEnumValues() []OperationStatusEnum { + values := make([]OperationStatusEnum, 0) + for _, v := range mappingOperationStatusEnum { + values = append(values, v) + } + return values +} + +// GetOperationStatusEnumStringValues Enumerates the set of values in String for OperationStatusEnum +func GetOperationStatusEnumStringValues() []string { + return []string{ + "ACCEPTED", + "IN_PROGRESS", + "WAITING", + "NEEDS_ATTENTION", + "FAILED", + "SUCCEEDED", + "CANCELING", + "CANCELED", + } +} + +// GetMappingOperationStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationStatusEnum(val string) (OperationStatusEnum, bool) { + enum, ok := mappingOperationStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/operation_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/operation_type.go new file mode 100644 index 00000000000..7c50fc78c8c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/operation_type.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "strings" +) + +// OperationTypeEnum Enum with underlying type: string +type OperationTypeEnum string + +// Set of constants representing the allowable values for OperationTypeEnum +const ( + OperationTypeCreateApipInstance OperationTypeEnum = "CREATE_APIP_INSTANCE" + OperationTypeUpdateApipInstance OperationTypeEnum = "UPDATE_APIP_INSTANCE" + OperationTypeDeleteApipInstance OperationTypeEnum = "DELETE_APIP_INSTANCE" + OperationTypeMoveApipInstance OperationTypeEnum = "MOVE_APIP_INSTANCE" +) + +var mappingOperationTypeEnum = map[string]OperationTypeEnum{ + "CREATE_APIP_INSTANCE": OperationTypeCreateApipInstance, + "UPDATE_APIP_INSTANCE": OperationTypeUpdateApipInstance, + "DELETE_APIP_INSTANCE": OperationTypeDeleteApipInstance, + "MOVE_APIP_INSTANCE": OperationTypeMoveApipInstance, +} + +var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ + "create_apip_instance": OperationTypeCreateApipInstance, + "update_apip_instance": OperationTypeUpdateApipInstance, + "delete_apip_instance": OperationTypeDeleteApipInstance, + "move_apip_instance": OperationTypeMoveApipInstance, +} + +// GetOperationTypeEnumValues Enumerates the set of values for OperationTypeEnum +func GetOperationTypeEnumValues() []OperationTypeEnum { + values := make([]OperationTypeEnum, 0) + for _, v := range mappingOperationTypeEnum { + values = append(values, v) + } + return values +} + +// GetOperationTypeEnumStringValues Enumerates the set of values in String for OperationTypeEnum +func GetOperationTypeEnumStringValues() []string { + return []string{ + "CREATE_APIP_INSTANCE", + "UPDATE_APIP_INSTANCE", + "DELETE_APIP_INSTANCE", + "MOVE_APIP_INSTANCE", + } +} + +// GetMappingOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingOperationTypeEnum(val string) (OperationTypeEnum, bool) { + enum, ok := mappingOperationTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/sort_order.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/sort_order.go new file mode 100644 index 00000000000..cdd00eb4dc4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/sort_order.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +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/apiplatform/update_api_platform_instance_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/update_api_platform_instance_details.go new file mode 100644 index 00000000000..66dccc48dd6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/update_api_platform_instance_details.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateApiPlatformInstanceDetails The data to update an instance +type UpdateApiPlatformInstanceDetails struct { + + // User-provided changeable and non-unique description of the instance + 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 UpdateApiPlatformInstanceDetails) 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 UpdateApiPlatformInstanceDetails) 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/apiplatform/update_api_platform_instance_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/update_api_platform_instance_request_response.go new file mode 100644 index 00000000000..ebff6c7c1d4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/update_api_platform_instance_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateApiPlatformInstanceRequest wrapper for the UpdateApiPlatformInstance operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apiplatform/UpdateApiPlatformInstance.go.html to see an example of how to use UpdateApiPlatformInstanceRequest. +type UpdateApiPlatformInstanceRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + ApiPlatformInstanceId *string `mandatory:"true" contributesTo:"path" name:"apiPlatformInstanceId"` + + // The information to be updated. + UpdateApiPlatformInstanceDetails `contributesTo:"body"` + + // For optimistic concurrency control. In the PUT or DELETE call for a resource, set the + // `if-match` parameter to the value of the etag from a previous GET or POST response for + // that resource. The resource will be updated or deleted only if the etag you provide + // matches the resource's current etag value. + IfMatch *string `mandatory:"false" contributesTo:"header" name:"if-match"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + // The only valid characters for request IDs are letters, numbers, + // underscore, and dash. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateApiPlatformInstanceRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateApiPlatformInstanceRequest) 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 UpdateApiPlatformInstanceRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateApiPlatformInstanceRequest) 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 UpdateApiPlatformInstanceRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateApiPlatformInstanceResponse wrapper for the UpdateApiPlatformInstance operation +type UpdateApiPlatformInstanceResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ApiPlatformInstance instance + ApiPlatformInstance `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 UpdateApiPlatformInstanceResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateApiPlatformInstanceResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/uris.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/uris.go new file mode 100644 index 00000000000..ac9079b60b3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/uris.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Uris Service URIs pertaining to the instance +type Uris struct { + + // Management Portal URI of the instance (/apiplatform) + ManagementPortalUri *string `mandatory:"true" json:"managementPortalUri"` + + // Developer's Portal URI of the instance (/developers) + DevelopersPortalUri *string `mandatory:"true" json:"developersPortalUri"` +} + +func (m Uris) 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 Uris) 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/apiplatform/work_request.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request.go new file mode 100644 index 00000000000..6af2e6fbfa1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequest An asynchronous work request. Work requests help you monitor long-running operations. When you start a long-running operation, +// the service creates a work request. A work request is an activity log that lets you track each step in the operation's +// progress. Each work request has an OCID that lets you interact with it programmatically and use it for automation. +type WorkRequest struct { + + // The asynchronous operation tracked by this work request. + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // The status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources that are affected by the work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Shows the progress of the operation tracked by the work request, as a percentage of the total work + // that must be performed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the work request was created, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request was started, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request was finished, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // The date and time the work request was updated, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m WorkRequest) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_error.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_error.go new file mode 100644 index 00000000000..a679c610837 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_error.go @@ -0,0 +1,47 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestError An error encountered while performing an operation that is tracked by a work request. +type WorkRequestError struct { + + // A machine-usable code for the error that occurred. For a list of error codes, see + // API Errors (https://docs.oracle.com/iaas/Content/API/References/apierrors.htm). + Code *string `mandatory:"true" json:"code"` + + // A human-readable error message. + Message *string `mandatory:"true" json:"message"` + + // The date and time the error occurred, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestError) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestError) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_error_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_error_collection.go new file mode 100644 index 00000000000..1df809b84c9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_error_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestErrorCollection A list of work request errors. Can contain both errors and other information, such as metadata. +type WorkRequestErrorCollection struct { + + // A list of work request errors. + Items []WorkRequestError `mandatory:"true" json:"items"` +} + +func (m WorkRequestErrorCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestErrorCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_log_entry.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_log_entry.go new file mode 100644 index 00000000000..b1d62be1bf6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_log_entry.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntry A log message from performing an operation that is tracked by a work request. +type WorkRequestLogEntry struct { + + // A human-readable log message. + Message *string `mandatory:"true" json:"message"` + + // The date and time the log message was written, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + Timestamp *common.SDKTime `mandatory:"true" json:"timestamp"` +} + +func (m WorkRequestLogEntry) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntry) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_log_entry_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_log_entry_collection.go new file mode 100644 index 00000000000..421eedaf0dd --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_log_entry_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestLogEntryCollection A list of work request logs. Can contain both logs and other information, such as metadata. +type WorkRequestLogEntryCollection struct { + + // A list of work request log entries. + Items []WorkRequestLogEntry `mandatory:"true" json:"items"` +} + +func (m WorkRequestLogEntryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestLogEntryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_resource.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_resource.go new file mode 100644 index 00000000000..b5825bbc195 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_resource.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestResource A resource created or operated on by a work request. +type WorkRequestResource struct { + + // The resource type that the work request affects. + EntityType *string `mandatory:"true" json:"entityType"` + + // The way in which this resource is affected by the operation tracked in the work request. + // A resource being created, updated, or deleted remains in the IN_PROGRESS state until + // work is complete for that resource, at which point it transitions to CREATED, UPDATED, + // or DELETED, respectively. + ActionType ActionTypeEnum `mandatory:"true" json:"actionType"` + + // An OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) or other unique identifier for the resource. + Identifier *string `mandatory:"true" json:"identifier"` + + // The URI path that you can use for a GET request to access the resource metadata. + EntityUri *string `mandatory:"false" json:"entityUri"` + + // Additional information that helps to explain the resource. + Metadata map[string]string `mandatory:"false" json:"metadata"` +} + +func (m WorkRequestResource) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestResource) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingActionTypeEnum(string(m.ActionType)); !ok && m.ActionType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ActionType: %s. Supported values are: %s.", m.ActionType, strings.Join(GetActionTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_resource_metadata_key.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_resource_metadata_key.go new file mode 100644 index 00000000000..1453854df4e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_resource_metadata_key.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "strings" +) + +// WorkRequestResourceMetadataKeyEnum Enum with underlying type: string +type WorkRequestResourceMetadataKeyEnum string + +// Set of constants representing the allowable values for WorkRequestResourceMetadataKeyEnum +const ( + WorkRequestResourceMetadataKeyIsDryRun WorkRequestResourceMetadataKeyEnum = "IS_DRY_RUN" +) + +var mappingWorkRequestResourceMetadataKeyEnum = map[string]WorkRequestResourceMetadataKeyEnum{ + "IS_DRY_RUN": WorkRequestResourceMetadataKeyIsDryRun, +} + +var mappingWorkRequestResourceMetadataKeyEnumLowerCase = map[string]WorkRequestResourceMetadataKeyEnum{ + "is_dry_run": WorkRequestResourceMetadataKeyIsDryRun, +} + +// GetWorkRequestResourceMetadataKeyEnumValues Enumerates the set of values for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumValues() []WorkRequestResourceMetadataKeyEnum { + values := make([]WorkRequestResourceMetadataKeyEnum, 0) + for _, v := range mappingWorkRequestResourceMetadataKeyEnum { + values = append(values, v) + } + return values +} + +// GetWorkRequestResourceMetadataKeyEnumStringValues Enumerates the set of values in String for WorkRequestResourceMetadataKeyEnum +func GetWorkRequestResourceMetadataKeyEnumStringValues() []string { + return []string{ + "IS_DRY_RUN", + } +} + +// GetMappingWorkRequestResourceMetadataKeyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingWorkRequestResourceMetadataKeyEnum(val string) (WorkRequestResourceMetadataKeyEnum, bool) { + enum, ok := mappingWorkRequestResourceMetadataKeyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_summary.go new file mode 100644 index 00000000000..f7933218529 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_summary.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummary Summary information about an asynchronous work request. +type WorkRequestSummary struct { + + // The asynchronous operation tracked by this work request. + OperationType OperationTypeEnum `mandatory:"true" json:"operationType"` + + // The status of the work request. + Status OperationStatusEnum `mandatory:"true" json:"status"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the work request. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The resources that are affected by this work request. + Resources []WorkRequestResource `mandatory:"true" json:"resources"` + + // Shows the progress of the operation tracked by the work request, as a percentage of the total work + // that must be performed. + PercentComplete *float32 `mandatory:"true" json:"percentComplete"` + + // The date and time the work request was created, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeAccepted *common.SDKTime `mandatory:"true" json:"timeAccepted"` + + // The date and time the work request was started, in the format defined by + // RFC 3339 (https://tools.ietf.org/html/rfc3339). + TimeStarted *common.SDKTime `mandatory:"false" json:"timeStarted"` + + // The date and time the work request was finished, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeFinished *common.SDKTime `mandatory:"false" json:"timeFinished"` + + // The date and time the work request was updated, in the format defined by + // RFC 3339 (https://tools.ietf.org/rfc/rfc3339). + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` +} + +func (m WorkRequestSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetOperationTypeEnumStringValues(), ","))) + } + if _, ok := GetMappingOperationStatusEnum(string(m.Status)); !ok && m.Status != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", m.Status, strings.Join(GetOperationStatusEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_summary_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_summary_collection.go new file mode 100644 index 00000000000..e6610863787 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apiplatform/work_request_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// APIP Control Plane API +// +// Control Plane designed to manage lifecycle of APIP Instances +// + +package apiplatform + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// WorkRequestSummaryCollection A list of work requests. Can contain both work requests and other information, such as metadata. +type WorkRequestSummaryCollection struct { + + // A list of work requests. + Items []WorkRequestSummary `mandatory:"true" json:"items"` +} + +func (m WorkRequestSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m WorkRequestSummaryCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config.go new file mode 100644 index 00000000000..5cdf1d7ab12 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config.go @@ -0,0 +1,137 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AgentConfig Agent configuration for any Agent complying with the OpAMP specification. +type AgentConfig struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration item. An OCID is generated + // when the item is created. + Id *string `mandatory:"false" json:"id"` + + // The time the resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-12T22:47:12.613Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-13T22:47:12.613Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + CreatedBy *string `mandatory:"false" json:"createdBy"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + UpdatedBy *string `mandatory:"false" json:"updatedBy"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // 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"` + + // The agent attribute KEY by which an Agent configuration is matched to an agent. + // All agent configuration objects share the same key. It is [ServiceName, service.name] by default. + // The attribute VALUE corresponding to this KEY is in the matchAgentsWithAttributeValue field. + MatchAgentsWithAttributeKey []string `mandatory:"false" json:"matchAgentsWithAttributeKey"` + + // The agent attribute VALUE by which an agent configuration is matched to an agent. + // Each agent configuration object must specify a different value. + // The attribute KEY corresponding to this VALUE is in the matchAgentsWithAttributeKey field. + MatchAgentsWithAttributeValue *string `mandatory:"false" json:"matchAgentsWithAttributeValue"` + + Config *AgentConfigMap `mandatory:"false" json:"config"` + + Overrides *AgentConfigOverrides `mandatory:"false" json:"overrides"` +} + +// GetId returns Id +func (m AgentConfig) GetId() *string { + return m.Id +} + +// GetTimeCreated returns TimeCreated +func (m AgentConfig) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m AgentConfig) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetCreatedBy returns CreatedBy +func (m AgentConfig) GetCreatedBy() *string { + return m.CreatedBy +} + +// GetUpdatedBy returns UpdatedBy +func (m AgentConfig) GetUpdatedBy() *string { + return m.UpdatedBy +} + +// GetEtag returns Etag +func (m AgentConfig) GetEtag() *string { + return m.Etag +} + +// GetFreeformTags returns FreeformTags +func (m AgentConfig) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m AgentConfig) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m AgentConfig) 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 AgentConfig) 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 AgentConfig) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAgentConfig AgentConfig + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeAgentConfig + }{ + "AGENT", + (MarshalTypeAgentConfig)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_file.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_file.go new file mode 100644 index 00000000000..438080defc4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_file.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AgentConfigFile An agent configuration file. +type AgentConfigFile struct { + + // The MIME Content-Type that describes the content of the body field, for example, text/yaml or text/yaml; charset=utf-8 + ContentType *string `mandatory:"false" json:"contentType"` + + // The Base64 encoded agent configuration file. + Body *string `mandatory:"false" json:"body"` +} + +func (m AgentConfigFile) 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 AgentConfigFile) 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/apmconfig/agent_config_map.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_map.go new file mode 100644 index 00000000000..f4b1743e858 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_map.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AgentConfigMap Collection of agent configuration files. +// For agents that use a single configuration file, this SHOULD contain a single entry and the key MAY be an empty string. +// To apply a different configuration in a subset of the agents, put this block anywhere in the body of the configuration and edit and +// {{ | default }} +// Example: +// com.oracle.apm.agent.tracer.enable.jfr = {{ isJfrEnabled | default false }} +// Then, in the configuration's overrides, specify a different value for along with the desired agent filter. +// Example: +// "agentFilter": "ApplicationType='Tomcat'" +// +// "overrideMap": { +// "isJfrEnabled": true +// } +type AgentConfigMap struct { + + // Map of agent configuration files, where keys are file names. + ConfigMap map[string]AgentConfigFile `mandatory:"false" json:"configMap"` +} + +func (m AgentConfigMap) 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 AgentConfigMap) 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/apmconfig/agent_config_override.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_override.go new file mode 100644 index 00000000000..afe212a815f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_override.go @@ -0,0 +1,46 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AgentConfigOverride Agent configuration overrides that should apply to a subset of the agents associated with an Agent Config object. +type AgentConfigOverride struct { + + // The string that defines the Agent Filter expression. + AgentFilter *string `mandatory:"false" json:"agentFilter"` + + // A map whose key is a substitution variable specified within the configuration's body. For example, if below was specified in the configuration's body + // {{ isJfrEnabled | default false }} + // Then a valid map key would be "isJfrEnabled". The value is typically different than the default specified in the configuration's body. + // Thus, in this example, the map entry could be "isJfrEnabled": true + OverrideMap map[string]string `mandatory:"false" json:"overrideMap"` +} + +func (m AgentConfigOverride) 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 AgentConfigOverride) 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/apmconfig/agent_config_overrides.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_overrides.go new file mode 100644 index 00000000000..1310ea3f905 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_overrides.go @@ -0,0 +1,38 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AgentConfigOverrides Agent configuration overrides that should apply to a subset of the agents associated with an Agent Config object. +type AgentConfigOverrides struct { + OverrideList []AgentConfigOverride `mandatory:"false" json:"overrideList"` +} + +func (m AgentConfigOverrides) 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 AgentConfigOverrides) 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/apmconfig/agent_config_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_summary.go new file mode 100644 index 00000000000..0777969bff6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/agent_config_summary.go @@ -0,0 +1,146 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AgentConfigSummary Agent configuration for any Agent complying with the OpAMP specification. +type AgentConfigSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration item. An OCID is generated + // when the item is created. + Id *string `mandatory:"false" json:"id"` + + // The time the resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-12T22:47:12.613Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-13T22:47:12.613Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + CreatedBy *string `mandatory:"false" json:"createdBy"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + UpdatedBy *string `mandatory:"false" json:"updatedBy"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The agent attribute KEY by which an Agent configuration is matched to an agent. + // All agent configuration objects share the same key. It is [ServiceName, service.name] by default. + // The attribute VALUE corresponding to this KEY is in the matchAgentsWithAttributeValue field. + MatchAgentsWithAttributeKey []string `mandatory:"false" json:"matchAgentsWithAttributeKey"` + + // The agent attribute VALUE by which an agent configuration is matched to an agent. + // Each agent configuration object must specify a different value. + // The attribute KEY corresponding to this VALUE is in the matchAgentsWithAttributeKey field. + MatchAgentsWithAttributeValue *string `mandatory:"false" json:"matchAgentsWithAttributeValue"` + + Config *AgentConfigMap `mandatory:"false" json:"config"` + + Overrides *AgentConfigOverrides `mandatory:"false" json:"overrides"` +} + +// GetId returns Id +func (m AgentConfigSummary) GetId() *string { + return m.Id +} + +// GetTimeCreated returns TimeCreated +func (m AgentConfigSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m AgentConfigSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetCreatedBy returns CreatedBy +func (m AgentConfigSummary) GetCreatedBy() *string { + return m.CreatedBy +} + +// GetUpdatedBy returns UpdatedBy +func (m AgentConfigSummary) GetUpdatedBy() *string { + return m.UpdatedBy +} + +// GetEtag returns Etag +func (m AgentConfigSummary) GetEtag() *string { + return m.Etag +} + +// GetFreeformTags returns FreeformTags +func (m AgentConfigSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m AgentConfigSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m AgentConfigSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m AgentConfigSummary) 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 AgentConfigSummary) 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 AgentConfigSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeAgentConfigSummary AgentConfigSummary + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeAgentConfigSummary + }{ + "AGENT", + (MarshalTypeAgentConfigSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/apmconfig_config_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/apmconfig_config_client.go index ec2246d00b5..fdbabc67e68 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/apmconfig_config_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/apmconfig_config_client.go @@ -397,6 +397,64 @@ func (client ConfigClient) getConfig(ctx context.Context, request common.OCIRequ return response, err } +// GetMatchAgentsWithAttributeKey The domain-wide agents matching attribute key. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmconfig/GetMatchAgentsWithAttributeKey.go.html to see an example of how to use GetMatchAgentsWithAttributeKey API. +// A default retry strategy applies to this operation GetMatchAgentsWithAttributeKey() +func (client ConfigClient) GetMatchAgentsWithAttributeKey(ctx context.Context, request GetMatchAgentsWithAttributeKeyRequest) (response GetMatchAgentsWithAttributeKeyResponse, 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.getMatchAgentsWithAttributeKey, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetMatchAgentsWithAttributeKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetMatchAgentsWithAttributeKeyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetMatchAgentsWithAttributeKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetMatchAgentsWithAttributeKeyResponse") + } + return +} + +// getMatchAgentsWithAttributeKey implements the OCIOperation interface (enables retrying operations) +func (client ConfigClient) getMatchAgentsWithAttributeKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/actions/matchAgentsWithAttributeKey", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetMatchAgentsWithAttributeKeyResponse + 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/apm-config/20210201/MatchAgentsWithAttributeKey/GetMatchAgentsWithAttributeKey" + err = common.PostProcessServiceError(err, "Config", "GetMatchAgentsWithAttributeKey", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ImportConfiguration Import configurations Item(s) with its dependencies into a destination domain. // // # See also @@ -751,6 +809,64 @@ func (client ConfigClient) updateConfig(ctx context.Context, request common.OCIR return response, err } +// UpdateMatchAgentsWithAttributeKey Updates the agent matching attribute key for the APM Domain. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmconfig/UpdateMatchAgentsWithAttributeKey.go.html to see an example of how to use UpdateMatchAgentsWithAttributeKey API. +// A default retry strategy applies to this operation UpdateMatchAgentsWithAttributeKey() +func (client ConfigClient) UpdateMatchAgentsWithAttributeKey(ctx context.Context, request UpdateMatchAgentsWithAttributeKeyRequest) (response UpdateMatchAgentsWithAttributeKeyResponse, 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.updateMatchAgentsWithAttributeKey, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateMatchAgentsWithAttributeKeyResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateMatchAgentsWithAttributeKeyResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateMatchAgentsWithAttributeKeyResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateMatchAgentsWithAttributeKeyResponse") + } + return +} + +// updateMatchAgentsWithAttributeKey implements the OCIOperation interface (enables retrying operations) +func (client ConfigClient) updateMatchAgentsWithAttributeKey(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/actions/matchAgentsWithAttributeKey", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateMatchAgentsWithAttributeKeyResponse + 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/apm-config/20210201/MatchAgentsWithAttributeKey/UpdateMatchAgentsWithAttributeKey" + err = common.PostProcessServiceError(err, "Config", "UpdateMatchAgentsWithAttributeKey", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ValidateSpanFilterPattern Validates the Span Filter pattern (filterText) for syntactic correctness. // Returns 204 on success, 422 when validation fails. // diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config.go index c09bfb6f2dc..de4b1e31199 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config.go @@ -99,10 +99,18 @@ func (m *config) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { var err error switch m.ConfigType { + case "AGENT": + mm := AgentConfig{} + err = json.Unmarshal(data, &mm) + return mm, err case "OPTIONS": mm := Options{} err = json.Unmarshal(data, &mm) return mm, err + case "MACS_APM_EXTENSION": + mm := MacsApmExtension{} + err = json.Unmarshal(data, &mm) + return mm, err case "METRIC_GROUP": mm := MetricGroup{} err = json.Unmarshal(data, &mm) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_summary.go index 3623c819aca..d03495fd66b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_summary.go @@ -104,6 +104,10 @@ func (m *configsummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, erro var err error switch m.ConfigType { + case "MACS_APM_EXTENSION": + mm := MacsApmExtensionSummary{} + err = json.Unmarshal(data, &mm) + return mm, err case "METRIC_GROUP": mm := MetricGroupSummary{} err = json.Unmarshal(data, &mm) @@ -112,6 +116,10 @@ func (m *configsummary) UnmarshalPolymorphicJSON(data []byte) (interface{}, erro mm := ApdexRulesSummary{} err = json.Unmarshal(data, &mm) return mm, err + case "AGENT": + mm := AgentConfigSummary{} + err = json.Unmarshal(data, &mm) + return mm, err case "SPAN_FILTER": mm := SpanFilterSummary{} err = json.Unmarshal(data, &mm) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_types.go index f02738fb655..0da190e8dfe 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_types.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/config_types.go @@ -19,24 +19,30 @@ type ConfigTypesEnum string // Set of constants representing the allowable values for ConfigTypesEnum const ( - ConfigTypesSpanFilter ConfigTypesEnum = "SPAN_FILTER" - ConfigTypesMetricGroup ConfigTypesEnum = "METRIC_GROUP" - ConfigTypesApdex ConfigTypesEnum = "APDEX" - ConfigTypesOptions ConfigTypesEnum = "OPTIONS" + ConfigTypesSpanFilter ConfigTypesEnum = "SPAN_FILTER" + ConfigTypesMetricGroup ConfigTypesEnum = "METRIC_GROUP" + ConfigTypesApdex ConfigTypesEnum = "APDEX" + ConfigTypesOptions ConfigTypesEnum = "OPTIONS" + ConfigTypesAgent ConfigTypesEnum = "AGENT" + ConfigTypesMacsApmExtension ConfigTypesEnum = "MACS_APM_EXTENSION" ) var mappingConfigTypesEnum = map[string]ConfigTypesEnum{ - "SPAN_FILTER": ConfigTypesSpanFilter, - "METRIC_GROUP": ConfigTypesMetricGroup, - "APDEX": ConfigTypesApdex, - "OPTIONS": ConfigTypesOptions, + "SPAN_FILTER": ConfigTypesSpanFilter, + "METRIC_GROUP": ConfigTypesMetricGroup, + "APDEX": ConfigTypesApdex, + "OPTIONS": ConfigTypesOptions, + "AGENT": ConfigTypesAgent, + "MACS_APM_EXTENSION": ConfigTypesMacsApmExtension, } var mappingConfigTypesEnumLowerCase = map[string]ConfigTypesEnum{ - "span_filter": ConfigTypesSpanFilter, - "metric_group": ConfigTypesMetricGroup, - "apdex": ConfigTypesApdex, - "options": ConfigTypesOptions, + "span_filter": ConfigTypesSpanFilter, + "metric_group": ConfigTypesMetricGroup, + "apdex": ConfigTypesApdex, + "options": ConfigTypesOptions, + "agent": ConfigTypesAgent, + "macs_apm_extension": ConfigTypesMacsApmExtension, } // GetConfigTypesEnumValues Enumerates the set of values for ConfigTypesEnum @@ -55,6 +61,8 @@ func GetConfigTypesEnumStringValues() []string { "METRIC_GROUP", "APDEX", "OPTIONS", + "AGENT", + "MACS_APM_EXTENSION", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_agent_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_agent_config_details.go new file mode 100644 index 00000000000..11a4c233848 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_agent_config_details.go @@ -0,0 +1,79 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateAgentConfigDetails Agent configuration for any Agent complying with the OpAMP specification. +type CreateAgentConfigDetails struct { + + // The agent attribute VALUE by which an agent configuration is matched to an agent. + // Each agent configuration object must specify a different value. + // The attribute KEY corresponding to this VALUE is in the matchAgentsWithAttributeKey field. + MatchAgentsWithAttributeValue *string `mandatory:"true" json:"matchAgentsWithAttributeValue"` + + // 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"` + + Config *AgentConfigMap `mandatory:"false" json:"config"` + + Overrides *AgentConfigOverrides `mandatory:"false" json:"overrides"` +} + +// GetFreeformTags returns FreeformTags +func (m CreateAgentConfigDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateAgentConfigDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateAgentConfigDetails) 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 CreateAgentConfigDetails) 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 CreateAgentConfigDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateAgentConfigDetails CreateAgentConfigDetails + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeCreateAgentConfigDetails + }{ + "AGENT", + (MarshalTypeCreateAgentConfigDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_config_details.go index ad8a91728ea..ad3388574f9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_config_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_config_details.go @@ -72,10 +72,18 @@ func (m *createconfigdetails) UnmarshalPolymorphicJSON(data []byte) (interface{} mm := CreateMetricGroupDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "AGENT": + mm := CreateAgentConfigDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "OPTIONS": mm := CreateOptionsDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "MACS_APM_EXTENSION": + mm := CreateMacsApmExtensionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "APDEX": mm := CreateApdexRulesDetails{} err = json.Unmarshal(data, &mm) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_macs_apm_extension_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_macs_apm_extension_details.go new file mode 100644 index 00000000000..adbf24bdc46 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/create_macs_apm_extension_details.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateMacsApmExtensionDetails An object that represents APM Agent provisioning via a Management Agent. +type CreateMacsApmExtensionDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent that will provision the APM Agent. + ManagementAgentId *string `mandatory:"true" json:"managementAgentId"` + + // Filter patterns used to discover active Java processes for provisioning the APM Agent. + ProcessFilter []string `mandatory:"true" json:"processFilter"` + + // The OS user that should be used to discover Java processes. + RunAsUser *string `mandatory:"true" json:"runAsUser"` + + // The name of the service being monitored. This argument enables you to filter by + // service and view traces and other signals in the APM Explorer user interface. + ServiceName *string `mandatory:"true" json:"serviceName"` + + // The version of the referenced agent bundle. + AgentVersion *string `mandatory:"true" json:"agentVersion"` + + // The directory owned by runAsUser. + AttachInstallDir *string `mandatory:"true" json:"attachInstallDir"` + + // 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"` + + // The name by which a configuration entity is displayed to the end user. + DisplayName *string `mandatory:"false" json:"displayName"` +} + +// GetFreeformTags returns FreeformTags +func (m CreateMacsApmExtensionDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m CreateMacsApmExtensionDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m CreateMacsApmExtensionDetails) 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 CreateMacsApmExtensionDetails) 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 CreateMacsApmExtensionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateMacsApmExtensionDetails CreateMacsApmExtensionDetails + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeCreateMacsApmExtensionDetails + }{ + "MACS_APM_EXTENSION", + (MarshalTypeCreateMacsApmExtensionDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/get_match_agents_with_attribute_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/get_match_agents_with_attribute_key_request_response.go new file mode 100644 index 00000000000..13fb878e9f9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/get_match_agents_with_attribute_key_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetMatchAgentsWithAttributeKeyRequest wrapper for the GetMatchAgentsWithAttributeKey operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmconfig/GetMatchAgentsWithAttributeKey.go.html to see an example of how to use GetMatchAgentsWithAttributeKeyRequest. +type GetMatchAgentsWithAttributeKeyRequest struct { + + // The APM Domain ID the request is intended for. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetMatchAgentsWithAttributeKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetMatchAgentsWithAttributeKeyRequest) 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 GetMatchAgentsWithAttributeKeyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetMatchAgentsWithAttributeKeyRequest) 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 GetMatchAgentsWithAttributeKeyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetMatchAgentsWithAttributeKeyResponse wrapper for the GetMatchAgentsWithAttributeKey operation +type GetMatchAgentsWithAttributeKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MatchAgentsWithAttributeKey instance + MatchAgentsWithAttributeKey `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 GetMatchAgentsWithAttributeKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetMatchAgentsWithAttributeKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/list_configs_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/list_configs_request_response.go index 6fa64f154b4..70527e9f72a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/list_configs_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/list_configs_request_response.go @@ -26,7 +26,7 @@ type ListConfigsRequest struct { OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` // A filter to match configuration items of a given type. - // Supported values are SPAN_FILTER, METRIC_GROUP, and APDEX. + // Supported values are SPAN_FILTER, METRIC_GROUP, APDEX, AGENT and MACS_APM_EXTENSION. ConfigType *string `mandatory:"false" contributesTo:"query" name:"configType"` // A filter to return resources that match the given display name. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/macs_apm_extension.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/macs_apm_extension.go new file mode 100644 index 00000000000..1e4ed52ebe1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/macs_apm_extension.go @@ -0,0 +1,145 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MacsApmExtension An object that represents APM Agent provisioning via a Management Agent. +type MacsApmExtension struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration item. An OCID is generated + // when the item is created. + Id *string `mandatory:"false" json:"id"` + + // The time the resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-12T22:47:12.613Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-13T22:47:12.613Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + CreatedBy *string `mandatory:"false" json:"createdBy"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + UpdatedBy *string `mandatory:"false" json:"updatedBy"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // 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"` + + // The name by which a configuration entity is displayed to the end user. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent that will provision the APM Agent. + ManagementAgentId *string `mandatory:"false" json:"managementAgentId"` + + // Filter patterns used to discover active Java processes for provisioning the APM Agent. + ProcessFilter []string `mandatory:"false" json:"processFilter"` + + // The OS user that should be used to discover Java processes. + RunAsUser *string `mandatory:"false" json:"runAsUser"` + + // The name of the service being monitored. This argument enables you to filter by + // service and view traces and other signals in the APM Explorer user interface. + ServiceName *string `mandatory:"false" json:"serviceName"` + + // The version of the referenced agent bundle. + AgentVersion *string `mandatory:"false" json:"agentVersion"` + + // The directory owned by runAsUser. + AttachInstallDir *string `mandatory:"false" json:"attachInstallDir"` +} + +// GetId returns Id +func (m MacsApmExtension) GetId() *string { + return m.Id +} + +// GetTimeCreated returns TimeCreated +func (m MacsApmExtension) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m MacsApmExtension) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetCreatedBy returns CreatedBy +func (m MacsApmExtension) GetCreatedBy() *string { + return m.CreatedBy +} + +// GetUpdatedBy returns UpdatedBy +func (m MacsApmExtension) GetUpdatedBy() *string { + return m.UpdatedBy +} + +// GetEtag returns Etag +func (m MacsApmExtension) GetEtag() *string { + return m.Etag +} + +// GetFreeformTags returns FreeformTags +func (m MacsApmExtension) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m MacsApmExtension) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m MacsApmExtension) 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 MacsApmExtension) 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 MacsApmExtension) MarshalJSON() (buff []byte, e error) { + type MarshalTypeMacsApmExtension MacsApmExtension + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeMacsApmExtension + }{ + "MACS_APM_EXTENSION", + (MarshalTypeMacsApmExtension)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/macs_apm_extension_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/macs_apm_extension_summary.go new file mode 100644 index 00000000000..f61f3c31b3e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/macs_apm_extension_summary.go @@ -0,0 +1,154 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MacsApmExtensionSummary An object that represents APM Agent provisioning via a Management Agent. +type MacsApmExtensionSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration item. An OCID is generated + // when the item is created. + Id *string `mandatory:"false" json:"id"` + + // The time the resource was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-12T22:47:12.613Z` + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the resource was updated, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) + // timestamp format. + // Example: `2020-02-13T22:47:12.613Z` + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + CreatedBy *string `mandatory:"false" json:"createdBy"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. + UpdatedBy *string `mandatory:"false" json:"updatedBy"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `mandatory:"false" json:"etag"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // The name by which a configuration entity is displayed to the end user. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent that will provision the APM Agent. + ManagementAgentId *string `mandatory:"false" json:"managementAgentId"` + + // Filter patterns used to discover active Java processes for provisioning the APM Agent. + ProcessFilter []string `mandatory:"false" json:"processFilter"` + + // The OS user that should be used to discover Java processes. + RunAsUser *string `mandatory:"false" json:"runAsUser"` + + // The name of the service being monitored. This argument enables you to filter by + // service and view traces and other signals in the APM Explorer user interface. + ServiceName *string `mandatory:"false" json:"serviceName"` + + // The version of the referenced agent bundle. + AgentVersion *string `mandatory:"false" json:"agentVersion"` + + // The directory owned by runAsUser. + AttachInstallDir *string `mandatory:"false" json:"attachInstallDir"` +} + +// GetId returns Id +func (m MacsApmExtensionSummary) GetId() *string { + return m.Id +} + +// GetTimeCreated returns TimeCreated +func (m MacsApmExtensionSummary) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +// GetTimeUpdated returns TimeUpdated +func (m MacsApmExtensionSummary) GetTimeUpdated() *common.SDKTime { + return m.TimeUpdated +} + +// GetCreatedBy returns CreatedBy +func (m MacsApmExtensionSummary) GetCreatedBy() *string { + return m.CreatedBy +} + +// GetUpdatedBy returns UpdatedBy +func (m MacsApmExtensionSummary) GetUpdatedBy() *string { + return m.UpdatedBy +} + +// GetEtag returns Etag +func (m MacsApmExtensionSummary) GetEtag() *string { + return m.Etag +} + +// GetFreeformTags returns FreeformTags +func (m MacsApmExtensionSummary) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m MacsApmExtensionSummary) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +// GetSystemTags returns SystemTags +func (m MacsApmExtensionSummary) GetSystemTags() map[string]map[string]interface{} { + return m.SystemTags +} + +func (m MacsApmExtensionSummary) 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 MacsApmExtensionSummary) 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 MacsApmExtensionSummary) MarshalJSON() (buff []byte, e error) { + type MarshalTypeMacsApmExtensionSummary MacsApmExtensionSummary + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeMacsApmExtensionSummary + }{ + "MACS_APM_EXTENSION", + (MarshalTypeMacsApmExtensionSummary)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/match_agents_with_attribute_key.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/match_agents_with_attribute_key.go new file mode 100644 index 00000000000..0c9ad306657 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/match_agents_with_attribute_key.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MatchAgentsWithAttributeKey The object representing the agent matching attribute keys. +type MatchAgentsWithAttributeKey struct { + + // The list of agent matching attribute keys to be updated. + AgentAttributeKeys []string `mandatory:"true" json:"agentAttributeKeys"` +} + +func (m MatchAgentsWithAttributeKey) 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 MatchAgentsWithAttributeKey) 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/apmconfig/update_agent_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_agent_config_details.go new file mode 100644 index 00000000000..94870c48606 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_agent_config_details.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateAgentConfigDetails Agent configuration for any Agent complying with the OpAMP specification. +type UpdateAgentConfigDetails struct { + + // 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"` + + Config *AgentConfigMap `mandatory:"false" json:"config"` + + Overrides *AgentConfigOverrides `mandatory:"false" json:"overrides"` +} + +// GetFreeformTags returns FreeformTags +func (m UpdateAgentConfigDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m UpdateAgentConfigDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateAgentConfigDetails) 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 UpdateAgentConfigDetails) 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 UpdateAgentConfigDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateAgentConfigDetails UpdateAgentConfigDetails + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeUpdateAgentConfigDetails + }{ + "AGENT", + (MarshalTypeUpdateAgentConfigDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_config_details.go index 434abee72c9..519064e13fe 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_config_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_config_details.go @@ -67,6 +67,14 @@ func (m *updateconfigdetails) UnmarshalPolymorphicJSON(data []byte) (interface{} mm := UpdateMetricGroupDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "AGENT": + mm := UpdateAgentConfigDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "MACS_APM_EXTENSION": + mm := UpdateMacsApmExtensionDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "APDEX": mm := UpdateApdexRulesDetails{} err = json.Unmarshal(data, &mm) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_macs_apm_extension_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_macs_apm_extension_details.go new file mode 100644 index 00000000000..7ec04774426 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_macs_apm_extension_details.go @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateMacsApmExtensionDetails An object that represents APM Agent provisioning via a Management Agent. +type UpdateMacsApmExtensionDetails struct { + + // 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"` + + // The name by which a configuration entity is displayed to the end user. + DisplayName *string `mandatory:"false" json:"displayName"` + + // Filter patterns used to discover active Java processes for provisioning the APM Agent. + ProcessFilter []string `mandatory:"false" json:"processFilter"` + + // The OS user that should be used to discover Java processes. + RunAsUser *string `mandatory:"false" json:"runAsUser"` + + // The name of the service being monitored. This argument enables you to filter by + // service and view traces and other signals in the APM Explorer user interface. + ServiceName *string `mandatory:"false" json:"serviceName"` + + // The version of the referenced agent bundle. + AgentVersion *string `mandatory:"false" json:"agentVersion"` + + // The directory owned by runAsUser. + AttachInstallDir *string `mandatory:"false" json:"attachInstallDir"` +} + +// GetFreeformTags returns FreeformTags +func (m UpdateMacsApmExtensionDetails) GetFreeformTags() map[string]string { + return m.FreeformTags +} + +// GetDefinedTags returns DefinedTags +func (m UpdateMacsApmExtensionDetails) GetDefinedTags() map[string]map[string]interface{} { + return m.DefinedTags +} + +func (m UpdateMacsApmExtensionDetails) 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 UpdateMacsApmExtensionDetails) 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 UpdateMacsApmExtensionDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateMacsApmExtensionDetails UpdateMacsApmExtensionDetails + s := struct { + DiscriminatorParam string `json:"configType"` + MarshalTypeUpdateMacsApmExtensionDetails + }{ + "MACS_APM_EXTENSION", + (MarshalTypeUpdateMacsApmExtensionDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_match_agents_with_attribute_key_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_match_agents_with_attribute_key_details.go new file mode 100644 index 00000000000..0bfeb9ea4ad --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_match_agents_with_attribute_key_details.go @@ -0,0 +1,40 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Application Performance Monitoring Configuration API +// +// Use the Application Performance Monitoring Configuration API to query and set Application Performance Monitoring +// configuration. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html). +// + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateMatchAgentsWithAttributeKeyDetails The object representing the agent matching attribute keys. +type UpdateMatchAgentsWithAttributeKeyDetails struct { + + // The list of agent matching attribute keys to be updated. + Items []string `mandatory:"false" json:"items"` +} + +func (m UpdateMatchAgentsWithAttributeKeyDetails) 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 UpdateMatchAgentsWithAttributeKeyDetails) 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/apmconfig/update_match_agents_with_attribute_key_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_match_agents_with_attribute_key_request_response.go new file mode 100644 index 00000000000..41c38e2cf00 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/apmconfig/update_match_agents_with_attribute_key_request_response.go @@ -0,0 +1,97 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package apmconfig + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateMatchAgentsWithAttributeKeyRequest wrapper for the UpdateMatchAgentsWithAttributeKey operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/apmconfig/UpdateMatchAgentsWithAttributeKey.go.html to see an example of how to use UpdateMatchAgentsWithAttributeKeyRequest. +type UpdateMatchAgentsWithAttributeKeyRequest struct { + + // The APM Domain ID the request is intended for. + ApmDomainId *string `mandatory:"true" contributesTo:"query" name:"apmDomainId"` + + // The list of values to be updated. + UpdateMatchAgentsWithAttributeKeyDetails `contributesTo:"body"` + + // Unique identifier for the request. + // If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request UpdateMatchAgentsWithAttributeKeyRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateMatchAgentsWithAttributeKeyRequest) 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 UpdateMatchAgentsWithAttributeKeyRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateMatchAgentsWithAttributeKeyRequest) 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 UpdateMatchAgentsWithAttributeKeyRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateMatchAgentsWithAttributeKeyResponse wrapper for the UpdateMatchAgentsWithAttributeKey operation +type UpdateMatchAgentsWithAttributeKeyResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The MatchAgentsWithAttributeKey instance + MatchAgentsWithAttributeKey `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 UpdateMatchAgentsWithAttributeKeyResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateMatchAgentsWithAttributeKeyResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go index 2e4fc1cf854..28bd09250b1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/http.go @@ -22,6 +22,8 @@ import ( const ( //UsingExpectHeaderEnvVar is the key to determine whether expect 100-continue is enabled or not UsingExpectHeaderEnvVar = "OCI_GOSDK_USING_EXPECT_HEADER" + //EncodePathParamsEnvVar determines if special characters in path params such as / and & are URL encoded + EncodePathParamsEnvVar = "OCI_GOSDK_ENCODE_PATH_PARAMS" ) /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -461,6 +463,11 @@ func addToPath(request *http.Request, value reflect.Value, field reflect.StructF return fmt.Errorf("value cannot be empty for field %s in path", field.Name) } + // encode path param if EncodePathParamsEnvVar is set + if IsEnvVarTrue(EncodePathParamsEnvVar) { + additionalURLPathPart = url.PathEscape(additionalURLPathPart) + } + if request.URL == nil { request.URL = &url.URL{} request.URL.Path = "" diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go index b1dd0b79f31..ca32c4a952c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.go @@ -4,356 +4,352 @@ package common const ( - //RegionAPChuncheon1 region Chuncheon - RegionAPChuncheon1 Region = "ap-chuncheon-1" - //RegionAPHyderabad1 region Hyderabad - RegionAPHyderabad1 Region = "ap-hyderabad-1" - //RegionAPMelbourne1 region Melbourne - RegionAPMelbourne1 Region = "ap-melbourne-1" - //RegionAPMumbai1 region Mumbai - RegionAPMumbai1 Region = "ap-mumbai-1" - //RegionAPOsaka1 region Osaka - RegionAPOsaka1 Region = "ap-osaka-1" - //RegionAPSeoul1 region Seoul - RegionAPSeoul1 Region = "ap-seoul-1" - //RegionAPSydney1 region Sydney - RegionAPSydney1 Region = "ap-sydney-1" - //RegionAPTokyo1 region Tokyo - RegionAPTokyo1 Region = "ap-tokyo-1" - //RegionCAMontreal1 region Montreal - RegionCAMontreal1 Region = "ca-montreal-1" - //RegionCAToronto1 region Toronto - RegionCAToronto1 Region = "ca-toronto-1" - //RegionEUAmsterdam1 region Amsterdam - RegionEUAmsterdam1 Region = "eu-amsterdam-1" - //RegionFRA region Frankfurt - RegionFRA Region = "eu-frankfurt-1" - //RegionEUZurich1 region Zurich - RegionEUZurich1 Region = "eu-zurich-1" - //RegionMEJeddah1 region Jeddah - RegionMEJeddah1 Region = "me-jeddah-1" - //RegionMEDubai1 region Dubai - RegionMEDubai1 Region = "me-dubai-1" - //RegionSASaopaulo1 region Saopaulo - RegionSASaopaulo1 Region = "sa-saopaulo-1" - //RegionUKCardiff1 region Cardiff - RegionUKCardiff1 Region = "uk-cardiff-1" - //RegionLHR region London - RegionLHR Region = "uk-london-1" - //RegionIAD region Ashburn - RegionIAD Region = "us-ashburn-1" - //RegionPHX region Phoenix - RegionPHX Region = "us-phoenix-1" - //RegionSJC1 region Sanjose - RegionSJC1 Region = "us-sanjose-1" - //RegionSAVinhedo1 region Vinhedo - RegionSAVinhedo1 Region = "sa-vinhedo-1" - //RegionSASantiago1 region Santiago - RegionSASantiago1 Region = "sa-santiago-1" - //RegionILJerusalem1 region Jerusalem - RegionILJerusalem1 Region = "il-jerusalem-1" - //RegionEUMarseille1 region Marseille - RegionEUMarseille1 Region = "eu-marseille-1" - //RegionAPSingapore1 region Singapore - RegionAPSingapore1 Region = "ap-singapore-1" - //RegionMEAbudhabi1 region Abudhabi - RegionMEAbudhabi1 Region = "me-abudhabi-1" - //RegionEUMilan1 region Milan - RegionEUMilan1 Region = "eu-milan-1" - //RegionEUStockholm1 region Stockholm - RegionEUStockholm1 Region = "eu-stockholm-1" - //RegionAFJohannesburg1 region Johannesburg - RegionAFJohannesburg1 Region = "af-johannesburg-1" - //RegionEUParis1 region Paris - RegionEUParis1 Region = "eu-paris-1" - //RegionMXQueretaro1 region Queretaro - RegionMXQueretaro1 Region = "mx-queretaro-1" - //RegionEUMadrid1 region Madrid - RegionEUMadrid1 Region = "eu-madrid-1" - //RegionUSChicago1 region Chicago - RegionUSChicago1 Region = "us-chicago-1" - //RegionMXMonterrey1 region Monterrey - RegionMXMonterrey1 Region = "mx-monterrey-1" - //RegionUSSaltlake2 region Saltlake - RegionUSSaltlake2 Region = "us-saltlake-2" - //RegionSABogota1 region Bogota - RegionSABogota1 Region = "sa-bogota-1" - //RegionSAValparaiso1 region Valparaiso - RegionSAValparaiso1 Region = "sa-valparaiso-1" - //RegionAPSingapore2 region Singapore - RegionAPSingapore2 Region = "ap-singapore-2" - //RegionMERiyadh1 region Riyadh - RegionMERiyadh1 Region = "me-riyadh-1" - //RegionAPDelhi1 region Delhi - RegionAPDelhi1 Region = "ap-delhi-1" - //RegionAPKulai1 region Kulai - RegionAPKulai1 Region = "ap-kulai-1" - //RegionAPBatam1 region Batam - RegionAPBatam1 Region = "ap-batam-1" - //RegionUSLangley1 region Langley - RegionUSLangley1 Region = "us-langley-1" - //RegionUSLuke1 region Luke - RegionUSLuke1 Region = "us-luke-1" - //RegionUSGovAshburn1 gov region Ashburn - RegionUSGovAshburn1 Region = "us-gov-ashburn-1" - //RegionUSGovChicago1 gov region Chicago - RegionUSGovChicago1 Region = "us-gov-chicago-1" - //RegionUSGovPhoenix1 gov region Phoenix - RegionUSGovPhoenix1 Region = "us-gov-phoenix-1" - //RegionUKGovLondon1 gov region London - RegionUKGovLondon1 Region = "uk-gov-london-1" - //RegionUKGovCardiff1 gov region Cardiff - RegionUKGovCardiff1 Region = "uk-gov-cardiff-1" - //RegionAPChiyoda1 region Chiyoda - RegionAPChiyoda1 Region = "ap-chiyoda-1" - //RegionAPIbaraki1 region Ibaraki - RegionAPIbaraki1 Region = "ap-ibaraki-1" - //RegionMEDccMuscat1 region Muscat - RegionMEDccMuscat1 Region = "me-dcc-muscat-1" - //RegionAPDccCanberra1 region Canberra - RegionAPDccCanberra1 Region = "ap-dcc-canberra-1" - //RegionEUDccMilan1 region Milan - RegionEUDccMilan1 Region = "eu-dcc-milan-1" - //RegionEUDccMilan2 region Milan - RegionEUDccMilan2 Region = "eu-dcc-milan-2" - //RegionEUDccDublin2 region Dublin - RegionEUDccDublin2 Region = "eu-dcc-dublin-2" - //RegionEUDccRating2 region Rating - RegionEUDccRating2 Region = "eu-dcc-rating-2" - //RegionEUDccRating1 region Rating - RegionEUDccRating1 Region = "eu-dcc-rating-1" - //RegionEUDccDublin1 region Dublin - RegionEUDccDublin1 Region = "eu-dcc-dublin-1" - //RegionAPDccGazipur1 region Gazipur - RegionAPDccGazipur1 Region = "ap-dcc-gazipur-1" - //RegionEUMadrid2 region Madrid - RegionEUMadrid2 Region = "eu-madrid-2" - //RegionEUFrankfurt2 region Frankfurt - RegionEUFrankfurt2 Region = "eu-frankfurt-2" - //RegionEUJovanovac1 region Jovanovac - RegionEUJovanovac1 Region = "eu-jovanovac-1" - //RegionMEDccDoha1 region Doha - RegionMEDccDoha1 Region = "me-dcc-doha-1" - //RegionUSSomerset1 region Somerset - RegionUSSomerset1 Region = "us-somerset-1" - //RegionUSThames1 region Thames - RegionUSThames1 Region = "us-thames-1" - //RegionEUDccZurich1 region Zurich - RegionEUDccZurich1 Region = "eu-dcc-zurich-1" - //RegionEUCrissier1 region Crissier - RegionEUCrissier1 Region = "eu-crissier-1" - //RegionMEAbudhabi3 region Abudhabi - RegionMEAbudhabi3 Region = "me-abudhabi-3" - //RegionMEAlain1 region Alain - RegionMEAlain1 Region = "me-alain-1" - //RegionMEAbudhabi2 region Abudhabi - RegionMEAbudhabi2 Region = "me-abudhabi-2" - //RegionMEAbudhabi4 region Abudhabi - RegionMEAbudhabi4 Region = "me-abudhabi-4" - //RegionAPSeoul2 region Seoul - RegionAPSeoul2 Region = "ap-seoul-2" - //RegionAPSuwon1 region Suwon - RegionAPSuwon1 Region = "ap-suwon-1" - //RegionAPChuncheon2 region Chuncheon - RegionAPChuncheon2 Region = "ap-chuncheon-2" - //RegionUSAshburn2 region Ashburn - RegionUSAshburn2 Region = "us-ashburn-2" + //RegionAPChuncheon1 region Chuncheon + RegionAPChuncheon1 Region = "ap-chuncheon-1" + //RegionAPHyderabad1 region Hyderabad + RegionAPHyderabad1 Region = "ap-hyderabad-1" + //RegionAPMelbourne1 region Melbourne + RegionAPMelbourne1 Region = "ap-melbourne-1" + //RegionAPMumbai1 region Mumbai + RegionAPMumbai1 Region = "ap-mumbai-1" + //RegionAPOsaka1 region Osaka + RegionAPOsaka1 Region = "ap-osaka-1" + //RegionAPSeoul1 region Seoul + RegionAPSeoul1 Region = "ap-seoul-1" + //RegionAPSydney1 region Sydney + RegionAPSydney1 Region = "ap-sydney-1" + //RegionAPTokyo1 region Tokyo + RegionAPTokyo1 Region = "ap-tokyo-1" + //RegionCAMontreal1 region Montreal + RegionCAMontreal1 Region = "ca-montreal-1" + //RegionCAToronto1 region Toronto + RegionCAToronto1 Region = "ca-toronto-1" + //RegionEUAmsterdam1 region Amsterdam + RegionEUAmsterdam1 Region = "eu-amsterdam-1" + //RegionFRA region Frankfurt + RegionFRA Region = "eu-frankfurt-1" + //RegionEUZurich1 region Zurich + RegionEUZurich1 Region = "eu-zurich-1" + //RegionMEJeddah1 region Jeddah + RegionMEJeddah1 Region = "me-jeddah-1" + //RegionMEDubai1 region Dubai + RegionMEDubai1 Region = "me-dubai-1" + //RegionSASaopaulo1 region Saopaulo + RegionSASaopaulo1 Region = "sa-saopaulo-1" + //RegionUKCardiff1 region Cardiff + RegionUKCardiff1 Region = "uk-cardiff-1" + //RegionLHR region London + RegionLHR Region = "uk-london-1" + //RegionIAD region Ashburn + RegionIAD Region = "us-ashburn-1" + //RegionPHX region Phoenix + RegionPHX Region = "us-phoenix-1" + //RegionSJC1 region Sanjose + RegionSJC1 Region = "us-sanjose-1" + //RegionSAVinhedo1 region Vinhedo + RegionSAVinhedo1 Region = "sa-vinhedo-1" + //RegionSASantiago1 region Santiago + RegionSASantiago1 Region = "sa-santiago-1" + //RegionILJerusalem1 region Jerusalem + RegionILJerusalem1 Region = "il-jerusalem-1" + //RegionEUMarseille1 region Marseille + RegionEUMarseille1 Region = "eu-marseille-1" + //RegionAPSingapore1 region Singapore + RegionAPSingapore1 Region = "ap-singapore-1" + //RegionMEAbudhabi1 region Abudhabi + RegionMEAbudhabi1 Region = "me-abudhabi-1" + //RegionEUMilan1 region Milan + RegionEUMilan1 Region = "eu-milan-1" + //RegionEUStockholm1 region Stockholm + RegionEUStockholm1 Region = "eu-stockholm-1" + //RegionAFJohannesburg1 region Johannesburg + RegionAFJohannesburg1 Region = "af-johannesburg-1" + //RegionEUParis1 region Paris + RegionEUParis1 Region = "eu-paris-1" + //RegionMXQueretaro1 region Queretaro + RegionMXQueretaro1 Region = "mx-queretaro-1" + //RegionEUMadrid1 region Madrid + RegionEUMadrid1 Region = "eu-madrid-1" + //RegionUSChicago1 region Chicago + RegionUSChicago1 Region = "us-chicago-1" + //RegionMXMonterrey1 region Monterrey + RegionMXMonterrey1 Region = "mx-monterrey-1" + //RegionUSSaltlake2 region Saltlake + RegionUSSaltlake2 Region = "us-saltlake-2" + //RegionSABogota1 region Bogota + RegionSABogota1 Region = "sa-bogota-1" + //RegionSAValparaiso1 region Valparaiso + RegionSAValparaiso1 Region = "sa-valparaiso-1" + //RegionAPSingapore2 region Singapore + RegionAPSingapore2 Region = "ap-singapore-2" + //RegionMERiyadh1 region Riyadh + RegionMERiyadh1 Region = "me-riyadh-1" + //RegionAPDelhi1 region Delhi + RegionAPDelhi1 Region = "ap-delhi-1" + //RegionAPBatam1 region Batam + RegionAPBatam1 Region = "ap-batam-1" + //RegionUSLangley1 region Langley + RegionUSLangley1 Region = "us-langley-1" + //RegionUSLuke1 region Luke + RegionUSLuke1 Region = "us-luke-1" + //RegionUSGovAshburn1 gov region Ashburn + RegionUSGovAshburn1 Region = "us-gov-ashburn-1" + //RegionUSGovChicago1 gov region Chicago + RegionUSGovChicago1 Region = "us-gov-chicago-1" + //RegionUSGovPhoenix1 gov region Phoenix + RegionUSGovPhoenix1 Region = "us-gov-phoenix-1" + //RegionUKGovLondon1 gov region London + RegionUKGovLondon1 Region = "uk-gov-london-1" + //RegionUKGovCardiff1 gov region Cardiff + RegionUKGovCardiff1 Region = "uk-gov-cardiff-1" + //RegionAPChiyoda1 region Chiyoda + RegionAPChiyoda1 Region = "ap-chiyoda-1" + //RegionAPIbaraki1 region Ibaraki + RegionAPIbaraki1 Region = "ap-ibaraki-1" + //RegionMEDccMuscat1 region Muscat + RegionMEDccMuscat1 Region = "me-dcc-muscat-1" + //RegionAPDccCanberra1 region Canberra + RegionAPDccCanberra1 Region = "ap-dcc-canberra-1" + //RegionEUDccMilan1 region Milan + RegionEUDccMilan1 Region = "eu-dcc-milan-1" + //RegionEUDccMilan2 region Milan + RegionEUDccMilan2 Region = "eu-dcc-milan-2" + //RegionEUDccDublin2 region Dublin + RegionEUDccDublin2 Region = "eu-dcc-dublin-2" + //RegionEUDccRating2 region Rating + RegionEUDccRating2 Region = "eu-dcc-rating-2" + //RegionEUDccRating1 region Rating + RegionEUDccRating1 Region = "eu-dcc-rating-1" + //RegionEUDccDublin1 region Dublin + RegionEUDccDublin1 Region = "eu-dcc-dublin-1" + //RegionAPDccGazipur1 region Gazipur + RegionAPDccGazipur1 Region = "ap-dcc-gazipur-1" + //RegionEUMadrid2 region Madrid + RegionEUMadrid2 Region = "eu-madrid-2" + //RegionEUFrankfurt2 region Frankfurt + RegionEUFrankfurt2 Region = "eu-frankfurt-2" + //RegionEUJovanovac1 region Jovanovac + RegionEUJovanovac1 Region = "eu-jovanovac-1" + //RegionMEDccDoha1 region Doha + RegionMEDccDoha1 Region = "me-dcc-doha-1" + //RegionUSSomerset1 region Somerset + RegionUSSomerset1 Region = "us-somerset-1" + //RegionUSThames1 region Thames + RegionUSThames1 Region = "us-thames-1" + //RegionEUDccZurich1 region Zurich + RegionEUDccZurich1 Region = "eu-dcc-zurich-1" + //RegionEUCrissier1 region Crissier + RegionEUCrissier1 Region = "eu-crissier-1" + //RegionMEAbudhabi3 region Abudhabi + RegionMEAbudhabi3 Region = "me-abudhabi-3" + //RegionMEAlain1 region Alain + RegionMEAlain1 Region = "me-alain-1" + //RegionMEAbudhabi2 region Abudhabi + RegionMEAbudhabi2 Region = "me-abudhabi-2" + //RegionMEAbudhabi4 region Abudhabi + RegionMEAbudhabi4 Region = "me-abudhabi-4" + //RegionAPSeoul2 region Seoul + RegionAPSeoul2 Region = "ap-seoul-2" + //RegionAPSuwon1 region Suwon + RegionAPSuwon1 Region = "ap-suwon-1" + //RegionAPChuncheon2 region Chuncheon + RegionAPChuncheon2 Region = "ap-chuncheon-2" + //RegionUSAshburn2 region Ashburn + RegionUSAshburn2 Region = "us-ashburn-2" ) var shortNameRegion = map[string]Region{ - "yny": RegionAPChuncheon1, - "hyd": RegionAPHyderabad1, - "mel": RegionAPMelbourne1, - "bom": RegionAPMumbai1, - "kix": RegionAPOsaka1, - "icn": RegionAPSeoul1, - "syd": RegionAPSydney1, - "nrt": RegionAPTokyo1, - "yul": RegionCAMontreal1, - "yyz": RegionCAToronto1, - "ams": RegionEUAmsterdam1, - "fra": RegionFRA, - "zrh": RegionEUZurich1, - "jed": RegionMEJeddah1, - "dxb": RegionMEDubai1, - "gru": RegionSASaopaulo1, - "cwl": RegionUKCardiff1, - "lhr": RegionLHR, - "iad": RegionIAD, - "phx": RegionPHX, - "sjc": RegionSJC1, - "vcp": RegionSAVinhedo1, - "scl": RegionSASantiago1, - "mtz": RegionILJerusalem1, - "mrs": RegionEUMarseille1, - "sin": RegionAPSingapore1, - "auh": RegionMEAbudhabi1, - "lin": RegionEUMilan1, - "arn": RegionEUStockholm1, - "jnb": RegionAFJohannesburg1, - "cdg": RegionEUParis1, - "qro": RegionMXQueretaro1, - "mad": RegionEUMadrid1, - "ord": RegionUSChicago1, - "mty": RegionMXMonterrey1, - "aga": RegionUSSaltlake2, - "bog": RegionSABogota1, - "vap": RegionSAValparaiso1, - "xsp": RegionAPSingapore2, - "ruh": RegionMERiyadh1, - "onm": RegionAPDelhi1, - "fyv": RegionAPKulai1, - "hsg": RegionAPBatam1, - "lfi": RegionUSLangley1, - "luf": RegionUSLuke1, - "ric": RegionUSGovAshburn1, - "pia": RegionUSGovChicago1, - "tus": RegionUSGovPhoenix1, - "ltn": RegionUKGovLondon1, - "brs": RegionUKGovCardiff1, - "nja": RegionAPChiyoda1, - "ukb": RegionAPIbaraki1, - "mct": RegionMEDccMuscat1, - "wga": RegionAPDccCanberra1, - "bgy": RegionEUDccMilan1, - "mxp": RegionEUDccMilan2, - "snn": RegionEUDccDublin2, - "dtm": RegionEUDccRating2, - "dus": RegionEUDccRating1, - "ork": RegionEUDccDublin1, - "dac": RegionAPDccGazipur1, - "vll": RegionEUMadrid2, - "str": RegionEUFrankfurt2, - "beg": RegionEUJovanovac1, - "doh": RegionMEDccDoha1, - "ebb": RegionUSSomerset1, - "ebl": RegionUSThames1, - "avz": RegionEUDccZurich1, - "avf": RegionEUCrissier1, - "ahu": RegionMEAbudhabi3, - "rba": RegionMEAlain1, - "rkt": RegionMEAbudhabi2, - "shj": RegionMEAbudhabi4, - "dtz": RegionAPSeoul2, - "dln": RegionAPSuwon1, - "bno": RegionAPChuncheon2, - "yxj": RegionUSAshburn2, + "yny": RegionAPChuncheon1, + "hyd": RegionAPHyderabad1, + "mel": RegionAPMelbourne1, + "bom": RegionAPMumbai1, + "kix": RegionAPOsaka1, + "icn": RegionAPSeoul1, + "syd": RegionAPSydney1, + "nrt": RegionAPTokyo1, + "yul": RegionCAMontreal1, + "yyz": RegionCAToronto1, + "ams": RegionEUAmsterdam1, + "fra": RegionFRA, + "zrh": RegionEUZurich1, + "jed": RegionMEJeddah1, + "dxb": RegionMEDubai1, + "gru": RegionSASaopaulo1, + "cwl": RegionUKCardiff1, + "lhr": RegionLHR, + "iad": RegionIAD, + "phx": RegionPHX, + "sjc": RegionSJC1, + "vcp": RegionSAVinhedo1, + "scl": RegionSASantiago1, + "mtz": RegionILJerusalem1, + "mrs": RegionEUMarseille1, + "sin": RegionAPSingapore1, + "auh": RegionMEAbudhabi1, + "lin": RegionEUMilan1, + "arn": RegionEUStockholm1, + "jnb": RegionAFJohannesburg1, + "cdg": RegionEUParis1, + "qro": RegionMXQueretaro1, + "mad": RegionEUMadrid1, + "ord": RegionUSChicago1, + "mty": RegionMXMonterrey1, + "aga": RegionUSSaltlake2, + "bog": RegionSABogota1, + "vap": RegionSAValparaiso1, + "xsp": RegionAPSingapore2, + "ruh": RegionMERiyadh1, + "onm": RegionAPDelhi1, + "hsg": RegionAPBatam1, + "lfi": RegionUSLangley1, + "luf": RegionUSLuke1, + "ric": RegionUSGovAshburn1, + "pia": RegionUSGovChicago1, + "tus": RegionUSGovPhoenix1, + "ltn": RegionUKGovLondon1, + "brs": RegionUKGovCardiff1, + "nja": RegionAPChiyoda1, + "ukb": RegionAPIbaraki1, + "mct": RegionMEDccMuscat1, + "wga": RegionAPDccCanberra1, + "bgy": RegionEUDccMilan1, + "mxp": RegionEUDccMilan2, + "snn": RegionEUDccDublin2, + "dtm": RegionEUDccRating2, + "dus": RegionEUDccRating1, + "ork": RegionEUDccDublin1, + "dac": RegionAPDccGazipur1, + "vll": RegionEUMadrid2, + "str": RegionEUFrankfurt2, + "beg": RegionEUJovanovac1, + "doh": RegionMEDccDoha1, + "ebb": RegionUSSomerset1, + "ebl": RegionUSThames1, + "avz": RegionEUDccZurich1, + "avf": RegionEUCrissier1, + "ahu": RegionMEAbudhabi3, + "rba": RegionMEAlain1, + "rkt": RegionMEAbudhabi2, + "shj": RegionMEAbudhabi4, + "dtz": RegionAPSeoul2, + "dln": RegionAPSuwon1, + "bno": RegionAPChuncheon2, + "yxj": RegionUSAshburn2, } var realm = map[string]string{ - "oc1": "oraclecloud.com", - "oc2": "oraclegovcloud.com", - "oc3": "oraclegovcloud.com", - "oc4": "oraclegovcloud.uk", - "oc8": "oraclecloud8.com", - "oc9": "oraclecloud9.com", - "oc10": "oraclecloud10.com", - "oc14": "oraclecloud14.com", - "oc15": "oraclecloud15.com", - "oc19": "oraclecloud.eu", - "oc20": "oraclecloud20.com", - "oc21": "oraclecloud21.com", - "oc23": "oraclecloud23.com", - "oc24": "oraclecloud24.com", - "oc26": "oraclecloud26.com", - "oc29": "oraclecloud29.com", - "oc35": "oraclecloud35.com", - "oc42": "oraclecloud42.com", + "oc1": "oraclecloud.com", + "oc2": "oraclegovcloud.com", + "oc3": "oraclegovcloud.com", + "oc4": "oraclegovcloud.uk", + "oc8": "oraclecloud8.com", + "oc9": "oraclecloud9.com", + "oc10": "oraclecloud10.com", + "oc14": "oraclecloud14.com", + "oc15": "oraclecloud15.com", + "oc19": "oraclecloud.eu", + "oc20": "oraclecloud20.com", + "oc21": "oraclecloud21.com", + "oc23": "oraclecloud23.com", + "oc24": "oraclecloud24.com", + "oc26": "oraclecloud26.com", + "oc29": "oraclecloud29.com", + "oc35": "oraclecloud35.com", + "oc42": "oraclecloud42.com", } var regionRealm = map[Region]string{ - RegionAPChuncheon1: "oc1", - RegionAPHyderabad1: "oc1", - RegionAPMelbourne1: "oc1", - RegionAPMumbai1: "oc1", - RegionAPOsaka1: "oc1", - RegionAPSeoul1: "oc1", - RegionAPSydney1: "oc1", - RegionAPTokyo1: "oc1", - RegionCAMontreal1: "oc1", - RegionCAToronto1: "oc1", - RegionEUAmsterdam1: "oc1", - RegionFRA: "oc1", - RegionEUZurich1: "oc1", - RegionMEJeddah1: "oc1", - RegionMEDubai1: "oc1", - RegionSASaopaulo1: "oc1", - RegionUKCardiff1: "oc1", - RegionLHR: "oc1", - RegionIAD: "oc1", - RegionPHX: "oc1", - RegionSJC1: "oc1", - RegionSAVinhedo1: "oc1", - RegionSASantiago1: "oc1", - RegionILJerusalem1: "oc1", - RegionEUMarseille1: "oc1", - RegionAPSingapore1: "oc1", - RegionMEAbudhabi1: "oc1", - RegionEUMilan1: "oc1", - RegionEUStockholm1: "oc1", - RegionAFJohannesburg1: "oc1", - RegionEUParis1: "oc1", - RegionMXQueretaro1: "oc1", - RegionEUMadrid1: "oc1", - RegionUSChicago1: "oc1", - RegionMXMonterrey1: "oc1", - RegionUSSaltlake2: "oc1", - RegionSABogota1: "oc1", - RegionSAValparaiso1: "oc1", - RegionAPSingapore2: "oc1", - RegionMERiyadh1: "oc1", - RegionAPDelhi1: "oc1", - RegionAPKulai1: "oc1", - RegionAPBatam1: "oc1", + RegionAPChuncheon1: "oc1", + RegionAPHyderabad1: "oc1", + RegionAPMelbourne1: "oc1", + RegionAPMumbai1: "oc1", + RegionAPOsaka1: "oc1", + RegionAPSeoul1: "oc1", + RegionAPSydney1: "oc1", + RegionAPTokyo1: "oc1", + RegionCAMontreal1: "oc1", + RegionCAToronto1: "oc1", + RegionEUAmsterdam1: "oc1", + RegionFRA: "oc1", + RegionEUZurich1: "oc1", + RegionMEJeddah1: "oc1", + RegionMEDubai1: "oc1", + RegionSASaopaulo1: "oc1", + RegionUKCardiff1: "oc1", + RegionLHR: "oc1", + RegionIAD: "oc1", + RegionPHX: "oc1", + RegionSJC1: "oc1", + RegionSAVinhedo1: "oc1", + RegionSASantiago1: "oc1", + RegionILJerusalem1: "oc1", + RegionEUMarseille1: "oc1", + RegionAPSingapore1: "oc1", + RegionMEAbudhabi1: "oc1", + RegionEUMilan1: "oc1", + RegionEUStockholm1: "oc1", + RegionAFJohannesburg1: "oc1", + RegionEUParis1: "oc1", + RegionMXQueretaro1: "oc1", + RegionEUMadrid1: "oc1", + RegionUSChicago1: "oc1", + RegionMXMonterrey1: "oc1", + RegionUSSaltlake2: "oc1", + RegionSABogota1: "oc1", + RegionSAValparaiso1: "oc1", + RegionAPSingapore2: "oc1", + RegionMERiyadh1: "oc1", + RegionAPDelhi1: "oc1", + RegionAPBatam1: "oc1", - RegionUSLangley1: "oc2", - RegionUSLuke1: "oc2", + RegionUSLangley1: "oc2", + RegionUSLuke1: "oc2", - RegionUSGovAshburn1: "oc3", - RegionUSGovChicago1: "oc3", - RegionUSGovPhoenix1: "oc3", + RegionUSGovAshburn1: "oc3", + RegionUSGovChicago1: "oc3", + RegionUSGovPhoenix1: "oc3", - RegionUKGovLondon1: "oc4", - RegionUKGovCardiff1: "oc4", + RegionUKGovLondon1: "oc4", + RegionUKGovCardiff1: "oc4", - RegionAPChiyoda1: "oc8", - RegionAPIbaraki1: "oc8", + RegionAPChiyoda1: "oc8", + RegionAPIbaraki1: "oc8", - RegionMEDccMuscat1: "oc9", + RegionMEDccMuscat1: "oc9", - RegionAPDccCanberra1: "oc10", + RegionAPDccCanberra1: "oc10", - RegionEUDccMilan1: "oc14", - RegionEUDccMilan2: "oc14", - RegionEUDccDublin2: "oc14", - RegionEUDccRating2: "oc14", - RegionEUDccRating1: "oc14", - RegionEUDccDublin1: "oc14", + RegionEUDccMilan1: "oc14", + RegionEUDccMilan2: "oc14", + RegionEUDccDublin2: "oc14", + RegionEUDccRating2: "oc14", + RegionEUDccRating1: "oc14", + RegionEUDccDublin1: "oc14", - RegionAPDccGazipur1: "oc15", + RegionAPDccGazipur1: "oc15", - RegionEUMadrid2: "oc19", - RegionEUFrankfurt2: "oc19", + RegionEUMadrid2: "oc19", + RegionEUFrankfurt2: "oc19", - RegionEUJovanovac1: "oc20", + RegionEUJovanovac1: "oc20", - RegionMEDccDoha1: "oc21", + RegionMEDccDoha1: "oc21", - RegionUSSomerset1: "oc23", - RegionUSThames1: "oc23", + RegionUSSomerset1: "oc23", + RegionUSThames1: "oc23", - RegionEUDccZurich1: "oc24", - RegionEUCrissier1: "oc24", + RegionEUDccZurich1: "oc24", + RegionEUCrissier1: "oc24", - RegionMEAbudhabi3: "oc26", - RegionMEAlain1: "oc26", + RegionMEAbudhabi3: "oc26", + RegionMEAlain1: "oc26", - RegionMEAbudhabi2: "oc29", - RegionMEAbudhabi4: "oc29", + RegionMEAbudhabi2: "oc29", + RegionMEAbudhabi4: "oc29", - RegionAPSeoul2: "oc35", - RegionAPSuwon1: "oc35", - RegionAPChuncheon2: "oc35", + RegionAPSeoul2: "oc35", + RegionAPSuwon1: "oc35", + RegionAPChuncheon2: "oc35", - RegionUSAshburn2: "oc42", + RegionUSAshburn2: "oc42", } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json index bc44c68a67f..bda9d547a73 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json +++ b/vendor/github.com/oracle/oci-go-sdk/v65/common/regions.json @@ -449,12 +449,6 @@ "regionIdentifier": "ap-delhi-1", "realmDomainComponent": "oraclecloud.com" }, - { - "regionKey": "fyv", - "realmKey": "oc1", - "regionIdentifier": "ap-kulai-1", - "realmDomainComponent": "oraclecloud.com" - }, { "regionKey": "hsg", "realmKey": "oc1", 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 87d8dcfc180..621d678aa81 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 @@ -12,8 +12,8 @@ import ( const ( major = "65" - minor = "96" - patch = "0" + minor = "97" + patch = "1" tag = "" ) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/activate_model_group_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/activate_model_group_request_response.go new file mode 100644 index 00000000000..2850b800ffa --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/activate_model_group_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ActivateModelGroupRequest wrapper for the ActivateModelGroup operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ActivateModelGroup.go.html to see an example of how to use ActivateModelGroupRequest. +type ActivateModelGroupRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // 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"` + + // 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 ActivateModelGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ActivateModelGroupRequest) 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 ActivateModelGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ActivateModelGroupRequest) 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 ActivateModelGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ActivateModelGroupResponse wrapper for the ActivateModelGroup operation +type ActivateModelGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroup instance + ModelGroup `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 ActivateModelGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ActivateModelGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_compartment_details.go new file mode 100644 index 00000000000..257f639d2e2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ChangeModelGroupCompartmentDetails Details for changing the compartment of a model group. +type ChangeModelGroupCompartmentDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeModelGroupCompartmentDetails) 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 ChangeModelGroupCompartmentDetails) 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_model_group_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_compartment_request_response.go new file mode 100644 index 00000000000..8aa4df98a71 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_compartment_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeModelGroupCompartmentRequest wrapper for the ChangeModelGroupCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ChangeModelGroupCompartment.go.html to see an example of how to use ChangeModelGroupCompartmentRequest. +type ChangeModelGroupCompartmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // Details for changing the compartment of a model group. + ChangeModelGroupCompartmentDetails `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 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"` + + // 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"` + + // 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 ChangeModelGroupCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeModelGroupCompartmentRequest) 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 ChangeModelGroupCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeModelGroupCompartmentRequest) 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 ChangeModelGroupCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeModelGroupCompartmentResponse wrapper for the ChangeModelGroupCompartment operation +type ChangeModelGroupCompartmentResponse 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"` +} + +func (response ChangeModelGroupCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeModelGroupCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_version_history_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_version_history_compartment_details.go new file mode 100644 index 00000000000..3930dfd17d9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_version_history_compartment_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ChangeModelGroupVersionHistoryCompartmentDetails Details for changing the compartment of a model group version history. +type ChangeModelGroupVersionHistoryCompartmentDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment where the resource should be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeModelGroupVersionHistoryCompartmentDetails) 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 ChangeModelGroupVersionHistoryCompartmentDetails) 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_model_group_version_history_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_version_history_compartment_request_response.go new file mode 100644 index 00000000000..f47d674591d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/change_model_group_version_history_compartment_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeModelGroupVersionHistoryCompartmentRequest wrapper for the ChangeModelGroupVersionHistoryCompartment operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ChangeModelGroupVersionHistoryCompartment.go.html to see an example of how to use ChangeModelGroupVersionHistoryCompartmentRequest. +type ChangeModelGroupVersionHistoryCompartmentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + ModelGroupVersionHistoryId *string `mandatory:"true" contributesTo:"path" name:"modelGroupVersionHistoryId"` + + // Details for changing the compartment of a Model Group Version History. + ChangeModelGroupVersionHistoryCompartmentDetails `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 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"` + + // 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"` + + // 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 ChangeModelGroupVersionHistoryCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeModelGroupVersionHistoryCompartmentRequest) 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 ChangeModelGroupVersionHistoryCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeModelGroupVersionHistoryCompartmentRequest) 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 ChangeModelGroupVersionHistoryCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeModelGroupVersionHistoryCompartmentResponse wrapper for the ChangeModelGroupVersionHistoryCompartment operation +type ChangeModelGroupVersionHistoryCompartmentResponse 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"` +} + +func (response ChangeModelGroupVersionHistoryCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeModelGroupVersionHistoryCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_create_from_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_create_from_model_group_details.go new file mode 100644 index 00000000000..46561db14f5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_create_from_model_group_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CloneCreateFromModelGroupDetails Parameters needed to cloning a model group from an existing model group. +type CloneCreateFromModelGroupDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group to be cloned. + SourceId *string `mandatory:"true" json:"sourceId"` + + ModifyModelGroupDetails *ModifyModelGroupDetails `mandatory:"false" json:"modifyModelGroupDetails"` + + PatchModelGroupMemberModelDetails *PatchModelGroupMemberModelDetails `mandatory:"false" json:"patchModelGroupMemberModelDetails"` +} + +func (m CloneCreateFromModelGroupDetails) 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 CloneCreateFromModelGroupDetails) 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 CloneCreateFromModelGroupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCloneCreateFromModelGroupDetails CloneCreateFromModelGroupDetails + s := struct { + DiscriminatorParam string `json:"modelGroupCloneSourceType"` + MarshalTypeCloneCreateFromModelGroupDetails + }{ + "MODEL_GROUP", + (MarshalTypeCloneCreateFromModelGroupDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_create_from_model_group_version_history_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_create_from_model_group_version_history_details.go new file mode 100644 index 00000000000..daba1a6eecc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_create_from_model_group_version_history_details.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CloneCreateFromModelGroupVersionHistoryDetails Parameters needed to cloning a model group from latest model group in model group version history. +type CloneCreateFromModelGroupVersionHistoryDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history. + SourceId *string `mandatory:"true" json:"sourceId"` + + ModifyModelGroupDetails *ModifyModelGroupDetails `mandatory:"false" json:"modifyModelGroupDetails"` + + PatchModelGroupMemberModelDetails *PatchModelGroupMemberModelDetails `mandatory:"false" json:"patchModelGroupMemberModelDetails"` +} + +func (m CloneCreateFromModelGroupVersionHistoryDetails) 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 CloneCreateFromModelGroupVersionHistoryDetails) 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 CloneCreateFromModelGroupVersionHistoryDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCloneCreateFromModelGroupVersionHistoryDetails CloneCreateFromModelGroupVersionHistoryDetails + s := struct { + DiscriminatorParam string `json:"modelGroupCloneSourceType"` + MarshalTypeCloneCreateFromModelGroupVersionHistoryDetails + }{ + "MODEL_GROUP_VERSION_HISTORY", + (MarshalTypeCloneCreateFromModelGroupVersionHistoryDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_model_group_details.go new file mode 100644 index 00000000000..8c551b8572d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/clone_model_group_details.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CloneModelGroupDetails Parameters needed to clone a model group. +type CloneModelGroupDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the modelGroup in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project to associate with the modelGroup. + ProjectId *string `mandatory:"true" json:"projectId"` + + ModelGroupCloneSourceDetails ModelGroupCloneSourceDetails `mandatory:"true" json:"modelGroupCloneSourceDetails"` +} + +// GetCompartmentId returns CompartmentId +func (m CloneModelGroupDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetProjectId returns ProjectId +func (m CloneModelGroupDetails) GetProjectId() *string { + return m.ProjectId +} + +func (m CloneModelGroupDetails) 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 CloneModelGroupDetails) 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 CloneModelGroupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCloneModelGroupDetails CloneModelGroupDetails + s := struct { + DiscriminatorParam string `json:"createType"` + MarshalTypeCloneModelGroupDetails + }{ + "CLONE", + (MarshalTypeCloneModelGroupDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *CloneModelGroupDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + CompartmentId *string `json:"compartmentId"` + ProjectId *string `json:"projectId"` + ModelGroupCloneSourceDetails modelgroupclonesourcedetails `json:"modelGroupCloneSourceDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.CompartmentId = model.CompartmentId + + m.ProjectId = model.ProjectId + + nn, e = model.ModelGroupCloneSourceDetails.UnmarshalPolymorphicJSON(model.ModelGroupCloneSourceDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ModelGroupCloneSourceDetails = nn.(ModelGroupCloneSourceDetails) + } else { + m.ModelGroupCloneSourceDetails = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_base_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_base_model_group_details.go new file mode 100644 index 00000000000..b8a22fcab46 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_base_model_group_details.go @@ -0,0 +1,101 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateBaseModelGroupDetails The base create model group details. +type CreateBaseModelGroupDetails interface { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the modelGroup in. + GetCompartmentId() *string + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project to associate with the modelGroup. + GetProjectId() *string +} + +type createbasemodelgroupdetails struct { + JsonData []byte + CompartmentId *string `mandatory:"true" json:"compartmentId"` + ProjectId *string `mandatory:"true" json:"projectId"` + CreateType string `json:"createType"` +} + +// UnmarshalJSON unmarshals json +func (m *createbasemodelgroupdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercreatebasemodelgroupdetails createbasemodelgroupdetails + s := struct { + Model Unmarshalercreatebasemodelgroupdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CompartmentId = s.Model.CompartmentId + m.ProjectId = s.Model.ProjectId + m.CreateType = s.Model.CreateType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *createbasemodelgroupdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.CreateType { + case "CLONE": + mm := CloneModelGroupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CREATE": + mm := CreateModelGroupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for CreateBaseModelGroupDetails: %s.", m.CreateType) + return *m, nil + } +} + +// GetCompartmentId returns CompartmentId +func (m createbasemodelgroupdetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetProjectId returns ProjectId +func (m createbasemodelgroupdetails) GetProjectId() *string { + return m.ProjectId +} + +func (m createbasemodelgroupdetails) 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 createbasemodelgroupdetails) 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/create_model_group_artifact_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_artifact_request_response.go new file mode 100644 index 00000000000..761d3312369 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_artifact_request_response.go @@ -0,0 +1,118 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// CreateModelGroupArtifactRequest wrapper for the CreateModelGroupArtifact operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelGroupArtifact.go.html to see an example of how to use CreateModelGroupArtifactRequest. +type CreateModelGroupArtifactRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // The content length of the body. + ContentLength *int64 `mandatory:"false" contributesTo:"header" name:"content-length"` + + // The model group artifact to upload. + ModelGroupArtifact io.ReadCloser `mandatory:"true" contributesTo:"body" encoding:"binary"` + + // 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"` + + // 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"` + + // This header allows you to specify a filename during upload. This file name is used to dispose of the file contents + // while downloading the file. If this optional field is not populated in the request, then the OCID of the model is used for the file + // name when downloading. + // Example: `{"Content-Disposition": "attachment" + // "filename"="model.tar.gz" + // "Content-Length": "2347" + // "Content-Type": "application/gzip"}` + ContentDisposition *string `mandatory:"false" contributesTo:"header" name:"content-disposition"` + + // 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 CreateModelGroupArtifactRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateModelGroupArtifactRequest) HTTPRequest(method, path string, binaryRequestBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (http.Request, error) { + httpRequest, err := common.MakeDefaultHTTPRequestWithTaggedStructAndExtraHeaders(method, path, request, extraHeaders) + if err == nil && binaryRequestBody.Seekable() { + common.UpdateRequestBinaryBody(&httpRequest, binaryRequestBody) + } + return httpRequest, err +} + +// BinaryRequestBody implements the OCIRequest interface +func (request CreateModelGroupArtifactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + rsc := common.NewOCIReadSeekCloser(request.ModelGroupArtifact) + if rsc.Seekable() { + return rsc, true + } + return nil, true + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateModelGroupArtifactRequest) 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 CreateModelGroupArtifactRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateModelGroupArtifactResponse wrapper for the CreateModelGroupArtifact operation +type CreateModelGroupArtifactResponse struct { + + // The underlying http response + RawResponse *http.Response + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 CreateModelGroupArtifactResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateModelGroupArtifactResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_details.go new file mode 100644 index 00000000000..b6cf9b46c0b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_details.go @@ -0,0 +1,143 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateModelGroupDetails Parameters needed to create a model group. Model Group is a group of models. +type CreateModelGroupDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the modelGroup in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project to associate with the modelGroup. + ProjectId *string `mandatory:"true" json:"projectId"` + + ModelGroupDetails ModelGroupDetails `mandatory:"true" json:"modelGroupDetails"` + + MemberModelEntries *MemberModelEntries `mandatory:"true" json:"memberModelEntries"` + + // A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. + // Example: `My ModelGroup` + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the modelGroup. + Description *string `mandatory:"false" json:"description"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. + ModelGroupVersionHistoryId *string `mandatory:"false" json:"modelGroupVersionHistoryId"` + + // An additional description of the lifecycle state of the model group. + VersionLabel *string `mandatory:"false" json:"versionLabel"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +// GetCompartmentId returns CompartmentId +func (m CreateModelGroupDetails) GetCompartmentId() *string { + return m.CompartmentId +} + +// GetProjectId returns ProjectId +func (m CreateModelGroupDetails) GetProjectId() *string { + return m.ProjectId +} + +func (m CreateModelGroupDetails) 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 CreateModelGroupDetails) 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 CreateModelGroupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCreateModelGroupDetails CreateModelGroupDetails + s := struct { + DiscriminatorParam string `json:"createType"` + MarshalTypeCreateModelGroupDetails + }{ + "CREATE", + (MarshalTypeCreateModelGroupDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *CreateModelGroupDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + ModelGroupVersionHistoryId *string `json:"modelGroupVersionHistoryId"` + VersionLabel *string `json:"versionLabel"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + CompartmentId *string `json:"compartmentId"` + ProjectId *string `json:"projectId"` + ModelGroupDetails modelgroupdetails `json:"modelGroupDetails"` + MemberModelEntries *MemberModelEntries `json:"memberModelEntries"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.ModelGroupVersionHistoryId = model.ModelGroupVersionHistoryId + + m.VersionLabel = model.VersionLabel + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.CompartmentId = model.CompartmentId + + m.ProjectId = model.ProjectId + + nn, e = model.ModelGroupDetails.UnmarshalPolymorphicJSON(model.ModelGroupDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ModelGroupDetails = nn.(ModelGroupDetails) + } else { + m.ModelGroupDetails = nil + } + + m.MemberModelEntries = model.MemberModelEntries + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_request_response.go new file mode 100644 index 00000000000..06c9207f3b0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateModelGroupRequest wrapper for the CreateModelGroup operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelGroup.go.html to see an example of how to use CreateModelGroupRequest. +type CreateModelGroupRequest struct { + + // Details for creating a new model group. + CreateBaseModelGroupDetails `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"` + + // 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 CreateModelGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateModelGroupRequest) 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 CreateModelGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateModelGroupRequest) 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 CreateModelGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateModelGroupResponse wrapper for the CreateModelGroup operation +type CreateModelGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroup instance + ModelGroup `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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.oracle.com/iaas/Content/API/Concepts/identifiers.htm) of the work request. Use GetWorkRequest (https://docs.oracle.com/iaas/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 CreateModelGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateModelGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_version_history_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_version_history_details.go new file mode 100644 index 00000000000..e59472a09c7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_version_history_details.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// CreateModelGroupVersionHistoryDetails Parameters that are required to create a new model group version history. +type CreateModelGroupVersionHistoryDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the model group version history in. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project to associate with the model group version history. + ProjectId *string `mandatory:"true" json:"projectId"` + + // A user-friendly name for the resource. It must be unique and can't be modified. Avoid entering confidential information. + // Example: `My model version history` + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the model version history. + Description *string `mandatory:"false" json:"description"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest version of the model group to be associated. + LatestModelGroupId *string `mandatory:"false" json:"latestModelGroupId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m CreateModelGroupVersionHistoryDetails) 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 CreateModelGroupVersionHistoryDetails) 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/create_model_group_version_history_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_version_history_request_response.go new file mode 100644 index 00000000000..30352b9867d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/create_model_group_version_history_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateModelGroupVersionHistoryRequest wrapper for the CreateModelGroupVersionHistory operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelGroupVersionHistory.go.html to see an example of how to use CreateModelGroupVersionHistoryRequest. +type CreateModelGroupVersionHistoryRequest struct { + + // Details for creating a new model group version History. + CreateModelGroupVersionHistoryDetails `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"` + + // 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 CreateModelGroupVersionHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateModelGroupVersionHistoryRequest) 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 CreateModelGroupVersionHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateModelGroupVersionHistoryRequest) 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 CreateModelGroupVersionHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateModelGroupVersionHistoryResponse wrapper for the CreateModelGroupVersionHistory operation +type CreateModelGroupVersionHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroupVersionHistory instance + ModelGroupVersionHistory `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 CreateModelGroupVersionHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateModelGroupVersionHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/custom_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/custom_metadata.go new file mode 100644 index 00000000000..82e85cffbfc --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/custom_metadata.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// CustomMetadata Array of custom metadata details of model group. +type CustomMetadata struct { + + // Key of the metadata. + Key *string `mandatory:"false" json:"key"` + + // Value of the metadata. + Value *string `mandatory:"false" json:"value"` + + // Description of model metadata. + Description *string `mandatory:"false" json:"description"` + + // Category of the metadata. + Category *string `mandatory:"false" json:"category"` +} + +func (m CustomMetadata) 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 CustomMetadata) 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/datascience_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/datascience_client.go index 76563f80daa..545708f3a9d 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 @@ -206,6 +206,64 @@ func (client DataScienceClient) activateModelDeployment(ctx context.Context, req return response, err } +// ActivateModelGroup Activates the model group. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ActivateModelGroup.go.html to see an example of how to use ActivateModelGroup API. +// A default retry strategy applies to this operation ActivateModelGroup() +func (client DataScienceClient) ActivateModelGroup(ctx context.Context, request ActivateModelGroupRequest) (response ActivateModelGroupResponse, 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.activateModelGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ActivateModelGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ActivateModelGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ActivateModelGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ActivateModelGroupResponse") + } + return +} + +// activateModelGroup implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) activateModelGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelGroups/{modelGroupId}/actions/activate", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ActivateModelGroupResponse + 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/ModelGroup/ActivateModelGroup" + err = common.PostProcessServiceError(err, "DataScience", "ActivateModelGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ActivateNotebookSession Activates the notebook session. // // # See also @@ -1057,6 +1115,132 @@ func (client DataScienceClient) changeModelDeploymentCompartment(ctx context.Con return response, err } +// ChangeModelGroupCompartment Moves a model group resource into a different compartment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ChangeModelGroupCompartment.go.html to see an example of how to use ChangeModelGroupCompartment API. +// A default retry strategy applies to this operation ChangeModelGroupCompartment() +func (client DataScienceClient) ChangeModelGroupCompartment(ctx context.Context, request ChangeModelGroupCompartmentRequest) (response ChangeModelGroupCompartmentResponse, 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.changeModelGroupCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeModelGroupCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeModelGroupCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeModelGroupCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeModelGroupCompartmentResponse") + } + return +} + +// changeModelGroupCompartment implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) changeModelGroupCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelGroups/{modelGroupId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeModelGroupCompartmentResponse + 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/ModelGroup/ChangeModelGroupCompartment" + err = common.PostProcessServiceError(err, "DataScience", "ChangeModelGroupCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ChangeModelGroupVersionHistoryCompartment Moves a model Group Version History resource into a different compartment. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ChangeModelGroupVersionHistoryCompartment.go.html to see an example of how to use ChangeModelGroupVersionHistoryCompartment API. +// A default retry strategy applies to this operation ChangeModelGroupVersionHistoryCompartment() +func (client DataScienceClient) ChangeModelGroupVersionHistoryCompartment(ctx context.Context, request ChangeModelGroupVersionHistoryCompartmentRequest) (response ChangeModelGroupVersionHistoryCompartmentResponse, 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.changeModelGroupVersionHistoryCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeModelGroupVersionHistoryCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeModelGroupVersionHistoryCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeModelGroupVersionHistoryCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeModelGroupVersionHistoryCompartmentResponse") + } + return +} + +// changeModelGroupVersionHistoryCompartment implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) changeModelGroupVersionHistoryCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelGroupVersionHistory/{modelGroupVersionHistoryId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeModelGroupVersionHistoryCompartmentResponse + 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/ModelGroupVersionHistory/ChangeModelGroupVersionHistoryCompartment" + err = common.PostProcessServiceError(err, "DataScience", "ChangeModelGroupVersionHistoryCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeModelVersionSetCompartment Moves a modelVersionSet resource into a different compartment. // // # See also @@ -2203,13 +2387,13 @@ func (client DataScienceClient) createModelDeployment(ctx context.Context, reque return response, err } -// CreateModelProvenance Creates provenance information for the specified model. +// CreateModelGroup Create a new Model Group resource. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelProvenance.go.html to see an example of how to use CreateModelProvenance API. -// A default retry strategy applies to this operation CreateModelProvenance() -func (client DataScienceClient) CreateModelProvenance(ctx context.Context, request CreateModelProvenanceRequest) (response CreateModelProvenanceResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelGroup.go.html to see an example of how to use CreateModelGroup API. +// A default retry strategy applies to this operation CreateModelGroup() +func (client DataScienceClient) CreateModelGroup(ctx context.Context, request CreateModelGroupRequest) (response CreateModelGroupResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2223,42 +2407,42 @@ func (client DataScienceClient) CreateModelProvenance(ctx context.Context, reque request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createModelProvenance, policy) + ociResponse, err = common.Retry(ctx, request, client.createModelGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateModelProvenanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateModelGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateModelProvenanceResponse{} + response = CreateModelGroupResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateModelProvenanceResponse); ok { + if convertedResponse, ok := ociResponse.(CreateModelGroupResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateModelProvenanceResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateModelGroupResponse") } return } -// createModelProvenance implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) createModelProvenance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createModelGroup implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createModelGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/models/{modelId}/provenance", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelGroups", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateModelProvenanceResponse + var response CreateModelGroupResponse 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/Model/CreateModelProvenance" - err = common.PostProcessServiceError(err, "DataScience", "CreateModelProvenance", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroup/CreateModelGroup" + err = common.PostProcessServiceError(err, "DataScience", "CreateModelGroup", apiReferenceLink) return response, err } @@ -2266,13 +2450,13 @@ func (client DataScienceClient) createModelProvenance(ctx context.Context, reque return response, err } -// CreateModelVersionSet Creates a new modelVersionSet. +// CreateModelGroupArtifact Creates artifact for the Model Group. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelVersionSet.go.html to see an example of how to use CreateModelVersionSet API. -// A default retry strategy applies to this operation CreateModelVersionSet() -func (client DataScienceClient) CreateModelVersionSet(ctx context.Context, request CreateModelVersionSetRequest) (response CreateModelVersionSetResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelGroupArtifact.go.html to see an example of how to use CreateModelGroupArtifact API. +// A default retry strategy applies to this operation CreateModelGroupArtifact() +func (client DataScienceClient) CreateModelGroupArtifact(ctx context.Context, request CreateModelGroupArtifactRequest) (response CreateModelGroupArtifactResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2286,42 +2470,52 @@ func (client DataScienceClient) CreateModelVersionSet(ctx context.Context, reque request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createModelVersionSet, policy) + ociResponse, err = common.Retry(ctx, request, client.createModelGroupArtifact, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateModelVersionSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateModelGroupArtifactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateModelVersionSetResponse{} + response = CreateModelGroupArtifactResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateModelVersionSetResponse); ok { + if convertedResponse, ok := ociResponse.(CreateModelGroupArtifactResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateModelVersionSetResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateModelGroupArtifactResponse") } return } -// createModelVersionSet implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) createModelVersionSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createModelGroupArtifact implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createModelGroupArtifact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelVersionSets", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelGroups/{modelGroupId}/artifact", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateModelVersionSetResponse + var response CreateModelGroupArtifactResponse var httpResponse *http.Response - httpResponse, err = client.Call(ctx, &httpRequest) + var customSigner common.HTTPRequestSigner + excludeBodySigningPredicate := func(r *http.Request) bool { return false } + customSigner, err = common.NewSignerFromOCIRequestSigner(client.Signer, excludeBodySigningPredicate) + + //if there was an error overriding the signer, then use the signer from the client itself + if err != nil { + customSigner = client.Signer + } + + //Execute the request with a custom signer + httpResponse, err = client.CallWithDetails(ctx, &httpRequest, common.ClientCallDetails{Signer: customSigner}) defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelVersionSet/CreateModelVersionSet" - err = common.PostProcessServiceError(err, "DataScience", "CreateModelVersionSet", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroup/CreateModelGroupArtifact" + err = common.PostProcessServiceError(err, "DataScience", "CreateModelGroupArtifact", apiReferenceLink) return response, err } @@ -2329,13 +2523,13 @@ func (client DataScienceClient) createModelVersionSet(ctx context.Context, reque return response, err } -// CreateNotebookSession Creates a new notebook session. +// CreateModelGroupVersionHistory Creates a new modelGroupVersionHistory. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateNotebookSession.go.html to see an example of how to use CreateNotebookSession API. -// A default retry strategy applies to this operation CreateNotebookSession() -func (client DataScienceClient) CreateNotebookSession(ctx context.Context, request CreateNotebookSessionRequest) (response CreateNotebookSessionResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelGroupVersionHistory.go.html to see an example of how to use CreateModelGroupVersionHistory API. +// A default retry strategy applies to this operation CreateModelGroupVersionHistory() +func (client DataScienceClient) CreateModelGroupVersionHistory(ctx context.Context, request CreateModelGroupVersionHistoryRequest) (response CreateModelGroupVersionHistoryResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2349,42 +2543,42 @@ func (client DataScienceClient) CreateNotebookSession(ctx context.Context, reque request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createNotebookSession, policy) + ociResponse, err = common.Retry(ctx, request, client.createModelGroupVersionHistory, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreateNotebookSessionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateModelGroupVersionHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreateNotebookSessionResponse{} + response = CreateModelGroupVersionHistoryResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreateNotebookSessionResponse); ok { + if convertedResponse, ok := ociResponse.(CreateModelGroupVersionHistoryResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreateNotebookSessionResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateModelGroupVersionHistoryResponse") } return } -// createNotebookSession implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) createNotebookSession(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createModelGroupVersionHistory implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createModelGroupVersionHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/notebookSessions", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelGroupVersionHistory", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreateNotebookSessionResponse + var response CreateModelGroupVersionHistoryResponse 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/NotebookSession/CreateNotebookSession" - err = common.PostProcessServiceError(err, "DataScience", "CreateNotebookSession", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroupVersionHistory/CreateModelGroupVersionHistory" + err = common.PostProcessServiceError(err, "DataScience", "CreateModelGroupVersionHistory", apiReferenceLink) return response, err } @@ -2392,13 +2586,13 @@ func (client DataScienceClient) createNotebookSession(ctx context.Context, reque return response, err } -// CreatePipeline Creates a new Pipeline. +// CreateModelProvenance Creates provenance information for the specified model. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreatePipeline.go.html to see an example of how to use CreatePipeline API. -// A default retry strategy applies to this operation CreatePipeline() -func (client DataScienceClient) CreatePipeline(ctx context.Context, request CreatePipelineRequest) (response CreatePipelineResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelProvenance.go.html to see an example of how to use CreateModelProvenance API. +// A default retry strategy applies to this operation CreateModelProvenance() +func (client DataScienceClient) CreateModelProvenance(ctx context.Context, request CreateModelProvenanceRequest) (response CreateModelProvenanceResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2412,42 +2606,42 @@ func (client DataScienceClient) CreatePipeline(ctx context.Context, request Crea request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createPipeline, policy) + ociResponse, err = common.Retry(ctx, request, client.createModelProvenance, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreatePipelineResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateModelProvenanceResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreatePipelineResponse{} + response = CreateModelProvenanceResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreatePipelineResponse); ok { + if convertedResponse, ok := ociResponse.(CreateModelProvenanceResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreatePipelineResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateModelProvenanceResponse") } return } -// createPipeline implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) createPipeline(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createModelProvenance implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createModelProvenance(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/pipelines", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/models/{modelId}/provenance", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreatePipelineResponse + var response CreateModelProvenanceResponse 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/Pipeline/CreatePipeline" - err = common.PostProcessServiceError(err, "DataScience", "CreatePipeline", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/Model/CreateModelProvenance" + err = common.PostProcessServiceError(err, "DataScience", "CreateModelProvenance", apiReferenceLink) return response, err } @@ -2455,13 +2649,13 @@ func (client DataScienceClient) createPipeline(ctx context.Context, request comm return response, err } -// CreatePipelineRun Creates a new PipelineRun. +// CreateModelVersionSet Creates a new modelVersionSet. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreatePipelineRun.go.html to see an example of how to use CreatePipelineRun API. -// A default retry strategy applies to this operation CreatePipelineRun() -func (client DataScienceClient) CreatePipelineRun(ctx context.Context, request CreatePipelineRunRequest) (response CreatePipelineRunResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateModelVersionSet.go.html to see an example of how to use CreateModelVersionSet API. +// A default retry strategy applies to this operation CreateModelVersionSet() +func (client DataScienceClient) CreateModelVersionSet(ctx context.Context, request CreateModelVersionSetRequest) (response CreateModelVersionSetResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -2475,42 +2669,231 @@ func (client DataScienceClient) CreatePipelineRun(ctx context.Context, request C request.OpcRetryToken = common.String(common.RetryToken()) } - ociResponse, err = common.Retry(ctx, request, client.createPipelineRun, policy) + ociResponse, err = common.Retry(ctx, request, client.createModelVersionSet, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = CreatePipelineRunResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = CreateModelVersionSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = CreatePipelineRunResponse{} + response = CreateModelVersionSetResponse{} } } return } - if convertedResponse, ok := ociResponse.(CreatePipelineRunResponse); ok { + if convertedResponse, ok := ociResponse.(CreateModelVersionSetResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into CreatePipelineRunResponse") + err = fmt.Errorf("failed to convert OCIResponse into CreateModelVersionSetResponse") } return } -// createPipelineRun implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) createPipelineRun(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// createModelVersionSet implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createModelVersionSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodPost, "/pipelineRuns", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelVersionSets", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response CreatePipelineRunResponse + var response CreateModelVersionSetResponse 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/PipelineRun/CreatePipelineRun" - err = common.PostProcessServiceError(err, "DataScience", "CreatePipelineRun", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelVersionSet/CreateModelVersionSet" + err = common.PostProcessServiceError(err, "DataScience", "CreateModelVersionSet", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreateNotebookSession Creates a new notebook session. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreateNotebookSession.go.html to see an example of how to use CreateNotebookSession API. +// A default retry strategy applies to this operation CreateNotebookSession() +func (client DataScienceClient) CreateNotebookSession(ctx context.Context, request CreateNotebookSessionRequest) (response CreateNotebookSessionResponse, 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.createNotebookSession, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateNotebookSessionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateNotebookSessionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateNotebookSessionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNotebookSessionResponse") + } + return +} + +// createNotebookSession implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createNotebookSession(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/notebookSessions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateNotebookSessionResponse + 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/NotebookSession/CreateNotebookSession" + err = common.PostProcessServiceError(err, "DataScience", "CreateNotebookSession", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreatePipeline Creates a new Pipeline. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreatePipeline.go.html to see an example of how to use CreatePipeline API. +// A default retry strategy applies to this operation CreatePipeline() +func (client DataScienceClient) CreatePipeline(ctx context.Context, request CreatePipelineRequest) (response CreatePipelineResponse, 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.createPipeline, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreatePipelineResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreatePipelineResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreatePipelineResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePipelineResponse") + } + return +} + +// createPipeline implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createPipeline(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/pipelines", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreatePipelineResponse + 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/Pipeline/CreatePipeline" + err = common.PostProcessServiceError(err, "DataScience", "CreatePipeline", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// CreatePipelineRun Creates a new PipelineRun. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/CreatePipelineRun.go.html to see an example of how to use CreatePipelineRun API. +// A default retry strategy applies to this operation CreatePipelineRun() +func (client DataScienceClient) CreatePipelineRun(ctx context.Context, request CreatePipelineRunRequest) (response CreatePipelineRunResponse, 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.createPipelineRun, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreatePipelineRunResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreatePipelineRunResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreatePipelineRunResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreatePipelineRunResponse") + } + return +} + +// createPipelineRun implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) createPipelineRun(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/pipelineRuns", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreatePipelineRunResponse + 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/PipelineRun/CreatePipelineRun" + err = common.PostProcessServiceError(err, "DataScience", "CreatePipelineRun", apiReferenceLink) return response, err } @@ -2831,6 +3214,64 @@ func (client DataScienceClient) deactivateModelDeployment(ctx context.Context, r return response, err } +// DeactivateModelGroup Deactivates the model group. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeactivateModelGroup.go.html to see an example of how to use DeactivateModelGroup API. +// A default retry strategy applies to this operation DeactivateModelGroup() +func (client DataScienceClient) DeactivateModelGroup(ctx context.Context, request DeactivateModelGroupRequest) (response DeactivateModelGroupResponse, 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.deactivateModelGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeactivateModelGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeactivateModelGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeactivateModelGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeactivateModelGroupResponse") + } + return +} + +// deactivateModelGroup implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) deactivateModelGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/modelGroups/{modelGroupId}/actions/deactivate", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeactivateModelGroupResponse + 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/ModelGroup/DeactivateModelGroup" + err = common.PostProcessServiceError(err, "DataScience", "DeactivateModelGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeactivateNotebookSession Deactivates the notebook session. // // # See also @@ -3530,57 +3971,56 @@ func (client DataScienceClient) deleteModelDeployment(ctx context.Context, reque return response, err } -// DeleteModelVersionSet Deletes the specified modelVersionSet. +// DeleteModelGroup Deletes the specified Model Group. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteModelVersionSet.go.html to see an example of how to use DeleteModelVersionSet API. -// A default retry strategy applies to this operation DeleteModelVersionSet() -func (client DataScienceClient) DeleteModelVersionSet(ctx context.Context, request DeleteModelVersionSetRequest) (response DeleteModelVersionSetResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteModelGroup.go.html to see an example of how to use DeleteModelGroup API. +func (client DataScienceClient) DeleteModelGroup(ctx context.Context, request DeleteModelGroupRequest) (response DeleteModelGroupResponse, err error) { var ociResponse common.OCIResponse - policy := common.DefaultRetryPolicy() + policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteModelVersionSet, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteModelGroup, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = DeleteModelVersionSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = DeleteModelGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = DeleteModelVersionSetResponse{} + response = DeleteModelGroupResponse{} } } return } - if convertedResponse, ok := ociResponse.(DeleteModelVersionSetResponse); ok { + if convertedResponse, ok := ociResponse.(DeleteModelGroupResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into DeleteModelVersionSetResponse") + err = fmt.Errorf("failed to convert OCIResponse into DeleteModelGroupResponse") } return } -// deleteModelVersionSet implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) deleteModelVersionSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// deleteModelGroup implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) deleteModelGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodDelete, "/modelVersionSets/{modelVersionSetId}", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/modelGroups/{modelGroupId}", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response DeleteModelVersionSetResponse + var response DeleteModelGroupResponse 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/ModelVersionSet/DeleteModelVersionSet" - err = common.PostProcessServiceError(err, "DataScience", "DeleteModelVersionSet", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroup/DeleteModelGroup" + err = common.PostProcessServiceError(err, "DataScience", "DeleteModelGroup", apiReferenceLink) return response, err } @@ -3588,22 +4028,137 @@ func (client DataScienceClient) deleteModelVersionSet(ctx context.Context, reque return response, err } -// DeleteNotebookSession Deletes the specified notebook session. Any unsaved work in this notebook session are lost. +// DeleteModelGroupVersionHistory Deletes the specified modelGroupVersionHistory. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteNotebookSession.go.html to see an example of how to use DeleteNotebookSession API. -// A default retry strategy applies to this operation DeleteNotebookSession() -func (client DataScienceClient) DeleteNotebookSession(ctx context.Context, request DeleteNotebookSessionRequest) (response DeleteNotebookSessionResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteModelGroupVersionHistory.go.html to see an example of how to use DeleteModelGroupVersionHistory API. +func (client DataScienceClient) DeleteModelGroupVersionHistory(ctx context.Context, request DeleteModelGroupVersionHistoryRequest) (response DeleteModelGroupVersionHistoryResponse, err error) { var ociResponse common.OCIResponse - policy := common.DefaultRetryPolicy() + policy := common.NoRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.deleteNotebookSession, policy) + ociResponse, err = common.Retry(ctx, request, client.deleteModelGroupVersionHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteModelGroupVersionHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteModelGroupVersionHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteModelGroupVersionHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteModelGroupVersionHistoryResponse") + } + return +} + +// deleteModelGroupVersionHistory implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) deleteModelGroupVersionHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/modelGroupVersionHistory/{modelGroupVersionHistoryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteModelGroupVersionHistoryResponse + 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/ModelGroupVersionHistory/DeleteModelGroupVersionHistory" + err = common.PostProcessServiceError(err, "DataScience", "DeleteModelGroupVersionHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteModelVersionSet Deletes the specified modelVersionSet. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteModelVersionSet.go.html to see an example of how to use DeleteModelVersionSet API. +// A default retry strategy applies to this operation DeleteModelVersionSet() +func (client DataScienceClient) DeleteModelVersionSet(ctx context.Context, request DeleteModelVersionSetRequest) (response DeleteModelVersionSetResponse, 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.deleteModelVersionSet, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteModelVersionSetResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteModelVersionSetResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteModelVersionSetResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteModelVersionSetResponse") + } + return +} + +// deleteModelVersionSet implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) deleteModelVersionSet(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/modelVersionSets/{modelVersionSetId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteModelVersionSetResponse + 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/ModelVersionSet/DeleteModelVersionSet" + err = common.PostProcessServiceError(err, "DataScience", "DeleteModelVersionSet", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// DeleteNotebookSession Deletes the specified notebook session. Any unsaved work in this notebook session are lost. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteNotebookSession.go.html to see an example of how to use DeleteNotebookSession API. +// A default retry strategy applies to this operation DeleteNotebookSession() +func (client DataScienceClient) DeleteNotebookSession(ctx context.Context, request DeleteNotebookSessionRequest) (response DeleteNotebookSessionResponse, 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.deleteNotebookSession, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { @@ -4986,6 +5541,179 @@ func (client DataScienceClient) getModelDeployment(ctx context.Context, request return response, err } +// GetModelGroup Retrieves the Model Group resource based on the specified modelGroup id. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetModelGroup.go.html to see an example of how to use GetModelGroup API. +// A default retry strategy applies to this operation GetModelGroup() +func (client DataScienceClient) GetModelGroup(ctx context.Context, request GetModelGroupRequest) (response GetModelGroupResponse, 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.getModelGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetModelGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetModelGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetModelGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetModelGroupResponse") + } + return +} + +// getModelGroup implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) getModelGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelGroups/{modelGroupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetModelGroupResponse + 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/ModelGroup/GetModelGroup" + err = common.PostProcessServiceError(err, "DataScience", "GetModelGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetModelGroupArtifactContent Downloads the model artifact for the specified model group. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetModelGroupArtifactContent.go.html to see an example of how to use GetModelGroupArtifactContent API. +// A default retry strategy applies to this operation GetModelGroupArtifactContent() +func (client DataScienceClient) GetModelGroupArtifactContent(ctx context.Context, request GetModelGroupArtifactContentRequest) (response GetModelGroupArtifactContentResponse, 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.getModelGroupArtifactContent, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetModelGroupArtifactContentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetModelGroupArtifactContentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetModelGroupArtifactContentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetModelGroupArtifactContentResponse") + } + return +} + +// getModelGroupArtifactContent implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) getModelGroupArtifactContent(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelGroups/{modelGroupId}/artifact/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetModelGroupArtifactContentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroup/GetModelGroupArtifactContent" + err = common.PostProcessServiceError(err, "DataScience", "GetModelGroupArtifactContent", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetModelGroupVersionHistory Gets the specified modelGroupVersionHistory's information. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetModelGroupVersionHistory.go.html to see an example of how to use GetModelGroupVersionHistory API. +// A default retry strategy applies to this operation GetModelGroupVersionHistory() +func (client DataScienceClient) GetModelGroupVersionHistory(ctx context.Context, request GetModelGroupVersionHistoryRequest) (response GetModelGroupVersionHistoryResponse, 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.getModelGroupVersionHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetModelGroupVersionHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetModelGroupVersionHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetModelGroupVersionHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetModelGroupVersionHistoryResponse") + } + return +} + +// getModelGroupVersionHistory implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) getModelGroupVersionHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelGroupVersionHistory/{modelGroupVersionHistoryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetModelGroupVersionHistoryResponse + 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/ModelGroupVersionHistory/GetModelGroupVersionHistory" + err = common.PostProcessServiceError(err, "DataScience", "GetModelGroupVersionHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetModelProvenance Gets provenance information for specified model. // // # See also @@ -5749,6 +6477,64 @@ func (client DataScienceClient) headModelDefinedMetadatumArtifact(ctx context.Co return response, err } +// HeadModelGroupArtifact Gets model group artifact metadata for a specified model group. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/HeadModelGroupArtifact.go.html to see an example of how to use HeadModelGroupArtifact API. +// A default retry strategy applies to this operation HeadModelGroupArtifact() +func (client DataScienceClient) HeadModelGroupArtifact(ctx context.Context, request HeadModelGroupArtifactRequest) (response HeadModelGroupArtifactResponse, 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.headModelGroupArtifact, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = HeadModelGroupArtifactResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = HeadModelGroupArtifactResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(HeadModelGroupArtifactResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into HeadModelGroupArtifactResponse") + } + return +} + +// headModelGroupArtifact implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) headModelGroupArtifact(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodHead, "/modelGroups/{modelGroupId}/artifact/content", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response HeadModelGroupArtifactResponse + 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/ModelGroup/HeadModelGroupArtifact" + err = common.PostProcessServiceError(err, "DataScience", "HeadModelGroupArtifact", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // HeadStepArtifact Get the artifact metadata for a step in the pipeline. // // # See also @@ -6184,27 +6970,259 @@ func (client DataScienceClient) ListJobs(ctx context.Context, request ListJobsRe if convertedResponse, ok := ociResponse.(ListJobsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListJobsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListJobsResponse") + } + return +} + +// listJobs implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listJobs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListJobsResponse + 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/JobSummary/ListJobs" + err = common.PostProcessServiceError(err, "DataScience", "ListJobs", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMlApplicationImplementationVersions Returns a list of MlApplicationImplementationVersions. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationImplementationVersions.go.html to see an example of how to use ListMlApplicationImplementationVersions API. +// A default retry strategy applies to this operation ListMlApplicationImplementationVersions() +func (client DataScienceClient) ListMlApplicationImplementationVersions(ctx context.Context, request ListMlApplicationImplementationVersionsRequest) (response ListMlApplicationImplementationVersionsResponse, 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.listMlApplicationImplementationVersions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMlApplicationImplementationVersionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMlApplicationImplementationVersionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMlApplicationImplementationVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationImplementationVersionsResponse") + } + return +} + +// listMlApplicationImplementationVersions implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listMlApplicationImplementationVersions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationImplementationVersions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMlApplicationImplementationVersionsResponse + 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/MlApplicationImplementationVersion/ListMlApplicationImplementationVersions" + err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationImplementationVersions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMlApplicationImplementations Returns a list of MlApplicationImplementations. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationImplementations.go.html to see an example of how to use ListMlApplicationImplementations API. +// A default retry strategy applies to this operation ListMlApplicationImplementations() +func (client DataScienceClient) ListMlApplicationImplementations(ctx context.Context, request ListMlApplicationImplementationsRequest) (response ListMlApplicationImplementationsResponse, 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.listMlApplicationImplementations, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMlApplicationImplementationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMlApplicationImplementationsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMlApplicationImplementationsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationImplementationsResponse") + } + return +} + +// listMlApplicationImplementations implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listMlApplicationImplementations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationImplementations", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMlApplicationImplementationsResponse + 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/MlApplicationImplementation/ListMlApplicationImplementations" + err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationImplementations", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMlApplicationInstanceViews Returns a list of MlApplicationInstanceViews. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationInstanceViews.go.html to see an example of how to use ListMlApplicationInstanceViews API. +// A default retry strategy applies to this operation ListMlApplicationInstanceViews() +func (client DataScienceClient) ListMlApplicationInstanceViews(ctx context.Context, request ListMlApplicationInstanceViewsRequest) (response ListMlApplicationInstanceViewsResponse, 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.listMlApplicationInstanceViews, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMlApplicationInstanceViewsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMlApplicationInstanceViewsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMlApplicationInstanceViewsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationInstanceViewsResponse") + } + return +} + +// listMlApplicationInstanceViews implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listMlApplicationInstanceViews(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationInstanceViews", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListMlApplicationInstanceViewsResponse + 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/MlApplicationInstanceView/ListMlApplicationInstanceViews" + err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationInstanceViews", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListMlApplicationInstances Returns a list of MlApplicationsInstances. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationInstances.go.html to see an example of how to use ListMlApplicationInstances API. +// A default retry strategy applies to this operation ListMlApplicationInstances() +func (client DataScienceClient) ListMlApplicationInstances(ctx context.Context, request ListMlApplicationInstancesRequest) (response ListMlApplicationInstancesResponse, 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.listMlApplicationInstances, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListMlApplicationInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListMlApplicationInstancesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListMlApplicationInstancesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationInstancesResponse") } return } -// listJobs implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listJobs(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMlApplicationInstances implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listMlApplicationInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/jobs", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationInstances", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListJobsResponse + var response ListMlApplicationInstancesResponse 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/JobSummary/ListJobs" - err = common.PostProcessServiceError(err, "DataScience", "ListJobs", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/MlApplicationInstance/ListMlApplicationInstances" + err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationInstances", apiReferenceLink) return response, err } @@ -6212,13 +7230,13 @@ func (client DataScienceClient) listJobs(ctx context.Context, request common.OCI return response, err } -// ListMlApplicationImplementationVersions Returns a list of MlApplicationImplementationVersions. +// ListMlApplications Returns a list of MlApplications. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationImplementationVersions.go.html to see an example of how to use ListMlApplicationImplementationVersions API. -// A default retry strategy applies to this operation ListMlApplicationImplementationVersions() -func (client DataScienceClient) ListMlApplicationImplementationVersions(ctx context.Context, request ListMlApplicationImplementationVersionsRequest) (response ListMlApplicationImplementationVersionsResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplications.go.html to see an example of how to use ListMlApplications API. +// A default retry strategy applies to this operation ListMlApplications() +func (client DataScienceClient) ListMlApplications(ctx context.Context, request ListMlApplicationsRequest) (response ListMlApplicationsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -6227,42 +7245,42 @@ func (client DataScienceClient) ListMlApplicationImplementationVersions(ctx cont if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMlApplicationImplementationVersions, policy) + ociResponse, err = common.Retry(ctx, request, client.listMlApplications, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMlApplicationImplementationVersionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListMlApplicationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMlApplicationImplementationVersionsResponse{} + response = ListMlApplicationsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMlApplicationImplementationVersionsResponse); ok { + if convertedResponse, ok := ociResponse.(ListMlApplicationsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationImplementationVersionsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationsResponse") } return } -// listMlApplicationImplementationVersions implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listMlApplicationImplementationVersions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listMlApplications implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listMlApplications(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationImplementationVersions", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplications", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMlApplicationImplementationVersionsResponse + var response ListMlApplicationsResponse 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/MlApplicationImplementationVersion/ListMlApplicationImplementationVersions" - err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationImplementationVersions", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/MlApplication/ListMlApplications" + err = common.PostProcessServiceError(err, "DataScience", "ListMlApplications", apiReferenceLink) return response, err } @@ -6270,13 +7288,13 @@ func (client DataScienceClient) listMlApplicationImplementationVersions(ctx cont return response, err } -// ListMlApplicationImplementations Returns a list of MlApplicationImplementations. +// ListModelDeploymentModelStates Lists the status of models in a model group deployment. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationImplementations.go.html to see an example of how to use ListMlApplicationImplementations API. -// A default retry strategy applies to this operation ListMlApplicationImplementations() -func (client DataScienceClient) ListMlApplicationImplementations(ctx context.Context, request ListMlApplicationImplementationsRequest) (response ListMlApplicationImplementationsResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelDeploymentModelStates.go.html to see an example of how to use ListModelDeploymentModelStates API. +// A default retry strategy applies to this operation ListModelDeploymentModelStates() +func (client DataScienceClient) ListModelDeploymentModelStates(ctx context.Context, request ListModelDeploymentModelStatesRequest) (response ListModelDeploymentModelStatesResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -6285,42 +7303,47 @@ func (client DataScienceClient) ListMlApplicationImplementations(ctx context.Con if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMlApplicationImplementations, policy) + + if !(request.OpcRetryToken != nil && *request.OpcRetryToken != "") { + request.OpcRetryToken = common.String(common.RetryToken()) + } + + ociResponse, err = common.Retry(ctx, request, client.listModelDeploymentModelStates, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMlApplicationImplementationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListModelDeploymentModelStatesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMlApplicationImplementationsResponse{} + response = ListModelDeploymentModelStatesResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMlApplicationImplementationsResponse); ok { + if convertedResponse, ok := ociResponse.(ListModelDeploymentModelStatesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationImplementationsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListModelDeploymentModelStatesResponse") } return } -// listMlApplicationImplementations implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listMlApplicationImplementations(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listModelDeploymentModelStates implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listModelDeploymentModelStates(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationImplementations", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelDeployments/{modelDeploymentId}/models/modelState", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMlApplicationImplementationsResponse + var response ListModelDeploymentModelStatesResponse 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/MlApplicationImplementation/ListMlApplicationImplementations" - err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationImplementations", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelDeploymentModelStateSummary/ListModelDeploymentModelStates" + err = common.PostProcessServiceError(err, "DataScience", "ListModelDeploymentModelStates", apiReferenceLink) return response, err } @@ -6328,13 +7351,13 @@ func (client DataScienceClient) listMlApplicationImplementations(ctx context.Con return response, err } -// ListMlApplicationInstanceViews Returns a list of MlApplicationInstanceViews. +// ListModelDeploymentShapes Lists the valid model deployment shapes. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationInstanceViews.go.html to see an example of how to use ListMlApplicationInstanceViews API. -// A default retry strategy applies to this operation ListMlApplicationInstanceViews() -func (client DataScienceClient) ListMlApplicationInstanceViews(ctx context.Context, request ListMlApplicationInstanceViewsRequest) (response ListMlApplicationInstanceViewsResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelDeploymentShapes.go.html to see an example of how to use ListModelDeploymentShapes API. +// A default retry strategy applies to this operation ListModelDeploymentShapes() +func (client DataScienceClient) ListModelDeploymentShapes(ctx context.Context, request ListModelDeploymentShapesRequest) (response ListModelDeploymentShapesResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -6343,42 +7366,42 @@ func (client DataScienceClient) ListMlApplicationInstanceViews(ctx context.Conte if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMlApplicationInstanceViews, policy) + ociResponse, err = common.Retry(ctx, request, client.listModelDeploymentShapes, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMlApplicationInstanceViewsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListModelDeploymentShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMlApplicationInstanceViewsResponse{} + response = ListModelDeploymentShapesResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMlApplicationInstanceViewsResponse); ok { + if convertedResponse, ok := ociResponse.(ListModelDeploymentShapesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationInstanceViewsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListModelDeploymentShapesResponse") } return } -// listMlApplicationInstanceViews implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listMlApplicationInstanceViews(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listModelDeploymentShapes implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listModelDeploymentShapes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationInstanceViews", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelDeploymentShapes", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMlApplicationInstanceViewsResponse + var response ListModelDeploymentShapesResponse 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/MlApplicationInstanceView/ListMlApplicationInstanceViews" - err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationInstanceViews", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelDeploymentShapeSummary/ListModelDeploymentShapes" + err = common.PostProcessServiceError(err, "DataScience", "ListModelDeploymentShapes", apiReferenceLink) return response, err } @@ -6386,13 +7409,13 @@ func (client DataScienceClient) listMlApplicationInstanceViews(ctx context.Conte return response, err } -// ListMlApplicationInstances Returns a list of MlApplicationsInstances. +// ListModelDeployments Lists all model deployments in the specified compartment. Only one parameter other than compartmentId may also be included in a query. The query must include compartmentId. If the query does not include compartmentId, or includes compartmentId but two or more other parameters an error is returned. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplicationInstances.go.html to see an example of how to use ListMlApplicationInstances API. -// A default retry strategy applies to this operation ListMlApplicationInstances() -func (client DataScienceClient) ListMlApplicationInstances(ctx context.Context, request ListMlApplicationInstancesRequest) (response ListMlApplicationInstancesResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelDeployments.go.html to see an example of how to use ListModelDeployments API. +// A default retry strategy applies to this operation ListModelDeployments() +func (client DataScienceClient) ListModelDeployments(ctx context.Context, request ListModelDeploymentsRequest) (response ListModelDeploymentsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -6401,42 +7424,42 @@ func (client DataScienceClient) ListMlApplicationInstances(ctx context.Context, if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMlApplicationInstances, policy) + ociResponse, err = common.Retry(ctx, request, client.listModelDeployments, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMlApplicationInstancesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListModelDeploymentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMlApplicationInstancesResponse{} + response = ListModelDeploymentsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMlApplicationInstancesResponse); ok { + if convertedResponse, ok := ociResponse.(ListModelDeploymentsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationInstancesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListModelDeploymentsResponse") } return } -// listMlApplicationInstances implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listMlApplicationInstances(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listModelDeployments implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listModelDeployments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplicationInstances", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelDeployments", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMlApplicationInstancesResponse + var response ListModelDeploymentsResponse 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/MlApplicationInstance/ListMlApplicationInstances" - err = common.PostProcessServiceError(err, "DataScience", "ListMlApplicationInstances", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelDeploymentSummary/ListModelDeployments" + err = common.PostProcessServiceError(err, "DataScience", "ListModelDeployments", apiReferenceLink) return response, err } @@ -6444,13 +7467,13 @@ func (client DataScienceClient) listMlApplicationInstances(ctx context.Context, return response, err } -// ListMlApplications Returns a list of MlApplications. +// ListModelGroupModels Lists all models associated with the modelGroup in the specified compartment. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListMlApplications.go.html to see an example of how to use ListMlApplications API. -// A default retry strategy applies to this operation ListMlApplications() -func (client DataScienceClient) ListMlApplications(ctx context.Context, request ListMlApplicationsRequest) (response ListMlApplicationsResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelGroupModels.go.html to see an example of how to use ListModelGroupModels API. +// A default retry strategy applies to this operation ListModelGroupModels() +func (client DataScienceClient) ListModelGroupModels(ctx context.Context, request ListModelGroupModelsRequest) (response ListModelGroupModelsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -6459,42 +7482,42 @@ func (client DataScienceClient) ListMlApplications(ctx context.Context, request if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listMlApplications, policy) + ociResponse, err = common.Retry(ctx, request, client.listModelGroupModels, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListMlApplicationsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListModelGroupModelsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListMlApplicationsResponse{} + response = ListModelGroupModelsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListMlApplicationsResponse); ok { + if convertedResponse, ok := ociResponse.(ListModelGroupModelsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListMlApplicationsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListModelGroupModelsResponse") } return } -// listMlApplications implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listMlApplications(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listModelGroupModels implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listModelGroupModels(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/mlApplications", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelGroups/{modelGroupId}/models", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListMlApplicationsResponse + var response ListModelGroupModelsResponse 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/MlApplication/ListMlApplications" - err = common.PostProcessServiceError(err, "DataScience", "ListMlApplications", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroup/ListModelGroupModels" + err = common.PostProcessServiceError(err, "DataScience", "ListModelGroupModels", apiReferenceLink) return response, err } @@ -6502,13 +7525,13 @@ func (client DataScienceClient) listMlApplications(ctx context.Context, request return response, err } -// ListModelDeploymentShapes Lists the valid model deployment shapes. +// ListModelGroupVersionHistories List all modelGroupVersionHistories in the specified compartment. The query must include compartmentId. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelDeploymentShapes.go.html to see an example of how to use ListModelDeploymentShapes API. -// A default retry strategy applies to this operation ListModelDeploymentShapes() -func (client DataScienceClient) ListModelDeploymentShapes(ctx context.Context, request ListModelDeploymentShapesRequest) (response ListModelDeploymentShapesResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelGroupVersionHistories.go.html to see an example of how to use ListModelGroupVersionHistories API. +// A default retry strategy applies to this operation ListModelGroupVersionHistories() +func (client DataScienceClient) ListModelGroupVersionHistories(ctx context.Context, request ListModelGroupVersionHistoriesRequest) (response ListModelGroupVersionHistoriesResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -6517,42 +7540,42 @@ func (client DataScienceClient) ListModelDeploymentShapes(ctx context.Context, r if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listModelDeploymentShapes, policy) + ociResponse, err = common.Retry(ctx, request, client.listModelGroupVersionHistories, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListModelDeploymentShapesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListModelGroupVersionHistoriesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListModelDeploymentShapesResponse{} + response = ListModelGroupVersionHistoriesResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListModelDeploymentShapesResponse); ok { + if convertedResponse, ok := ociResponse.(ListModelGroupVersionHistoriesResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListModelDeploymentShapesResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListModelGroupVersionHistoriesResponse") } return } -// listModelDeploymentShapes implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listModelDeploymentShapes(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listModelGroupVersionHistories implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listModelGroupVersionHistories(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelDeploymentShapes", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelGroupVersionHistory", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListModelDeploymentShapesResponse + var response ListModelGroupVersionHistoriesResponse 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/ModelDeploymentShapeSummary/ListModelDeploymentShapes" - err = common.PostProcessServiceError(err, "DataScience", "ListModelDeploymentShapes", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroupVersionHistorySummary/ListModelGroupVersionHistories" + err = common.PostProcessServiceError(err, "DataScience", "ListModelGroupVersionHistories", apiReferenceLink) return response, err } @@ -6560,13 +7583,13 @@ func (client DataScienceClient) listModelDeploymentShapes(ctx context.Context, r return response, err } -// ListModelDeployments Lists all model deployments in the specified compartment. Only one parameter other than compartmentId may also be included in a query. The query must include compartmentId. If the query does not include compartmentId, or includes compartmentId but two or more other parameters an error is returned. +// ListModelGroups Lists all the modelGroups in the specified compartment. The query must include compartmentId. // // # See also // -// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelDeployments.go.html to see an example of how to use ListModelDeployments API. -// A default retry strategy applies to this operation ListModelDeployments() -func (client DataScienceClient) ListModelDeployments(ctx context.Context, request ListModelDeploymentsRequest) (response ListModelDeploymentsResponse, err error) { +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelGroups.go.html to see an example of how to use ListModelGroups API. +// A default retry strategy applies to this operation ListModelGroups() +func (client DataScienceClient) ListModelGroups(ctx context.Context, request ListModelGroupsRequest) (response ListModelGroupsResponse, err error) { var ociResponse common.OCIResponse policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { @@ -6575,42 +7598,42 @@ func (client DataScienceClient) ListModelDeployments(ctx context.Context, reques if request.RetryPolicy() != nil { policy = *request.RetryPolicy() } - ociResponse, err = common.Retry(ctx, request, client.listModelDeployments, policy) + ociResponse, err = common.Retry(ctx, request, client.listModelGroups, policy) if err != nil { if ociResponse != nil { if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { opcRequestId := httpResponse.Header.Get("opc-request-id") - response = ListModelDeploymentsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + response = ListModelGroupsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} } else { - response = ListModelDeploymentsResponse{} + response = ListModelGroupsResponse{} } } return } - if convertedResponse, ok := ociResponse.(ListModelDeploymentsResponse); ok { + if convertedResponse, ok := ociResponse.(ListModelGroupsResponse); ok { response = convertedResponse } else { - err = fmt.Errorf("failed to convert OCIResponse into ListModelDeploymentsResponse") + err = fmt.Errorf("failed to convert OCIResponse into ListModelGroupsResponse") } return } -// listModelDeployments implements the OCIOperation interface (enables retrying operations) -func (client DataScienceClient) listModelDeployments(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { +// listModelGroups implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) listModelGroups(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { - httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelDeployments", binaryReqBody, extraHeaders) + httpRequest, err := request.HTTPRequest(http.MethodGet, "/modelGroups", binaryReqBody, extraHeaders) if err != nil { return nil, err } - var response ListModelDeploymentsResponse + var response ListModelGroupsResponse 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/ModelDeploymentSummary/ListModelDeployments" - err = common.PostProcessServiceError(err, "DataScience", "ListModelDeployments", apiReferenceLink) + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/data-science/20190101/ModelGroupSummary/ListModelGroups" + err = common.PostProcessServiceError(err, "DataScience", "ListModelGroups", apiReferenceLink) return response, err } @@ -8354,6 +9377,120 @@ func (client DataScienceClient) updateModelDeployment(ctx context.Context, reque return response, err } +// UpdateModelGroup Updates the properties of the Model Group. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/UpdateModelGroup.go.html to see an example of how to use UpdateModelGroup API. +func (client DataScienceClient) UpdateModelGroup(ctx context.Context, request UpdateModelGroupRequest) (response UpdateModelGroupResponse, 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.updateModelGroup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateModelGroupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateModelGroupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateModelGroupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateModelGroupResponse") + } + return +} + +// updateModelGroup implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) updateModelGroup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/modelGroups/{modelGroupId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateModelGroupResponse + 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/ModelGroup/UpdateModelGroup" + err = common.PostProcessServiceError(err, "DataScience", "UpdateModelGroup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// UpdateModelGroupVersionHistory Updates the properties of a modelGroupVersionHistory. +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/UpdateModelGroupVersionHistory.go.html to see an example of how to use UpdateModelGroupVersionHistory API. +func (client DataScienceClient) UpdateModelGroupVersionHistory(ctx context.Context, request UpdateModelGroupVersionHistoryRequest) (response UpdateModelGroupVersionHistoryResponse, 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.updateModelGroupVersionHistory, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateModelGroupVersionHistoryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateModelGroupVersionHistoryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateModelGroupVersionHistoryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateModelGroupVersionHistoryResponse") + } + return +} + +// updateModelGroupVersionHistory implements the OCIOperation interface (enables retrying operations) +func (client DataScienceClient) updateModelGroupVersionHistory(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/modelGroupVersionHistory/{modelGroupVersionHistoryId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateModelGroupVersionHistoryResponse + 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/ModelGroupVersionHistory/UpdateModelGroupVersionHistory" + err = common.PostProcessServiceError(err, "DataScience", "UpdateModelGroupVersionHistory", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateModelProvenance Updates the provenance information for the specified model. // // # See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/deactivate_model_group_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/deactivate_model_group_request_response.go new file mode 100644 index 00000000000..1ce8bdd0828 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/deactivate_model_group_request_response.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeactivateModelGroupRequest wrapper for the DeactivateModelGroup operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeactivateModelGroup.go.html to see an example of how to use DeactivateModelGroupRequest. +type DeactivateModelGroupRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // 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"` + + // 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 DeactivateModelGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeactivateModelGroupRequest) 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 DeactivateModelGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeactivateModelGroupRequest) 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 DeactivateModelGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeactivateModelGroupResponse wrapper for the DeactivateModelGroup operation +type DeactivateModelGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroup instance + ModelGroup `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 DeactivateModelGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeactivateModelGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_model_group_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_model_group_request_response.go new file mode 100644 index 00000000000..1173e80dda9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_model_group_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteModelGroupRequest wrapper for the DeleteModelGroup operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteModelGroup.go.html to see an example of how to use DeleteModelGroupRequest. +type DeleteModelGroupRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // 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 DeleteModelGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteModelGroupRequest) 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 DeleteModelGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteModelGroupRequest) 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 DeleteModelGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteModelGroupResponse wrapper for the DeleteModelGroup operation +type DeleteModelGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/API/Concepts/identifiers.htm) of the work request. Use GetWorkRequest (https://docs.oracle.com/iaas/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"` + + // 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 DeleteModelGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteModelGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_model_group_version_history_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_model_group_version_history_request_response.go new file mode 100644 index 00000000000..16bea8e96e8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/delete_model_group_version_history_request_response.go @@ -0,0 +1,98 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteModelGroupVersionHistoryRequest wrapper for the DeleteModelGroupVersionHistory operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/DeleteModelGroupVersionHistory.go.html to see an example of how to use DeleteModelGroupVersionHistoryRequest. +type DeleteModelGroupVersionHistoryRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + ModelGroupVersionHistoryId *string `mandatory:"true" contributesTo:"path" name:"modelGroupVersionHistoryId"` + + // 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 DeleteModelGroupVersionHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteModelGroupVersionHistoryRequest) 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 DeleteModelGroupVersionHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteModelGroupVersionHistoryRequest) 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 DeleteModelGroupVersionHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteModelGroupVersionHistoryResponse wrapper for the DeleteModelGroupVersionHistory operation +type DeleteModelGroupVersionHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID (https://docs.oracle.com/iaas/Content/API/Concepts/identifiers.htm) of the work request. Use GetWorkRequest (https://docs.oracle.com/iaas/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"` + + // 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 DeleteModelGroupVersionHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteModelGroupVersionHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_artifact_content_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_artifact_content_request_response.go new file mode 100644 index 00000000000..b6d6e618e5b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_artifact_content_request_response.go @@ -0,0 +1,114 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "io" + "net/http" + "strings" +) + +// GetModelGroupArtifactContentRequest wrapper for the GetModelGroupArtifactContent operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetModelGroupArtifactContent.go.html to see an example of how to use GetModelGroupArtifactContentRequest. +type GetModelGroupArtifactContentRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // 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"` + + // Optional byte range to fetch, as described in RFC 7233 (https://tools.ietf.org/html/rfc7232#section-2.1), section 2.1. + // Note that only a single range of bytes is supported. + Range *string `mandatory:"false" contributesTo:"header" name:"range"` + + // 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 GetModelGroupArtifactContentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetModelGroupArtifactContentRequest) 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 GetModelGroupArtifactContentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetModelGroupArtifactContentRequest) 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 GetModelGroupArtifactContentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetModelGroupArtifactContentResponse wrapper for the GetModelGroupArtifactContent operation +type GetModelGroupArtifactContentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The io.ReadCloser instance + Content io.ReadCloser `presentIn:"body" encoding:"binary"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 content size of the body in bytes. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // The content disposition of the body, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 19.5.1. + ContentDisposition *string `presentIn:"header" name:"content-disposition"` + + // The base-64 encoded MD5 hash of the body, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.15. + // Unavailable for objects uploaded using multipart upload. + // If the `content-md5` header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. + // If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message: + // "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)" + ContentMd5 *string `presentIn:"header" name:"content-md5"` + + // The artifact modification time, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` +} + +func (response GetModelGroupArtifactContentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetModelGroupArtifactContentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_request_response.go new file mode 100644 index 00000000000..ebebe4548f4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetModelGroupRequest wrapper for the GetModelGroup operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetModelGroup.go.html to see an example of how to use GetModelGroupRequest. +type GetModelGroupRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // 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 GetModelGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetModelGroupRequest) 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 GetModelGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetModelGroupRequest) 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 GetModelGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetModelGroupResponse wrapper for the GetModelGroup operation +type GetModelGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroup instance + ModelGroup `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 GetModelGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetModelGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_version_history_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_version_history_request_response.go new file mode 100644 index 00000000000..03c496664c0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/get_model_group_version_history_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetModelGroupVersionHistoryRequest wrapper for the GetModelGroupVersionHistory operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/GetModelGroupVersionHistory.go.html to see an example of how to use GetModelGroupVersionHistoryRequest. +type GetModelGroupVersionHistoryRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + ModelGroupVersionHistoryId *string `mandatory:"true" contributesTo:"path" name:"modelGroupVersionHistoryId"` + + // 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 GetModelGroupVersionHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetModelGroupVersionHistoryRequest) 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 GetModelGroupVersionHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetModelGroupVersionHistoryRequest) 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 GetModelGroupVersionHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetModelGroupVersionHistoryResponse wrapper for the GetModelGroupVersionHistory operation +type GetModelGroupVersionHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroupVersionHistory instance + ModelGroupVersionHistory `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 GetModelGroupVersionHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetModelGroupVersionHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/head_model_group_artifact_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/head_model_group_artifact_request_response.go new file mode 100644 index 00000000000..774388d9c24 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/head_model_group_artifact_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// HeadModelGroupArtifactRequest wrapper for the HeadModelGroupArtifact operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/HeadModelGroupArtifact.go.html to see an example of how to use HeadModelGroupArtifactRequest. +type HeadModelGroupArtifactRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // 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 HeadModelGroupArtifactRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request HeadModelGroupArtifactRequest) 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 HeadModelGroupArtifactRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request HeadModelGroupArtifactRequest) 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 HeadModelGroupArtifactRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// HeadModelGroupArtifactResponse wrapper for the HeadModelGroupArtifact operation +type HeadModelGroupArtifactResponse struct { + + // The underlying http response + RawResponse *http.Response + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 content size of the body in bytes. + ContentLength *int64 `presentIn:"header" name:"content-length"` + + // The content disposition of the body, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 19.5.1. + ContentDisposition *string `presentIn:"header" name:"content-disposition"` + + // The base-64 encoded MD5 hash of the body, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.15. + // Unavailable for objects uploaded using multipart upload. + // If the `content-md5` header is present, Object Storage performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. + // If the two hashes do not match, the object is rejected and an HTTP-400 Unmatched Content MD5 error is returned with the message: + // "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)" + ContentMd5 *string `presentIn:"header" name:"content-md5"` + + // The artifact modification time, as described in RFC 2616 (https://tools.ietf.org/rfc/rfc2616), section 14.29. + LastModified *common.SDKTime `presentIn:"header" name:"last-modified"` +} + +func (response HeadModelGroupArtifactResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response HeadModelGroupArtifactResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/heterogeneous_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/heterogeneous_model_group_details.go new file mode 100644 index 00000000000..f724fe96529 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/heterogeneous_model_group_details.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HeterogeneousModelGroupDetails Heterogeneous model group type. +type HeterogeneousModelGroupDetails struct { + + // An array of custom metadata details for the model group. + CustomMetadataList []CustomMetadata `mandatory:"false" json:"customMetadataList"` +} + +// GetCustomMetadataList returns CustomMetadataList +func (m HeterogeneousModelGroupDetails) GetCustomMetadataList() []CustomMetadata { + return m.CustomMetadataList +} + +func (m HeterogeneousModelGroupDetails) 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 HeterogeneousModelGroupDetails) 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 HeterogeneousModelGroupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeHeterogeneousModelGroupDetails HeterogeneousModelGroupDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeHeterogeneousModelGroupDetails + }{ + "HETEROGENEOUS", + (MarshalTypeHeterogeneousModelGroupDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/homogeneous_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/homogeneous_model_group_details.go new file mode 100644 index 00000000000..1605fc2f5fe --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/homogeneous_model_group_details.go @@ -0,0 +1,59 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// HomogeneousModelGroupDetails Homogeneous model group type. +type HomogeneousModelGroupDetails struct { + + // An array of custom metadata details for the model group. + CustomMetadataList []CustomMetadata `mandatory:"false" json:"customMetadataList"` +} + +// GetCustomMetadataList returns CustomMetadataList +func (m HomogeneousModelGroupDetails) GetCustomMetadataList() []CustomMetadata { + return m.CustomMetadataList +} + +func (m HomogeneousModelGroupDetails) 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 HomogeneousModelGroupDetails) 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 HomogeneousModelGroupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeHomogeneousModelGroupDetails HomogeneousModelGroupDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeHomogeneousModelGroupDetails + }{ + "HOMOGENEOUS", + (MarshalTypeHomogeneousModelGroupDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/infrastructure_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/infrastructure_configuration_details.go new file mode 100644 index 00000000000..39724fbc650 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/infrastructure_configuration_details.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InfrastructureConfigurationDetails The infrastructure configuration details. +type InfrastructureConfigurationDetails interface { +} + +type infrastructureconfigurationdetails struct { + JsonData []byte + InfrastructureType string `json:"infrastructureType"` +} + +// UnmarshalJSON unmarshals json +func (m *infrastructureconfigurationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerinfrastructureconfigurationdetails infrastructureconfigurationdetails + s := struct { + Model Unmarshalerinfrastructureconfigurationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.InfrastructureType = s.Model.InfrastructureType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *infrastructureconfigurationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.InfrastructureType { + case "INSTANCE_POOL": + mm := InstancePoolInfrastructureConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for InfrastructureConfigurationDetails: %s.", m.InfrastructureType) + return *m, nil + } +} + +func (m infrastructureconfigurationdetails) 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 infrastructureconfigurationdetails) 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/infrastructure_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/infrastructure_type.go new file mode 100644 index 00000000000..e1186f56c4c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/infrastructure_type.go @@ -0,0 +1,52 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// InfrastructureTypeEnum Enum with underlying type: string +type InfrastructureTypeEnum string + +// Set of constants representing the allowable values for InfrastructureTypeEnum +const ( + InfrastructureTypeInstancePool InfrastructureTypeEnum = "INSTANCE_POOL" +) + +var mappingInfrastructureTypeEnum = map[string]InfrastructureTypeEnum{ + "INSTANCE_POOL": InfrastructureTypeInstancePool, +} + +var mappingInfrastructureTypeEnumLowerCase = map[string]InfrastructureTypeEnum{ + "instance_pool": InfrastructureTypeInstancePool, +} + +// GetInfrastructureTypeEnumValues Enumerates the set of values for InfrastructureTypeEnum +func GetInfrastructureTypeEnumValues() []InfrastructureTypeEnum { + values := make([]InfrastructureTypeEnum, 0) + for _, v := range mappingInfrastructureTypeEnum { + values = append(values, v) + } + return values +} + +// GetInfrastructureTypeEnumStringValues Enumerates the set of values in String for InfrastructureTypeEnum +func GetInfrastructureTypeEnumStringValues() []string { + return []string{ + "INSTANCE_POOL", + } +} + +// GetMappingInfrastructureTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingInfrastructureTypeEnum(val string) (InfrastructureTypeEnum, bool) { + enum, ok := mappingInfrastructureTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/instance_configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/instance_configuration.go index 2a797ec85df..aa9e478eea3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/instance_configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/instance_configuration.go @@ -15,7 +15,7 @@ import ( "strings" ) -// InstanceConfiguration The model deployment instance configuration +// InstanceConfiguration The model deployment instance configuration. type InstanceConfiguration struct { // The shape used to launch the model deployment instances. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/instance_pool_infrastructure_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/instance_pool_infrastructure_configuration_details.go new file mode 100644 index 00000000000..35e2055833c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/instance_pool_infrastructure_configuration_details.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// InstancePoolInfrastructureConfigurationDetails Instance Pool based Infrastructure configuration details. +type InstancePoolInfrastructureConfigurationDetails struct { + InstanceConfiguration *InstanceConfiguration `mandatory:"true" json:"instanceConfiguration"` + + ScalingPolicy ScalingPolicy `mandatory:"false" json:"scalingPolicy"` + + // The minimum network bandwidth for the model deployment. + BandwidthMbps *int `mandatory:"false" json:"bandwidthMbps"` + + // The maximum network bandwidth for the model deployment. + MaximumBandwidthMbps *int `mandatory:"false" json:"maximumBandwidthMbps"` +} + +func (m InstancePoolInfrastructureConfigurationDetails) 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 InstancePoolInfrastructureConfigurationDetails) 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 InstancePoolInfrastructureConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeInstancePoolInfrastructureConfigurationDetails InstancePoolInfrastructureConfigurationDetails + s := struct { + DiscriminatorParam string `json:"infrastructureType"` + MarshalTypeInstancePoolInfrastructureConfigurationDetails + }{ + "INSTANCE_POOL", + (MarshalTypeInstancePoolInfrastructureConfigurationDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *InstancePoolInfrastructureConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + ScalingPolicy scalingpolicy `json:"scalingPolicy"` + BandwidthMbps *int `json:"bandwidthMbps"` + MaximumBandwidthMbps *int `json:"maximumBandwidthMbps"` + InstanceConfiguration *InstanceConfiguration `json:"instanceConfiguration"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.ScalingPolicy.UnmarshalPolymorphicJSON(model.ScalingPolicy.JsonData) + if e != nil { + return + } + if nn != nil { + m.ScalingPolicy = nn.(ScalingPolicy) + } else { + m.ScalingPolicy = nil + } + + m.BandwidthMbps = model.BandwidthMbps + + m.MaximumBandwidthMbps = model.MaximumBandwidthMbps + + m.InstanceConfiguration = model.InstanceConfiguration + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/job_shape_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/job_shape_config_details.go index a330eb1c5b2..104351c78a7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/job_shape_config_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/job_shape_config_details.go @@ -23,6 +23,13 @@ type JobShapeConfigDetails struct { // The total amount of memory available to the job run instance, in gigabytes. MemoryInGBs *float32 `mandatory:"false" json:"memoryInGBs"` + + // The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. + // The following values are supported: + // BASELINE_1_8 - baseline usage is 1/8 of an OCPU. + // BASELINE_1_2 - baseline usage is 1/2 of an OCPU. + // BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. + CpuBaseline JobShapeConfigDetailsCpuBaselineEnum `mandatory:"false" json:"cpuBaseline,omitempty"` } func (m JobShapeConfigDetails) String() string { @@ -35,8 +42,57 @@ func (m JobShapeConfigDetails) String() string { func (m JobShapeConfigDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingJobShapeConfigDetailsCpuBaselineEnum(string(m.CpuBaseline)); !ok && m.CpuBaseline != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CpuBaseline: %s. Supported values are: %s.", m.CpuBaseline, strings.Join(GetJobShapeConfigDetailsCpuBaselineEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } + +// JobShapeConfigDetailsCpuBaselineEnum Enum with underlying type: string +type JobShapeConfigDetailsCpuBaselineEnum string + +// Set of constants representing the allowable values for JobShapeConfigDetailsCpuBaselineEnum +const ( + JobShapeConfigDetailsCpuBaseline8 JobShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_8" + JobShapeConfigDetailsCpuBaseline2 JobShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_2" + JobShapeConfigDetailsCpuBaseline1 JobShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_1" +) + +var mappingJobShapeConfigDetailsCpuBaselineEnum = map[string]JobShapeConfigDetailsCpuBaselineEnum{ + "BASELINE_1_8": JobShapeConfigDetailsCpuBaseline8, + "BASELINE_1_2": JobShapeConfigDetailsCpuBaseline2, + "BASELINE_1_1": JobShapeConfigDetailsCpuBaseline1, +} + +var mappingJobShapeConfigDetailsCpuBaselineEnumLowerCase = map[string]JobShapeConfigDetailsCpuBaselineEnum{ + "baseline_1_8": JobShapeConfigDetailsCpuBaseline8, + "baseline_1_2": JobShapeConfigDetailsCpuBaseline2, + "baseline_1_1": JobShapeConfigDetailsCpuBaseline1, +} + +// GetJobShapeConfigDetailsCpuBaselineEnumValues Enumerates the set of values for JobShapeConfigDetailsCpuBaselineEnum +func GetJobShapeConfigDetailsCpuBaselineEnumValues() []JobShapeConfigDetailsCpuBaselineEnum { + values := make([]JobShapeConfigDetailsCpuBaselineEnum, 0) + for _, v := range mappingJobShapeConfigDetailsCpuBaselineEnum { + values = append(values, v) + } + return values +} + +// GetJobShapeConfigDetailsCpuBaselineEnumStringValues Enumerates the set of values in String for JobShapeConfigDetailsCpuBaselineEnum +func GetJobShapeConfigDetailsCpuBaselineEnumStringValues() []string { + return []string{ + "BASELINE_1_8", + "BASELINE_1_2", + "BASELINE_1_1", + } +} + +// GetMappingJobShapeConfigDetailsCpuBaselineEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingJobShapeConfigDetailsCpuBaselineEnum(val string) (JobShapeConfigDetailsCpuBaselineEnum, bool) { + enum, ok := mappingJobShapeConfigDetailsCpuBaselineEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_deployment_model_states_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_deployment_model_states_request_response.go new file mode 100644 index 00000000000..324341d67e6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_deployment_model_states_request_response.go @@ -0,0 +1,225 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListModelDeploymentModelStatesRequest wrapper for the ListModelDeploymentModelStates operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelDeploymentModelStates.go.html to see an example of how to use ListModelDeploymentModelStatesRequest. +type ListModelDeploymentModelStatesRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model deployment. + ModelDeploymentId *string `mandatory:"true" contributesTo:"path" name:"modelDeploymentId"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project. + ProjectId *string `mandatory:"false" contributesTo:"query" name:"projectId"` + + // Filter results by its user-friendly name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Filter results by the inference key. + InferenceKey *string `mandatory:"false" contributesTo:"query" name:"inferenceKey"` + + // Filter results by the model ocid. + ModelId *string `mandatory:"false" contributesTo:"query" name:"modelId"` + + // 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, 100 is the maximum. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Specifies sort order to use, either `ASC` (ascending) or `DESC` (descending). + SortOrder ListModelDeploymentModelStatesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Specifies the field to sort by. Accepts only one field. + // By default, when you sort by `timeCreated`, results are shown + // in descending order. When you sort by `displayName`, results are + // shown in ascending order. Sort order for the `displayName` field is case sensitive. + SortBy ListModelDeploymentModelStatesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // 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 ListModelDeploymentModelStatesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListModelDeploymentModelStatesRequest) 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 ListModelDeploymentModelStatesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListModelDeploymentModelStatesRequest) 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 ListModelDeploymentModelStatesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListModelDeploymentModelStatesSortOrderEnum(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(GetListModelDeploymentModelStatesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListModelDeploymentModelStatesSortByEnum(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(GetListModelDeploymentModelStatesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListModelDeploymentModelStatesResponse wrapper for the ListModelDeploymentModelStates operation +type ListModelDeploymentModelStatesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ModelDeploymentModelStateSummary instances + Items []ModelDeploymentModelStateSummary `presentIn:"body"` + + // Retrieves the next page of results. When this header appears in the response, additional pages of results remain. See List Pagination (https://docs.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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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 ListModelDeploymentModelStatesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListModelDeploymentModelStatesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListModelDeploymentModelStatesSortOrderEnum Enum with underlying type: string +type ListModelDeploymentModelStatesSortOrderEnum string + +// Set of constants representing the allowable values for ListModelDeploymentModelStatesSortOrderEnum +const ( + ListModelDeploymentModelStatesSortOrderAsc ListModelDeploymentModelStatesSortOrderEnum = "ASC" + ListModelDeploymentModelStatesSortOrderDesc ListModelDeploymentModelStatesSortOrderEnum = "DESC" +) + +var mappingListModelDeploymentModelStatesSortOrderEnum = map[string]ListModelDeploymentModelStatesSortOrderEnum{ + "ASC": ListModelDeploymentModelStatesSortOrderAsc, + "DESC": ListModelDeploymentModelStatesSortOrderDesc, +} + +var mappingListModelDeploymentModelStatesSortOrderEnumLowerCase = map[string]ListModelDeploymentModelStatesSortOrderEnum{ + "asc": ListModelDeploymentModelStatesSortOrderAsc, + "desc": ListModelDeploymentModelStatesSortOrderDesc, +} + +// GetListModelDeploymentModelStatesSortOrderEnumValues Enumerates the set of values for ListModelDeploymentModelStatesSortOrderEnum +func GetListModelDeploymentModelStatesSortOrderEnumValues() []ListModelDeploymentModelStatesSortOrderEnum { + values := make([]ListModelDeploymentModelStatesSortOrderEnum, 0) + for _, v := range mappingListModelDeploymentModelStatesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListModelDeploymentModelStatesSortOrderEnumStringValues Enumerates the set of values in String for ListModelDeploymentModelStatesSortOrderEnum +func GetListModelDeploymentModelStatesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListModelDeploymentModelStatesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelDeploymentModelStatesSortOrderEnum(val string) (ListModelDeploymentModelStatesSortOrderEnum, bool) { + enum, ok := mappingListModelDeploymentModelStatesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModelDeploymentModelStatesSortByEnum Enum with underlying type: string +type ListModelDeploymentModelStatesSortByEnum string + +// Set of constants representing the allowable values for ListModelDeploymentModelStatesSortByEnum +const ( + ListModelDeploymentModelStatesSortByTimecreated ListModelDeploymentModelStatesSortByEnum = "timeCreated" + ListModelDeploymentModelStatesSortByDisplayname ListModelDeploymentModelStatesSortByEnum = "displayName" +) + +var mappingListModelDeploymentModelStatesSortByEnum = map[string]ListModelDeploymentModelStatesSortByEnum{ + "timeCreated": ListModelDeploymentModelStatesSortByTimecreated, + "displayName": ListModelDeploymentModelStatesSortByDisplayname, +} + +var mappingListModelDeploymentModelStatesSortByEnumLowerCase = map[string]ListModelDeploymentModelStatesSortByEnum{ + "timecreated": ListModelDeploymentModelStatesSortByTimecreated, + "displayname": ListModelDeploymentModelStatesSortByDisplayname, +} + +// GetListModelDeploymentModelStatesSortByEnumValues Enumerates the set of values for ListModelDeploymentModelStatesSortByEnum +func GetListModelDeploymentModelStatesSortByEnumValues() []ListModelDeploymentModelStatesSortByEnum { + values := make([]ListModelDeploymentModelStatesSortByEnum, 0) + for _, v := range mappingListModelDeploymentModelStatesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListModelDeploymentModelStatesSortByEnumStringValues Enumerates the set of values in String for ListModelDeploymentModelStatesSortByEnum +func GetListModelDeploymentModelStatesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + } +} + +// GetMappingListModelDeploymentModelStatesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelDeploymentModelStatesSortByEnum(val string) (ListModelDeploymentModelStatesSortByEnum, bool) { + enum, ok := mappingListModelDeploymentModelStatesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_group_models_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_group_models_request_response.go new file mode 100644 index 00000000000..e4270e948a6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_group_models_request_response.go @@ -0,0 +1,279 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListModelGroupModelsRequest wrapper for the ListModelGroupModels operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelGroupModels.go.html to see an example of how to use ListModelGroupModelsRequest. +type ListModelGroupModelsRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Filter results by OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // Filter results by its user-friendly name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // Filter results by the specified lifecycle state. Must be a valid + // state for the resource type. + LifecycleState ListModelGroupModelsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the resource. + CreatedBy *string `mandatory:"false" contributesTo:"query" name:"createdBy"` + + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 100 is the maximum. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Specifies sort order to use, either `ASC` (ascending) or `DESC` (descending). + SortOrder ListModelGroupModelsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Specifies the field to sort by. Accepts only one field. + // By default, when you sort by `timeCreated`, the results are shown + // in descending order. All other fields default to ascending order. Sort order for the `displayName` field is case sensitive. + SortBy ListModelGroupModelsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, 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 ListModelGroupModelsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListModelGroupModelsRequest) 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 ListModelGroupModelsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListModelGroupModelsRequest) 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 ListModelGroupModelsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListModelGroupModelsLifecycleStateEnum(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(GetListModelGroupModelsLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListModelGroupModelsSortOrderEnum(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(GetListModelGroupModelsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListModelGroupModelsSortByEnum(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(GetListModelGroupModelsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListModelGroupModelsResponse wrapper for the ListModelGroupModels operation +type ListModelGroupModelsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ModelGroupModelSummary instances + Items []ModelGroupModelSummary `presentIn:"body"` + + // Retrieves the next page of results. When this header appears in the response, additional pages of results remain. See List Pagination (https://docs.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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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 ListModelGroupModelsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListModelGroupModelsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListModelGroupModelsLifecycleStateEnum Enum with underlying type: string +type ListModelGroupModelsLifecycleStateEnum string + +// Set of constants representing the allowable values for ListModelGroupModelsLifecycleStateEnum +const ( + ListModelGroupModelsLifecycleStateActive ListModelGroupModelsLifecycleStateEnum = "ACTIVE" + ListModelGroupModelsLifecycleStateDeleted ListModelGroupModelsLifecycleStateEnum = "DELETED" + ListModelGroupModelsLifecycleStateFailed ListModelGroupModelsLifecycleStateEnum = "FAILED" + ListModelGroupModelsLifecycleStateInactive ListModelGroupModelsLifecycleStateEnum = "INACTIVE" +) + +var mappingListModelGroupModelsLifecycleStateEnum = map[string]ListModelGroupModelsLifecycleStateEnum{ + "ACTIVE": ListModelGroupModelsLifecycleStateActive, + "DELETED": ListModelGroupModelsLifecycleStateDeleted, + "FAILED": ListModelGroupModelsLifecycleStateFailed, + "INACTIVE": ListModelGroupModelsLifecycleStateInactive, +} + +var mappingListModelGroupModelsLifecycleStateEnumLowerCase = map[string]ListModelGroupModelsLifecycleStateEnum{ + "active": ListModelGroupModelsLifecycleStateActive, + "deleted": ListModelGroupModelsLifecycleStateDeleted, + "failed": ListModelGroupModelsLifecycleStateFailed, + "inactive": ListModelGroupModelsLifecycleStateInactive, +} + +// GetListModelGroupModelsLifecycleStateEnumValues Enumerates the set of values for ListModelGroupModelsLifecycleStateEnum +func GetListModelGroupModelsLifecycleStateEnumValues() []ListModelGroupModelsLifecycleStateEnum { + values := make([]ListModelGroupModelsLifecycleStateEnum, 0) + for _, v := range mappingListModelGroupModelsLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupModelsLifecycleStateEnumStringValues Enumerates the set of values in String for ListModelGroupModelsLifecycleStateEnum +func GetListModelGroupModelsLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "DELETED", + "FAILED", + "INACTIVE", + } +} + +// GetMappingListModelGroupModelsLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupModelsLifecycleStateEnum(val string) (ListModelGroupModelsLifecycleStateEnum, bool) { + enum, ok := mappingListModelGroupModelsLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModelGroupModelsSortOrderEnum Enum with underlying type: string +type ListModelGroupModelsSortOrderEnum string + +// Set of constants representing the allowable values for ListModelGroupModelsSortOrderEnum +const ( + ListModelGroupModelsSortOrderAsc ListModelGroupModelsSortOrderEnum = "ASC" + ListModelGroupModelsSortOrderDesc ListModelGroupModelsSortOrderEnum = "DESC" +) + +var mappingListModelGroupModelsSortOrderEnum = map[string]ListModelGroupModelsSortOrderEnum{ + "ASC": ListModelGroupModelsSortOrderAsc, + "DESC": ListModelGroupModelsSortOrderDesc, +} + +var mappingListModelGroupModelsSortOrderEnumLowerCase = map[string]ListModelGroupModelsSortOrderEnum{ + "asc": ListModelGroupModelsSortOrderAsc, + "desc": ListModelGroupModelsSortOrderDesc, +} + +// GetListModelGroupModelsSortOrderEnumValues Enumerates the set of values for ListModelGroupModelsSortOrderEnum +func GetListModelGroupModelsSortOrderEnumValues() []ListModelGroupModelsSortOrderEnum { + values := make([]ListModelGroupModelsSortOrderEnum, 0) + for _, v := range mappingListModelGroupModelsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupModelsSortOrderEnumStringValues Enumerates the set of values in String for ListModelGroupModelsSortOrderEnum +func GetListModelGroupModelsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListModelGroupModelsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupModelsSortOrderEnum(val string) (ListModelGroupModelsSortOrderEnum, bool) { + enum, ok := mappingListModelGroupModelsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModelGroupModelsSortByEnum Enum with underlying type: string +type ListModelGroupModelsSortByEnum string + +// Set of constants representing the allowable values for ListModelGroupModelsSortByEnum +const ( + ListModelGroupModelsSortByTimecreated ListModelGroupModelsSortByEnum = "timeCreated" + ListModelGroupModelsSortByDisplayname ListModelGroupModelsSortByEnum = "displayName" + ListModelGroupModelsSortByLifecyclestate ListModelGroupModelsSortByEnum = "lifecycleState" +) + +var mappingListModelGroupModelsSortByEnum = map[string]ListModelGroupModelsSortByEnum{ + "timeCreated": ListModelGroupModelsSortByTimecreated, + "displayName": ListModelGroupModelsSortByDisplayname, + "lifecycleState": ListModelGroupModelsSortByLifecyclestate, +} + +var mappingListModelGroupModelsSortByEnumLowerCase = map[string]ListModelGroupModelsSortByEnum{ + "timecreated": ListModelGroupModelsSortByTimecreated, + "displayname": ListModelGroupModelsSortByDisplayname, + "lifecyclestate": ListModelGroupModelsSortByLifecyclestate, +} + +// GetListModelGroupModelsSortByEnumValues Enumerates the set of values for ListModelGroupModelsSortByEnum +func GetListModelGroupModelsSortByEnumValues() []ListModelGroupModelsSortByEnum { + values := make([]ListModelGroupModelsSortByEnum, 0) + for _, v := range mappingListModelGroupModelsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupModelsSortByEnumStringValues Enumerates the set of values in String for ListModelGroupModelsSortByEnum +func GetListModelGroupModelsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + "lifecycleState", + } +} + +// GetMappingListModelGroupModelsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupModelsSortByEnum(val string) (ListModelGroupModelsSortByEnum, bool) { + enum, ok := mappingListModelGroupModelsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_group_version_histories_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_group_version_histories_request_response.go new file mode 100644 index 00000000000..6087c044f20 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_group_version_histories_request_response.go @@ -0,0 +1,278 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListModelGroupVersionHistoriesRequest wrapper for the ListModelGroupVersionHistories operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelGroupVersionHistories.go.html to see an example of how to use ListModelGroupVersionHistoriesRequest. +type ListModelGroupVersionHistoriesRequest struct { + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project. + ProjectId *string `mandatory:"false" contributesTo:"query" name:"projectId"` + + // Filter results by OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // Filter results by its user-friendly name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return resources matching the given lifecycleState. + LifecycleState ListModelGroupVersionHistoriesLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the resource. + CreatedBy *string `mandatory:"false" contributesTo:"query" name:"createdBy"` + + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 100 is the maximum. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Specifies sort order to use, either `ASC` (ascending) or `DESC` (descending). + SortOrder ListModelGroupVersionHistoriesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Specifies the field to sort by. Accepts only one field. + // By default, when you sort by `timeCreated`, the results are shown + // in descending order. All other fields default to ascending order. Sort order for the `displayName` field is case sensitive. + SortBy ListModelGroupVersionHistoriesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, 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 ListModelGroupVersionHistoriesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListModelGroupVersionHistoriesRequest) 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 ListModelGroupVersionHistoriesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListModelGroupVersionHistoriesRequest) 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 ListModelGroupVersionHistoriesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListModelGroupVersionHistoriesLifecycleStateEnum(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(GetListModelGroupVersionHistoriesLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListModelGroupVersionHistoriesSortOrderEnum(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(GetListModelGroupVersionHistoriesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListModelGroupVersionHistoriesSortByEnum(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(GetListModelGroupVersionHistoriesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListModelGroupVersionHistoriesResponse wrapper for the ListModelGroupVersionHistories operation +type ListModelGroupVersionHistoriesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ModelGroupVersionHistorySummary instances + Items []ModelGroupVersionHistorySummary `presentIn:"body"` + + // Retrieves the next page of results. When this header appears in the response, additional pages of results remain. See List Pagination (https://docs.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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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 ListModelGroupVersionHistoriesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListModelGroupVersionHistoriesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListModelGroupVersionHistoriesLifecycleStateEnum Enum with underlying type: string +type ListModelGroupVersionHistoriesLifecycleStateEnum string + +// Set of constants representing the allowable values for ListModelGroupVersionHistoriesLifecycleStateEnum +const ( + ListModelGroupVersionHistoriesLifecycleStateActive ListModelGroupVersionHistoriesLifecycleStateEnum = "ACTIVE" + ListModelGroupVersionHistoriesLifecycleStateDeleted ListModelGroupVersionHistoriesLifecycleStateEnum = "DELETED" + ListModelGroupVersionHistoriesLifecycleStateFailed ListModelGroupVersionHistoriesLifecycleStateEnum = "FAILED" + ListModelGroupVersionHistoriesLifecycleStateDeleting ListModelGroupVersionHistoriesLifecycleStateEnum = "DELETING" +) + +var mappingListModelGroupVersionHistoriesLifecycleStateEnum = map[string]ListModelGroupVersionHistoriesLifecycleStateEnum{ + "ACTIVE": ListModelGroupVersionHistoriesLifecycleStateActive, + "DELETED": ListModelGroupVersionHistoriesLifecycleStateDeleted, + "FAILED": ListModelGroupVersionHistoriesLifecycleStateFailed, + "DELETING": ListModelGroupVersionHistoriesLifecycleStateDeleting, +} + +var mappingListModelGroupVersionHistoriesLifecycleStateEnumLowerCase = map[string]ListModelGroupVersionHistoriesLifecycleStateEnum{ + "active": ListModelGroupVersionHistoriesLifecycleStateActive, + "deleted": ListModelGroupVersionHistoriesLifecycleStateDeleted, + "failed": ListModelGroupVersionHistoriesLifecycleStateFailed, + "deleting": ListModelGroupVersionHistoriesLifecycleStateDeleting, +} + +// GetListModelGroupVersionHistoriesLifecycleStateEnumValues Enumerates the set of values for ListModelGroupVersionHistoriesLifecycleStateEnum +func GetListModelGroupVersionHistoriesLifecycleStateEnumValues() []ListModelGroupVersionHistoriesLifecycleStateEnum { + values := make([]ListModelGroupVersionHistoriesLifecycleStateEnum, 0) + for _, v := range mappingListModelGroupVersionHistoriesLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupVersionHistoriesLifecycleStateEnumStringValues Enumerates the set of values in String for ListModelGroupVersionHistoriesLifecycleStateEnum +func GetListModelGroupVersionHistoriesLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "DELETED", + "FAILED", + "DELETING", + } +} + +// GetMappingListModelGroupVersionHistoriesLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupVersionHistoriesLifecycleStateEnum(val string) (ListModelGroupVersionHistoriesLifecycleStateEnum, bool) { + enum, ok := mappingListModelGroupVersionHistoriesLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModelGroupVersionHistoriesSortOrderEnum Enum with underlying type: string +type ListModelGroupVersionHistoriesSortOrderEnum string + +// Set of constants representing the allowable values for ListModelGroupVersionHistoriesSortOrderEnum +const ( + ListModelGroupVersionHistoriesSortOrderAsc ListModelGroupVersionHistoriesSortOrderEnum = "ASC" + ListModelGroupVersionHistoriesSortOrderDesc ListModelGroupVersionHistoriesSortOrderEnum = "DESC" +) + +var mappingListModelGroupVersionHistoriesSortOrderEnum = map[string]ListModelGroupVersionHistoriesSortOrderEnum{ + "ASC": ListModelGroupVersionHistoriesSortOrderAsc, + "DESC": ListModelGroupVersionHistoriesSortOrderDesc, +} + +var mappingListModelGroupVersionHistoriesSortOrderEnumLowerCase = map[string]ListModelGroupVersionHistoriesSortOrderEnum{ + "asc": ListModelGroupVersionHistoriesSortOrderAsc, + "desc": ListModelGroupVersionHistoriesSortOrderDesc, +} + +// GetListModelGroupVersionHistoriesSortOrderEnumValues Enumerates the set of values for ListModelGroupVersionHistoriesSortOrderEnum +func GetListModelGroupVersionHistoriesSortOrderEnumValues() []ListModelGroupVersionHistoriesSortOrderEnum { + values := make([]ListModelGroupVersionHistoriesSortOrderEnum, 0) + for _, v := range mappingListModelGroupVersionHistoriesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupVersionHistoriesSortOrderEnumStringValues Enumerates the set of values in String for ListModelGroupVersionHistoriesSortOrderEnum +func GetListModelGroupVersionHistoriesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListModelGroupVersionHistoriesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupVersionHistoriesSortOrderEnum(val string) (ListModelGroupVersionHistoriesSortOrderEnum, bool) { + enum, ok := mappingListModelGroupVersionHistoriesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModelGroupVersionHistoriesSortByEnum Enum with underlying type: string +type ListModelGroupVersionHistoriesSortByEnum string + +// Set of constants representing the allowable values for ListModelGroupVersionHistoriesSortByEnum +const ( + ListModelGroupVersionHistoriesSortByTimecreated ListModelGroupVersionHistoriesSortByEnum = "timeCreated" + ListModelGroupVersionHistoriesSortByDisplayname ListModelGroupVersionHistoriesSortByEnum = "displayName" + ListModelGroupVersionHistoriesSortByLifecyclestate ListModelGroupVersionHistoriesSortByEnum = "lifecycleState" +) + +var mappingListModelGroupVersionHistoriesSortByEnum = map[string]ListModelGroupVersionHistoriesSortByEnum{ + "timeCreated": ListModelGroupVersionHistoriesSortByTimecreated, + "displayName": ListModelGroupVersionHistoriesSortByDisplayname, + "lifecycleState": ListModelGroupVersionHistoriesSortByLifecyclestate, +} + +var mappingListModelGroupVersionHistoriesSortByEnumLowerCase = map[string]ListModelGroupVersionHistoriesSortByEnum{ + "timecreated": ListModelGroupVersionHistoriesSortByTimecreated, + "displayname": ListModelGroupVersionHistoriesSortByDisplayname, + "lifecyclestate": ListModelGroupVersionHistoriesSortByLifecyclestate, +} + +// GetListModelGroupVersionHistoriesSortByEnumValues Enumerates the set of values for ListModelGroupVersionHistoriesSortByEnum +func GetListModelGroupVersionHistoriesSortByEnumValues() []ListModelGroupVersionHistoriesSortByEnum { + values := make([]ListModelGroupVersionHistoriesSortByEnum, 0) + for _, v := range mappingListModelGroupVersionHistoriesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupVersionHistoriesSortByEnumStringValues Enumerates the set of values in String for ListModelGroupVersionHistoriesSortByEnum +func GetListModelGroupVersionHistoriesSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + "lifecycleState", + } +} + +// GetMappingListModelGroupVersionHistoriesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupVersionHistoriesSortByEnum(val string) (ListModelGroupVersionHistoriesSortByEnum, bool) { + enum, ok := mappingListModelGroupVersionHistoriesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_groups_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_groups_request_response.go new file mode 100644 index 00000000000..e0d2f6bc503 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/list_model_groups_request_response.go @@ -0,0 +1,289 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListModelGroupsRequest wrapper for the ListModelGroups operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/ListModelGroups.go.html to see an example of how to use ListModelGroupsRequest. +type ListModelGroupsRequest struct { + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project. + ProjectId *string `mandatory:"false" contributesTo:"query" name:"projectId"` + + // Filter results by OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type. + Id *string `mandatory:"false" contributesTo:"query" name:"id"` + + // Filter results by its user-friendly name. + DisplayName *string `mandatory:"false" contributesTo:"query" name:"displayName"` + + // A filter to return resources matching the given lifecycleState. + LifecycleState ListModelGroupsLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + + // Filter results by the OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the resource. + CreatedBy *string `mandatory:"false" contributesTo:"query" name:"createdBy"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + ModelGroupVersionHistoryId *string `mandatory:"false" contributesTo:"query" name:"modelGroupVersionHistoryId"` + + // For list pagination. The maximum number of results per page, + // or items to return in a paginated "List" call. + // 1 is the minimum, 100 is the maximum. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response + // header from the previous "List" call. + // See List Pagination (https://docs.oracle.com/iaas/Content/General/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // Specifies sort order to use, either `ASC` (ascending) or `DESC` (descending). + SortOrder ListModelGroupsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // Specifies the field to sort by. Accepts only one field. + // By default, when you sort by `timeCreated`, the results are shown + // in descending order. All other fields default to ascending order. Sort order for the `displayName` field is case sensitive. + SortBy ListModelGroupsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // Unique Oracle assigned identifier for the request. If you need to contact Oracle about a particular request, 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 ListModelGroupsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListModelGroupsRequest) 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 ListModelGroupsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListModelGroupsRequest) 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 ListModelGroupsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListModelGroupsLifecycleStateEnum(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(GetListModelGroupsLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingListModelGroupsSortOrderEnum(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(GetListModelGroupsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListModelGroupsSortByEnum(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(GetListModelGroupsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListModelGroupsResponse wrapper for the ListModelGroups operation +type ListModelGroupsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of []ModelGroupSummary instances + Items []ModelGroupSummary `presentIn:"body"` + + // Retrieves the next page of results. When this header appears in the response, additional pages of results remain. See List Pagination (https://docs.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.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine). + OpcPrevPage *string `presentIn:"header" name:"opc-prev-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 ListModelGroupsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListModelGroupsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListModelGroupsLifecycleStateEnum Enum with underlying type: string +type ListModelGroupsLifecycleStateEnum string + +// Set of constants representing the allowable values for ListModelGroupsLifecycleStateEnum +const ( + ListModelGroupsLifecycleStateCreating ListModelGroupsLifecycleStateEnum = "CREATING" + ListModelGroupsLifecycleStateActive ListModelGroupsLifecycleStateEnum = "ACTIVE" + ListModelGroupsLifecycleStateFailed ListModelGroupsLifecycleStateEnum = "FAILED" + ListModelGroupsLifecycleStateInactive ListModelGroupsLifecycleStateEnum = "INACTIVE" + ListModelGroupsLifecycleStateDeleting ListModelGroupsLifecycleStateEnum = "DELETING" + ListModelGroupsLifecycleStateDeleted ListModelGroupsLifecycleStateEnum = "DELETED" +) + +var mappingListModelGroupsLifecycleStateEnum = map[string]ListModelGroupsLifecycleStateEnum{ + "CREATING": ListModelGroupsLifecycleStateCreating, + "ACTIVE": ListModelGroupsLifecycleStateActive, + "FAILED": ListModelGroupsLifecycleStateFailed, + "INACTIVE": ListModelGroupsLifecycleStateInactive, + "DELETING": ListModelGroupsLifecycleStateDeleting, + "DELETED": ListModelGroupsLifecycleStateDeleted, +} + +var mappingListModelGroupsLifecycleStateEnumLowerCase = map[string]ListModelGroupsLifecycleStateEnum{ + "creating": ListModelGroupsLifecycleStateCreating, + "active": ListModelGroupsLifecycleStateActive, + "failed": ListModelGroupsLifecycleStateFailed, + "inactive": ListModelGroupsLifecycleStateInactive, + "deleting": ListModelGroupsLifecycleStateDeleting, + "deleted": ListModelGroupsLifecycleStateDeleted, +} + +// GetListModelGroupsLifecycleStateEnumValues Enumerates the set of values for ListModelGroupsLifecycleStateEnum +func GetListModelGroupsLifecycleStateEnumValues() []ListModelGroupsLifecycleStateEnum { + values := make([]ListModelGroupsLifecycleStateEnum, 0) + for _, v := range mappingListModelGroupsLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupsLifecycleStateEnumStringValues Enumerates the set of values in String for ListModelGroupsLifecycleStateEnum +func GetListModelGroupsLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "FAILED", + "INACTIVE", + "DELETING", + "DELETED", + } +} + +// GetMappingListModelGroupsLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupsLifecycleStateEnum(val string) (ListModelGroupsLifecycleStateEnum, bool) { + enum, ok := mappingListModelGroupsLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModelGroupsSortOrderEnum Enum with underlying type: string +type ListModelGroupsSortOrderEnum string + +// Set of constants representing the allowable values for ListModelGroupsSortOrderEnum +const ( + ListModelGroupsSortOrderAsc ListModelGroupsSortOrderEnum = "ASC" + ListModelGroupsSortOrderDesc ListModelGroupsSortOrderEnum = "DESC" +) + +var mappingListModelGroupsSortOrderEnum = map[string]ListModelGroupsSortOrderEnum{ + "ASC": ListModelGroupsSortOrderAsc, + "DESC": ListModelGroupsSortOrderDesc, +} + +var mappingListModelGroupsSortOrderEnumLowerCase = map[string]ListModelGroupsSortOrderEnum{ + "asc": ListModelGroupsSortOrderAsc, + "desc": ListModelGroupsSortOrderDesc, +} + +// GetListModelGroupsSortOrderEnumValues Enumerates the set of values for ListModelGroupsSortOrderEnum +func GetListModelGroupsSortOrderEnumValues() []ListModelGroupsSortOrderEnum { + values := make([]ListModelGroupsSortOrderEnum, 0) + for _, v := range mappingListModelGroupsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupsSortOrderEnumStringValues Enumerates the set of values in String for ListModelGroupsSortOrderEnum +func GetListModelGroupsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListModelGroupsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupsSortOrderEnum(val string) (ListModelGroupsSortOrderEnum, bool) { + enum, ok := mappingListModelGroupsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListModelGroupsSortByEnum Enum with underlying type: string +type ListModelGroupsSortByEnum string + +// Set of constants representing the allowable values for ListModelGroupsSortByEnum +const ( + ListModelGroupsSortByTimecreated ListModelGroupsSortByEnum = "timeCreated" + ListModelGroupsSortByDisplayname ListModelGroupsSortByEnum = "displayName" + ListModelGroupsSortByLifecyclestate ListModelGroupsSortByEnum = "lifecycleState" +) + +var mappingListModelGroupsSortByEnum = map[string]ListModelGroupsSortByEnum{ + "timeCreated": ListModelGroupsSortByTimecreated, + "displayName": ListModelGroupsSortByDisplayname, + "lifecycleState": ListModelGroupsSortByLifecyclestate, +} + +var mappingListModelGroupsSortByEnumLowerCase = map[string]ListModelGroupsSortByEnum{ + "timecreated": ListModelGroupsSortByTimecreated, + "displayname": ListModelGroupsSortByDisplayname, + "lifecyclestate": ListModelGroupsSortByLifecyclestate, +} + +// GetListModelGroupsSortByEnumValues Enumerates the set of values for ListModelGroupsSortByEnum +func GetListModelGroupsSortByEnumValues() []ListModelGroupsSortByEnum { + values := make([]ListModelGroupsSortByEnum, 0) + for _, v := range mappingListModelGroupsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListModelGroupsSortByEnumStringValues Enumerates the set of values in String for ListModelGroupsSortByEnum +func GetListModelGroupsSortByEnumStringValues() []string { + return []string{ + "timeCreated", + "displayName", + "lifecycleState", + } +} + +// GetMappingListModelGroupsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListModelGroupsSortByEnum(val string) (ListModelGroupsSortByEnum, bool) { + enum, ok := mappingListModelGroupsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} 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 7eaba5d3c58..731a61ea244 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 @@ -185,6 +185,10 @@ const ( ListWorkRequestsOperationTypeScheduleDeactivate ListWorkRequestsOperationTypeEnum = "SCHEDULE_DEACTIVATE" ListWorkRequestsOperationTypeRegisterModelArtifact ListWorkRequestsOperationTypeEnum = "REGISTER_MODEL_ARTIFACT" ListWorkRequestsOperationTypeRestoreArchivedModel ListWorkRequestsOperationTypeEnum = "RESTORE_ARCHIVED_MODEL" + ListWorkRequestsOperationTypeModelGroupCreate ListWorkRequestsOperationTypeEnum = "MODEL_GROUP_CREATE" + ListWorkRequestsOperationTypeModelGroupUpdate ListWorkRequestsOperationTypeEnum = "MODEL_GROUP_UPDATE" + ListWorkRequestsOperationTypeModelGroupDelete ListWorkRequestsOperationTypeEnum = "MODEL_GROUP_DELETE" + ListWorkRequestsOperationTypeModelGroupVersionHistoryDelete ListWorkRequestsOperationTypeEnum = "MODEL_GROUP_VERSION_HISTORY_DELETE" ) var mappingListWorkRequestsOperationTypeEnum = map[string]ListWorkRequestsOperationTypeEnum{ @@ -234,6 +238,10 @@ var mappingListWorkRequestsOperationTypeEnum = map[string]ListWorkRequestsOperat "SCHEDULE_DEACTIVATE": ListWorkRequestsOperationTypeScheduleDeactivate, "REGISTER_MODEL_ARTIFACT": ListWorkRequestsOperationTypeRegisterModelArtifact, "RESTORE_ARCHIVED_MODEL": ListWorkRequestsOperationTypeRestoreArchivedModel, + "MODEL_GROUP_CREATE": ListWorkRequestsOperationTypeModelGroupCreate, + "MODEL_GROUP_UPDATE": ListWorkRequestsOperationTypeModelGroupUpdate, + "MODEL_GROUP_DELETE": ListWorkRequestsOperationTypeModelGroupDelete, + "MODEL_GROUP_VERSION_HISTORY_DELETE": ListWorkRequestsOperationTypeModelGroupVersionHistoryDelete, } var mappingListWorkRequestsOperationTypeEnumLowerCase = map[string]ListWorkRequestsOperationTypeEnum{ @@ -283,6 +291,10 @@ var mappingListWorkRequestsOperationTypeEnumLowerCase = map[string]ListWorkReque "schedule_deactivate": ListWorkRequestsOperationTypeScheduleDeactivate, "register_model_artifact": ListWorkRequestsOperationTypeRegisterModelArtifact, "restore_archived_model": ListWorkRequestsOperationTypeRestoreArchivedModel, + "model_group_create": ListWorkRequestsOperationTypeModelGroupCreate, + "model_group_update": ListWorkRequestsOperationTypeModelGroupUpdate, + "model_group_delete": ListWorkRequestsOperationTypeModelGroupDelete, + "model_group_version_history_delete": ListWorkRequestsOperationTypeModelGroupVersionHistoryDelete, } // GetListWorkRequestsOperationTypeEnumValues Enumerates the set of values for ListWorkRequestsOperationTypeEnum @@ -343,6 +355,10 @@ func GetListWorkRequestsOperationTypeEnumStringValues() []string { "SCHEDULE_DEACTIVATE", "REGISTER_MODEL_ARTIFACT", "RESTORE_ARCHIVED_MODEL", + "MODEL_GROUP_CREATE", + "MODEL_GROUP_UPDATE", + "MODEL_GROUP_DELETE", + "MODEL_GROUP_VERSION_HISTORY_DELETE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/member_model_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/member_model_details.go new file mode 100644 index 00000000000..4825f6c1dce --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/member_model_details.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// MemberModelDetails Model details which needs to be part of Model Group. +type MemberModelDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. + ModelId *string `mandatory:"true" json:"modelId"` + + // SaaS friendly name of the model. + InferenceKey *string `mandatory:"false" json:"inferenceKey"` +} + +func (m MemberModelDetails) 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 MemberModelDetails) 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/member_model_entries.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/member_model_entries.go new file mode 100644 index 00000000000..16ab2c6e4af --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/member_model_entries.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// MemberModelEntries List of member models (inferenceKey & modelId) to be associated with the model group. +type MemberModelEntries struct { + + // Each List item contains inference key and model ocid. + MemberModelDetails []MemberModelDetails `mandatory:"false" json:"memberModelDetails"` +} + +func (m MemberModelEntries) 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 MemberModelEntries) 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/model_deployment_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_configuration_details.go index f9b774108c8..d4531c37172 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_configuration_details.go @@ -54,6 +54,10 @@ func (m *modeldeploymentconfigurationdetails) UnmarshalPolymorphicJSON(data []by mm := SingleModelDeploymentConfigurationDetails{} err = json.Unmarshal(data, &mm) return mm, err + case "MODEL_GROUP": + mm := ModelGroupDeploymentConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err default: common.Logf("Received unsupported enum value for ModelDeploymentConfigurationDetails: %s.", m.DeploymentType) return *m, nil diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_model_state_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_model_state_summary.go new file mode 100644 index 00000000000..cef07660dff --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_model_state_summary.go @@ -0,0 +1,112 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelDeploymentModelStateSummary Status of the model in a model group deployment. +type ModelDeploymentModelStateSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the deployed model in model deployment. + ModelId *string `mandatory:"true" json:"modelId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the model. + ProjectId *string `mandatory:"true" json:"projectId"` + + // A user-friendly display name for the resource. + DisplayName *string `mandatory:"true" json:"displayName"` + + // SaaS friendly name for the model OCID. + InferenceKey *string `mandatory:"true" json:"inferenceKey"` + + // The state of the deployed model in model deployment. + State ModelDeploymentModelStateSummaryStateEnum `mandatory:"true" json:"state"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ModelDeploymentModelStateSummary) 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 ModelDeploymentModelStateSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingModelDeploymentModelStateSummaryStateEnum(string(m.State)); !ok && m.State != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for State: %s. Supported values are: %s.", m.State, strings.Join(GetModelDeploymentModelStateSummaryStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ModelDeploymentModelStateSummaryStateEnum Enum with underlying type: string +type ModelDeploymentModelStateSummaryStateEnum string + +// Set of constants representing the allowable values for ModelDeploymentModelStateSummaryStateEnum +const ( + ModelDeploymentModelStateSummaryStateSuccess ModelDeploymentModelStateSummaryStateEnum = "SUCCESS" + ModelDeploymentModelStateSummaryStateFailed ModelDeploymentModelStateSummaryStateEnum = "FAILED" + ModelDeploymentModelStateSummaryStateInconsistent ModelDeploymentModelStateSummaryStateEnum = "INCONSISTENT" +) + +var mappingModelDeploymentModelStateSummaryStateEnum = map[string]ModelDeploymentModelStateSummaryStateEnum{ + "SUCCESS": ModelDeploymentModelStateSummaryStateSuccess, + "FAILED": ModelDeploymentModelStateSummaryStateFailed, + "INCONSISTENT": ModelDeploymentModelStateSummaryStateInconsistent, +} + +var mappingModelDeploymentModelStateSummaryStateEnumLowerCase = map[string]ModelDeploymentModelStateSummaryStateEnum{ + "success": ModelDeploymentModelStateSummaryStateSuccess, + "failed": ModelDeploymentModelStateSummaryStateFailed, + "inconsistent": ModelDeploymentModelStateSummaryStateInconsistent, +} + +// GetModelDeploymentModelStateSummaryStateEnumValues Enumerates the set of values for ModelDeploymentModelStateSummaryStateEnum +func GetModelDeploymentModelStateSummaryStateEnumValues() []ModelDeploymentModelStateSummaryStateEnum { + values := make([]ModelDeploymentModelStateSummaryStateEnum, 0) + for _, v := range mappingModelDeploymentModelStateSummaryStateEnum { + values = append(values, v) + } + return values +} + +// GetModelDeploymentModelStateSummaryStateEnumStringValues Enumerates the set of values in String for ModelDeploymentModelStateSummaryStateEnum +func GetModelDeploymentModelStateSummaryStateEnumStringValues() []string { + return []string{ + "SUCCESS", + "FAILED", + "INCONSISTENT", + } +} + +// GetMappingModelDeploymentModelStateSummaryStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModelDeploymentModelStateSummaryStateEnum(val string) (ModelDeploymentModelStateSummaryStateEnum, bool) { + enum, ok := mappingModelDeploymentModelStateSummaryStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_type.go index 1ff159bc16a..bd8c1a73c2d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_deployment_type.go @@ -19,14 +19,17 @@ type ModelDeploymentTypeEnum string // Set of constants representing the allowable values for ModelDeploymentTypeEnum const ( ModelDeploymentTypeSingleModel ModelDeploymentTypeEnum = "SINGLE_MODEL" + ModelDeploymentTypeModelGroup ModelDeploymentTypeEnum = "MODEL_GROUP" ) var mappingModelDeploymentTypeEnum = map[string]ModelDeploymentTypeEnum{ "SINGLE_MODEL": ModelDeploymentTypeSingleModel, + "MODEL_GROUP": ModelDeploymentTypeModelGroup, } var mappingModelDeploymentTypeEnumLowerCase = map[string]ModelDeploymentTypeEnum{ "single_model": ModelDeploymentTypeSingleModel, + "model_group": ModelDeploymentTypeModelGroup, } // GetModelDeploymentTypeEnumValues Enumerates the set of values for ModelDeploymentTypeEnum @@ -42,6 +45,7 @@ func GetModelDeploymentTypeEnumValues() []ModelDeploymentTypeEnum { func GetModelDeploymentTypeEnumStringValues() []string { return []string{ "SINGLE_MODEL", + "MODEL_GROUP", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group.go new file mode 100644 index 00000000000..09544aec6aa --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group.go @@ -0,0 +1,190 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModelGroup Model group is a collection of the models. Model groups are represented by their associated metadata. +type ModelGroup struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup's compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroup. + ProjectId *string `mandatory:"true" json:"projectId"` + + ModelGroupDetails ModelGroupDetails `mandatory:"true" json:"modelGroupDetails"` + + MemberModelEntries *MemberModelEntries `mandatory:"true" json:"memberModelEntries"` + + // The state of the modelGroup. + LifecycleState ModelGroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the resource was created in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the resource was updated in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroup. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the modelGroup. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Details about the lifecycle state of the model group. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. + ModelGroupVersionHistoryId *string `mandatory:"false" json:"modelGroupVersionHistoryId"` + + // The name of the model group version history to which the model group is associated. + ModelGroupVersionHistoryName *string `mandatory:"false" json:"modelGroupVersionHistoryName"` + + // An additional description of the lifecycle state of the model group. + VersionLabel *string `mandatory:"false" json:"versionLabel"` + + // Unique identifier assigned to each version of the model group. It would be auto-incremented number generated by service. + VersionId *int64 `mandatory:"false" json:"versionId"` + + // The type of the model group create operation. + CreateType *string `mandatory:"false" json:"createType"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group used for the clone operation. + SourceModelGroupId *string `mandatory:"false" json:"sourceModelGroupId"` +} + +func (m ModelGroup) 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 ModelGroup) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingModelGroupLifecycleStateEnum(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(GetModelGroupLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ModelGroup) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + SystemTags map[string]map[string]interface{} `json:"systemTags"` + LifecycleDetails *string `json:"lifecycleDetails"` + ModelGroupVersionHistoryId *string `json:"modelGroupVersionHistoryId"` + ModelGroupVersionHistoryName *string `json:"modelGroupVersionHistoryName"` + VersionLabel *string `json:"versionLabel"` + VersionId *int64 `json:"versionId"` + CreateType *string `json:"createType"` + SourceModelGroupId *string `json:"sourceModelGroupId"` + Id *string `json:"id"` + CompartmentId *string `json:"compartmentId"` + ProjectId *string `json:"projectId"` + ModelGroupDetails modelgroupdetails `json:"modelGroupDetails"` + MemberModelEntries *MemberModelEntries `json:"memberModelEntries"` + LifecycleState ModelGroupLifecycleStateEnum `json:"lifecycleState"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + CreatedBy *string `json:"createdBy"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.LifecycleDetails = model.LifecycleDetails + + m.ModelGroupVersionHistoryId = model.ModelGroupVersionHistoryId + + m.ModelGroupVersionHistoryName = model.ModelGroupVersionHistoryName + + m.VersionLabel = model.VersionLabel + + m.VersionId = model.VersionId + + m.CreateType = model.CreateType + + m.SourceModelGroupId = model.SourceModelGroupId + + m.Id = model.Id + + m.CompartmentId = model.CompartmentId + + m.ProjectId = model.ProjectId + + nn, e = model.ModelGroupDetails.UnmarshalPolymorphicJSON(model.ModelGroupDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ModelGroupDetails = nn.(ModelGroupDetails) + } else { + m.ModelGroupDetails = nil + } + + m.MemberModelEntries = model.MemberModelEntries + + m.LifecycleState = model.LifecycleState + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.CreatedBy = model.CreatedBy + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_clone_source_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_clone_source_details.go new file mode 100644 index 00000000000..3b8c0e5c185 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_clone_source_details.go @@ -0,0 +1,123 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModelGroupCloneSourceDetails Model Group clone source details. +type ModelGroupCloneSourceDetails interface { +} + +type modelgroupclonesourcedetails struct { + JsonData []byte + ModelGroupCloneSourceType string `json:"modelGroupCloneSourceType"` +} + +// UnmarshalJSON unmarshals json +func (m *modelgroupclonesourcedetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalermodelgroupclonesourcedetails modelgroupclonesourcedetails + s := struct { + Model Unmarshalermodelgroupclonesourcedetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.ModelGroupCloneSourceType = s.Model.ModelGroupCloneSourceType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *modelgroupclonesourcedetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.ModelGroupCloneSourceType { + case "MODEL_GROUP_VERSION_HISTORY": + mm := CloneCreateFromModelGroupVersionHistoryDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "MODEL_GROUP": + mm := CloneCreateFromModelGroupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for ModelGroupCloneSourceDetails: %s.", m.ModelGroupCloneSourceType) + return *m, nil + } +} + +func (m modelgroupclonesourcedetails) 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 modelgroupclonesourcedetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum Enum with underlying type: string +type ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum string + +// Set of constants representing the allowable values for ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum +const ( + ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeGroup ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum = "MODEL_GROUP" + ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeGroupVersionHistory ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum = "MODEL_GROUP_VERSION_HISTORY" +) + +var mappingModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum = map[string]ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum{ + "MODEL_GROUP": ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeGroup, + "MODEL_GROUP_VERSION_HISTORY": ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeGroupVersionHistory, +} + +var mappingModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnumLowerCase = map[string]ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum{ + "model_group": ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeGroup, + "model_group_version_history": ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeGroupVersionHistory, +} + +// GetModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnumValues Enumerates the set of values for ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum +func GetModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnumValues() []ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum { + values := make([]ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum, 0) + for _, v := range mappingModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum { + values = append(values, v) + } + return values +} + +// GetModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnumStringValues Enumerates the set of values in String for ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum +func GetModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnumStringValues() []string { + return []string{ + "MODEL_GROUP", + "MODEL_GROUP_VERSION_HISTORY", + } +} + +// GetMappingModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum(val string) (ModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnum, bool) { + enum, ok := mappingModelGroupCloneSourceDetailsModelGroupCloneSourceTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_configuration_details.go new file mode 100644 index 00000000000..95aa4a232d8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_configuration_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupConfigurationDetails The model group configuration details. +type ModelGroupConfigurationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group you want to deploy. + ModelGroupId *string `mandatory:"true" json:"modelGroupId"` +} + +func (m ModelGroupConfigurationDetails) 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 ModelGroupConfigurationDetails) 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/model_group_create_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_create_type.go new file mode 100644 index 00000000000..c3f82b59d98 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_create_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupCreateTypeEnum Enum with underlying type: string +type ModelGroupCreateTypeEnum string + +// Set of constants representing the allowable values for ModelGroupCreateTypeEnum +const ( + ModelGroupCreateTypeCreate ModelGroupCreateTypeEnum = "CREATE" + ModelGroupCreateTypeClone ModelGroupCreateTypeEnum = "CLONE" +) + +var mappingModelGroupCreateTypeEnum = map[string]ModelGroupCreateTypeEnum{ + "CREATE": ModelGroupCreateTypeCreate, + "CLONE": ModelGroupCreateTypeClone, +} + +var mappingModelGroupCreateTypeEnumLowerCase = map[string]ModelGroupCreateTypeEnum{ + "create": ModelGroupCreateTypeCreate, + "clone": ModelGroupCreateTypeClone, +} + +// GetModelGroupCreateTypeEnumValues Enumerates the set of values for ModelGroupCreateTypeEnum +func GetModelGroupCreateTypeEnumValues() []ModelGroupCreateTypeEnum { + values := make([]ModelGroupCreateTypeEnum, 0) + for _, v := range mappingModelGroupCreateTypeEnum { + values = append(values, v) + } + return values +} + +// GetModelGroupCreateTypeEnumStringValues Enumerates the set of values in String for ModelGroupCreateTypeEnum +func GetModelGroupCreateTypeEnumStringValues() []string { + return []string{ + "CREATE", + "CLONE", + } +} + +// GetMappingModelGroupCreateTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModelGroupCreateTypeEnum(val string) (ModelGroupCreateTypeEnum, bool) { + enum, ok := mappingModelGroupCreateTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_deployment_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_deployment_configuration_details.go new file mode 100644 index 00000000000..17c65e83c54 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_deployment_configuration_details.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModelGroupDeploymentConfigurationDetails The model group type deployment. +type ModelGroupDeploymentConfigurationDetails struct { + ModelGroupConfigurationDetails *ModelGroupConfigurationDetails `mandatory:"true" json:"modelGroupConfigurationDetails"` + + InfrastructureConfigurationDetails InfrastructureConfigurationDetails `mandatory:"true" json:"infrastructureConfigurationDetails"` + + EnvironmentConfigurationDetails ModelDeploymentEnvironmentConfigurationDetails `mandatory:"false" json:"environmentConfigurationDetails"` +} + +func (m ModelGroupDeploymentConfigurationDetails) 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 ModelGroupDeploymentConfigurationDetails) 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 ModelGroupDeploymentConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeModelGroupDeploymentConfigurationDetails ModelGroupDeploymentConfigurationDetails + s := struct { + DiscriminatorParam string `json:"deploymentType"` + MarshalTypeModelGroupDeploymentConfigurationDetails + }{ + "MODEL_GROUP", + (MarshalTypeModelGroupDeploymentConfigurationDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *ModelGroupDeploymentConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + EnvironmentConfigurationDetails modeldeploymentenvironmentconfigurationdetails `json:"environmentConfigurationDetails"` + ModelGroupConfigurationDetails *ModelGroupConfigurationDetails `json:"modelGroupConfigurationDetails"` + InfrastructureConfigurationDetails infrastructureconfigurationdetails `json:"infrastructureConfigurationDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + nn, e = model.EnvironmentConfigurationDetails.UnmarshalPolymorphicJSON(model.EnvironmentConfigurationDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.EnvironmentConfigurationDetails = nn.(ModelDeploymentEnvironmentConfigurationDetails) + } else { + m.EnvironmentConfigurationDetails = nil + } + + m.ModelGroupConfigurationDetails = model.ModelGroupConfigurationDetails + + nn, e = model.InfrastructureConfigurationDetails.UnmarshalPolymorphicJSON(model.InfrastructureConfigurationDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.InfrastructureConfigurationDetails = nn.(InfrastructureConfigurationDetails) + } else { + m.InfrastructureConfigurationDetails = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_details.go new file mode 100644 index 00000000000..e62ce8fb1c9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_details.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModelGroupDetails The model group details. +type ModelGroupDetails interface { + + // An array of custom metadata details for the model group. + GetCustomMetadataList() []CustomMetadata +} + +type modelgroupdetails struct { + JsonData []byte + CustomMetadataList []CustomMetadata `mandatory:"false" json:"customMetadataList"` + Type string `json:"type"` +} + +// UnmarshalJSON unmarshals json +func (m *modelgroupdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalermodelgroupdetails modelgroupdetails + s := struct { + Model Unmarshalermodelgroupdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CustomMetadataList = s.Model.CustomMetadataList + m.Type = s.Model.Type + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *modelgroupdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Type { + case "HETEROGENEOUS": + mm := HeterogeneousModelGroupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "STACKED": + mm := StackedModelGroupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + case "HOMOGENEOUS": + mm := HomogeneousModelGroupDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for ModelGroupDetails: %s.", m.Type) + return *m, nil + } +} + +// GetCustomMetadataList returns CustomMetadataList +func (m modelgroupdetails) GetCustomMetadataList() []CustomMetadata { + return m.CustomMetadataList +} + +func (m modelgroupdetails) 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 modelgroupdetails) 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/model_group_lifecycle_state.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_lifecycle_state.go new file mode 100644 index 00000000000..de7a613ab08 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_lifecycle_state.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupLifecycleStateEnum Enum with underlying type: string +type ModelGroupLifecycleStateEnum string + +// Set of constants representing the allowable values for ModelGroupLifecycleStateEnum +const ( + ModelGroupLifecycleStateCreating ModelGroupLifecycleStateEnum = "CREATING" + ModelGroupLifecycleStateActive ModelGroupLifecycleStateEnum = "ACTIVE" + ModelGroupLifecycleStateFailed ModelGroupLifecycleStateEnum = "FAILED" + ModelGroupLifecycleStateInactive ModelGroupLifecycleStateEnum = "INACTIVE" + ModelGroupLifecycleStateDeleting ModelGroupLifecycleStateEnum = "DELETING" + ModelGroupLifecycleStateDeleted ModelGroupLifecycleStateEnum = "DELETED" +) + +var mappingModelGroupLifecycleStateEnum = map[string]ModelGroupLifecycleStateEnum{ + "CREATING": ModelGroupLifecycleStateCreating, + "ACTIVE": ModelGroupLifecycleStateActive, + "FAILED": ModelGroupLifecycleStateFailed, + "INACTIVE": ModelGroupLifecycleStateInactive, + "DELETING": ModelGroupLifecycleStateDeleting, + "DELETED": ModelGroupLifecycleStateDeleted, +} + +var mappingModelGroupLifecycleStateEnumLowerCase = map[string]ModelGroupLifecycleStateEnum{ + "creating": ModelGroupLifecycleStateCreating, + "active": ModelGroupLifecycleStateActive, + "failed": ModelGroupLifecycleStateFailed, + "inactive": ModelGroupLifecycleStateInactive, + "deleting": ModelGroupLifecycleStateDeleting, + "deleted": ModelGroupLifecycleStateDeleted, +} + +// GetModelGroupLifecycleStateEnumValues Enumerates the set of values for ModelGroupLifecycleStateEnum +func GetModelGroupLifecycleStateEnumValues() []ModelGroupLifecycleStateEnum { + values := make([]ModelGroupLifecycleStateEnum, 0) + for _, v := range mappingModelGroupLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetModelGroupLifecycleStateEnumStringValues Enumerates the set of values in String for ModelGroupLifecycleStateEnum +func GetModelGroupLifecycleStateEnumStringValues() []string { + return []string{ + "CREATING", + "ACTIVE", + "FAILED", + "INACTIVE", + "DELETING", + "DELETED", + } +} + +// GetMappingModelGroupLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModelGroupLifecycleStateEnum(val string) (ModelGroupLifecycleStateEnum, bool) { + enum, ok := mappingModelGroupLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_model_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_model_summary.go new file mode 100644 index 00000000000..5676b4fde6b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_model_summary.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupModelSummary Summary information for a model associated with the model group. +type ModelGroupModelSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. + ModelId *string `mandatory:"true" json:"modelId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model's compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the model. + ProjectId *string `mandatory:"true" json:"projectId"` + + // A user-friendly display name of the model. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the model. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // The date and time the resource was created in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the resource was updated in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The state of the model. + LifecycleState ModelLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // Details about the lifecycle state of the model. + LifecycleDetails *string `mandatory:"true" json:"lifecycleDetails"` + + // The category of the model. + Category ModelCategoryEnum `mandatory:"true" json:"category"` + + // Identifier to indicate whether a model artifact resides in the Service Tenancy or Customer Tenancy. + IsModelByReference *bool `mandatory:"true" json:"isModelByReference"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ModelGroupModelSummary) 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 ModelGroupModelSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingModelLifecycleStateEnum(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(GetModelLifecycleStateEnumStringValues(), ","))) + } + if _, ok := GetMappingModelCategoryEnum(string(m.Category)); !ok && m.Category != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Category: %s. Supported values are: %s.", m.Category, strings.Join(GetModelCategoryEnumStringValues(), ","))) + } + + 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/model_group_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_summary.go new file mode 100644 index 00000000000..d61b1e0b325 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_summary.go @@ -0,0 +1,167 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModelGroupSummary Summary information for a modelGroup. +type ModelGroupSummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup's compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroup. + ProjectId *string `mandatory:"true" json:"projectId"` + + // A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroup. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // The date and time the resource was created in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the resource was last updated in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The state of the model. + LifecycleState ModelGroupLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + ModelGroupDetails ModelGroupDetails `mandatory:"true" json:"modelGroupDetails"` + + // Details about the lifecycle state of the model group. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. + ModelGroupVersionHistoryId *string `mandatory:"false" json:"modelGroupVersionHistoryId"` + + // The name of the model group version history to which the model group is associated. + ModelGroupVersionHistoryName *string `mandatory:"false" json:"modelGroupVersionHistoryName"` + + // An additional description of the lifecycle state of the model group. + VersionLabel *string `mandatory:"false" json:"versionLabel"` + + // Unique identifier assigned to each version of the model group. It would be auto-incremented number generated by service. + VersionId *int64 `mandatory:"false" json:"versionId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` +} + +func (m ModelGroupSummary) 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 ModelGroupSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingModelGroupLifecycleStateEnum(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(GetModelGroupLifecycleStateEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ModelGroupSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + LifecycleDetails *string `json:"lifecycleDetails"` + ModelGroupVersionHistoryId *string `json:"modelGroupVersionHistoryId"` + ModelGroupVersionHistoryName *string `json:"modelGroupVersionHistoryName"` + VersionLabel *string `json:"versionLabel"` + VersionId *int64 `json:"versionId"` + 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"` + CompartmentId *string `json:"compartmentId"` + ProjectId *string `json:"projectId"` + DisplayName *string `json:"displayName"` + CreatedBy *string `json:"createdBy"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleState ModelGroupLifecycleStateEnum `json:"lifecycleState"` + ModelGroupDetails modelgroupdetails `json:"modelGroupDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.LifecycleDetails = model.LifecycleDetails + + m.ModelGroupVersionHistoryId = model.ModelGroupVersionHistoryId + + m.ModelGroupVersionHistoryName = model.ModelGroupVersionHistoryName + + m.VersionLabel = model.VersionLabel + + m.VersionId = model.VersionId + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.SystemTags = model.SystemTags + + m.Id = model.Id + + m.CompartmentId = model.CompartmentId + + m.ProjectId = model.ProjectId + + m.DisplayName = model.DisplayName + + m.CreatedBy = model.CreatedBy + + m.TimeCreated = model.TimeCreated + + m.TimeUpdated = model.TimeUpdated + + m.LifecycleState = model.LifecycleState + + nn, e = model.ModelGroupDetails.UnmarshalPolymorphicJSON(model.ModelGroupDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ModelGroupDetails = nn.(ModelGroupDetails) + } else { + m.ModelGroupDetails = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_type.go new file mode 100644 index 00000000000..668680d93c1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_type.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupTypeEnum Enum with underlying type: string +type ModelGroupTypeEnum string + +// Set of constants representing the allowable values for ModelGroupTypeEnum +const ( + ModelGroupTypeHomogeneous ModelGroupTypeEnum = "HOMOGENEOUS" + ModelGroupTypeHeterogeneous ModelGroupTypeEnum = "HETEROGENEOUS" + ModelGroupTypeStacked ModelGroupTypeEnum = "STACKED" +) + +var mappingModelGroupTypeEnum = map[string]ModelGroupTypeEnum{ + "HOMOGENEOUS": ModelGroupTypeHomogeneous, + "HETEROGENEOUS": ModelGroupTypeHeterogeneous, + "STACKED": ModelGroupTypeStacked, +} + +var mappingModelGroupTypeEnumLowerCase = map[string]ModelGroupTypeEnum{ + "homogeneous": ModelGroupTypeHomogeneous, + "heterogeneous": ModelGroupTypeHeterogeneous, + "stacked": ModelGroupTypeStacked, +} + +// GetModelGroupTypeEnumValues Enumerates the set of values for ModelGroupTypeEnum +func GetModelGroupTypeEnumValues() []ModelGroupTypeEnum { + values := make([]ModelGroupTypeEnum, 0) + for _, v := range mappingModelGroupTypeEnum { + values = append(values, v) + } + return values +} + +// GetModelGroupTypeEnumStringValues Enumerates the set of values in String for ModelGroupTypeEnum +func GetModelGroupTypeEnumStringValues() []string { + return []string{ + "HOMOGENEOUS", + "HETEROGENEOUS", + "STACKED", + } +} + +// GetMappingModelGroupTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModelGroupTypeEnum(val string) (ModelGroupTypeEnum, bool) { + enum, ok := mappingModelGroupTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history.go new file mode 100644 index 00000000000..ae7adcef6bf --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history.go @@ -0,0 +1,86 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupVersionHistory Model Group Version history to associate different versions of Model Group resource. +type ModelGroupVersionHistory struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory's compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroupVersionHistory. + ProjectId *string `mandatory:"true" json:"projectId"` + + // A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The state of the modelGroupVersionHistory. + LifecycleState ModelGroupVersionHistoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the resource was created in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the resource was last updated in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroupVersionHistory. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // A short description of the modelGroupVersionHistory. + Description *string `mandatory:"false" json:"description"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest version of the model group associated. + LatestModelGroupId *string `mandatory:"false" json:"latestModelGroupId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Details about the lifecycle state of the model group version history. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m ModelGroupVersionHistory) 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 ModelGroupVersionHistory) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingModelGroupVersionHistoryLifecycleStateEnum(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(GetModelGroupVersionHistoryLifecycleStateEnumStringValues(), ","))) + } + + 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/model_group_version_history_lifecycle_state.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history_lifecycle_state.go new file mode 100644 index 00000000000..7677c1cc06c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history_lifecycle_state.go @@ -0,0 +1,64 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupVersionHistoryLifecycleStateEnum Enum with underlying type: string +type ModelGroupVersionHistoryLifecycleStateEnum string + +// Set of constants representing the allowable values for ModelGroupVersionHistoryLifecycleStateEnum +const ( + ModelGroupVersionHistoryLifecycleStateActive ModelGroupVersionHistoryLifecycleStateEnum = "ACTIVE" + ModelGroupVersionHistoryLifecycleStateDeleted ModelGroupVersionHistoryLifecycleStateEnum = "DELETED" + ModelGroupVersionHistoryLifecycleStateFailed ModelGroupVersionHistoryLifecycleStateEnum = "FAILED" + ModelGroupVersionHistoryLifecycleStateDeleting ModelGroupVersionHistoryLifecycleStateEnum = "DELETING" +) + +var mappingModelGroupVersionHistoryLifecycleStateEnum = map[string]ModelGroupVersionHistoryLifecycleStateEnum{ + "ACTIVE": ModelGroupVersionHistoryLifecycleStateActive, + "DELETED": ModelGroupVersionHistoryLifecycleStateDeleted, + "FAILED": ModelGroupVersionHistoryLifecycleStateFailed, + "DELETING": ModelGroupVersionHistoryLifecycleStateDeleting, +} + +var mappingModelGroupVersionHistoryLifecycleStateEnumLowerCase = map[string]ModelGroupVersionHistoryLifecycleStateEnum{ + "active": ModelGroupVersionHistoryLifecycleStateActive, + "deleted": ModelGroupVersionHistoryLifecycleStateDeleted, + "failed": ModelGroupVersionHistoryLifecycleStateFailed, + "deleting": ModelGroupVersionHistoryLifecycleStateDeleting, +} + +// GetModelGroupVersionHistoryLifecycleStateEnumValues Enumerates the set of values for ModelGroupVersionHistoryLifecycleStateEnum +func GetModelGroupVersionHistoryLifecycleStateEnumValues() []ModelGroupVersionHistoryLifecycleStateEnum { + values := make([]ModelGroupVersionHistoryLifecycleStateEnum, 0) + for _, v := range mappingModelGroupVersionHistoryLifecycleStateEnum { + values = append(values, v) + } + return values +} + +// GetModelGroupVersionHistoryLifecycleStateEnumStringValues Enumerates the set of values in String for ModelGroupVersionHistoryLifecycleStateEnum +func GetModelGroupVersionHistoryLifecycleStateEnumStringValues() []string { + return []string{ + "ACTIVE", + "DELETED", + "FAILED", + "DELETING", + } +} + +// GetMappingModelGroupVersionHistoryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingModelGroupVersionHistoryLifecycleStateEnum(val string) (ModelGroupVersionHistoryLifecycleStateEnum, bool) { + enum, ok := mappingModelGroupVersionHistoryLifecycleStateEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history_summary.go new file mode 100644 index 00000000000..7bcfc00cf83 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/model_group_version_history_summary.go @@ -0,0 +1,83 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// ModelGroupVersionHistorySummary Summary information for a modelGroupVersionHistory. +type ModelGroupVersionHistorySummary struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory's compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroupVersionHistory. + ProjectId *string `mandatory:"true" json:"projectId"` + + // A user-friendly display name for the resource. + DisplayName *string `mandatory:"true" json:"displayName"` + + // The state of the modelGroupVersionHistory. + LifecycleState ModelGroupVersionHistoryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"` + + // The date and time the resource was created in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The date and time the resource was last updated in the timestamp format defined by RFC3339 (https://tools.ietf.org/html/rfc3339). + // Example: 2019-08-25T21:10:29.41Z + TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroupVersionHistory. + CreatedBy *string `mandatory:"true" json:"createdBy"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest version of the model group associated + LatestModelGroupId *string `mandatory:"false" json:"latestModelGroupId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Details about the lifecycle state of the model group version history. + LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` +} + +func (m ModelGroupVersionHistorySummary) 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 ModelGroupVersionHistorySummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingModelGroupVersionHistoryLifecycleStateEnum(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(GetModelGroupVersionHistoryLifecycleStateEnumStringValues(), ","))) + } + + 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/modify_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/modify_model_group_details.go new file mode 100644 index 00000000000..4d174c7d806 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/modify_model_group_details.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ModifyModelGroupDetails Overwrites the properties of the source modelGroup. +type ModifyModelGroupDetails struct { + + // A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. + // Example: `My ModelGroup` + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the modelGroup. + Description *string `mandatory:"false" json:"description"` + + // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. + ModelGroupVersionHistoryId *string `mandatory:"false" json:"modelGroupVersionHistoryId"` + + // An additional description of the lifecycle state of the model group. + VersionLabel *string `mandatory:"false" json:"versionLabel"` + + ModelGroupDetails ModelGroupDetails `mandatory:"false" json:"modelGroupDetails"` +} + +func (m ModifyModelGroupDetails) 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 ModifyModelGroupDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *ModifyModelGroupDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + Description *string `json:"description"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + ModelGroupVersionHistoryId *string `json:"modelGroupVersionHistoryId"` + VersionLabel *string `json:"versionLabel"` + ModelGroupDetails modelgroupdetails `json:"modelGroupDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.Description = model.Description + + m.FreeformTags = model.FreeformTags + + m.DefinedTags = model.DefinedTags + + m.ModelGroupVersionHistoryId = model.ModelGroupVersionHistoryId + + m.VersionLabel = model.VersionLabel + + nn, e = model.ModelGroupDetails.UnmarshalPolymorphicJSON(model.ModelGroupDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.ModelGroupDetails = nn.(ModelGroupDetails) + } else { + m.ModelGroupDetails = nil + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_shape_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_shape_config_details.go index 1bf63903b99..8e7a2d9efcc 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_shape_config_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/notebook_session_shape_config_details.go @@ -23,6 +23,13 @@ type NotebookSessionShapeConfigDetails struct { // The total amount of memory available to the notebook session instance, in gigabytes. MemoryInGBs *float32 `mandatory:"false" json:"memoryInGBs"` + + // The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. + // The following values are supported: + // BASELINE_1_8 - baseline usage is 1/8 of an OCPU. + // BASELINE_1_2 - baseline usage is 1/2 of an OCPU. + // BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. + CpuBaseline NotebookSessionShapeConfigDetailsCpuBaselineEnum `mandatory:"false" json:"cpuBaseline,omitempty"` } func (m NotebookSessionShapeConfigDetails) String() string { @@ -35,8 +42,57 @@ func (m NotebookSessionShapeConfigDetails) String() string { func (m NotebookSessionShapeConfigDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingNotebookSessionShapeConfigDetailsCpuBaselineEnum(string(m.CpuBaseline)); !ok && m.CpuBaseline != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CpuBaseline: %s. Supported values are: %s.", m.CpuBaseline, strings.Join(GetNotebookSessionShapeConfigDetailsCpuBaselineEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } + +// NotebookSessionShapeConfigDetailsCpuBaselineEnum Enum with underlying type: string +type NotebookSessionShapeConfigDetailsCpuBaselineEnum string + +// Set of constants representing the allowable values for NotebookSessionShapeConfigDetailsCpuBaselineEnum +const ( + NotebookSessionShapeConfigDetailsCpuBaseline8 NotebookSessionShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_8" + NotebookSessionShapeConfigDetailsCpuBaseline2 NotebookSessionShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_2" + NotebookSessionShapeConfigDetailsCpuBaseline1 NotebookSessionShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_1" +) + +var mappingNotebookSessionShapeConfigDetailsCpuBaselineEnum = map[string]NotebookSessionShapeConfigDetailsCpuBaselineEnum{ + "BASELINE_1_8": NotebookSessionShapeConfigDetailsCpuBaseline8, + "BASELINE_1_2": NotebookSessionShapeConfigDetailsCpuBaseline2, + "BASELINE_1_1": NotebookSessionShapeConfigDetailsCpuBaseline1, +} + +var mappingNotebookSessionShapeConfigDetailsCpuBaselineEnumLowerCase = map[string]NotebookSessionShapeConfigDetailsCpuBaselineEnum{ + "baseline_1_8": NotebookSessionShapeConfigDetailsCpuBaseline8, + "baseline_1_2": NotebookSessionShapeConfigDetailsCpuBaseline2, + "baseline_1_1": NotebookSessionShapeConfigDetailsCpuBaseline1, +} + +// GetNotebookSessionShapeConfigDetailsCpuBaselineEnumValues Enumerates the set of values for NotebookSessionShapeConfigDetailsCpuBaselineEnum +func GetNotebookSessionShapeConfigDetailsCpuBaselineEnumValues() []NotebookSessionShapeConfigDetailsCpuBaselineEnum { + values := make([]NotebookSessionShapeConfigDetailsCpuBaselineEnum, 0) + for _, v := range mappingNotebookSessionShapeConfigDetailsCpuBaselineEnum { + values = append(values, v) + } + return values +} + +// GetNotebookSessionShapeConfigDetailsCpuBaselineEnumStringValues Enumerates the set of values in String for NotebookSessionShapeConfigDetailsCpuBaselineEnum +func GetNotebookSessionShapeConfigDetailsCpuBaselineEnumStringValues() []string { + return []string{ + "BASELINE_1_8", + "BASELINE_1_2", + "BASELINE_1_1", + } +} + +// GetMappingNotebookSessionShapeConfigDetailsCpuBaselineEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNotebookSessionShapeConfigDetailsCpuBaselineEnum(val string) (NotebookSessionShapeConfigDetailsCpuBaselineEnum, bool) { + enum, ok := mappingNotebookSessionShapeConfigDetailsCpuBaselineEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_insert_new_member_models.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_insert_new_member_models.go new file mode 100644 index 00000000000..a1eb8be0b8e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_insert_new_member_models.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchInsertNewMemberModels This will specify the list of new models that are to be associated with the cloned model group. +type PatchInsertNewMemberModels struct { + + // Array of inference key and model OCID. + Values []MemberModelDetails `mandatory:"true" json:"values"` +} + +func (m PatchInsertNewMemberModels) 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 PatchInsertNewMemberModels) 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 PatchInsertNewMemberModels) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchInsertNewMemberModels PatchInsertNewMemberModels + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchInsertNewMemberModels + }{ + "INSERT", + (MarshalTypePatchInsertNewMemberModels)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_instruction.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_instruction.go new file mode 100644 index 00000000000..b2363c29f58 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_instruction.go @@ -0,0 +1,81 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchInstruction A single instruction to be included as part of Patch request content. +type PatchInstruction interface { +} + +type patchinstruction struct { + JsonData []byte + Operation string `json:"operation"` +} + +// UnmarshalJSON unmarshals json +func (m *patchinstruction) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerpatchinstruction patchinstruction + s := struct { + Model Unmarshalerpatchinstruction + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.Operation = s.Model.Operation + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *patchinstruction) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.Operation { + case "REMOVE": + mm := PatchRemoveMemberModels{} + err = json.Unmarshal(data, &mm) + return mm, err + case "INSERT": + mm := PatchInsertNewMemberModels{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for PatchInstruction: %s.", m.Operation) + return *m, nil + } +} + +func (m patchinstruction) 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 patchinstruction) 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/patch_instruction_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_instruction_type.go new file mode 100644 index 00000000000..e54e8a29943 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_instruction_type.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// PatchInstructionTypeEnum Enum with underlying type: string +type PatchInstructionTypeEnum string + +// Set of constants representing the allowable values for PatchInstructionTypeEnum +const ( + PatchInstructionTypeInsert PatchInstructionTypeEnum = "INSERT" + PatchInstructionTypeRemove PatchInstructionTypeEnum = "REMOVE" +) + +var mappingPatchInstructionTypeEnum = map[string]PatchInstructionTypeEnum{ + "INSERT": PatchInstructionTypeInsert, + "REMOVE": PatchInstructionTypeRemove, +} + +var mappingPatchInstructionTypeEnumLowerCase = map[string]PatchInstructionTypeEnum{ + "insert": PatchInstructionTypeInsert, + "remove": PatchInstructionTypeRemove, +} + +// GetPatchInstructionTypeEnumValues Enumerates the set of values for PatchInstructionTypeEnum +func GetPatchInstructionTypeEnumValues() []PatchInstructionTypeEnum { + values := make([]PatchInstructionTypeEnum, 0) + for _, v := range mappingPatchInstructionTypeEnum { + values = append(values, v) + } + return values +} + +// GetPatchInstructionTypeEnumStringValues Enumerates the set of values in String for PatchInstructionTypeEnum +func GetPatchInstructionTypeEnumStringValues() []string { + return []string{ + "INSERT", + "REMOVE", + } +} + +// GetMappingPatchInstructionTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPatchInstructionTypeEnum(val string) (PatchInstructionTypeEnum, bool) { + enum, ok := mappingPatchInstructionTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_model_group_member_model_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_model_group_member_model_details.go new file mode 100644 index 00000000000..6f96acfcd27 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_model_group_member_model_details.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchModelGroupMemberModelDetails Specifies the list of new models to be added and list of models from source model group to be removed for cloning. +type PatchModelGroupMemberModelDetails struct { + + // Array of patch instructions. + Items []PatchInstruction `mandatory:"false" json:"items"` +} + +func (m PatchModelGroupMemberModelDetails) 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 PatchModelGroupMemberModelDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UnmarshalJSON unmarshals from json +func (m *PatchModelGroupMemberModelDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + Items []patchinstruction `json:"items"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Items = make([]PatchInstruction, len(model.Items)) + for i, n := range model.Items { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Items[i] = nn.(PatchInstruction) + } else { + m.Items[i] = nil + } + } + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_remove_member_models.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_remove_member_models.go new file mode 100644 index 00000000000..e80630f80e6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/patch_remove_member_models.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatchRemoveMemberModels This will specify the list of source model group models that are not to be associated with the cloned model group. +type PatchRemoveMemberModels struct { + + // Array of inference key and model OCID. + Values []MemberModelDetails `mandatory:"true" json:"values"` +} + +func (m PatchRemoveMemberModels) 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 PatchRemoveMemberModels) 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 PatchRemoveMemberModels) MarshalJSON() (buff []byte, e error) { + type MarshalTypePatchRemoveMemberModels PatchRemoveMemberModels + s := struct { + DiscriminatorParam string `json:"operation"` + MarshalTypePatchRemoveMemberModels + }{ + "REMOVE", + (MarshalTypePatchRemoveMemberModels)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/pipeline_shape_config_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/pipeline_shape_config_details.go index b74cb4ad21f..034bd4d158e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/pipeline_shape_config_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/pipeline_shape_config_details.go @@ -23,6 +23,13 @@ type PipelineShapeConfigDetails struct { // A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. MemoryInGBs *float32 `mandatory:"false" json:"memoryInGBs"` + + // The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. + // The following values are supported: + // BASELINE_1_8 - baseline usage is 1/8 of an OCPU. + // BASELINE_1_2 - baseline usage is 1/2 of an OCPU. + // BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. + CpuBaseline PipelineShapeConfigDetailsCpuBaselineEnum `mandatory:"false" json:"cpuBaseline,omitempty"` } func (m PipelineShapeConfigDetails) String() string { @@ -35,8 +42,57 @@ func (m PipelineShapeConfigDetails) String() string { func (m PipelineShapeConfigDetails) ValidateEnumValue() (bool, error) { errMessage := []string{} + if _, ok := GetMappingPipelineShapeConfigDetailsCpuBaselineEnum(string(m.CpuBaseline)); !ok && m.CpuBaseline != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CpuBaseline: %s. Supported values are: %s.", m.CpuBaseline, strings.Join(GetPipelineShapeConfigDetailsCpuBaselineEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) } return false, nil } + +// PipelineShapeConfigDetailsCpuBaselineEnum Enum with underlying type: string +type PipelineShapeConfigDetailsCpuBaselineEnum string + +// Set of constants representing the allowable values for PipelineShapeConfigDetailsCpuBaselineEnum +const ( + PipelineShapeConfigDetailsCpuBaseline8 PipelineShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_8" + PipelineShapeConfigDetailsCpuBaseline2 PipelineShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_2" + PipelineShapeConfigDetailsCpuBaseline1 PipelineShapeConfigDetailsCpuBaselineEnum = "BASELINE_1_1" +) + +var mappingPipelineShapeConfigDetailsCpuBaselineEnum = map[string]PipelineShapeConfigDetailsCpuBaselineEnum{ + "BASELINE_1_8": PipelineShapeConfigDetailsCpuBaseline8, + "BASELINE_1_2": PipelineShapeConfigDetailsCpuBaseline2, + "BASELINE_1_1": PipelineShapeConfigDetailsCpuBaseline1, +} + +var mappingPipelineShapeConfigDetailsCpuBaselineEnumLowerCase = map[string]PipelineShapeConfigDetailsCpuBaselineEnum{ + "baseline_1_8": PipelineShapeConfigDetailsCpuBaseline8, + "baseline_1_2": PipelineShapeConfigDetailsCpuBaseline2, + "baseline_1_1": PipelineShapeConfigDetailsCpuBaseline1, +} + +// GetPipelineShapeConfigDetailsCpuBaselineEnumValues Enumerates the set of values for PipelineShapeConfigDetailsCpuBaselineEnum +func GetPipelineShapeConfigDetailsCpuBaselineEnumValues() []PipelineShapeConfigDetailsCpuBaselineEnum { + values := make([]PipelineShapeConfigDetailsCpuBaselineEnum, 0) + for _, v := range mappingPipelineShapeConfigDetailsCpuBaselineEnum { + values = append(values, v) + } + return values +} + +// GetPipelineShapeConfigDetailsCpuBaselineEnumStringValues Enumerates the set of values in String for PipelineShapeConfigDetailsCpuBaselineEnum +func GetPipelineShapeConfigDetailsCpuBaselineEnumStringValues() []string { + return []string{ + "BASELINE_1_8", + "BASELINE_1_2", + "BASELINE_1_1", + } +} + +// GetMappingPipelineShapeConfigDetailsCpuBaselineEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingPipelineShapeConfigDetailsCpuBaselineEnum(val string) (PipelineShapeConfigDetailsCpuBaselineEnum, bool) { + enum, ok := mappingPipelineShapeConfigDetailsCpuBaselineEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/stacked_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/stacked_model_group_details.go new file mode 100644 index 00000000000..8f3946e9f84 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/stacked_model_group_details.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StackedModelGroupDetails Stacked model group type. +type StackedModelGroupDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model in the group that represents the base model for stacked deployment. + BaseModelId *string `mandatory:"true" json:"baseModelId"` + + // An array of custom metadata details for the model group. + CustomMetadataList []CustomMetadata `mandatory:"false" json:"customMetadataList"` +} + +// GetCustomMetadataList returns CustomMetadataList +func (m StackedModelGroupDetails) GetCustomMetadataList() []CustomMetadata { + return m.CustomMetadataList +} + +func (m StackedModelGroupDetails) 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 StackedModelGroupDetails) 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 StackedModelGroupDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeStackedModelGroupDetails StackedModelGroupDetails + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeStackedModelGroupDetails + }{ + "STACKED", + (MarshalTypeStackedModelGroupDetails)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_infrastructure_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_infrastructure_configuration_details.go new file mode 100644 index 00000000000..e70bce19e1f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_infrastructure_configuration_details.go @@ -0,0 +1,77 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateInfrastructureConfigurationDetails The infrastructure configuration details for update. +type UpdateInfrastructureConfigurationDetails interface { +} + +type updateinfrastructureconfigurationdetails struct { + JsonData []byte + InfrastructureType string `json:"infrastructureType"` +} + +// UnmarshalJSON unmarshals json +func (m *updateinfrastructureconfigurationdetails) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerupdateinfrastructureconfigurationdetails updateinfrastructureconfigurationdetails + s := struct { + Model Unmarshalerupdateinfrastructureconfigurationdetails + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.InfrastructureType = s.Model.InfrastructureType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *updateinfrastructureconfigurationdetails) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.InfrastructureType { + case "INSTANCE_POOL": + mm := UpdateInstancePoolInfrastructureConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Received unsupported enum value for UpdateInfrastructureConfigurationDetails: %s.", m.InfrastructureType) + return *m, nil + } +} + +func (m updateinfrastructureconfigurationdetails) 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 updateinfrastructureconfigurationdetails) 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_instance_pool_infrastructure_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_instance_pool_infrastructure_configuration_details.go new file mode 100644 index 00000000000..35811cb892a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_instance_pool_infrastructure_configuration_details.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateInstancePoolInfrastructureConfigurationDetails Instance Pool based Infrastructure configuration details for update. +type UpdateInstancePoolInfrastructureConfigurationDetails struct { + InstanceConfiguration *InstanceConfiguration `mandatory:"false" json:"instanceConfiguration"` + + ScalingPolicy ScalingPolicy `mandatory:"false" json:"scalingPolicy"` + + // The minimum network bandwidth for the model deployment. + BandwidthMbps *int `mandatory:"false" json:"bandwidthMbps"` + + // The maximum network bandwidth for the model deployment. + MaximumBandwidthMbps *int `mandatory:"false" json:"maximumBandwidthMbps"` +} + +func (m UpdateInstancePoolInfrastructureConfigurationDetails) 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 UpdateInstancePoolInfrastructureConfigurationDetails) 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 UpdateInstancePoolInfrastructureConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateInstancePoolInfrastructureConfigurationDetails UpdateInstancePoolInfrastructureConfigurationDetails + s := struct { + DiscriminatorParam string `json:"infrastructureType"` + MarshalTypeUpdateInstancePoolInfrastructureConfigurationDetails + }{ + "INSTANCE_POOL", + (MarshalTypeUpdateInstancePoolInfrastructureConfigurationDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateInstancePoolInfrastructureConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + InstanceConfiguration *InstanceConfiguration `json:"instanceConfiguration"` + ScalingPolicy scalingpolicy `json:"scalingPolicy"` + BandwidthMbps *int `json:"bandwidthMbps"` + MaximumBandwidthMbps *int `json:"maximumBandwidthMbps"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.InstanceConfiguration = model.InstanceConfiguration + + nn, e = model.ScalingPolicy.UnmarshalPolymorphicJSON(model.ScalingPolicy.JsonData) + if e != nil { + return + } + if nn != nil { + m.ScalingPolicy = nn.(ScalingPolicy) + } else { + m.ScalingPolicy = nil + } + + m.BandwidthMbps = model.BandwidthMbps + + m.MaximumBandwidthMbps = model.MaximumBandwidthMbps + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_deployment_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_deployment_configuration_details.go index 7b097c30bfc..2dae8f3ed1d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_deployment_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_deployment_configuration_details.go @@ -50,6 +50,10 @@ func (m *updatemodeldeploymentconfigurationdetails) UnmarshalPolymorphicJSON(dat var err error switch m.DeploymentType { + case "MODEL_GROUP": + mm := UpdateModelGroupDeploymentConfigurationDetails{} + err = json.Unmarshal(data, &mm) + return mm, err case "SINGLE_MODEL": mm := UpdateSingleModelDeploymentConfigurationDetails{} err = json.Unmarshal(data, &mm) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_configuration_details.go new file mode 100644 index 00000000000..aaa7b383948 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_configuration_details.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// UpdateModelGroupConfigurationDetails The model group configuration details for update. +type UpdateModelGroupConfigurationDetails struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group you want to deploy. + ModelGroupId *string `mandatory:"true" json:"modelGroupId"` +} + +func (m UpdateModelGroupConfigurationDetails) 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 UpdateModelGroupConfigurationDetails) 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_model_group_deployment_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_deployment_configuration_details.go new file mode 100644 index 00000000000..5092d935b97 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_deployment_configuration_details.go @@ -0,0 +1,145 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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 ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateModelGroupDeploymentConfigurationDetails The model group type deployment for update. +type UpdateModelGroupDeploymentConfigurationDetails struct { + ModelGroupConfigurationDetails *UpdateModelGroupConfigurationDetails `mandatory:"false" json:"modelGroupConfigurationDetails"` + + InfrastructureConfigurationDetails UpdateInfrastructureConfigurationDetails `mandatory:"false" json:"infrastructureConfigurationDetails"` + + EnvironmentConfigurationDetails UpdateModelDeploymentEnvironmentConfigurationDetails `mandatory:"false" json:"environmentConfigurationDetails"` + + // The type of update operation. + UpdateType UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum `mandatory:"false" json:"updateType,omitempty"` +} + +func (m UpdateModelGroupDeploymentConfigurationDetails) 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 UpdateModelGroupDeploymentConfigurationDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum(string(m.UpdateType)); !ok && m.UpdateType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for UpdateType: %s. Supported values are: %s.", m.UpdateType, strings.Join(GetUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m UpdateModelGroupDeploymentConfigurationDetails) MarshalJSON() (buff []byte, e error) { + type MarshalTypeUpdateModelGroupDeploymentConfigurationDetails UpdateModelGroupDeploymentConfigurationDetails + s := struct { + DiscriminatorParam string `json:"deploymentType"` + MarshalTypeUpdateModelGroupDeploymentConfigurationDetails + }{ + "MODEL_GROUP", + (MarshalTypeUpdateModelGroupDeploymentConfigurationDetails)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *UpdateModelGroupDeploymentConfigurationDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + UpdateType UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum `json:"updateType"` + ModelGroupConfigurationDetails *UpdateModelGroupConfigurationDetails `json:"modelGroupConfigurationDetails"` + InfrastructureConfigurationDetails updateinfrastructureconfigurationdetails `json:"infrastructureConfigurationDetails"` + EnvironmentConfigurationDetails updatemodeldeploymentenvironmentconfigurationdetails `json:"environmentConfigurationDetails"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.UpdateType = model.UpdateType + + m.ModelGroupConfigurationDetails = model.ModelGroupConfigurationDetails + + nn, e = model.InfrastructureConfigurationDetails.UnmarshalPolymorphicJSON(model.InfrastructureConfigurationDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.InfrastructureConfigurationDetails = nn.(UpdateInfrastructureConfigurationDetails) + } else { + m.InfrastructureConfigurationDetails = nil + } + + nn, e = model.EnvironmentConfigurationDetails.UnmarshalPolymorphicJSON(model.EnvironmentConfigurationDetails.JsonData) + if e != nil { + return + } + if nn != nil { + m.EnvironmentConfigurationDetails = nn.(UpdateModelDeploymentEnvironmentConfigurationDetails) + } else { + m.EnvironmentConfigurationDetails = nil + } + + return +} + +// UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum Enum with underlying type: string +type UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum string + +// Set of constants representing the allowable values for UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum +const ( + UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeZdt UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum = "ZDT" + UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeLive UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum = "LIVE" +) + +var mappingUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum = map[string]UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum{ + "ZDT": UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeZdt, + "LIVE": UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeLive, +} + +var mappingUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnumLowerCase = map[string]UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum{ + "zdt": UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeZdt, + "live": UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeLive, +} + +// GetUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnumValues Enumerates the set of values for UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum +func GetUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnumValues() []UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum { + values := make([]UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum, 0) + for _, v := range mappingUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum { + values = append(values, v) + } + return values +} + +// GetUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnumStringValues Enumerates the set of values in String for UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum +func GetUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnumStringValues() []string { + return []string{ + "ZDT", + "LIVE", + } +} + +// GetMappingUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum(val string) (UpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnum, bool) { + enum, ok := mappingUpdateModelGroupDeploymentConfigurationDetailsUpdateTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_details.go new file mode 100644 index 00000000000..c2b7a9947e5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_details.go @@ -0,0 +1,57 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// UpdateModelGroupDetails Details for updating a modelGroup. +type UpdateModelGroupDetails struct { + + // A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. + // Example: `My ModelGroup` + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the modelGroup. + Description *string `mandatory:"false" json:"description"` + + // An additional description of the lifecycle state of the model group. + VersionLabel *string `mandatory:"false" json:"versionLabel"` + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup will be associated. + ModelGroupVersionHistoryId *string `mandatory:"false" json:"modelGroupVersionHistoryId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateModelGroupDetails) 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 UpdateModelGroupDetails) 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_model_group_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_request_response.go new file mode 100644 index 00000000000..3c5e9989115 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateModelGroupRequest wrapper for the UpdateModelGroup operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/UpdateModelGroup.go.html to see an example of how to use UpdateModelGroupRequest. +type UpdateModelGroupRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + ModelGroupId *string `mandatory:"true" contributesTo:"path" name:"modelGroupId"` + + // Details for updating a modelGroup. + UpdateModelGroupDetails `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 UpdateModelGroupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateModelGroupRequest) 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 UpdateModelGroupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateModelGroupRequest) 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 UpdateModelGroupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateModelGroupResponse wrapper for the UpdateModelGroup operation +type UpdateModelGroupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroup instance + ModelGroup `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 UpdateModelGroupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateModelGroupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_version_history_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_version_history_details.go new file mode 100644 index 00000000000..72000c6df1c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_version_history_details.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// 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" +) + +// UpdateModelGroupVersionHistoryDetails Details for updating a model group version history. +type UpdateModelGroupVersionHistoryDetails struct { + + // A user-friendly display name for the resource. + DisplayName *string `mandatory:"false" json:"displayName"` + + // A short description of the model group version history. + Description *string `mandatory:"false" json:"description"` + + // The OCID of the latest version of the model group associated. + LatestModelGroupId *string `mandatory:"false" json:"latestModelGroupId"` + + // 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.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Department": "Finance"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). + // Example: `{"Operations": {"CostCenter": "42"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` +} + +func (m UpdateModelGroupVersionHistoryDetails) 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 UpdateModelGroupVersionHistoryDetails) 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_model_group_version_history_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_version_history_request_response.go new file mode 100644 index 00000000000..4a76d0d984a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/datascience/update_model_group_version_history_request_response.go @@ -0,0 +1,103 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package datascience + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateModelGroupVersionHistoryRequest wrapper for the UpdateModelGroupVersionHistory operation +// +// # See also +// +// Click https://docs.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/datascience/UpdateModelGroupVersionHistory.go.html to see an example of how to use UpdateModelGroupVersionHistoryRequest. +type UpdateModelGroupVersionHistoryRequest struct { + + // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + ModelGroupVersionHistoryId *string `mandatory:"true" contributesTo:"path" name:"modelGroupVersionHistoryId"` + + // Details for updating a modelGroupVersionHistory. + UpdateModelGroupVersionHistoryDetails `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 UpdateModelGroupVersionHistoryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateModelGroupVersionHistoryRequest) 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 UpdateModelGroupVersionHistoryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateModelGroupVersionHistoryRequest) 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 UpdateModelGroupVersionHistoryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateModelGroupVersionHistoryResponse wrapper for the UpdateModelGroupVersionHistory operation +type UpdateModelGroupVersionHistoryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ModelGroupVersionHistory instance + ModelGroupVersionHistory `presentIn:"body"` + + // For optimistic concurrency control. See ETags for Optimistic Concurrency Control (https://docs.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 UpdateModelGroupVersionHistoryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateModelGroupVersionHistoryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} 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 a0bbd3fa4a6..cd4a17c9026 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 @@ -64,6 +64,10 @@ const ( WorkRequestOperationTypeScheduleDeactivate WorkRequestOperationTypeEnum = "SCHEDULE_DEACTIVATE" WorkRequestOperationTypeRegisterModelArtifact WorkRequestOperationTypeEnum = "REGISTER_MODEL_ARTIFACT" WorkRequestOperationTypeRestoreArchivedModel WorkRequestOperationTypeEnum = "RESTORE_ARCHIVED_MODEL" + WorkRequestOperationTypeModelGroupCreate WorkRequestOperationTypeEnum = "MODEL_GROUP_CREATE" + WorkRequestOperationTypeModelGroupUpdate WorkRequestOperationTypeEnum = "MODEL_GROUP_UPDATE" + WorkRequestOperationTypeModelGroupDelete WorkRequestOperationTypeEnum = "MODEL_GROUP_DELETE" + WorkRequestOperationTypeModelGroupVersionHistoryDelete WorkRequestOperationTypeEnum = "MODEL_GROUP_VERSION_HISTORY_DELETE" ) var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnum{ @@ -113,6 +117,10 @@ var mappingWorkRequestOperationTypeEnum = map[string]WorkRequestOperationTypeEnu "SCHEDULE_DEACTIVATE": WorkRequestOperationTypeScheduleDeactivate, "REGISTER_MODEL_ARTIFACT": WorkRequestOperationTypeRegisterModelArtifact, "RESTORE_ARCHIVED_MODEL": WorkRequestOperationTypeRestoreArchivedModel, + "MODEL_GROUP_CREATE": WorkRequestOperationTypeModelGroupCreate, + "MODEL_GROUP_UPDATE": WorkRequestOperationTypeModelGroupUpdate, + "MODEL_GROUP_DELETE": WorkRequestOperationTypeModelGroupDelete, + "MODEL_GROUP_VERSION_HISTORY_DELETE": WorkRequestOperationTypeModelGroupVersionHistoryDelete, } var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperationTypeEnum{ @@ -162,6 +170,10 @@ var mappingWorkRequestOperationTypeEnumLowerCase = map[string]WorkRequestOperati "schedule_deactivate": WorkRequestOperationTypeScheduleDeactivate, "register_model_artifact": WorkRequestOperationTypeRegisterModelArtifact, "restore_archived_model": WorkRequestOperationTypeRestoreArchivedModel, + "model_group_create": WorkRequestOperationTypeModelGroupCreate, + "model_group_update": WorkRequestOperationTypeModelGroupUpdate, + "model_group_delete": WorkRequestOperationTypeModelGroupDelete, + "model_group_version_history_delete": WorkRequestOperationTypeModelGroupVersionHistoryDelete, } // GetWorkRequestOperationTypeEnumValues Enumerates the set of values for WorkRequestOperationTypeEnum @@ -222,6 +234,10 @@ func GetWorkRequestOperationTypeEnumStringValues() []string { "SCHEDULE_DEACTIVATE", "REGISTER_MODEL_ARTIFACT", "RESTORE_ARCHIVED_MODEL", + "MODEL_GROUP_CREATE", + "MODEL_GROUP_UPDATE", + "MODEL_GROUP_DELETE", + "MODEL_GROUP_VERSION_HISTORY_DELETE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/dblm/dblm_dblifecyclemanagement_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/dblm/dblm_dblifecyclemanagement_client.go index f40a4491818..beb9e857c7d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/dblm/dblm_dblifecyclemanagement_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/dblm/dblm_dblifecyclemanagement_client.go @@ -145,7 +145,7 @@ func (client DbLifeCycleManagementClient) createVulnerabilityScan(ctx context.Co defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/VulnerabilityScan/CreateVulnerabilityScan" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "CreateVulnerabilityScan", apiReferenceLink) return response, err } @@ -203,7 +203,7 @@ func (client DbLifeCycleManagementClient) getPatchManagement(ctx context.Context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/DblmPatchManagement/GetPatchManagement" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "GetPatchManagement", apiReferenceLink) return response, err } @@ -261,7 +261,7 @@ func (client DbLifeCycleManagementClient) getVulnerability(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/DblmVulnerability/GetVulnerability" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "GetVulnerability", apiReferenceLink) return response, err } @@ -319,7 +319,7 @@ func (client DbLifeCycleManagementClient) getVulnerabilityScan(ctx context.Conte defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/VulnerabilityScan/GetVulnerabilityScan" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "GetVulnerabilityScan", apiReferenceLink) return response, err } @@ -377,7 +377,7 @@ func (client DbLifeCycleManagementClient) getWorkRequest(ctx context.Context, re defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/WorkRequest/GetWorkRequest" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "GetWorkRequest", apiReferenceLink) return response, err } @@ -435,7 +435,7 @@ func (client DbLifeCycleManagementClient) listAggregatedVulnerabilityData(ctx co defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/DblmVulnerability/ListAggregatedVulnerabilityData" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListAggregatedVulnerabilityData", apiReferenceLink) return response, err } @@ -493,7 +493,7 @@ func (client DbLifeCycleManagementClient) listDatabases(ctx context.Context, req defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/PatchDatabasesCollection/ListDatabases" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListDatabases", apiReferenceLink) return response, err } @@ -551,7 +551,7 @@ func (client DbLifeCycleManagementClient) listNotifications(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/NotificationCollection/ListNotifications" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListNotifications", apiReferenceLink) return response, err } @@ -614,7 +614,7 @@ func (client DbLifeCycleManagementClient) listVulnerabilities(ctx context.Contex defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/DblmVulnerability/ListVulnerabilities" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListVulnerabilities", apiReferenceLink) return response, err } @@ -672,7 +672,7 @@ func (client DbLifeCycleManagementClient) listVulnerabilityResources(ctx context defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/VulnerabilityResourceCollection/ListVulnerabilityResources" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListVulnerabilityResources", apiReferenceLink) return response, err } @@ -730,7 +730,7 @@ func (client DbLifeCycleManagementClient) listVulnerabilityScans(ctx context.Con defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/VulnerabilityScanCollection/ListVulnerabilityScans" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListVulnerabilityScans", apiReferenceLink) return response, err } @@ -788,7 +788,7 @@ func (client DbLifeCycleManagementClient) listWorkRequestErrors(ctx context.Cont defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/WorkRequestError/ListWorkRequestErrors" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListWorkRequestErrors", apiReferenceLink) return response, err } @@ -846,7 +846,7 @@ func (client DbLifeCycleManagementClient) listWorkRequestLogs(ctx context.Contex defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/WorkRequestLogEntry/ListWorkRequestLogs" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListWorkRequestLogs", apiReferenceLink) return response, err } @@ -904,7 +904,7 @@ func (client DbLifeCycleManagementClient) listWorkRequests(ctx context.Context, defer common.CloseBodyIfValid(httpResponse) response.RawResponse = httpResponse if err != nil { - apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/dbmgmt/20240102/WorkRequest/ListWorkRequests" + apiReferenceLink := "" err = common.PostProcessServiceError(err, "DbLifeCycleManagement", "ListWorkRequests", apiReferenceLink) return response, err } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/export_dashboard_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/export_dashboard_request_response.go index fa3f067ae79..2f1bb9d62d0 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/export_dashboard_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/export_dashboard_request_response.go @@ -31,6 +31,10 @@ type ExportDashboardRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // Indicates whether tags must be included when exporting dashboards and saved searches. If this attribute is set to true, then both defined and free-form tags are included in the response. The default is false and tag fields are empty objects in the response. + // If set to true, NotAuthorizedException is returned if you do not have the permission to access tags, even if you have the permission to access dashboards and saved searches. + ExportTags *string `mandatory:"false" contributesTo:"query" name:"exportTags"` + // 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/managementdashboard/import_dashboard_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/import_dashboard_request_response.go index 2c17be04372..ea8d27ef15f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/import_dashboard_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/import_dashboard_request_response.go @@ -38,6 +38,16 @@ type ImportDashboardRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // By default, if a resource with the same OCID exists in the target compartment, it is updated during the import process, otherwise, a new resource is created. + // However, if this attribute is set to true, then during the import process if a resource with the same displayName exists in the compartment, then it is updated even if the OCIDs are different. This is useful when importing the same resource multiple times. If the compartment and displayName remain the same, the resource is only updated and multiple copies of a resource are not created. + OverrideSameName *string `mandatory:"false" contributesTo:"query" name:"overrideSameName"` + + // If this attribute is set, the dashboard resources are created or updated in the compartment specified by OCID. If this attribute is not set, the compartment specified in the JSON metadata is used. + OverrideDashboardCompartmentOcid *string `mandatory:"false" contributesTo:"query" name:"overrideDashboardCompartmentOcid"` + + // If this attribute is set, the saved search resources are created or updated in the compartment specified by OCID. If this attribute is not set, the compartment specified in the JSON metadata is used. + OverrideSavedSearchCompartmentOcid *string `mandatory:"false" contributesTo:"query" name:"overrideSavedSearchCompartmentOcid"` + // 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/managementdashboard/management_dashboard.go b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_dashboard.go index b5f066672aa..a7bb30fcaf9 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_dashboard.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_dashboard.go @@ -110,6 +110,10 @@ type ManagementDashboard struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m ManagementDashboard) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_dashboard_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_dashboard_summary.go index 6b48c76d626..a5e457b7f11 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_dashboard_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_dashboard_summary.go @@ -83,6 +83,10 @@ type ManagementDashboardSummary struct { // Contains configuration for enabling features. FeaturesConfig *interface{} `mandatory:"false" json:"featuresConfig"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m ManagementDashboardSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search.go b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search.go index 2fbed73c623..8dab84536a7 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search.go @@ -98,6 +98,10 @@ type ManagementSavedSearch struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m ManagementSavedSearch) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search_summary.go index 84b9ba45159..f236db49079 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/management_saved_search_summary.go @@ -95,6 +95,10 @@ type ManagementSavedSearchSummary struct { // Defined tags for this resource. Each key is predefined and scoped to a namespace. // Example: `{"foo-namespace": {"bar-key": "value"}}` DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // Usage of system tag keys. These predefined keys are scoped to namespaces. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` } func (m ManagementSavedSearchSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/managementdashboard_dashxapis_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/managementdashboard_dashxapis_client.go index 92d1e07bbfd..0ca47b6e7e3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/managementdashboard_dashxapis_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/managementdashboard/managementdashboard_dashxapis_client.go @@ -648,7 +648,7 @@ func (client DashxApisClient) getManagementSavedSearch(ctx context.Context, requ return response, err } -// GetOobManagementDashboard Gets an OOB dashboard and its saved searches by ID. Deleted or unauthorized saved searches are marked by tile's state property. +// GetOobManagementDashboard Gets an out-of-the-box dashboard and its saved searches by ID. Deleted or unauthorized saved searches are marked by tile's state property. // // # See also // @@ -705,7 +705,7 @@ func (client DashxApisClient) getOobManagementDashboard(ctx context.Context, req return response, err } -// GetOobManagementSavedSearch Gets a saved search by ID. +// GetOobManagementSavedSearch Gets an out-of-the-box saved search by ID. // // # See also // @@ -943,7 +943,7 @@ func (client DashxApisClient) listManagementSavedSearches(ctx context.Context, r return response, err } -// ListOobManagementDashboards Gets the list of OOB dashboards with pagination. Returned properties are the summary. +// ListOobManagementDashboards Gets the list of out-of-the-box dashboards with pagination. Returned properties are the summary. // // # See also // @@ -1000,7 +1000,7 @@ func (client DashxApisClient) listOobManagementDashboards(ctx context.Context, r return response, err } -// ListOobManagementSavedSearches Gets the list of out-of-box saved searches in a compartment with pagination. Returned properties are the summary. +// ListOobManagementSavedSearches Gets the list of out-of-the-box saved searches in a compartment with pagination. Returned properties are the summary. // // # See also // diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/backup_source_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/backup_source_details.go index 4e8dc071efb..054039efb4c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/backup_source_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/backup_source_details.go @@ -17,8 +17,7 @@ import ( "strings" ) -// BackupSourceDetails Restoring to a new database system from the backup. -// The database system details that are part of the CreateDbSystem request are not required, but if present will override the details from the backup's database system snapshot. +// BackupSourceDetails Details of the database system backup. type BackupSourceDetails struct { // The OCID (https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database system backup. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration.go index d10e2e56f02..beda3d5704c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration.go @@ -40,7 +40,7 @@ type Configuration struct { DbVersion *string `mandatory:"true" json:"dbVersion"` // The name of the shape for the configuration. - // Example: `VM.Standard.E4.Flex` + // For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. Shape *string `mandatory:"true" json:"shape"` // CPU core count. @@ -51,6 +51,12 @@ type Configuration struct { // It's value is set to 0 if configuration is for a flexible shape. InstanceMemorySizeInGBs *int `mandatory:"true" json:"instanceMemorySizeInGBs"` + // Indicates the collection of compatible shapes for this configuration. + CompatibleShapes []string `mandatory:"true" json:"compatibleShapes"` + + // The Default configuration used for this configuration. + DefaultConfigId *string `mandatory:"true" json:"defaultConfigId"` + ConfigurationDetails *ConfigurationDetails `mandatory:"true" json:"configurationDetails"` // A description for the configuration. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration_summary.go index dabd3f91bf0..da56e8d0300 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/configuration_summary.go @@ -40,7 +40,7 @@ type ConfigurationSummary struct { DbVersion *string `mandatory:"true" json:"dbVersion"` // The name of the shape for the configuration. - // Example: `VM.Standard.E4.Flex` + // For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. Shape *string `mandatory:"true" json:"shape"` // CPU core count. @@ -51,6 +51,12 @@ type ConfigurationSummary struct { // It's value is set to 0 if configuration is for a flexible shape. InstanceMemorySizeInGBs *int `mandatory:"true" json:"instanceMemorySizeInGBs"` + // Indicates the collection of compatible shapes for this configuration. + CompatibleShapes []string `mandatory:"true" json:"compatibleShapes"` + + // The Default configuration used for this configuration. + DefaultConfigId *string `mandatory:"true" json:"defaultConfigId"` + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/create_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/create_configuration_details.go index 8b6e393da1f..955cfab0b35 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/create_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/create_configuration_details.go @@ -28,15 +28,15 @@ type CreateConfigurationDetails struct { // Version of the PostgreSQL database. DbVersion *string `mandatory:"true" json:"dbVersion"` - // The name of the shape for the configuration. - // Example: `VM.Standard.E4.Flex` - Shape *string `mandatory:"true" json:"shape"` - DbConfigurationOverrides *DbConfigurationOverrideCollection `mandatory:"true" json:"dbConfigurationOverrides"` // Details about the configuration set. Description *string `mandatory:"false" json:"description"` + // The name of the shape for the configuration. + // For multi-shape enabled configurations, it is set to PostgreSQL.X86 or similar. Please use compatibleShapes property to set the list of supported shapes. + Shape *string `mandatory:"false" json:"shape"` + // Whether the configuration supports flexible shapes. IsFlexible *bool `mandatory:"false" json:"isFlexible"` @@ -48,6 +48,9 @@ type CreateConfigurationDetails struct { // Skip or set it's value to 0 if configuration is for a flexible shape. InstanceMemorySizeInGBs *int `mandatory:"false" json:"instanceMemorySizeInGBs"` + // Indicates the collection of compatible shapes for this configuration. + CompatibleShapes []string `mandatory:"false" json:"compatibleShapes"` + // 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"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration.go index 6e2623de22c..7a50218c059 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration.go @@ -37,7 +37,7 @@ type DefaultConfiguration struct { DbVersion *string `mandatory:"true" json:"dbVersion"` // The name of the shape for the configuration. - // Example: `VM.Standard.E4.Flex` + // For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. Shape *string `mandatory:"true" json:"shape"` // CPU core count. @@ -48,6 +48,9 @@ type DefaultConfiguration struct { // Its value is set to 0 if configuration is for a flexible shape. InstanceMemorySizeInGBs *int `mandatory:"true" json:"instanceMemorySizeInGBs"` + // Indicates the collection of compatible shapes for this configuration. + CompatibleShapes []string `mandatory:"true" json:"compatibleShapes"` + ConfigurationDetails *DefaultConfigurationDetails `mandatory:"true" json:"configurationDetails"` // A description for the configuration. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration_summary.go index 789f5141889..643598c8e8f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/default_configuration_summary.go @@ -37,7 +37,7 @@ type DefaultConfigurationSummary struct { DbVersion *string `mandatory:"true" json:"dbVersion"` // The name of the shape for the configuration. - // Example: `VM.Standard.E4.Flex` + // For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. Shape *string `mandatory:"true" json:"shape"` // CPU core count. @@ -48,6 +48,9 @@ type DefaultConfigurationSummary struct { // It's value is set to 0 if configuration is for a flexible shape. InstanceMemorySizeInGBs *int `mandatory:"true" json:"instanceMemorySizeInGBs"` + // Indicates the collection of compatible shapes for this configuration. + CompatibleShapes []string `mandatory:"true" json:"compatibleShapes"` + // A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_configurations_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_configurations_request_response.go index 499a1e18132..a74acf03329 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_configurations_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_configurations_request_response.go @@ -33,13 +33,18 @@ type ListConfigurationsRequest struct { // Version of the PostgreSQL database, such as 14.9. DbVersion *string `mandatory:"false" contributesTo:"query" name:"dbVersion"` - // The name of the shape for the configuration. - // Example: `VM.Standard.E4.Flex` + // The compute name of the shape for the configuration. Shape *string `mandatory:"false" contributesTo:"query" name:"shape"` // A unique identifier for the configuration. ConfigurationId *string `mandatory:"false" contributesTo:"query" name:"configurationId"` + // The instance ocpu count for the configuration. + InstanceOcpuCount *int `mandatory:"false" contributesTo:"query" name:"instanceOcpuCount"` + + // The instance memory size in GBs for the configuration. + InstanceMemorySizeInGBs *int `mandatory:"false" contributesTo:"query" name:"instanceMemorySizeInGBs"` + // The maximum number of items to return. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_default_configurations_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_default_configurations_request_response.go index 43eba59821b..54f80e6967d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_default_configurations_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/list_default_configurations_request_response.go @@ -27,10 +27,15 @@ type ListDefaultConfigurationsRequest struct { // Version of the PostgreSQL database, such as 14.9. DbVersion *string `mandatory:"false" contributesTo:"query" name:"dbVersion"` - // The name of the shape for the configuration. - // Example: `VM.Standard.E4.Flex` + // The compute name of the shape for the configuration. Shape *string `mandatory:"false" contributesTo:"query" name:"shape"` + // The instance ocpu count for the configuration. + InstanceOcpuCount *int `mandatory:"false" contributesTo:"query" name:"instanceOcpuCount"` + + // The instance memory size in GBs for the configuration. + InstanceMemorySizeInGBs *int `mandatory:"false" contributesTo:"query" name:"instanceMemorySizeInGBs"` + // A unique identifier for the configuration. ConfigurationId *string `mandatory:"false" contributesTo:"query" name:"configurationId"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/source_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/source_details.go index 85a2b5da480..876b4916785 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/source_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/source_details.go @@ -17,7 +17,7 @@ import ( "strings" ) -// SourceDetails The source used to restore the database system. +// SourceDetails The source of the database system. type SourceDetails interface { } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/psql/update_configuration_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/psql/update_configuration_details.go index 272a76e408b..6648cea38f1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/psql/update_configuration_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/psql/update_configuration_details.go @@ -32,6 +32,9 @@ type UpdateConfigurationDetails struct { // 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"` + + // Indicates the collection of compatible shapes for this configuration. + CompatibleShapes []string `mandatory:"false" json:"compatibleShapes"` } func (m UpdateConfigurationDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/vault/create_secret_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/vault/create_secret_details.go index cea341fc0f8..35b5bd7c40b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/vault/create_secret_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/vault/create_secret_details.go @@ -51,6 +51,8 @@ type CreateSecretDetails struct { SecretContent SecretContentDetails `mandatory:"false" json:"secretContent"` + ReplicationConfig *ReplicationConfig `mandatory:"false" json:"replicationConfig"` + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` // A list of rules to control how the secret is used and managed. @@ -86,6 +88,7 @@ func (m *CreateSecretDetails) UnmarshalJSON(data []byte) (e error) { FreeformTags map[string]string `json:"freeformTags"` Metadata map[string]interface{} `json:"metadata"` SecretContent secretcontentdetails `json:"secretContent"` + ReplicationConfig *ReplicationConfig `json:"replicationConfig"` RotationConfig *RotationConfig `json:"rotationConfig"` SecretRules []secretrule `json:"secretRules"` SecretGenerationContext secretgenerationcontext `json:"secretGenerationContext"` @@ -119,6 +122,8 @@ func (m *CreateSecretDetails) UnmarshalJSON(data []byte) (e error) { m.SecretContent = nil } + m.ReplicationConfig = model.ReplicationConfig + m.RotationConfig = model.RotationConfig m.SecretRules = make([]SecretRule, len(model.SecretRules)) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/vault/replication_config.go b/vendor/github.com/oracle/oci-go-sdk/v65/vault/replication_config.go new file mode 100644 index 00000000000..68fee106ee5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/vault/replication_config.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Secret Management API +// +// Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingsecrets.htm). +// + +package vault + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplicationConfig Defines the configuration that enables cross-region secret replication. +type ReplicationConfig struct { + + // List of the secret replication targets. By default, a maximum of 3 targets is allowed. To configure more than 3 targets, an override is required. + ReplicationTargets []ReplicationTarget `mandatory:"true" json:"replicationTargets"` + + // (Optional) A Boolean value to enable forwarding of write requests from replicated secrets to the source secrets. The default value of false disables this option. + IsWriteForwardEnabled *bool `mandatory:"false" json:"isWriteForwardEnabled"` +} + +func (m ReplicationConfig) 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 ReplicationConfig) 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/vault/replication_target.go b/vendor/github.com/oracle/oci-go-sdk/v65/vault/replication_target.go new file mode 100644 index 00000000000..c71a763f817 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/vault/replication_target.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Secret Management API +// +// Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingsecrets.htm). +// + +package vault + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ReplicationTarget Details for the target that the source secret will be replicated to. +type ReplicationTarget struct { + + // The OCID of the target region KMS key. + TargetKeyId *string `mandatory:"true" json:"targetKeyId"` + + // The name of the target's region. + TargetRegion *string `mandatory:"true" json:"targetRegion"` + + // The OCID of the target region's Vault. + TargetVaultId *string `mandatory:"true" json:"targetVaultId"` +} + +func (m ReplicationTarget) 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 ReplicationTarget) 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/vault/secret.go b/vendor/github.com/oracle/oci-go-sdk/v65/vault/secret.go index 6cd55db97a4..2d24e371f0c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/vault/secret.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/vault/secret.go @@ -65,6 +65,13 @@ type Secret struct { // metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. Metadata map[string]interface{} `mandatory:"false" json:"metadata"` + ReplicationConfig *ReplicationConfig `mandatory:"false" json:"replicationConfig"` + + // A Boolean value that indicates whether the secret is a source or replica secret. + IsReplica *bool `mandatory:"false" json:"isReplica"` + + SourceRegionInformation *SourceRegionInformation `mandatory:"false" json:"sourceRegionInformation"` + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` // Additional information about the status of the secret rotation @@ -127,6 +134,9 @@ func (m *Secret) UnmarshalJSON(data []byte) (e error) { KeyId *string `json:"keyId"` LifecycleDetails *string `json:"lifecycleDetails"` Metadata map[string]interface{} `json:"metadata"` + ReplicationConfig *ReplicationConfig `json:"replicationConfig"` + IsReplica *bool `json:"isReplica"` + SourceRegionInformation *SourceRegionInformation `json:"sourceRegionInformation"` RotationConfig *RotationConfig `json:"rotationConfig"` RotationStatus SecretRotationStatusEnum `json:"rotationStatus"` LastRotationTime *common.SDKTime `json:"lastRotationTime"` @@ -163,6 +173,12 @@ func (m *Secret) UnmarshalJSON(data []byte) (e error) { m.Metadata = model.Metadata + m.ReplicationConfig = model.ReplicationConfig + + m.IsReplica = model.IsReplica + + m.SourceRegionInformation = model.SourceRegionInformation + m.RotationConfig = model.RotationConfig m.RotationStatus = model.RotationStatus diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/vault/secret_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/vault/secret_summary.go index bcc0439b28c..6ce8ef7c35d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/vault/secret_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/vault/secret_summary.go @@ -61,6 +61,13 @@ type SecretSummary struct { // Additional information about the secret's current lifecycle state. LifecycleDetails *string `mandatory:"false" json:"lifecycleDetails"` + ReplicationConfig *ReplicationConfig `mandatory:"false" json:"replicationConfig"` + + // A Boolean value that indicates whether the secret is a source or replica secret. + IsReplica *bool `mandatory:"false" json:"isReplica"` + + SourceRegionInformation *SourceRegionInformation `mandatory:"false" json:"sourceRegionInformation"` + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` // Additional information about the status of the secret rotation @@ -119,6 +126,9 @@ func (m *SecretSummary) UnmarshalJSON(data []byte) (e error) { SystemTags map[string]map[string]interface{} `json:"systemTags"` KeyId *string `json:"keyId"` LifecycleDetails *string `json:"lifecycleDetails"` + ReplicationConfig *ReplicationConfig `json:"replicationConfig"` + IsReplica *bool `json:"isReplica"` + SourceRegionInformation *SourceRegionInformation `json:"sourceRegionInformation"` RotationConfig *RotationConfig `json:"rotationConfig"` RotationStatus SecretRotationStatusEnum `json:"rotationStatus"` LastRotationTime *common.SDKTime `json:"lastRotationTime"` @@ -152,6 +162,12 @@ func (m *SecretSummary) UnmarshalJSON(data []byte) (e error) { m.LifecycleDetails = model.LifecycleDetails + m.ReplicationConfig = model.ReplicationConfig + + m.IsReplica = model.IsReplica + + m.SourceRegionInformation = model.SourceRegionInformation + m.RotationConfig = model.RotationConfig m.RotationStatus = model.RotationStatus diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/vault/source_region_information.go b/vendor/github.com/oracle/oci-go-sdk/v65/vault/source_region_information.go new file mode 100644 index 00000000000..075fd40b94c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/vault/source_region_information.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Vault Secret Management API +// +// Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets (https://docs.oracle.com/iaas/Content/KeyManagement/Tasks/managingsecrets.htm). +// + +package vault + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// SourceRegionInformation Details for the source that the source secret has. +type SourceRegionInformation struct { + + // The OCID of the source region KMS key. + SourceKeyId *string `mandatory:"true" json:"sourceKeyId"` + + // The name of the source's region. + SourceRegion *string `mandatory:"true" json:"sourceRegion"` + + // The OCID of the source region's Vault. + SourceVaultId *string `mandatory:"true" json:"sourceVaultId"` +} + +func (m SourceRegionInformation) 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 SourceRegionInformation) 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/vault/update_secret_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/vault/update_secret_details.go index 24e6bef8fd3..3861b11b94c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/vault/update_secret_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/vault/update_secret_details.go @@ -44,6 +44,8 @@ type UpdateSecretDetails struct { SecretContent SecretContentDetails `mandatory:"false" json:"secretContent"` + ReplicationConfig *ReplicationConfig `mandatory:"false" json:"replicationConfig"` + RotationConfig *RotationConfig `mandatory:"false" json:"rotationConfig"` // A list of rules to control how the secret is used and managed. @@ -80,6 +82,7 @@ func (m *UpdateSecretDetails) UnmarshalJSON(data []byte) (e error) { FreeformTags map[string]string `json:"freeformTags"` Metadata map[string]interface{} `json:"metadata"` SecretContent secretcontentdetails `json:"secretContent"` + ReplicationConfig *ReplicationConfig `json:"replicationConfig"` RotationConfig *RotationConfig `json:"rotationConfig"` SecretRules []secretrule `json:"secretRules"` SecretGenerationContext secretgenerationcontext `json:"secretGenerationContext"` @@ -111,6 +114,8 @@ func (m *UpdateSecretDetails) UnmarshalJSON(data []byte) (e error) { m.SecretContent = nil } + m.ReplicationConfig = model.ReplicationConfig + m.RotationConfig = model.RotationConfig m.SecretRules = make([]SecretRule, len(model.SecretRules)) diff --git a/vendor/modules.txt b/vendor/modules.txt index 0ce4d076e27..008e4a8dca1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -288,7 +288,7 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.1.0 ## explicit; go 1.13 github.com/oklog/run -# github.com/oracle/oci-go-sdk/v65 v65.96.0 +# github.com/oracle/oci-go-sdk/v65 v65.97.1 ## explicit; go 1.13 github.com/oracle/oci-go-sdk/v65/adm github.com/oracle/oci-go-sdk/v65/aidocument @@ -298,6 +298,7 @@ github.com/oracle/oci-go-sdk/v65/analytics github.com/oracle/oci-go-sdk/v65/announcementsservice github.com/oracle/oci-go-sdk/v65/apiaccesscontrol github.com/oracle/oci-go-sdk/v65/apigateway +github.com/oracle/oci-go-sdk/v65/apiplatform github.com/oracle/oci-go-sdk/v65/apmconfig github.com/oracle/oci-go-sdk/v65/apmcontrolplane github.com/oracle/oci-go-sdk/v65/apmsynthetics diff --git a/website/docs/d/api_platform_api_platform_instance.html.markdown b/website/docs/d/api_platform_api_platform_instance.html.markdown new file mode 100644 index 00000000000..991e4d1068d --- /dev/null +++ b/website/docs/d/api_platform_api_platform_instance.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "Api Platform" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_api_platform_api_platform_instance" +sidebar_current: "docs-oci-datasource-api_platform-api_platform_instance" +description: |- + Provides details about a specific Api Platform Instance in Oracle Cloud Infrastructure Api Platform service +--- + +# Data Source: oci_api_platform_api_platform_instance +This data source provides details about a specific Api Platform Instance resource in Oracle Cloud Infrastructure Api Platform service. + +Gets information about an API Platform Instance + +## Example Usage + +```hcl +data "oci_api_platform_api_platform_instance" "test_api_platform_instance" { + #Required + api_platform_instance_id = oci_api_platform_api_platform_instance.test_api_platform_instance.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `api_platform_instance_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance + + +## 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 +* `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 changeable and non-unique description of the instance +* `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 [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance +* `idcs_app` - IDCS app associated with the instance, that can be used to manage the roles of the users + * `url` - IDCS URL of the app +* `lifecycle_details` - A message that describes the current state of the instance in more detail. For example, can be used to provide actionable information for a resource in the Failed state +* `name` - A regionally unique, non-changeable instance name provided by the user during instance creation +* `state` - The current state of the instance +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the instance was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339) Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the instance was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339) Example: `2016-08-25T21:10:29.600Z` +* `uris` - Service URIs pertaining to the instance + * `developers_portal_uri` - Developer's Portal URI of the instance (/developers) + * `management_portal_uri` - Management Portal URI of the instance (/apiplatform) + diff --git a/website/docs/d/api_platform_api_platform_instances.html.markdown b/website/docs/d/api_platform_api_platform_instances.html.markdown new file mode 100644 index 00000000000..9b69281963a --- /dev/null +++ b/website/docs/d/api_platform_api_platform_instances.html.markdown @@ -0,0 +1,65 @@ +--- +subcategory: "Api Platform" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_api_platform_api_platform_instances" +sidebar_current: "docs-oci-datasource-api_platform-api_platform_instances" +description: |- + Provides the list of Api Platform Instances in Oracle Cloud Infrastructure Api Platform service +--- + +# Data Source: oci_api_platform_api_platform_instances +This data source provides the list of Api Platform Instances in Oracle Cloud Infrastructure Api Platform service. + +Gets a list of API Platform Instances + + +## Example Usage + +```hcl +data "oci_api_platform_api_platform_instances" "test_api_platform_instances" { + + #Optional + compartment_id = var.compartment_id + id = var.api_platform_instance_id + name = var.api_platform_instance_name + state = var.api_platform_instance_state +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment in which to list resources. +* `id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance +* `name` - (Optional) A filter to return only resources that match the given name exactly +* `state` - (Optional) A filter to return only resources that match the given lifecycle state. The state value is case-insensitive. + + +## Attributes Reference + +The following attributes are exported: + +* `api_platform_instance_collection` - The list of api_platform_instance_collection. + +### ApiPlatformInstance Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - User-provided changeable and non-unique description of the instance +* `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 [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance +* `idcs_app` - IDCS app associated with the instance, that can be used to manage the roles of the users + * `url` - IDCS URL of the app +* `lifecycle_details` - A message that describes the current state of the instance in more detail. For example, can be used to provide actionable information for a resource in the Failed state +* `name` - A regionally unique, non-changeable instance name provided by the user during instance creation +* `state` - The current state of the instance +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the instance was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339) Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the instance was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339) Example: `2016-08-25T21:10:29.600Z` +* `uris` - Service URIs pertaining to the instance + * `developers_portal_uri` - Developer's Portal URI of the instance (/developers) + * `management_portal_uri` - Management Portal URI of the instance (/apiplatform) + diff --git a/website/docs/d/apm_config_config.html.markdown b/website/docs/d/apm_config_config.html.markdown index 54c30a5dfc1..3d49787cdea 100644 --- a/website/docs/d/apm_config_config.html.markdown +++ b/website/docs/d/apm_config_config.html.markdown @@ -34,6 +34,13 @@ The following arguments are supported: The following attributes are exported: +* `agent_version` - The version of the referenced agent bundle. +* `attach_install_dir` - The directory owned by runAsUser. +* `config` - Collection of agent configuration files. For agents that use a single configuration file, this SHOULD contain a single entry and the file name MAY be an empty string. For multiple entries, you should use multiple blocks of `config_map`. To apply a different configuration in a subset of the agents, put this block anywhere in the body of the configuration and edit and {{ | default }} Example: com.oracle.apm.agent.tracer.enable.jfr = {{ isJfrEnabled | default false }} Then, in the configuration's overrides, specify a different value for along with the desired agent filter. Example: "agentFilter": "ApplicationType='Tomcat'" "overrideMap": { "isJfrEnabled": true } + * `config_map` - Map of an agent configuration file. + * `file_name` - An agent configuration file name. + * `body` - The Base64 encoded agent configuration file. + * `content_type` - The MIME Content-Type that describes the content of the body field, for example, text/yaml or text/yaml; charset=utf-8 * `config_type` - The type of configuration item. * `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` @@ -53,6 +60,9 @@ The following attributes are exported: * `display_name` - The name by which a configuration entity is displayed to the end user. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration item. An OCID is generated when the item is created. * `options_group` - A string that specifies the group that an OPTIONS item belongs to. +* `management_agent_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent that will provision the APM Agent. +* `match_agents_with_attribute_key` - The agent attribute KEY by which an Agent configuration is matched to an agent. All agent configuration objects share the same key. It is [ServiceName, service.name] by default. The attribute VALUE corresponding to this KEY is in the matchAgentsWithAttributeValue field. +* `match_agents_with_attribute_value` - The agent attribute VALUE by which an agent configuration is matched to an agent. Each agent configuration object must specify a different value. The attribute KEY corresponding to this VALUE is in the matchAgentsWithAttributeKey field. * `metrics` - The list of metrics in this group. * `description` - A description of the metric. * `name` - The name of the metric. This must be a known metric name. @@ -60,6 +70,11 @@ The following attributes are exported: * `value_source` - This must not be set. * `namespace` - The namespace to which the metrics are published. It must be one of several predefined namespaces. * `options` - The options are stored here as JSON. +* `overrides` - Agent configuration overrides that should apply to a subset of the agents associated with an Agent Config object. + * `override_list` - + * `agent_filter` - The string that defines the Agent Filter expression. + * `override_map` - A map whose key is a substitution variable specified within the configuration's body. For example, if below was specified in the configuration's body {{ isJfrEnabled | default false }} Then a valid map key would be "isJfrEnabled". The value is typically different than the default specified in the configuration's body. Thus, in this example, the map entry could be "isJfrEnabled": true +* `process_filter` - Filter patterns used to discover active Java processes for provisioning the APM Agent. * `rules` - * `display_name` - The name by which a configuration entity is displayed to the end user. * `filter_text` - The string that defines the Span Filter expression. @@ -68,6 +83,8 @@ The following attributes are exported: * `priority` - The priority controls the order in which multiple rules in a rule set are applied. Lower values indicate higher priorities. Rules with higher priority are applied first, and once a match is found, the rest of the rules are ignored. Rules within the same rule set cannot have the same priority. * `satisfied_response_time` - The maximum response time in milliseconds that is considered "satisfactory" for the end user. * `tolerating_response_time` - The maximum response time in milliseconds that is considered "tolerable" for the end user. A response time beyond this threshold is considered "frustrating". This value cannot be lower than "satisfiedResponseTime". +* `run_as_user` - The OS user that should be used to discover Java processes. +* `service_name` - The name of the service being monitored. This argument enables you to filter by service and view traces and other signals in the APM Explorer user interface. * `time_created` - The time the resource was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-12T22:47:12.613Z` * `time_updated` - The time the resource was updated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-13T22:47:12.613Z` * `updated_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. diff --git a/website/docs/d/apm_config_configs.html.markdown b/website/docs/d/apm_config_configs.html.markdown index a839515c6cf..e47148d5010 100644 --- a/website/docs/d/apm_config_configs.html.markdown +++ b/website/docs/d/apm_config_configs.html.markdown @@ -35,10 +35,10 @@ data "oci_apm_config_configs" "test_configs" { The following arguments are supported: * `apm_domain_id` - (Required) The APM Domain ID the request is intended for. -* `config_type` - (Optional) A filter to match configuration items of a given type. Supported values are SPAN_FILTER, METRIC_GROUP, and APDEX. +* `config_type` - (Optional) A filter to match configuration items of a given type. Supported values are SPAN_FILTER, METRIC_GROUP, APDEX, AGENT and MACS_APM_EXTENSION. * `defined_tag_equals` - (Optional) A list of tag filters to apply. Only resources with a defined tag matching the value will be returned. Each item in the list has the format "{namespace}.{tagName}.{value}". All inputs are case-insensitive. Multiple values for the same key (i.e. same namespace and tag name) are interpreted as "OR". Values for different keys (i.e. different namespaces, different tag names, or both) are interpreted as "AND". * `defined_tag_exists` - (Optional) A list of tag existence filters to apply. Only resources for which the specified defined tags exist will be returned. Each item in the list has the format "{namespace}.{tagName}.true" (for checking existence of a defined tag) or "{namespace}.true". All inputs are case-insensitive. Currently, only existence ("true" at the end) is supported. Absence ("false" at the end) is not supported. Multiple values for the same key (i.e. same namespace and tag name) are interpreted as "OR". Values for different keys (i.e. different namespaces, different tag names, or both) are interpreted as "AND". -* `display_name` - (Optional) A filter to return resources that match the given display name. +* `display_name` - (Applicable when config_type=APDEX | MACS_APM_EXTENSION | METRIC_GROUP | OPTIONS | SPAN_FILTER) A filter to return resources that match the given display name. * `freeform_tag_equals` - (Optional) A list of tag filters to apply. Only resources with a freeform tag matching the value will be returned. The key for each tag is "{tagName}.{value}". All inputs are case-insensitive. Multiple values for the same tag name are interpreted as "OR". Values for different tag names are interpreted as "AND". * `freeform_tag_exists` - (Optional) A list of tag existence filters to apply. Only resources for which the specified freeform tags exist the value will be returned. The key for each tag is "{tagName}.true". All inputs are case-insensitive. Currently, only existence ("true" at the end) is supported. Absence ("false" at the end) is not supported. Multiple values for different tag names are interpreted as "AND". * `options_group` - (Optional) A filter to return OPTIONS resources that match the given group. @@ -54,6 +54,13 @@ The following attributes are exported: The following attributes are exported: +* `agent_version` - The version of the referenced agent bundle. +* `attach_install_dir` - The directory owned by runAsUser. +* `config` - Collection of agent configuration files. For agents that use a single configuration file, this SHOULD contain a single entry and the file name MAY be an empty string. For multiple entries, you should use multiple blocks of `config_map`. To apply a different configuration in a subset of the agents, put this block anywhere in the body of the configuration and edit and {{ | default }} Example: com.oracle.apm.agent.tracer.enable.jfr = {{ isJfrEnabled | default false }} Then, in the configuration's overrides, specify a different value for along with the desired agent filter. Example: "agentFilter": "ApplicationType='Tomcat'" "overrideMap": { "isJfrEnabled": true } + * `config_map` - Map of an agent configuration file. + * `file_name` - An agent configuration file name. + * `body` - The Base64 encoded agent configuration file. + * `content_type` - The MIME Content-Type that describes the content of the body field, for example, text/yaml or text/yaml; charset=utf-8 * `config_type` - The type of configuration item. * `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` @@ -73,6 +80,9 @@ The following attributes are exported: * `display_name` - The name by which a configuration entity is displayed to the end user. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration item. An OCID is generated when the item is created. * `options_group` - A string that specifies the group that an OPTIONS item belongs to. +* `management_agent_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent that will provision the APM Agent. +* `match_agents_with_attribute_key` - The agent attribute KEY by which an Agent configuration is matched to an agent. All agent configuration objects share the same key. It is [ServiceName, service.name] by default. The attribute VALUE corresponding to this KEY is in the matchAgentsWithAttributeValue field. +* `match_agents_with_attribute_value` - The agent attribute VALUE by which an agent configuration is matched to an agent. Each agent configuration object must specify a different value. The attribute KEY corresponding to this VALUE is in the matchAgentsWithAttributeKey field. * `metrics` - The list of metrics in this group. * `description` - A description of the metric. * `name` - The name of the metric. This must be a known metric name. @@ -80,6 +90,11 @@ The following attributes are exported: * `value_source` - This must not be set. * `namespace` - The namespace to which the metrics are published. It must be one of several predefined namespaces. * `options` - The options are stored here as JSON. +* `overrides` - Agent configuration overrides that should apply to a subset of the agents associated with an Agent Config object. + * `override_list` - + * `agent_filter` - The string that defines the Agent Filter expression. + * `override_map` - A map whose key is a substitution variable specified within the configuration's body. For example, if below was specified in the configuration's body {{ isJfrEnabled | default false }} Then a valid map key would be "isJfrEnabled". The value is typically different than the default specified in the configuration's body. Thus, in this example, the map entry could be "isJfrEnabled": true +* `process_filter` - Filter patterns used to discover active Java processes for provisioning the APM Agent. * `rules` - * `display_name` - The name by which a configuration entity is displayed to the end user. * `filter_text` - The string that defines the Span Filter expression. @@ -88,6 +103,8 @@ The following attributes are exported: * `priority` - The priority controls the order in which multiple rules in a rule set are applied. Lower values indicate higher priorities. Rules with higher priority are applied first, and once a match is found, the rest of the rules are ignored. Rules within the same rule set cannot have the same priority. * `satisfied_response_time` - The maximum response time in milliseconds that is considered "satisfactory" for the end user. * `tolerating_response_time` - The maximum response time in milliseconds that is considered "tolerable" for the end user. A response time beyond this threshold is considered "frustrating". This value cannot be lower than "satisfiedResponseTime". +* `run_as_user` - The OS user that should be used to discover Java processes. +* `service_name` - The name of the service being monitored. This argument enables you to filter by service and view traces and other signals in the APM Explorer user interface. * `time_created` - The time the resource was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-12T22:47:12.613Z` * `time_updated` - The time the resource was updated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-13T22:47:12.613Z` * `updated_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. diff --git a/website/docs/d/apm_traces_attribute_auto_activate_status.html.markdown b/website/docs/d/apm_traces_attribute_auto_activate_status.html.markdown new file mode 100644 index 00000000000..4a2cf6a8130 --- /dev/null +++ b/website/docs/d/apm_traces_attribute_auto_activate_status.html.markdown @@ -0,0 +1,40 @@ +--- +subcategory: "Apm Traces" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_apm_traces_attribute_auto_activate_status" +sidebar_current: "docs-oci-datasource-apm_traces-attribute_auto_activate_status" +description: |- + Provides details about a specific Attribute Auto Activate Status in Oracle Cloud Infrastructure Apm Traces service +--- + +# Data Source: oci_apm_traces_attribute_auto_activate_status +This data source provides details about a specific Attribute Auto Activate Status resource in Oracle Cloud Infrastructure Apm Traces service. + +Get autoactivation status for a private data key or public data key in the APM Domain. + + +## Example Usage + +```hcl +data "oci_apm_traces_attribute_auto_activate_status" "test_attribute_auto_activate_status" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + data_key_type = var.attribute_auto_activate_status_data_key_type +} +``` + +## Argument Reference + +The following arguments are supported: + +* `apm_domain_id` - (Required) The APM Domain ID for the intended request. +* `data_key_type` - (Required) Data key type for which auto-activate needs to be turned on or off. + + +## Attributes Reference + +The following attributes are exported: + +* `data_key` - Data key type for which auto-activate needs needs to be turned on or off. +* `state` - State of autoactivation in this APM Domain. If "ON" auto-activate is set to true, if "OFF" auto-activate is set to false. + diff --git a/website/docs/d/apm_traces_log.html.markdown b/website/docs/d/apm_traces_log.html.markdown new file mode 100644 index 00000000000..20b0dae3492 --- /dev/null +++ b/website/docs/d/apm_traces_log.html.markdown @@ -0,0 +1,60 @@ +--- +subcategory: "Apm Traces" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_apm_traces_log" +sidebar_current: "docs-oci-datasource-apm_traces-log" +description: |- + Provides details about a specific Log in Oracle Cloud Infrastructure Apm Traces service +--- + +# Data Source: oci_apm_traces_log +This data source provides details about a specific Log resource in Oracle Cloud Infrastructure Apm Traces service. + +Retrieve a log in the APM Domain. + + +## Example Usage + +```hcl +data "oci_apm_traces_log" "test_log" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + log_key = var.log_log_key + time_log_ended_less_than = var.log_time_log_ended_less_than + time_log_started_greater_than_or_equal_to = var.log_time_log_started_greater_than_or_equal_to +} +``` + +## Argument Reference + +The following arguments are supported: + +* `apm_domain_id` - (Required) The APM Domain ID for the intended request. +* `log_key` - (Required) Log key. +* `time_log_ended_less_than` - (Required) Include logs with log time less than this value. +* `time_log_started_greater_than_or_equal_to` - (Required) Include logs with log time equal to or greater than this value. + + +## Attributes Reference + +The following attributes are exported: + +* `attribute_metadata` - Metadata about the attributes in the logs. + * `attribute_type` - Type associated with the attribute key. + * `attribute_unit` - Unit associated with the attribute key. If unit is not specified, it defaults to NONE. +* `attributes` - List of attributes associated with the logs. + * `attribute_name` - Key that specifies the attribute name. + * `attribute_value` - Value associated with the attribute key. +* `body` - Log body (Body). +* `event_name` - Name of the event. +* `log_key` - Unique identifier (logId) for the logKey. Note that this field is defined as logKey in the API and it maps to the logId in Application Performance Monitoring. +* `overflow_attributes` - Full values for attributes that are too long to be stored as a log attribute (Overflow). +* `severity_number` - Log Severity number (SeverityNumber). +* `severity_text` - Log Severity text (SeverityText). Also known as Log level. +* `span_key` - Unique identifier for the span (spanId) associated with this log. +* `time_created` - Time that the log event occurred (CreatedTime). +* `time_observed` - Time that the log was received by apm (ObservedTime). +* `timestamp` - Time used by the time picker (RecordedTime). Either the timeCreated if present or the timeObserved. +* `trace_flags` - Trace flags. +* `trace_key` - Unique identifier for the trace (traceId) associated with this log. + diff --git a/website/docs/d/apm_traces_scheduled_queries.html.markdown b/website/docs/d/apm_traces_scheduled_queries.html.markdown new file mode 100644 index 00000000000..a82660a63b6 --- /dev/null +++ b/website/docs/d/apm_traces_scheduled_queries.html.markdown @@ -0,0 +1,78 @@ +--- +subcategory: "Apm Traces" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_apm_traces_scheduled_queries" +sidebar_current: "docs-oci-datasource-apm_traces-scheduled_queries" +description: |- + Provides the list of Scheduled Queries in Oracle Cloud Infrastructure Apm Traces service +--- + +# Data Source: oci_apm_traces_scheduled_queries +This data source provides the list of Scheduled Queries in Oracle Cloud Infrastructure Apm Traces service. + +Returns a list of all scheduled queries in the APM Domain. + + +## Example Usage + +```hcl +data "oci_apm_traces_scheduled_queries" "test_scheduled_queries" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + + #Optional + display_name = var.scheduled_query_display_name +} +``` + +## Argument Reference + +The following arguments are supported: + +* `apm_domain_id` - (Required) The APM Domain ID for the intended request. +* `display_name` - (Optional) A filter to return resources that match the given display name. This will return resources that have name starting with this filter. + + +## Attributes Reference + +The following attributes are exported: + +* `scheduled_query_collection` - The list of scheduled_query_collection. + +### ScheduledQuery Reference + +The following attributes are exported: + +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `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 [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the scheduled query . An OCID is generated when the scheduled query is created. +* `scheduled_query_description` - Description for the scheduled query. +* `scheduled_query_instances` - Scheduled query instances. +* `scheduled_query_maximum_runtime_in_seconds` - Maximum runtime for the scheduled query in seconds. +* `scheduled_query_name` - Name of the scheduled query. +* `scheduled_query_next_run_in_ms` - Next run for the scheduled query. +* `scheduled_query_processing_configuration` - Definition of the scheduled query processing configuration. + * `custom_metric` - Definition of the Custom Metric. + * `compartment` - Compartment of the Monitoring Service. It defaults to the APM domain's compartment if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that compartment. + * `description` - Description of the Custom Metric. + * `is_anomaly_detection_enabled` - Indicates whether anomaly Detection should be performed on the generated metric. + * `is_metric_published` - Used in conjunction with the dry run header. When the dry run header is set and the isPublishMetric flag is set to true, the scheduled query is not created, but validations happen to check if the right Oracle Cloud Infrastructure policies have been set to write to the specified namespace/compartment. + * `name` - Name of the Custom Metric. + * `namespace` - Namespace in the Custom Metric. It defaults to `oracle_apm_custom` if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that namespace. + * `resource_group` - Resource Group of the Custom Metric. + * `unit` - Unit in which the metric value is reported. For example 'ms'. + * `object_storage` - Definition of the object storage. + * `bucket` - Bucket name in the object store. + * `name_space` - Namespace in the object store. + * `object_name_prefix` - Object name prefix in the object store. + * `streaming` - Definition of the Stream. + * `stream_id` - Stream Id. +* `scheduled_query_processing_sub_type` - Processing sub type of the scheduled query. +* `scheduled_query_processing_type` - Processing type of the scheduled query. +* `scheduled_query_retention_criteria` - Retention criteria for the scheduled query. +* `scheduled_query_retention_period_in_ms` - Retention period for the scheduled query in milliseconds. +* `scheduled_query_schedule` - Schedule for the scheduled query. +* `scheduled_query_text` - Scheduled query to be run. +* `state` - The current lifecycle state of the Scheduled Query. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` + diff --git a/website/docs/d/apm_traces_scheduled_query.html.markdown b/website/docs/d/apm_traces_scheduled_query.html.markdown new file mode 100644 index 00000000000..e1a0b28d768 --- /dev/null +++ b/website/docs/d/apm_traces_scheduled_query.html.markdown @@ -0,0 +1,70 @@ +--- +subcategory: "Apm Traces" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_apm_traces_scheduled_query" +sidebar_current: "docs-oci-datasource-apm_traces-scheduled_query" +description: |- + Provides details about a specific Scheduled Query in Oracle Cloud Infrastructure Apm Traces service +--- + +# Data Source: oci_apm_traces_scheduled_query +This data source provides details about a specific Scheduled Query resource in Oracle Cloud Infrastructure Apm Traces service. + +Retrieve a scheduled query in the APM Domain. + + +## Example Usage + +```hcl +data "oci_apm_traces_scheduled_query" "test_scheduled_query" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + scheduled_query_id = oci_apm_traces_scheduled_query.test_scheduled_query.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `apm_domain_id` - (Required) The APM Domain ID for the intended request. +* `scheduled_query_id` - (Required) Id of the scheduled query. + + +## Attributes Reference + +The following attributes are exported: + +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `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 [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the scheduled query . An OCID is generated when the scheduled query is created. +* `scheduled_query_description` - Description for the scheduled query. +* `scheduled_query_instances` - Scheduled query instances. +* `scheduled_query_maximum_runtime_in_seconds` - Maximum runtime for the scheduled query in seconds. +* `scheduled_query_name` - Name of the scheduled query. +* `scheduled_query_next_run_in_ms` - Next run for the scheduled query. +* `scheduled_query_processing_configuration` - Definition of the scheduled query processing configuration. + * `custom_metric` - Definition of the Custom Metric. + * `compartment` - Compartment of the Monitoring Service. It defaults to the APM domain's compartment if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that compartment. + * `description` - Description of the Custom Metric. + * `is_anomaly_detection_enabled` - Indicates whether anomaly Detection should be performed on the generated metric. + * `is_metric_published` - Used in conjunction with the dry run header. When the dry run header is set and the isPublishMetric flag is set to true, the scheduled query is not created, but validations happen to check if the right Oracle Cloud Infrastructure policies have been set to write to the specified namespace/compartment. + * `name` - Name of the Custom Metric. + * `namespace` - Namespace in the Custom Metric. It defaults to `oracle_apm_custom` if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that namespace. + * `resource_group` - Resource Group of the Custom Metric. + * `unit` - Unit in which the metric value is reported. For example 'ms'. + * `object_storage` - Definition of the object storage. + * `bucket` - Bucket name in the object store. + * `name_space` - Namespace in the object store. + * `object_name_prefix` - Object name prefix in the object store. + * `streaming` - Definition of the Stream. + * `stream_id` - Stream Id. +* `scheduled_query_processing_sub_type` - Processing sub type of the scheduled query. +* `scheduled_query_processing_type` - Processing type of the scheduled query. +* `scheduled_query_retention_criteria` - Retention criteria for the scheduled query. +* `scheduled_query_retention_period_in_ms` - Retention period for the scheduled query in milliseconds. +* `scheduled_query_schedule` - Schedule for the scheduled query. +* `scheduled_query_text` - Scheduled query to be run. +* `state` - The current lifecycle state of the Scheduled Query. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` + diff --git a/website/docs/d/apm_traces_trace.html.markdown b/website/docs/d/apm_traces_trace.html.markdown index a91e34b03bb..a3af1cfe422 100644 --- a/website/docs/d/apm_traces_trace.html.markdown +++ b/website/docs/d/apm_traces_trace.html.markdown @@ -33,8 +33,8 @@ data "oci_apm_traces_trace" "test_trace" { The following arguments are supported: * `apm_domain_id` - (Required) The APM Domain ID for the intended request. -* `time_trace_started_greater_than_or_equal_to` - (Optional) Include traces that have a `minTraceStartTime` equal to or greater than this value. -* `time_trace_started_less_than` - (Optional) Include traces that have a `minTraceStartTime` less than this value. +* `time_trace_started_greater_than_or_equal_to` - (Optional) Include traces that have a minTraceStartTime equal to or greater than this value. +* `time_trace_started_less_than` - (Optional) Include traces that have a minTraceStartTime less than this value. * `trace_key` - (Required) Unique Application Performance Monitoring trace identifier (traceId). * `trace_namespace` - (Optional) Name space from which the trace details need to be retrieved. @@ -95,7 +95,7 @@ The following attributes are exported: * `tag_value` - Value associated with the tag key. * `tags_metadata` - Metadata about the tags in the span. * `tag_type` - Type associated with the tag key. - * `tag_unit` - Unit associated with the tag key. + * `tag_unit` - Unit associated with the tag key. If unit is not specified, it defaults to NONE. * `time_ended` - Span end time. Timestamp when the span was completed. * `time_started` - Span start time. Timestamp when the span was started. * `trace_key` - Unique identifier for the trace. diff --git a/website/docs/d/datascience_job.html.markdown b/website/docs/d/datascience_job.html.markdown index 35607a6d5ef..f6f409b44ac 100644 --- a/website/docs/d/datascience_job.html.markdown +++ b/website/docs/d/datascience_job.html.markdown @@ -55,6 +55,7 @@ The following attributes are exported: * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance running the job * `job_infrastructure_type` - The infrastructure type used for job run. * `job_shape_config_details` - Details for the job run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - The total amount of memory available to the job run instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the job run instance. * `shape_name` - The shape used to launch the job run instances. diff --git a/website/docs/d/datascience_job_run.html.markdown b/website/docs/d/datascience_job_run.html.markdown index 8bee1e9673f..bad303372b9 100644 --- a/website/docs/d/datascience_job_run.html.markdown +++ b/website/docs/d/datascience_job_run.html.markdown @@ -55,6 +55,7 @@ The following attributes are exported: * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance running the job * `job_infrastructure_type` - The infrastructure type used for job run. * `job_shape_config_details` - Details for the job run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - The total amount of memory available to the job run instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the job run instance. * `shape_name` - The shape used to launch the job run instances. diff --git a/website/docs/d/datascience_job_runs.html.markdown b/website/docs/d/datascience_job_runs.html.markdown index a95d747a920..98103169f59 100644 --- a/website/docs/d/datascience_job_runs.html.markdown +++ b/website/docs/d/datascience_job_runs.html.markdown @@ -73,6 +73,7 @@ The following attributes are exported: * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance running the job * `job_infrastructure_type` - The infrastructure type used for job run. * `job_shape_config_details` - Details for the job run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - The total amount of memory available to the job run instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the job run instance. * `shape_name` - The shape used to launch the job run instances. diff --git a/website/docs/d/datascience_jobs.html.markdown b/website/docs/d/datascience_jobs.html.markdown index c16f0ff509e..6004c38fdba 100644 --- a/website/docs/d/datascience_jobs.html.markdown +++ b/website/docs/d/datascience_jobs.html.markdown @@ -73,6 +73,7 @@ The following attributes are exported: * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance running the job * `job_infrastructure_type` - The infrastructure type used for job run. * `job_shape_config_details` - Details for the job run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - The total amount of memory available to the job run instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the job run instance. * `shape_name` - The shape used to launch the job run instances. diff --git a/website/docs/d/datascience_model_deployment.html.markdown b/website/docs/d/datascience_model_deployment.html.markdown index 49c50aff07f..53bde04dd1d 100644 --- a/website/docs/d/datascience_model_deployment.html.markdown +++ b/website/docs/d/datascience_model_deployment.html.markdown @@ -58,9 +58,70 @@ The following attributes are exported: * `image` - The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format. Acceptable format: `.ocir.io//:` `.ocir.io//:@digest` * `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`. + * `infrastructure_configuration_details` - The infrastructure configuration details. + * `bandwidth_mbps` - The minimum network bandwidth for the model deployment. + * `infrastructure_type` - The type of the model deployment infrastructure. + * `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. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. + * `memory_in_gbs` - A model-deployment instance of type VM.Standard.E3.Flex or VM.Standard.E4.Flex allows the memory to be specified with in the range of 6 to 1024 GB. VM.Standard3.Flex memory range is between 6 to 512 GB and VM.Optimized3.Flex memory range is between 6 to 256 GB. + * `ocpus` - A model-deployment instance of type VM.Standard.E3.Flex or VM.Standard.E4.Flex allows the ocpu count to be specified with in the range of 1 to 64 ocpu. VM.Standard3.Flex OCPU range is between 1 to 32 ocpu and for VM.Optimized3.Flex OCPU range is 1 to 18 ocpu. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. + * `subnet_id` - A model deployment 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/SGW gateway for egress. + * `maximum_bandwidth_mbps` - The maximum network bandwidth for the model deployment. + * `scaling_policy` - The scaling policy to apply to each model of the deployment. + * `auto_scaling_policies` - The list of autoscaling policy details. + * `auto_scaling_policy_type` - The type of autoscaling policy. + * `initial_instance_count` - For a threshold-based autoscaling policy, this value is the initial number of instances to launch in the model deployment immediately after autoscaling is enabled. Note that anytime this value is updated, the number of instances will be reset to this value. After autoscaling retrieves performance metrics, the number of instances is automatically adjusted from this initial number to a number that is based on the limits that you set. + * `maximum_instance_count` - For a threshold-based autoscaling policy, this value is the maximum number of instances the model deployment is allowed to increase to (scale out). + * `minimum_instance_count` - For a threshold-based autoscaling policy, this value is the minimum number of instances the model deployment is allowed to decrease to (scale in). + * `rules` - The list of autoscaling policy rules. + * `metric_expression_rule_type` - The metric expression for creating the alarm used to trigger autoscaling actions on the model deployment. + + The following values are supported: + * `PREDEFINED_EXPRESSION`: An expression built using CPU or Memory metrics emitted by the Model Deployment Monitoring. + * `CUSTOM_EXPRESSION`: A custom Monitoring Query Language (MQL) expression. + * `metric_type` - Metric type + * `scale_in_configuration` - The scaling configuration for the predefined metric expression rule. + * `instance_count_adjustment` - The value is used for adjusting the count of instances by. + * `pending_duration` - The period of time that the condition defined in the alarm must persist before the alarm state changes from "OK" to "FIRING" or vice versa. For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to "FIRING"; likewise, the alarm must persist in not breaching the condition for five minutes before the alarm updates its state to "OK." + + The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` for one hour). Minimum: PT3M. Maximum: PT1H. Default: PT3M. + * `query` - The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + + Example of threshold alarm: + + ----- + + CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() < 25 CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() > 75 + + ----- + * `scaling_configuration_type` - The type of scaling configuration. + * `threshold` - A metric value at which the scaling operation will be triggered. + * `scale_out_configuration` - The scaling configuration for the predefined metric expression rule. + * `instance_count_adjustment` - The value is used for adjusting the count of instances by. + * `pending_duration` - The period of time that the condition defined in the alarm must persist before the alarm state changes from "OK" to "FIRING" or vice versa. For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to "FIRING"; likewise, the alarm must persist in not breaching the condition for five minutes before the alarm updates its state to "OK." + + The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` for one hour). Minimum: PT3M. Maximum: PT1H. Default: PT3M. + * `query` - The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + + Example of threshold alarm: + + ----- + + CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() < 25 CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() > 75 + + ----- + * `scaling_configuration_type` - The type of scaling configuration. + * `threshold` - A metric value at which the scaling operation will be triggered. + * `cool_down_in_seconds` - For threshold-based autoscaling policies, this value is the minimum period of time to wait between scaling actions. The cooldown period gives the system time to stabilize before rescaling. The minimum value is 600 seconds, which is also the default. The cooldown period starts when the model deployment becomes ACTIVE after the scaling operation. + * `instance_count` - The number of instances for the model deployment. + * `is_enabled` - Whether the autoscaling policy is enabled. + * `policy_type` - The type of scaling policy. * `model_configuration_details` - The model configuration details. * `bandwidth_mbps` - The minimum network bandwidth for the model deployment. - * `instance_configuration` - The model deployment instance configuration + * `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. * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. @@ -119,6 +180,8 @@ The following attributes are exported: * `instance_count` - The number of instances for the model deployment. * `is_enabled` - Whether the autoscaling policy is enabled. * `policy_type` - The type of scaling policy. + * `model_group_configuration_details` - The model group configuration details. + * `model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group you want to deploy. * `model_deployment_system_data` - Model deployment system data. * `current_instance_count` - This value is the current count of the model deployment instances. * `system_infra_type` - The infrastructure type of the model deployment. diff --git a/website/docs/d/datascience_model_deployment_model_states.html.markdown b/website/docs/d/datascience_model_deployment_model_states.html.markdown new file mode 100644 index 00000000000..1ae9155fe67 --- /dev/null +++ b/website/docs/d/datascience_model_deployment_model_states.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_deployment_model_states" +sidebar_current: "docs-oci-datasource-datascience-model_deployment_model_states" +description: |- + Provides the list of Model Deployment Model States in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_model_deployment_model_states +This data source provides the list of Model Deployment Model States in Oracle Cloud Infrastructure Data Science service. + +Lists the status of models in a model group deployment. + +## Example Usage + +```hcl +data "oci_datascience_model_deployment_model_states" "test_model_deployment_model_states" { + #Required + compartment_id = var.compartment_id + model_deployment_id = oci_datascience_model_deployment.test_model_deployment.id + + #Optional + display_name = var.model_deployment_model_state_display_name + inference_key = var.model_deployment_model_state_inference_key + model_id = oci_datascience_model.test_model.id + project_id = oci_datascience_project.test_project.id +} +``` + +## 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. +* `display_name` - (Optional) Filter results by its user-friendly name. +* `inference_key` - (Optional) Filter results by the inference key. +* `model_deployment_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model deployment. +* `model_id` - (Optional) Filter results by the model ocid. +* `project_id` - (Optional) Filter results by the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project. + + +## Attributes Reference + +The following attributes are exported: + +* `model_deployment_model_states` - The list of model_deployment_model_states. + +### ModelDeploymentModelState Reference + +The following attributes are exported: + +* `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"}` +* `display_name` - A user-friendly display name for the resource. +* `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"}` +* `inference_key` - SaaS friendly name for the model OCID. +* `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the deployed model in model deployment. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the model. +* `state` - The state of the deployed model in model deployment. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` + diff --git a/website/docs/d/datascience_model_deployments.html.markdown b/website/docs/d/datascience_model_deployments.html.markdown index c2555d99301..44113137712 100644 --- a/website/docs/d/datascience_model_deployments.html.markdown +++ b/website/docs/d/datascience_model_deployments.html.markdown @@ -77,9 +77,70 @@ The following attributes are exported: * `image` - The full path to the Oracle Container Repository (OCIR) registry, image, and tag in a canonical format. Acceptable format: `.ocir.io//:` `.ocir.io//:@digest` * `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`. + * `infrastructure_configuration_details` - The infrastructure configuration details. + * `bandwidth_mbps` - The minimum network bandwidth for the model deployment. + * `infrastructure_type` - The type of the model deployment infrastructure. + * `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. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. + * `memory_in_gbs` - A model-deployment instance of type VM.Standard.E3.Flex or VM.Standard.E4.Flex allows the memory to be specified with in the range of 6 to 1024 GB. VM.Standard3.Flex memory range is between 6 to 512 GB and VM.Optimized3.Flex memory range is between 6 to 256 GB. + * `ocpus` - A model-deployment instance of type VM.Standard.E3.Flex or VM.Standard.E4.Flex allows the ocpu count to be specified with in the range of 1 to 64 ocpu. VM.Standard3.Flex OCPU range is between 1 to 32 ocpu and for VM.Optimized3.Flex OCPU range is 1 to 18 ocpu. + * `private_endpoint_id` - The OCID of a Data Science private endpoint. + * `subnet_id` - A model deployment 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/SGW gateway for egress. + * `maximum_bandwidth_mbps` - The maximum network bandwidth for the model deployment. + * `scaling_policy` - The scaling policy to apply to each model of the deployment. + * `auto_scaling_policies` - The list of autoscaling policy details. + * `auto_scaling_policy_type` - The type of autoscaling policy. + * `initial_instance_count` - For a threshold-based autoscaling policy, this value is the initial number of instances to launch in the model deployment immediately after autoscaling is enabled. Note that anytime this value is updated, the number of instances will be reset to this value. After autoscaling retrieves performance metrics, the number of instances is automatically adjusted from this initial number to a number that is based on the limits that you set. + * `maximum_instance_count` - For a threshold-based autoscaling policy, this value is the maximum number of instances the model deployment is allowed to increase to (scale out). + * `minimum_instance_count` - For a threshold-based autoscaling policy, this value is the minimum number of instances the model deployment is allowed to decrease to (scale in). + * `rules` - The list of autoscaling policy rules. + * `metric_expression_rule_type` - The metric expression for creating the alarm used to trigger autoscaling actions on the model deployment. + + The following values are supported: + * `PREDEFINED_EXPRESSION`: An expression built using CPU or Memory metrics emitted by the Model Deployment Monitoring. + * `CUSTOM_EXPRESSION`: A custom Monitoring Query Language (MQL) expression. + * `metric_type` - Metric type + * `scale_in_configuration` - The scaling configuration for the predefined metric expression rule. + * `instance_count_adjustment` - The value is used for adjusting the count of instances by. + * `pending_duration` - The period of time that the condition defined in the alarm must persist before the alarm state changes from "OK" to "FIRING" or vice versa. For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to "FIRING"; likewise, the alarm must persist in not breaching the condition for five minutes before the alarm updates its state to "OK." + + The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` for one hour). Minimum: PT3M. Maximum: PT1H. Default: PT3M. + * `query` - The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + + Example of threshold alarm: + + ----- + + CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() < 25 CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() > 75 + + ----- + * `scaling_configuration_type` - The type of scaling configuration. + * `threshold` - A metric value at which the scaling operation will be triggered. + * `scale_out_configuration` - The scaling configuration for the predefined metric expression rule. + * `instance_count_adjustment` - The value is used for adjusting the count of instances by. + * `pending_duration` - The period of time that the condition defined in the alarm must persist before the alarm state changes from "OK" to "FIRING" or vice versa. For example, a value of 5 minutes means that the alarm must persist in breaching the condition for five minutes before the alarm updates its state to "FIRING"; likewise, the alarm must persist in not breaching the condition for five minutes before the alarm updates its state to "OK." + + The duration is specified as a string in ISO 8601 format (`PT10M` for ten minutes or `PT1H` for one hour). Minimum: PT3M. Maximum: PT1H. Default: PT3M. + * `query` - The Monitoring Query Language (MQL) expression to evaluate for the alarm. The Alarms feature of the Monitoring service interprets results for each returned time series as Boolean values, where zero represents false and a non-zero value represents true. A true value means that the trigger rule condition has been met. The query must specify a metric, statistic, interval, and trigger rule (threshold or absence). Supported values for interval: `1m`-`60m` (also `1h`). You can optionally specify dimensions and grouping functions. Supported grouping functions: `grouping()`, `groupBy()`. + + Example of threshold alarm: + + ----- + + CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() < 25 CPUUtilization[1m]{resourceId = "MODEL_DEPLOYMENT_OCID"}.grouping().mean() > 75 + + ----- + * `scaling_configuration_type` - The type of scaling configuration. + * `threshold` - A metric value at which the scaling operation will be triggered. + * `cool_down_in_seconds` - For threshold-based autoscaling policies, this value is the minimum period of time to wait between scaling actions. The cooldown period gives the system time to stabilize before rescaling. The minimum value is 600 seconds, which is also the default. The cooldown period starts when the model deployment becomes ACTIVE after the scaling operation. + * `instance_count` - The number of instances for the model deployment. + * `is_enabled` - Whether the autoscaling policy is enabled. + * `policy_type` - The type of scaling policy. * `model_configuration_details` - The model configuration details. * `bandwidth_mbps` - The minimum network bandwidth for the model deployment. - * `instance_configuration` - The model deployment instance configuration + * `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. * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. @@ -138,6 +199,8 @@ The following attributes are exported: * `instance_count` - The number of instances for the model deployment. * `is_enabled` - Whether the autoscaling policy is enabled. * `policy_type` - The type of scaling policy. + * `model_group_configuration_details` - The model group configuration details. + * `model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group you want to deploy. * `model_deployment_system_data` - Model deployment system data. * `current_instance_count` - This value is the current count of the model deployment instances. * `system_infra_type` - The infrastructure type of the model deployment. diff --git a/website/docs/d/datascience_model_group.html.markdown b/website/docs/d/datascience_model_group.html.markdown new file mode 100644 index 00000000000..9f1e0455ac5 --- /dev/null +++ b/website/docs/d/datascience_model_group.html.markdown @@ -0,0 +1,66 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group" +sidebar_current: "docs-oci-datasource-datascience-model_group" +description: |- + Provides details about a specific Model Group in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_model_group +This data source provides details about a specific Model Group resource in Oracle Cloud Infrastructure Data Science service. + +Retrieves the Model Group resource based on the specified modelGroup id. + +## Example Usage + +```hcl +data "oci_datascience_model_group" "test_model_group" { + #Required + model_group_id = oci_datascience_model_group.test_model_group.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `model_group_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + + +## Attributes Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup's compartment. +* `create_type` - The type of the model group create operation. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroup. +* `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 short description of the modelGroup. +* `display_name` - A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. +* `lifecycle_details` - Details about the lifecycle state of the model group. +* `member_model_entries` - List of member models (inferenceKey & modelId) to be associated with the model group. + * `member_model_details` - Each List item contains inference key and model ocid. + * `inference_key` - SaaS friendly name of the model. + * `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. +* `model_group_details` - The model group details. + * `base_model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model in the group that represents the base model for stacked deployment. + * `custom_metadata_list` - An array of custom metadata details for the model group. + * `category` - Category of the metadata. + * `description` - Description of model metadata. + * `key` - Key of the metadata. + * `value` - Value of the metadata. + * `type` - The type of the model group. +* `model_group_version_history_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. +* `model_group_version_history_name` - The name of the model group version history to which the model group is associated. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroup. +* `source_model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group used for the clone operation. +* `state` - The state of the modelGroup. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the resource was created in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `time_updated` - The date and time the resource was last updated in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `version_id` - Unique identifier assigned to each version of the model group. It would be auto-incremented number generated by service. +* `version_label` - An additional description of the lifecycle state of the model group. + diff --git a/website/docs/d/datascience_model_group_artifact_content.html.markdown b/website/docs/d/datascience_model_group_artifact_content.html.markdown new file mode 100644 index 00000000000..465e849c05e --- /dev/null +++ b/website/docs/d/datascience_model_group_artifact_content.html.markdown @@ -0,0 +1,39 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group_artifact_content" +sidebar_current: "docs-oci-datasource-datascience-model_group_artifact_content" +description: |- + Provides details about a specific Model Group Artifact Content in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_model_group_artifact_content +This data source provides details about a specific Model Group Artifact Content resource in Oracle Cloud Infrastructure Data Science service. + +Downloads the model artifact for the specified model group. + +## Example Usage + +```hcl +data "oci_datascience_model_group_artifact_content" "test_model_group_artifact_content" { + #Required + model_group_id = oci_datascience_model_group.test_model_group.id + + #Optional + range = var.model_group_artifact_content_range +} +``` + +## Argument Reference + +The following arguments are supported: + +* `model_group_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. +* `range` - (Optional) Optional byte range to fetch, as described in [RFC 7233](https://tools.ietf.org/html/rfc7232#section-2.1), section 2.1. Note that only a single range of bytes is supported. + + +## Attributes Reference + +The following attributes are exported: + + diff --git a/website/docs/d/datascience_model_group_models.html.markdown b/website/docs/d/datascience_model_group_models.html.markdown new file mode 100644 index 00000000000..7c8b60a342e --- /dev/null +++ b/website/docs/d/datascience_model_group_models.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group_models" +sidebar_current: "docs-oci-datasource-datascience-model_group_models" +description: |- + Provides the list of Model Group Models in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_model_group_models +This data source provides the list of Model Group Models in Oracle Cloud Infrastructure Data Science service. + +Lists all models associated with the modelGroup in the specified compartment. + +## Example Usage + +```hcl +data "oci_datascience_model_group_models" "test_model_group_models" { + #Required + compartment_id = var.compartment_id + model_group_id = oci_datascience_model_group.test_model_group.id + + #Optional + created_by = var.model_group_model_created_by + display_name = var.model_group_model_display_name + id = var.model_group_model_id + state = var.model_group_model_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. +* `display_name` - (Optional) Filter results by its user-friendly name. +* `id` - (Optional) Filter results by [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type. +* `model_group_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. +* `state` - (Optional) Filter results by the specified lifecycle state. Must be a valid state for the resource type. + + +## Attributes Reference + +The following attributes are exported: + +* `model_group_models` - The list of model_group_models. + +### ModelGroupModel Reference + +The following attributes are exported: + +* `category` - The category of the model. +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model's compartment. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the model. +* `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"}` +* `display_name` - A user-friendly display name of the model. +* `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](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group. +* `is_model_by_reference` - Identifier to indicate whether a model artifact resides in the Service Tenancy or Customer Tenancy. +* `lifecycle_details` - Details about the lifecycle state of the model. +* `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the model. +* `state` - The state of the model. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the resource was created in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `time_updated` - The date and time the resource was updated in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z + diff --git a/website/docs/d/datascience_model_group_version_histories.html.markdown b/website/docs/d/datascience_model_group_version_histories.html.markdown new file mode 100644 index 00000000000..f4df123a31c --- /dev/null +++ b/website/docs/d/datascience_model_group_version_histories.html.markdown @@ -0,0 +1,67 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group_version_histories" +sidebar_current: "docs-oci-datasource-datascience-model_group_version_histories" +description: |- + Provides the list of Model Group Version Histories in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_model_group_version_histories +This data source provides the list of Model Group Version Histories in Oracle Cloud Infrastructure Data Science service. + +List all modelGroupVersionHistories in the specified compartment. The query must include compartmentId. + +## Example Usage + +```hcl +data "oci_datascience_model_group_version_histories" "test_model_group_version_histories" { + #Required + compartment_id = var.compartment_id + + #Optional + created_by = var.model_group_version_history_created_by + display_name = var.model_group_version_history_display_name + id = var.model_group_version_history_id + project_id = oci_datascience_project.test_project.id + state = var.model_group_version_history_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. +* `display_name` - (Optional) Filter results by its user-friendly name. +* `id` - (Optional) Filter results by [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type. +* `project_id` - (Optional) Filter results by the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project. +* `state` - (Optional) A filter to return resources matching the given lifecycleState. + + +## Attributes Reference + +The following attributes are exported: + +* `model_group_version_histories` - The list of model_group_version_histories. + +### ModelGroupVersionHistory Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory's compartment. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroupVersionHistory. +* `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 short description of the modelGroupVersionHistory. +* `display_name` - A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. +* `latest_model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest version of the model group associated. +* `lifecycle_details` - Details about the lifecycle state of the model group version history. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroupVersionHistory. +* `state` - The state of the modelGroupVersionHistory. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the resource was created in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `time_updated` - The date and time the resource was last updated in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z + diff --git a/website/docs/d/datascience_model_group_version_history.html.markdown b/website/docs/d/datascience_model_group_version_history.html.markdown new file mode 100644 index 00000000000..f1296a7b380 --- /dev/null +++ b/website/docs/d/datascience_model_group_version_history.html.markdown @@ -0,0 +1,49 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group_version_history" +sidebar_current: "docs-oci-datasource-datascience-model_group_version_history" +description: |- + Provides details about a specific Model Group Version History in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_model_group_version_history +This data source provides details about a specific Model Group Version History resource in Oracle Cloud Infrastructure Data Science service. + +Gets the specified modelGroupVersionHistory's information. + +## Example Usage + +```hcl +data "oci_datascience_model_group_version_history" "test_model_group_version_history" { + #Required + model_group_version_history_id = oci_datascience_model_group_version_history.test_model_group_version_history.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `model_group_version_history_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. + + +## Attributes Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory's compartment. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroupVersionHistory. +* `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 short description of the modelGroupVersionHistory. +* `display_name` - A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. +* `latest_model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest version of the model group associated. +* `lifecycle_details` - Details about the lifecycle state of the model group version history. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroupVersionHistory. +* `state` - The state of the modelGroupVersionHistory. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the resource was created in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `time_updated` - The date and time the resource was last updated in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z + diff --git a/website/docs/d/datascience_model_groups.html.markdown b/website/docs/d/datascience_model_groups.html.markdown new file mode 100644 index 00000000000..dc6956d6e94 --- /dev/null +++ b/website/docs/d/datascience_model_groups.html.markdown @@ -0,0 +1,86 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_groups" +sidebar_current: "docs-oci-datasource-datascience-model_groups" +description: |- + Provides the list of Model Groups in Oracle Cloud Infrastructure Data Science service +--- + +# Data Source: oci_datascience_model_groups +This data source provides the list of Model Groups in Oracle Cloud Infrastructure Data Science service. + +Lists all the modelGroups in the specified compartment. The query must include compartmentId. + +## Example Usage + +```hcl +data "oci_datascience_model_groups" "test_model_groups" { + #Required + compartment_id = var.compartment_id + + #Optional + created_by = var.model_group_created_by + display_name = var.model_group_display_name + id = var.model_group_id + model_group_version_history_id = oci_datascience_model_group_version_history.test_model_group_version_history.id + project_id = oci_datascience_project.test_project.id + state = var.model_group_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. +* `display_name` - (Applicable when create_type=CREATE) Filter results by its user-friendly name. +* `id` - (Optional) Filter results by [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). Must be an OCID of the correct type for the resource type. +* `model_group_version_history_id` - (Applicable when create_type=CREATE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. +* `project_id` - (Optional) Filter results by the [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project. +* `state` - (Optional) A filter to return resources matching the given lifecycleState. + + +## Attributes Reference + +The following attributes are exported: + +* `model_groups` - The list of model_groups. + +### ModelGroup Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup's compartment. +* `create_type` - The type of the model group create operation. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroup. +* `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 short description of the modelGroup. +* `display_name` - A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. +* `lifecycle_details` - Details about the lifecycle state of the model group. +* `member_model_entries` - List of member models (inferenceKey & modelId) to be associated with the model group. + * `member_model_details` - Each List item contains inference key and model ocid. + * `inference_key` - SaaS friendly name of the model. + * `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. +* `model_group_details` - The model group details. + * `base_model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model in the group that represents the base model for stacked deployment. + * `custom_metadata_list` - An array of custom metadata details for the model group. + * `category` - Category of the metadata. + * `description` - Description of model metadata. + * `key` - Key of the metadata. + * `value` - Value of the metadata. + * `type` - The type of the model group. +* `model_group_version_history_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. +* `model_group_version_history_name` - The name of the model group version history to which the model group is associated. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroup. +* `source_model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group used for the clone operation. +* `state` - The state of the modelGroup. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the resource was created in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `time_updated` - The date and time the resource was last updated in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `version_id` - Unique identifier assigned to each version of the model group. It would be auto-incremented number generated by service. +* `version_label` - An additional description of the lifecycle state of the model group. + diff --git a/website/docs/d/datascience_notebook_session.html.markdown b/website/docs/d/datascience_notebook_session.html.markdown index 2a51474f0db..9d73d56768b 100644 --- a/website/docs/d/datascience_notebook_session.html.markdown +++ b/website/docs/d/datascience_notebook_session.html.markdown @@ -42,6 +42,7 @@ The following attributes are exported: * `notebook_session_config_details` - Details for the notebook session configuration. * `block_storage_size_in_gbs` - A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. @@ -50,6 +51,7 @@ The following attributes are exported: * `notebook_session_configuration_details` - Details for the notebook session configuration. * `block_storage_size_in_gbs` - A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. diff --git a/website/docs/d/datascience_notebook_sessions.html.markdown b/website/docs/d/datascience_notebook_sessions.html.markdown index ee4d7e44b84..7f72c551186 100644 --- a/website/docs/d/datascience_notebook_sessions.html.markdown +++ b/website/docs/d/datascience_notebook_sessions.html.markdown @@ -60,6 +60,7 @@ The following attributes are exported: * `notebook_session_config_details` - Details for the notebook session configuration. * `block_storage_size_in_gbs` - A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. @@ -68,6 +69,7 @@ The following attributes are exported: * `notebook_session_configuration_details` - Details for the notebook session configuration. * `block_storage_size_in_gbs` - A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. diff --git a/website/docs/d/datascience_pipeline.html.markdown b/website/docs/d/datascience_pipeline.html.markdown index 056a56f2760..541e8809203 100644 --- a/website/docs/d/datascience_pipeline.html.markdown +++ b/website/docs/d/datascience_pipeline.html.markdown @@ -47,6 +47,7 @@ The following attributes are exported: * `infrastructure_configuration_details` - The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance. * `shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - The shape used to launch the instance for all step runs in the pipeline. @@ -82,10 +83,12 @@ The following attributes are exported: * `configuration` - The Spark configuration passed to the running process. * `driver_shape` - The VM shape for the driver. * `driver_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - The VM shape for the executors. * `executor_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. @@ -94,6 +97,7 @@ The following attributes are exported: * `step_infrastructure_configuration_details` - The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance. * `shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - The shape used to launch the instance for all step runs in the pipeline. diff --git a/website/docs/d/datascience_pipeline_run.html.markdown b/website/docs/d/datascience_pipeline_run.html.markdown index 83f2b3c9b3c..79b1cf87949 100644 --- a/website/docs/d/datascience_pipeline_run.html.markdown +++ b/website/docs/d/datascience_pipeline_run.html.markdown @@ -77,10 +77,12 @@ The following attributes are exported: * `configuration` - The Spark configuration passed to the running process. * `driver_shape` - The VM shape for the driver. * `driver_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - The VM shape for the executors. * `executor_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. diff --git a/website/docs/d/datascience_pipeline_runs.html.markdown b/website/docs/d/datascience_pipeline_runs.html.markdown index ef8cd299dd4..3f05dd21c8f 100644 --- a/website/docs/d/datascience_pipeline_runs.html.markdown +++ b/website/docs/d/datascience_pipeline_runs.html.markdown @@ -94,10 +94,12 @@ The following attributes are exported: * `configuration` - The Spark configuration passed to the running process. * `driver_shape` - The VM shape for the driver. * `driver_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - The VM shape for the executors. * `executor_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. diff --git a/website/docs/d/datascience_pipelines.html.markdown b/website/docs/d/datascience_pipelines.html.markdown index 860e5d1feeb..10f8109834a 100644 --- a/website/docs/d/datascience_pipelines.html.markdown +++ b/website/docs/d/datascience_pipelines.html.markdown @@ -65,6 +65,7 @@ The following attributes are exported: * `infrastructure_configuration_details` - The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance. * `shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - The shape used to launch the instance for all step runs in the pipeline. @@ -99,10 +100,12 @@ The following attributes are exported: * `configuration` - The Spark configuration passed to the running process. * `driver_shape` - The VM shape for the driver. * `driver_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - The VM shape for the executors. * `executor_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. @@ -111,6 +114,7 @@ The following attributes are exported: * `step_infrastructure_configuration_details` - The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance. * `shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - The shape used to launch the instance for all step runs in the pipeline. diff --git a/website/docs/d/opsi_database_insight.html.markdown b/website/docs/d/opsi_database_insight.html.markdown index 37769465888..3e3ebd64ae9 100644 --- a/website/docs/d/opsi_database_insight.html.markdown +++ b/website/docs/d/opsi_database_insight.html.markdown @@ -33,13 +33,14 @@ The following arguments are supported: The following attributes are exported: * `compartment_id` - Compartment identifier of the database -* `connection_credential_details` - User credential details to connect to the database. +* `connection_credential_details` - User credential details to connect to the database. * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. - * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. CREDENTIALS_BY_NAMED_CREDS is supplied by Management Agent service to connect for Macs Managed Cloud Database or Autonomous Database. + * `named_credential_id` - The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. * `password_secret_id` - The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - database user role. * `user_name` - database user name. - * `wallet_secret_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. + * `wallet_secret_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored * `connection_details` - Connection details to connect to the database. HostName, protocol, and port should be specified. * `host_name` - Name of the listener host that will be used to create the connect string to the database. * `hosts` - List of hosts and port for private endpoint accessed database resource. @@ -49,9 +50,9 @@ The following attributes are exported: * `protocol` - Protocol used for connection requests for private endpoint accssed database resource. * `service_name` - Database service name used for connection requests. * `connector_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of External Database Connector -* `credential_details` - User credential details to connect to the database. +* `credential_details` - User credential details to connect to the database. * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. - * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. CREDENTIALS_BY_NAMED_CREDS is supplied by Management Agent service to connect for Macs Managed Cloud Database or Autonomous Database. * `password_secret_id` - The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - database user role. * `user_name` - database user name. diff --git a/website/docs/d/opsi_database_insights.html.markdown b/website/docs/d/opsi_database_insights.html.markdown index c8546d44f50..64558aef158 100644 --- a/website/docs/d/opsi_database_insights.html.markdown +++ b/website/docs/d/opsi_database_insights.html.markdown @@ -62,9 +62,10 @@ The following attributes are exported: The following attributes are exported: * `compartment_id` - Compartment identifier of the database -* `connection_credential_details` - User credential details to connect to the database. - * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. - * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. +* `connection_credential_details` - User credential details to connect to the database. + * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for the others. + * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. CREDENTIALS_BY_NAMED_CREDS is supplied by Management Agent service to connect for Macs Managed Cloud Database or Autonomous Database. + * `named_credential_id` - The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. * `password_secret_id` - The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - database user role. * `user_name` - database user name. @@ -77,10 +78,11 @@ The following attributes are exported: * `port` - Listener port number used for connection requests. * `protocol` - Protocol used for connection requests for private endpoint accssed database resource. * `service_name` - Database service name used for connection requests. - * `connector_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of External Database Connector -* `credential_details` - User credential details to connect to the database. - * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. - * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. +* `connector_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of External Database Connector +* `credential_details` - User credential details to connect to the database. + * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for the others. + * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. CREDENTIALS_BY_NAMED_CREDS is supplied by Management Agent service to connect for Macs Managed Cloud Database or Autonomous Database. + * `named_credential_id` - The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. * `password_secret_id` - The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - database user role. * `user_name` - database user name. diff --git a/website/docs/d/psql_configuration.html.markdown b/website/docs/d/psql_configuration.html.markdown index 785ed331fa8..4809f22e59b 100644 --- a/website/docs/d/psql_configuration.html.markdown +++ b/website/docs/d/psql_configuration.html.markdown @@ -33,6 +33,7 @@ The following arguments are supported: The following attributes are exported: * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the configuration. +* `compatible_shapes` - Indicates the collection of compatible shapes for this configuration. * `config_type` - The type of configuration. Either user-created or a default configuration. * `configuration_details` - List of configuration details. * `items` - List of ConfigParms object. @@ -45,6 +46,7 @@ The following attributes are exported: * `is_restart_required` - If true, modifying this configuration value will require a restart of the database. * `overriden_config_value` - User-selected configuration variable value. * `db_version` - Version of the PostgreSQL database. +* `default_config_id` - The Default configuration used for this configuration. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `description` - A description for the configuration. * `display_name` - A user-friendly display name for the configuration. Avoid entering confidential information. @@ -58,7 +60,9 @@ The following attributes are exported: It's value is set to 0 if configuration is for a flexible shape. * `is_flexible` - Whether the configuration supports flexible shapes. * `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. -* `shape` - The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `shape` - The name of the shape for the configuration. + + For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. * `state` - The current state of the configuration. * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The date and time that the configuration was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2016-08-25T21:10:29.600Z` diff --git a/website/docs/d/psql_configurations.html.markdown b/website/docs/d/psql_configurations.html.markdown index 05121896d1a..396892671ee 100644 --- a/website/docs/d/psql_configurations.html.markdown +++ b/website/docs/d/psql_configurations.html.markdown @@ -24,6 +24,8 @@ data "oci_psql_configurations" "test_configurations" { configuration_id = oci_psql_configuration.test_configuration.id db_version = var.configuration_db_version display_name = var.configuration_display_name + instance_memory_size_in_gbs = var.configuration_instance_memory_size_in_gbs + instance_ocpu_count = var.configuration_instance_ocpu_count shape = var.configuration_shape state = var.configuration_state } @@ -38,7 +40,9 @@ The following arguments are supported: * `configuration_id` - (Optional) A unique identifier for the configuration. * `db_version` - (Optional) Version of the PostgreSQL database, such as 14.9. * `display_name` - (Optional) A filter to return only resources that match the entire display name given. -* `shape` - (Optional) The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `instance_memory_size_in_gbs` - (Optional) The instance memory size in GBs for the configuration. +* `instance_ocpu_count` - (Optional) The instance ocpu count for the configuration. +* `shape` - (Optional) The compute name of the shape for the configuration. * `state` - (Optional) A filter to return only resources if their `lifecycleState` matches the given `lifecycleState`. @@ -53,6 +57,7 @@ The following attributes are exported: The following attributes are exported: * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the configuration. +* `compatible_shapes` - Indicates the collection of compatible shapes for this configuration. * `config_type` - The type of configuration. Either user-created or a default configuration. * `configuration_details` - List of configuration details. * `items` - List of ConfigParms object. @@ -65,6 +70,7 @@ The following attributes are exported: * `is_restart_required` - If true, modifying this configuration value will require a restart of the database. * `overriden_config_value` - User-selected configuration variable value. * `db_version` - Version of the PostgreSQL database. +* `default_config_id` - The Default configuration used for this configuration. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `description` - A description for the configuration. * `display_name` - A user-friendly display name for the configuration. Avoid entering confidential information. @@ -78,7 +84,9 @@ The following attributes are exported: It's value is set to 0 if configuration is for a flexible shape. * `is_flexible` - Whether the configuration supports flexible shapes. * `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. -* `shape` - The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `shape` - The name of the shape for the configuration. + + For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. * `state` - The current state of the configuration. * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The date and time that the configuration was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2016-08-25T21:10:29.600Z` diff --git a/website/docs/d/psql_db_system.html.markdown b/website/docs/d/psql_db_system.html.markdown index a422fb2839f..590edc71a04 100644 --- a/website/docs/d/psql_db_system.html.markdown +++ b/website/docs/d/psql_db_system.html.markdown @@ -76,7 +76,7 @@ The following attributes are exported: * `primary_db_endpoint_private_ip` - Private IP in customer subnet. The value is optional. If the IP is not provided, the IP will be chosen from the available IP addresses from the specified subnet. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the customer subnet associated with the database system. * `shape` - The name of the shape for the database instance. Example: `VM.Standard.E4.Flex` -* `source` - The source used to restore the database system. +* `source` - The source of the database system. * `backup_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database system backup. * `is_having_restore_config_overrides` - Deprecated. Don't use. * `source_type` - The source descriminator. diff --git a/website/docs/d/psql_db_systems.html.markdown b/website/docs/d/psql_db_systems.html.markdown index 08fdbabdf8a..8b0e536be5b 100644 --- a/website/docs/d/psql_db_systems.html.markdown +++ b/website/docs/d/psql_db_systems.html.markdown @@ -86,7 +86,7 @@ The following attributes are exported: * `primary_db_endpoint_private_ip` - Private IP in customer subnet. The value is optional. If the IP is not provided, the IP will be chosen from the available IP addresses from the specified subnet. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the customer subnet associated with the database system. * `shape` - The name of the shape for the database instance. Example: `VM.Standard.E4.Flex` -* `source` - The source used to restore the database system. +* `source` - The source of the database system. * `backup_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database system backup. * `is_having_restore_config_overrides` - Deprecated. Don't use. * `source_type` - The source descriminator. diff --git a/website/docs/d/psql_default_configuration.html.markdown b/website/docs/d/psql_default_configuration.html.markdown index 2d7f7d56a6f..d6f072b5396 100644 --- a/website/docs/d/psql_default_configuration.html.markdown +++ b/website/docs/d/psql_default_configuration.html.markdown @@ -32,6 +32,7 @@ The following arguments are supported: The following attributes are exported: +* `compatible_shapes` - Indicates the collection of compatible shapes for this configuration. * `configuration_details` - List of default configuration values for databases. * `items` - List of ConfigParms object. * `allowed_values` - Range or list of allowed values. @@ -53,7 +54,9 @@ The following attributes are exported: Its value is set to 0 if configuration is for a flexible shape. * `is_flexible` - True if the configuration supports flexible shapes, false otherwise. * `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. -* `shape` - The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `shape` - The name of the shape for the configuration. + + For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. * `state` - The current state of the configuration. * `time_created` - The date and time that the configuration was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2016-08-25T21:10:29.600Z` diff --git a/website/docs/d/psql_default_configurations.html.markdown b/website/docs/d/psql_default_configurations.html.markdown index 774d2c247d1..e6c345bd996 100644 --- a/website/docs/d/psql_default_configurations.html.markdown +++ b/website/docs/d/psql_default_configurations.html.markdown @@ -22,6 +22,8 @@ data "oci_psql_default_configurations" "test_default_configurations" { configuration_id = oci_psql_configuration.test_configuration.id db_version = var.default_configuration_db_version display_name = var.default_configuration_display_name + instance_memory_size_in_gbs = var.default_configuration_instance_memory_size_in_gbs + instance_ocpu_count = var.default_configuration_instance_ocpu_count shape = var.default_configuration_shape state = var.default_configuration_state } @@ -34,7 +36,9 @@ The following arguments are supported: * `configuration_id` - (Optional) A unique identifier for the configuration. * `db_version` - (Optional) Version of the PostgreSQL database, such as 14.9. * `display_name` - (Optional) A filter to return only resources that match the entire display name given. -* `shape` - (Optional) The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `instance_memory_size_in_gbs` - (Optional) The instance memory size in GBs for the configuration. +* `instance_ocpu_count` - (Optional) The instance ocpu count for the configuration. +* `shape` - (Optional) The compute name of the shape for the configuration. * `state` - (Optional) A filter to return only resources if their `lifecycleState` matches the given `lifecycleState`. @@ -48,6 +52,7 @@ The following attributes are exported: The following attributes are exported: +* `compatible_shapes` - Indicates the collection of compatible shapes for this configuration. * `configuration_details` - List of default configuration values for databases. * `items` - List of ConfigParms object. * `allowed_values` - Range or list of allowed values. @@ -69,7 +74,9 @@ The following attributes are exported: Its value is set to 0 if configuration is for a flexible shape. * `is_flexible` - True if the configuration supports flexible shapes, false otherwise. * `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. -* `shape` - The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `shape` - The name of the shape for the configuration. + + For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. * `state` - The current state of the configuration. * `time_created` - The date and time that the configuration was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2016-08-25T21:10:29.600Z` diff --git a/website/docs/d/vault_secret.html.markdown b/website/docs/d/vault_secret.html.markdown index f0629e4d336..fe630f205ba 100644 --- a/website/docs/d/vault_secret.html.markdown +++ b/website/docs/d/vault_secret.html.markdown @@ -39,11 +39,18 @@ The following attributes are exported: * `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 secret. * `is_auto_generation_enabled` - The value of this flag determines whether or not secret content will be generated automatically. +* `is_replica` - A Boolean value that indicates whether the secret is a source or replica secret. * `key_id` - The OCID of the master encryption key that is used to encrypt the secret. You must specify a symmetric key to encrypt the secret during import to the vault. You cannot encrypt secrets with asymmetric keys. Furthermore, the key must exist in the vault that you specify. * `last_rotation_time` - A property indicating when the secret was last rotated successfully, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` * `lifecycle_details` - Additional information about the current lifecycle state of the secret. * `metadata` - Additional metadata that you can use to provide context about how to use the secret or during rotation or other administrative tasks. For example, for a secret that you use to connect to a database, the additional metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. * `next_rotation_time` - A property indicating when the secret is scheduled to be rotated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` +* `replication_config` - Defines the configuration that enables cross-region secret replication. + * `is_write_forward_enabled` - (Optional) A Boolean value to enable forwarding of write requests from replicated secrets to the source secrets. The default value of false disables this option. + * `replication_targets` - List of the secret replication targets. By default, a maximum of 3 targets is allowed. To configure more than 3 targets, an override is required. + * `target_key_id` - The OCID of the target region KMS key. + * `target_region` - The name of the target's region. + * `target_vault_id` - The OCID of the target region's Vault. * `rotation_config` - Defines the frequency of the rotation and the information about the target system * `is_scheduled_rotation_enabled` - Enables auto rotation, when set to true rotationInterval must be set. * `rotation_interval` - The time interval that indicates the frequency for rotating secret data, as described in ISO 8601 format. The minimum value is 1 day and maximum value is 360 days. For example, if you want to set the time interval for rotating a secret data as 30 days, the duration is expressed as "P30D." @@ -64,6 +71,10 @@ The following attributes are exported: * `rule_type` - The type of rule, which either controls when the secret contents expire or whether they can be reused. * `secret_version_expiry_interval` - A property indicating how long the secret contents will be considered valid, expressed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. The secret needs to be updated when the secret content expires. The timer resets after you update the secret contents. The minimum value is 1 day and the maximum value is 90 days for this property. Currently, only intervals expressed in days are supported. For example, pass `P3D` to have the secret version expire every 3 days. * `time_of_absolute_expiry` - An optional property indicating the absolute time when this secret will expire, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. The minimum number of days from current time is 1 day and the maximum number of days from current time is 365 days. Example: `2019-04-03T21:10:29.600Z` +* `source_region_information` - Details for the source that the source secret has. + * `source_key_id` - The OCID of the source region KMS key. + * `source_region` - The name of the source's region. + * `source_vault_id` - The OCID of the source region's Vault. * `state` - The current lifecycle state of the secret. * `time_created` - A property indicating when the secret was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` * `time_of_current_version_expiry` - An optional property indicating when the current secret version will expire, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` diff --git a/website/docs/d/vault_secrets.html.markdown b/website/docs/d/vault_secrets.html.markdown index 04605eeb35e..ccb7aceceaa 100644 --- a/website/docs/d/vault_secrets.html.markdown +++ b/website/docs/d/vault_secrets.html.markdown @@ -53,11 +53,18 @@ The following attributes are exported: * `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 secret. * `is_auto_generation_enabled` - The value of this flag determines whether or not secret content will be generated automatically. +* `is_replica` - A Boolean value that indicates whether the secret is a source or replica secret. * `key_id` - The OCID of the master encryption key that is used to encrypt the secret. You must specify a symmetric key to encrypt the secret during import to the vault. You cannot encrypt secrets with asymmetric keys. Furthermore, the key must exist in the vault that you specify. * `last_rotation_time` - A property indicating when the secret was last rotated successfully, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` * `lifecycle_details` - Additional information about the current lifecycle state of the secret. * `metadata` - Additional metadata that you can use to provide context about how to use the secret or during rotation or other administrative tasks. For example, for a secret that you use to connect to a database, the additional metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. * `next_rotation_time` - A property indicating when the secret is scheduled to be rotated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` +* `replication_config` - Defines the configuration that enables cross-region secret replication. + * `is_write_forward_enabled` - (Optional) A Boolean value to enable forwarding of write requests from replicated secrets to the source secrets. The default value of false disables this option. + * `replication_targets` - List of the secret replication targets. By default, a maximum of 3 targets is allowed. To configure more than 3 targets, an override is required. + * `target_key_id` - The OCID of the target region KMS key. + * `target_region` - The name of the target's region. + * `target_vault_id` - The OCID of the target region's Vault. * `rotation_config` - Defines the frequency of the rotation and the information about the target system * `is_scheduled_rotation_enabled` - Enables auto rotation, when set to true rotationInterval must be set. * `rotation_interval` - The time interval that indicates the frequency for rotating secret data, as described in ISO 8601 format. The minimum value is 1 day and maximum value is 360 days. For example, if you want to set the time interval for rotating a secret data as 30 days, the duration is expressed as "P30D." @@ -78,6 +85,10 @@ The following attributes are exported: * `rule_type` - The type of rule, which either controls when the secret contents expire or whether they can be reused. * `secret_version_expiry_interval` - A property indicating how long the secret contents will be considered valid, expressed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. The secret needs to be updated when the secret content expires. The timer resets after you update the secret contents. The minimum value is 1 day and the maximum value is 90 days for this property. Currently, only intervals expressed in days are supported. For example, pass `P3D` to have the secret version expire every 3 days. * `time_of_absolute_expiry` - An optional property indicating the absolute time when this secret will expire, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. The minimum number of days from current time is 1 day and the maximum number of days from current time is 365 days. Example: `2019-04-03T21:10:29.600Z` +* `source_region_information` - Details for the source that the source secret has. + * `source_key_id` - The OCID of the source region KMS key. + * `source_region` - The name of the source's region. + * `source_vault_id` - The OCID of the source region's Vault. * `state` - The current lifecycle state of the secret. * `time_created` - A property indicating when the secret was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` * `time_of_current_version_expiry` - An optional property indicating when the current secret version will expire, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` diff --git a/website/docs/guides/resource_discovery.html.markdown b/website/docs/guides/resource_discovery.html.markdown index fe6718b9a03..c7443a3e419 100644 --- a/website/docs/guides/resource_discovery.html.markdown +++ b/website/docs/guides/resource_discovery.html.markdown @@ -127,11 +127,13 @@ Make sure the `output_path` is empty before running resource discovery * `ai_vision` - Discovers ai_vision resources within the specified compartment * `analytics` - Discovers analytics resources within the specified compartment * `announcements_service` - Discovers announcements_service resources within the specified compartment + * `api_platform` - Discovers api_platform resources within the specified compartment * `apiaccesscontrol` - Discovers apiaccesscontrol resources within the specified compartment * `apigateway` - Discovers apigateway resources within the specified compartment * `apm` - Discovers apm resources within the specified compartment * `apm_config` - Discovers apm_config resources within the specified compartment * `apm_synthetics` - Discovers apm_synthetics resources within the specified compartment + * `apm_traces` - Discovers apm_traces resources within the specified compartment * `artifacts` - Discovers artifacts resources within the specified compartment * `auto_scaling` - Discovers auto_scaling resources within the specified compartment * `bastion` - Discovers bastion resources within the specified compartment @@ -246,6 +248,13 @@ Make sure the `output_path` is empty before running resource discovery * The compartment export functionality currently supports discovery of the target compartment. The ability to discover resources in child compartments is not yet supported. * If using Instance Principals, resources can not be discovered if compartment_id is not specified + +You can specify the maximum number of parallel chunks used for importing resources by setting the following environment variable. By default, it is set to twice the number of CPU cores. + +``` +export TF_MAX_PARALLEL_CHUNKS= +``` + ### Exit status While discovering resources if there is any error related to the APIs or service unavailability, the tool will move on to find next resource. All the errors encountered will be displayed after the discovery is complete. @@ -364,6 +373,10 @@ announcements_service * oci\_announcements\_service\_announcement\_subscriptions\_actions\_change\_compartment * oci\_announcements\_service\_announcement\_subscriptions\_filter\_group +api_platform + +* oci\_api\_platform\_api\_platform\_instance + apiaccesscontrol * oci\_apiaccesscontrol\_privileged\_api\_control @@ -383,7 +396,7 @@ apm * oci\_apm\_apm\_domain apm_config - + * oci\_apm\_config\_config apm_synthetics @@ -394,6 +407,10 @@ apm_synthetics * oci\_apm\_synthetics\_on\_premise\_vantage\_point\_worker * oci\_apm\_synthetics\_on\_premise\_vantage\_point +apm_traces + +* oci\_apm\_traces\_scheduled\_query + artifacts * oci\_artifacts\_container\_configuration @@ -705,6 +722,9 @@ datascience * oci\_datascience\_ml\_application\_implementation * oci\_datascience\_ml\_application\_instance * oci\_datascience\_ml\_application +* oci\_datascience\_model\_group\_version\_history +* oci\_datascience\_model\_group\_artifact +* oci\_datascience\_model\_group dblm diff --git a/website/docs/r/api_platform_api_platform_instance.html.markdown b/website/docs/r/api_platform_api_platform_instance.html.markdown new file mode 100644 index 00000000000..ac5835dc53d --- /dev/null +++ b/website/docs/r/api_platform_api_platform_instance.html.markdown @@ -0,0 +1,81 @@ +--- +subcategory: "Api Platform" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_api_platform_api_platform_instance" +sidebar_current: "docs-oci-resource-api_platform-api_platform_instance" +description: |- + Provides the Api Platform Instance resource in Oracle Cloud Infrastructure Api Platform service +--- + +# oci_api_platform_api_platform_instance +This resource provides the Api Platform Instance resource in Oracle Cloud Infrastructure Api Platform service. + +Creates an API Platform Instance + + +## Example Usage + +```hcl +resource "oci_api_platform_api_platform_instance" "test_api_platform_instance" { + #Required + compartment_id = var.compartment_id + name = var.api_platform_instance_name + + #Optional + defined_tags = {"foo-namespace.bar-key"= "value"} + description = var.api_platform_instance_description + freeform_tags = {"bar-key"= "value"} +} +``` + +## 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 to create the instance in. +* `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) User-provided changeable and non-unique description of the instance +* `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"}` +* `name` - (Required) A regionally unique, non-changeable instance name provided by the user during creation + + +** 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 +* `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 changeable and non-unique description of the instance +* `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 [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance +* `idcs_app` - IDCS app associated with the instance, that can be used to manage the roles of the users + * `url` - IDCS URL of the app +* `lifecycle_details` - A message that describes the current state of the instance in more detail. For example, can be used to provide actionable information for a resource in the Failed state +* `name` - A regionally unique, non-changeable instance name provided by the user during instance creation +* `state` - The current state of the instance +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the instance was created, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339) Example: `2016-08-25T21:10:29.600Z` +* `time_updated` - The date and time the instance was updated, in the format defined by [RFC 3339](https://tools.ietf.org/html/rfc3339) Example: `2016-08-25T21:10:29.600Z` +* `uris` - Service URIs pertaining to the instance + * `developers_portal_uri` - Developer's Portal URI of the instance (/developers) + * `management_portal_uri` - Management Portal URI of the instance (/apiplatform) + +## 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 Api Platform Instance + * `update` - (Defaults to 20 minutes), when updating the Api Platform Instance + * `delete` - (Defaults to 20 minutes), when destroying the Api Platform Instance + + +## Import + +ApiPlatformInstances can be imported using the `id`, e.g. + +``` +$ terraform import oci_api_platform_api_platform_instance.test_api_platform_instance "id" +``` + diff --git a/website/docs/r/apm_config_config.html.markdown b/website/docs/r/apm_config_config.html.markdown index c1e25c68944..3d05c5a8350 100644 --- a/website/docs/r/apm_config_config.html.markdown +++ b/website/docs/r/apm_config_config.html.markdown @@ -19,9 +19,21 @@ resource "oci_apm_config_config" "test_config" { #Required apm_domain_id = oci_apm_apm_domain.test_apm_domain.id config_type = var.config_config_type - display_name = var.config_display_name #Optional + agent_version = var.config_agent_version + attach_install_dir = var.config_attach_install_dir + config { + + #Optional + config_map { + + #Optional + file_name = var.config_config_config_map_file_name + body = var.config_config_config_map_body + content_type = var.config_config_config_map_content_type + } + } defined_tags = {"foo-namespace.bar-key"= "value"} description = var.config_description dimensions { @@ -30,10 +42,13 @@ resource "oci_apm_config_config" "test_config" { name = var.config_dimensions_name value_source = var.config_dimensions_value_source } + display_name = var.config_display_name filter_id = oci_apm_config_filter.test_filter.id filter_text = var.config_filter_text freeform_tags = {"bar-key"= "value"} group = var.config_group + management_agent_id = oci_management_agent_management_agent.test_management_agent.id + match_agents_with_attribute_value = var.config_match_agents_with_attribute_value metrics { #Optional @@ -45,6 +60,17 @@ resource "oci_apm_config_config" "test_config" { namespace = var.config_namespace opc_dry_run = var.config_opc_dry_run options = var.config_options + overrides { + + #Optional + override_list { + + #Optional + agent_filter = var.config_overrides_override_list_agent_filter + override_map = var.config_overrides_override_list_override_map + } + } + process_filter = var.config_process_filter rules { #Optional @@ -56,6 +82,8 @@ resource "oci_apm_config_config" "test_config" { satisfied_response_time = var.config_rules_satisfied_response_time tolerating_response_time = var.config_rules_tolerating_response_time } + run_as_user = var.config_run_as_user + service_name = oci_announcements_service_service.test_service.name } ``` @@ -63,18 +91,27 @@ resource "oci_apm_config_config" "test_config" { The following arguments are supported: +* `agent_version` - (Required when config_type=MACS_APM_EXTENSION) (Updatable) The version of the referenced agent bundle. * `apm_domain_id` - (Required) (Updatable) The APM Domain ID the request is intended for. +* `attach_install_dir` - (Required when config_type=MACS_APM_EXTENSION) (Updatable) The directory owned by runAsUser. +* `config` - (Applicable when config_type=AGENT) (Updatable) Collection of agent configuration files. For agents that use a single configuration file, this SHOULD contain a single entry and the file name MAY be an empty string. For multiple entries, you should use multiple blocks of `config_map`. To apply a different configuration in a subset of the agents, put this block anywhere in the body of the configuration and edit and {{ | default }} Example: com.oracle.apm.agent.tracer.enable.jfr = {{ isJfrEnabled | default false }} Then, in the configuration's overrides, specify a different value for along with the desired agent filter. Example: "agentFilter": "ApplicationType='Tomcat'" "overrideMap": { "isJfrEnabled": true } + * `config_map` - (Applicable when config_type=AGENT) (Updatable) Map of an agent configuration file. + * `file_name` - (Applicable when config_type=AGENT) (Updatable) An agent configuration file name. + * `body` - (Applicable when config_type=AGENT) (Updatable) The Base64 encoded agent configuration file. + * `content_type` - (Applicable when config_type=AGENT) (Updatable) The MIME Content-Type that describes the content of the body field, for example, text/yaml or text/yaml; charset=utf-8 * `config_type` - (Required) (Updatable) The type of configuration item. * `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` - (Applicable when config_type=OPTIONS | SPAN_FILTER) (Updatable) An optional string that describes what the options are intended or used for. * `dimensions` - (Applicable when config_type=METRIC_GROUP) (Updatable) A list of dimensions for the metric. This variable should not be used. * `name` - (Required when config_type=METRIC_GROUP) (Updatable) The name of the dimension. * `value_source` - (Applicable when config_type=METRIC_GROUP) (Updatable) The source to populate the dimension. This must not be specified. -* `display_name` - (Required) (Updatable) The name by which a configuration entity is displayed to the end user. +* `display_name` - (Required when config_type=APDEX | MACS_APM_EXTENSION | METRIC_GROUP | OPTIONS | SPAN_FILTER) (Updatable) The name by which a configuration entity is displayed to the end user. * `filter_id` - (Required when config_type=METRIC_GROUP) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a Span Filter. The filterId is mandatory for the creation of MetricGroups. A filterId is generated when a Span Filter is created. * `filter_text` - (Required when config_type=SPAN_FILTER) (Updatable) The string that defines the Span Filter expression. * `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"}` * `group` - (Applicable when config_type=OPTIONS) (Updatable) A string that specifies the group that an OPTIONS item belongs to. +* `management_agent_id` - (Required when config_type=MACS_APM_EXTENSION) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent that will provision the APM Agent. +* `match_agents_with_attribute_value` - (Required when config_type=AGENT) The agent attribute VALUE by which an agent configuration is matched to an agent. Each agent configuration object must specify a different value. The attribute KEY corresponding to this VALUE is in the matchAgentsWithAttributeKey field. * `metrics` - (Required when config_type=METRIC_GROUP) (Updatable) The list of metrics in this group. * `description` - (Applicable when config_type=METRIC_GROUP) (Updatable) A description of the metric. * `name` - (Required when config_type=METRIC_GROUP) (Updatable) The name of the metric. This must be a known metric name. @@ -83,6 +120,11 @@ The following arguments are supported: * `namespace` - (Applicable when config_type=METRIC_GROUP) (Updatable) The namespace to which the metrics are published. It must be one of several predefined namespaces. * `opc_dry_run` - (Optional) (Updatable) Indicates that the request is a dry run, if set to "true". A dry run request does not modify the configuration item details and is used only to perform validation on the submitted data. * `options` - (Applicable when config_type=OPTIONS) (Updatable) The options are stored here as JSON. +* `overrides` - (Applicable when config_type=AGENT) (Updatable) Agent configuration overrides that should apply to a subset of the agents associated with an Agent Config object. + * `override_list` - (Applicable when config_type=AGENT) (Updatable) + * `agent_filter` - (Applicable when config_type=AGENT) (Updatable) The string that defines the Agent Filter expression. + * `override_map` - (Applicable when config_type=AGENT) (Updatable) A map whose key is a substitution variable specified within the configuration's body. For example, if below was specified in the configuration's body {{ isJfrEnabled | default false }} Then a valid map key would be "isJfrEnabled". The value is typically different than the default specified in the configuration's body. Thus, in this example, the map entry could be "isJfrEnabled": true +* `process_filter` - (Required when config_type=MACS_APM_EXTENSION) (Updatable) Filter patterns used to discover active Java processes for provisioning the APM Agent. * `rules` - (Required when config_type=APDEX) (Updatable) * `display_name` - (Applicable when config_type=APDEX) (Updatable) The name by which a configuration entity is displayed to the end user. * `filter_text` - (Required when config_type=APDEX) (Updatable) The string that defines the Span Filter expression. @@ -91,6 +133,8 @@ The following arguments are supported: * `priority` - (Required when config_type=APDEX) (Updatable) The priority controls the order in which multiple rules in a rule set are applied. Lower values indicate higher priorities. Rules with higher priority are applied first, and once a match is found, the rest of the rules are ignored. Rules within the same rule set cannot have the same priority. * `satisfied_response_time` - (Applicable when config_type=APDEX) (Updatable) The maximum response time in milliseconds that is considered "satisfactory" for the end user. * `tolerating_response_time` - (Applicable when config_type=APDEX) (Updatable) The maximum response time in milliseconds that is considered "tolerable" for the end user. A response time beyond this threshold is considered "frustrating". This value cannot be lower than "satisfiedResponseTime". +* `run_as_user` - (Required when config_type=MACS_APM_EXTENSION) (Updatable) The OS user that should be used to discover Java processes. +* `service_name` - (Required when config_type=MACS_APM_EXTENSION) (Updatable) The name of the service being monitored. This argument enables you to filter by service and view traces and other signals in the APM Explorer user interface. ** IMPORTANT ** @@ -100,6 +144,13 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: +* `agent_version` - The version of the referenced agent bundle. +* `attach_install_dir` - The directory owned by runAsUser. +* `config` - Collection of agent configuration files. For agents that use a single configuration file, this SHOULD contain a single entry and the file name MAY be an empty string. For multiple entries, you should use multiple blocks of `config_map`. To apply a different configuration in a subset of the agents, put this block anywhere in the body of the configuration and edit and {{ | default }} Example: com.oracle.apm.agent.tracer.enable.jfr = {{ isJfrEnabled | default false }} Then, in the configuration's overrides, specify a different value for along with the desired agent filter. Example: "agentFilter": "ApplicationType='Tomcat'" "overrideMap": { "isJfrEnabled": true } + * `config_map` - Map of an agent configuration file. + * `file_name` - An agent configuration file name. + * `body` - The Base64 encoded agent configuration file. + * `content_type` - The MIME Content-Type that describes the content of the body field, for example, text/yaml or text/yaml; charset=utf-8 * `config_type` - The type of configuration item. * `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` @@ -119,6 +170,9 @@ The following attributes are exported: * `display_name` - The name by which a configuration entity is displayed to the end user. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the configuration item. An OCID is generated when the item is created. * `options_group` - A string that specifies the group that an OPTIONS item belongs to. +* `management_agent_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent that will provision the APM Agent. +* `match_agents_with_attribute_key` - The agent attribute KEY by which an Agent configuration is matched to an agent. All agent configuration objects share the same key. It is [ServiceName, service.name] by default. The attribute VALUE corresponding to this KEY is in the matchAgentsWithAttributeValue field. +* `match_agents_with_attribute_value` - The agent attribute VALUE by which an agent configuration is matched to an agent. Each agent configuration object must specify a different value. The attribute KEY corresponding to this VALUE is in the matchAgentsWithAttributeKey field. * `metrics` - The list of metrics in this group. * `description` - A description of the metric. * `name` - The name of the metric. This must be a known metric name. @@ -126,6 +180,11 @@ The following attributes are exported: * `value_source` - This must not be set. * `namespace` - The namespace to which the metrics are published. It must be one of several predefined namespaces. * `options` - The options are stored here as JSON. +* `overrides` - Agent configuration overrides that should apply to a subset of the agents associated with an Agent Config object. + * `override_list` - + * `agent_filter` - The string that defines the Agent Filter expression. + * `override_map` - A map whose key is a substitution variable specified within the configuration's body. For example, if below was specified in the configuration's body {{ isJfrEnabled | default false }} Then a valid map key would be "isJfrEnabled". The value is typically different than the default specified in the configuration's body. Thus, in this example, the map entry could be "isJfrEnabled": true +* `process_filter` - Filter patterns used to discover active Java processes for provisioning the APM Agent. * `rules` - * `display_name` - The name by which a configuration entity is displayed to the end user. * `filter_text` - The string that defines the Span Filter expression. @@ -134,6 +193,8 @@ The following attributes are exported: * `priority` - The priority controls the order in which multiple rules in a rule set are applied. Lower values indicate higher priorities. Rules with higher priority are applied first, and once a match is found, the rest of the rules are ignored. Rules within the same rule set cannot have the same priority. * `satisfied_response_time` - The maximum response time in milliseconds that is considered "satisfactory" for the end user. * `tolerating_response_time` - The maximum response time in milliseconds that is considered "tolerable" for the end user. A response time beyond this threshold is considered "frustrating". This value cannot be lower than "satisfiedResponseTime". +* `run_as_user` - The OS user that should be used to discover Java processes. +* `service_name` - The name of the service being monitored. This argument enables you to filter by service and view traces and other signals in the APM Explorer user interface. * `time_created` - The time the resource was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-12T22:47:12.613Z` * `time_updated` - The time the resource was updated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2020-02-13T22:47:12.613Z` * `updated_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of a user. diff --git a/website/docs/r/apm_traces_scheduled_query.html.markdown b/website/docs/r/apm_traces_scheduled_query.html.markdown new file mode 100644 index 00000000000..877e016af07 --- /dev/null +++ b/website/docs/r/apm_traces_scheduled_query.html.markdown @@ -0,0 +1,158 @@ +--- +subcategory: "Apm Traces" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_apm_traces_scheduled_query" +sidebar_current: "docs-oci-resource-apm_traces-scheduled_query" +description: |- + Provides the Scheduled Query resource in Oracle Cloud Infrastructure Apm Traces service +--- + +# oci_apm_traces_scheduled_query +This resource provides the Scheduled Query resource in Oracle Cloud Infrastructure Apm Traces service. + +Create a scheduled query in the APM Domain. + + +## Example Usage + +```hcl +resource "oci_apm_traces_scheduled_query" "test_scheduled_query" { + #Required + apm_domain_id = oci_apm_apm_domain.test_apm_domain.id + + #Optional + defined_tags = {"foo-namespace.bar-key"= "value"} + freeform_tags = {"bar-key"= "value"} + opc_dry_run = var.scheduled_query_opc_dry_run + scheduled_query_description = var.scheduled_query_scheduled_query_description + scheduled_query_maximum_runtime_in_seconds = var.scheduled_query_scheduled_query_maximum_runtime_in_seconds + scheduled_query_name = oci_apm_traces_scheduled_query.test_scheduled_query.name + scheduled_query_processing_configuration { + + #Optional + custom_metric { + #Required + name = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_name + + #Optional + compartment = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_compartment + description = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_description + is_anomaly_detection_enabled = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_is_anomaly_detection_enabled + is_metric_published = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_is_metric_published + namespace = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_namespace + resource_group = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_resource_group + unit = var.scheduled_query_scheduled_query_processing_configuration_custom_metric_unit + } + object_storage { + + #Optional + bucket = var.scheduled_query_scheduled_query_processing_configuration_object_storage_bucket + name_space = var.scheduled_query_scheduled_query_processing_configuration_object_storage_name_space + object_name_prefix = var.scheduled_query_scheduled_query_processing_configuration_object_storage_object_name_prefix + } + streaming { + + #Optional + stream_id = oci_streaming_stream.test_stream.id + } + } + scheduled_query_processing_sub_type = var.scheduled_query_scheduled_query_processing_sub_type + scheduled_query_processing_type = var.scheduled_query_scheduled_query_processing_type + scheduled_query_retention_criteria = var.scheduled_query_scheduled_query_retention_criteria + scheduled_query_retention_period_in_ms = var.scheduled_query_scheduled_query_retention_period_in_ms + scheduled_query_schedule = var.scheduled_query_scheduled_query_schedule + scheduled_query_text = var.scheduled_query_scheduled_query_text +} +``` + +## Argument Reference + +The following arguments are supported: + +* `apm_domain_id` - (Required) (Updatable) The APM Domain ID for the intended request. +* `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `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"}` +* `opc_dry_run` - (Optional) (Updatable) Indicates that the request is a dry run, if set to "true". A dry run request does not create or modify the resource and is used only to perform validation on the submitted data. +* `scheduled_query_description` - (Optional) (Updatable) Description for the scheduled query. +* `scheduled_query_maximum_runtime_in_seconds` - (Optional) (Updatable) Maximum runtime for the scheduled query in seconds. +* `scheduled_query_name` - (Optional) (Updatable) Name of the scheduled query. +* `scheduled_query_processing_configuration` - (Optional) (Updatable) Definition of the scheduled query processing configuration. + * `custom_metric` - (Optional) (Updatable) Definition of the Custom Metric. + * `compartment` - (Optional) (Updatable) Compartment of the Monitoring Service. It defaults to the APM domain's compartment if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that compartment. + * `description` - (Optional) (Updatable) Description of the Custom Metric. + * `is_anomaly_detection_enabled` - (Optional) (Updatable) Indicates whether anomaly Detection should be performed on the generated metric. + * `is_metric_published` - (Optional) (Updatable) Used in conjunction with the dry run header. When the dry run header is set and the isPublishMetric flag is set to true, the scheduled query is not created, but validations happen to check if the right Oracle Cloud Infrastructure policies have been set to write to the specified namespace/compartment. + * `name` - (Required) (Updatable) Name of the Custom Metric. + * `namespace` - (Optional) (Updatable) Namespace in the Custom Metric. It defaults to `oracle_apm_custom` if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that namespace. + * `resource_group` - (Optional) (Updatable) Resource Group of the Custom Metric. + * `unit` - (Optional) (Updatable) Unit in which the metric value is reported. For example 'ms'. + * `object_storage` - (Optional) (Updatable) Definition of the object storage. + * `bucket` - (Optional) (Updatable) Bucket name in the object store. + * `name_space` - (Optional) (Updatable) Namespace in the object store. + * `object_name_prefix` - (Optional) (Updatable) Object name prefix in the object store. + * `streaming` - (Optional) (Updatable) Definition of the Stream. + * `stream_id` - (Optional) (Updatable) Stream Id. +* `scheduled_query_processing_sub_type` - (Optional) (Updatable) Processing sub type of the scheduled query. +* `scheduled_query_processing_type` - (Optional) (Updatable) Type of the scheduled query. +* `scheduled_query_retention_criteria` - (Optional) (Updatable) Retention criteria for the scheduled query. +* `scheduled_query_retention_period_in_ms` - (Optional) (Updatable) Retention period for the scheduled query in milliseconds. +* `scheduled_query_schedule` - (Optional) (Updatable) Schedule for the scheduled query. +* `scheduled_query_text` - (Optional) (Updatable) Scheduled query to be run. + + +** 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: + +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `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 [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the scheduled query . An OCID is generated when the scheduled query is created. +* `scheduled_query_description` - Description for the scheduled query. +* `scheduled_query_instances` - Scheduled query instances. +* `scheduled_query_maximum_runtime_in_seconds` - Maximum runtime for the scheduled query in seconds. +* `scheduled_query_name` - Name of the scheduled query. +* `scheduled_query_next_run_in_ms` - Next run for the scheduled query. +* `scheduled_query_processing_configuration` - Definition of the scheduled query processing configuration. + * `custom_metric` - Definition of the Custom Metric. + * `compartment` - Compartment of the Monitoring Service. It defaults to the APM domain's compartment if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that compartment. + * `description` - Description of the Custom Metric. + * `is_anomaly_detection_enabled` - Indicates whether anomaly Detection should be performed on the generated metric. + * `is_metric_published` - Used in conjunction with the dry run header. When the dry run header is set and the isPublishMetric flag is set to true, the scheduled query is not created, but validations happen to check if the right Oracle Cloud Infrastructure policies have been set to write to the specified namespace/compartment. + * `name` - Name of the Custom Metric. + * `namespace` - Namespace in the Custom Metric. It defaults to `oracle_apm_custom` if not specified. If specified, the necessary Oracle Cloud Infrastructure policies should be set to allow APM to write to that namespace. + * `resource_group` - Resource Group of the Custom Metric. + * `unit` - Unit in which the metric value is reported. For example 'ms'. + * `object_storage` - Definition of the object storage. + * `bucket` - Bucket name in the object store. + * `name_space` - Namespace in the object store. + * `object_name_prefix` - Object name prefix in the object store. + * `streaming` - Definition of the Stream. + * `stream_id` - Stream Id. +* `scheduled_query_processing_sub_type` - Processing sub type of the scheduled query. +* `scheduled_query_processing_type` - Processing type of the scheduled query. +* `scheduled_query_retention_criteria` - Retention criteria for the scheduled query. +* `scheduled_query_retention_period_in_ms` - Retention period for the scheduled query in milliseconds. +* `scheduled_query_schedule` - Schedule for the scheduled query. +* `scheduled_query_text` - Scheduled query to be run. +* `state` - The current lifecycle state of the Scheduled Query. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` + +## 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 Scheduled Query + * `update` - (Defaults to 20 minutes), when updating the Scheduled Query + * `delete` - (Defaults to 20 minutes), when destroying the Scheduled Query + + +## Import + +ScheduledQueries can be imported using the `id`, e.g. + +``` +$ terraform import oci_apm_traces_scheduled_query.test_scheduled_query "scheduledQueries/{scheduledQueryId}/apmDomainId/{apmDomainId}" +``` + diff --git a/website/docs/r/datascience_job.html.markdown b/website/docs/r/datascience_job.html.markdown index b02eb8eed78..e94edca00fa 100644 --- a/website/docs/r/datascience_job.html.markdown +++ b/website/docs/r/datascience_job.html.markdown @@ -37,6 +37,7 @@ resource "oci_datascience_job" "test_job" { job_shape_config_details { #Optional + cpu_baseline = var.job_job_infrastructure_configuration_details_job_shape_config_details_cpu_baseline memory_in_gbs = var.job_job_infrastructure_configuration_details_job_shape_config_details_memory_in_gbs ocpus = var.job_job_infrastructure_configuration_details_job_shape_config_details_ocpus } @@ -110,6 +111,7 @@ The following arguments are supported: * `block_storage_size_in_gbs` - (Required) (Updatable) The size of the block storage volume to attach to the instance running the job * `job_infrastructure_type` - (Required) (Updatable) The infrastructure type used for job run. * `job_shape_config_details` - (Optional) (Updatable) Details for the job run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - (Applicable when job_infrastructure_type=ME_STANDALONE | STANDALONE) (Updatable) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - (Applicable when job_infrastructure_type=ME_STANDALONE | STANDALONE) (Updatable) The total amount of memory available to the job run instance, in gigabytes. * `ocpus` - (Applicable when job_infrastructure_type=ME_STANDALONE | STANDALONE) (Updatable) The total number of OCPUs available to the job run instance. * `shape_name` - (Required) (Updatable) The shape used to launch the job run instances. @@ -164,6 +166,7 @@ The following attributes are exported: * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance running the job * `job_infrastructure_type` - The infrastructure type used for job run. * `job_shape_config_details` - Details for the job run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - The total amount of memory available to the job run instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the job run instance. * `shape_name` - The shape used to launch the job run instances. diff --git a/website/docs/r/datascience_job_run.html.markdown b/website/docs/r/datascience_job_run.html.markdown index 0704f18ce65..d614d5d3a73 100644 --- a/website/docs/r/datascience_job_run.html.markdown +++ b/website/docs/r/datascience_job_run.html.markdown @@ -119,6 +119,7 @@ The following attributes are exported: * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance running the job * `job_infrastructure_type` - The infrastructure type used for job run. * `job_shape_config_details` - Details for the job run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - The total amount of memory available to the job run instance, in gigabytes. * `ocpus` - The total number of OCPUs available to the job run instance. * `shape_name` - The shape used to launch the job run instances. diff --git a/website/docs/r/datascience_model_deployment.html.markdown b/website/docs/r/datascience_model_deployment.html.markdown index 75b271e6e0c..10d497a7f54 100644 --- a/website/docs/r/datascience_model_deployment.html.markdown +++ b/website/docs/r/datascience_model_deployment.html.markdown @@ -155,7 +155,7 @@ The following arguments are supported: * `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 minimum network bandwidth for the model deployment. - * `instance_configuration` - (Required) (Updatable) The model deployment instance configuration + * `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. * `cpu_baseline` - (Optional) (Updatable) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. @@ -254,7 +254,7 @@ The following attributes are exported: * `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 minimum network bandwidth for the model deployment. - * `instance_configuration` - The model deployment instance configuration + * `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. * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. diff --git a/website/docs/r/datascience_model_group.html.markdown b/website/docs/r/datascience_model_group.html.markdown new file mode 100644 index 00000000000..7a48e9a482d --- /dev/null +++ b/website/docs/r/datascience_model_group.html.markdown @@ -0,0 +1,211 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group" +sidebar_current: "docs-oci-resource-datascience-model_group" +description: |- + Provides the Model Group resource in Oracle Cloud Infrastructure Data Science service +--- + +# oci_datascience_model_group +This resource provides the Model Group resource in Oracle Cloud Infrastructure Data Science service. + +Create a new Model Group resource. + +## Example Usage + +```hcl +resource "oci_datascience_model_group" "test_model_group" { + #Required + compartment_id = var.compartment_id + create_type = var.model_group_create_type + project_id = oci_datascience_project.test_project.id + + #Optional + defined_tags = {"Operations.CostCenter"= "42"} + description = var.model_group_description + display_name = var.model_group_display_name + freeform_tags = {"Department"= "Finance"} + member_model_entries { + + #Optional + member_model_details { + + #Optional + inference_key = var.model_group_member_model_entries_member_model_details_inference_key + model_id = oci_datascience_model.test_model.id + } + } + model_group_clone_source_details { + #Required + model_group_clone_source_type = var.model_group_model_group_clone_source_details_model_group_clone_source_type + source_id = oci_datascience_source.test_source.id + + #Optional + modify_model_group_details { + + #Optional + defined_tags = var.model_group_model_group_clone_source_details_modify_model_group_details_defined_tags + description = var.model_group_model_group_clone_source_details_modify_model_group_details_description + display_name = var.model_group_model_group_clone_source_details_modify_model_group_details_display_name + freeform_tags = var.model_group_model_group_clone_source_details_modify_model_group_details_freeform_tags + model_group_details { + #Required + type = var.model_group_model_group_clone_source_details_modify_model_group_details_model_group_details_type + + #Optional + base_model_id = oci_datascience_model.test_model.id + custom_metadata_list { + + #Optional + category = var.model_group_model_group_clone_source_details_modify_model_group_details_model_group_details_custom_metadata_list_category + description = var.model_group_model_group_clone_source_details_modify_model_group_details_model_group_details_custom_metadata_list_description + key = var.model_group_model_group_clone_source_details_modify_model_group_details_model_group_details_custom_metadata_list_key + value = var.model_group_model_group_clone_source_details_modify_model_group_details_model_group_details_custom_metadata_list_value + } + } + model_group_version_history_id = oci_datascience_model_group_version_history.test_model_group_version_history.id + version_label = var.model_group_model_group_clone_source_details_modify_model_group_details_version_label + } + patch_model_group_member_model_details { + + #Optional + items { + #Required + operation = var.model_group_model_group_clone_source_details_patch_model_group_member_model_details_items_operation + values { + #Required + model_id = oci_datascience_model.test_model.id + + #Optional + inference_key = var.model_group_model_group_clone_source_details_patch_model_group_member_model_details_items_values_inference_key + } + } + } + } + model_group_details { + #Required + type = var.model_group_model_group_details_type + + #Optional + base_model_id = oci_datascience_model.test_model.id + custom_metadata_list { + + #Optional + category = var.model_group_model_group_details_custom_metadata_list_category + description = var.model_group_model_group_details_custom_metadata_list_description + key = var.model_group_model_group_details_custom_metadata_list_key + value = var.model_group_model_group_details_custom_metadata_list_value + } + } + model_group_version_history_id = oci_datascience_model_group_version_history.test_model_group_version_history.id + version_label = var.model_group_version_label +} +``` + +## 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 to create the modelGroup in. +* `create_type` - (Required) The type of the model group create operation. +* `defined_tags` - (Applicable when create_type=CREATE) (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` - (Applicable when create_type=CREATE) (Updatable) A short description of the modelGroup. +* `display_name` - (Applicable when create_type=CREATE) (Updatable) A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. Example: `My ModelGroup` +* `freeform_tags` - (Applicable when create_type=CREATE) (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"}` +* `member_model_entries` - (Required when create_type=CREATE) List of member models (inferenceKey & modelId) to be associated with the model group. + * `member_model_details` - (Applicable when create_type=CREATE) Each List item contains inference key and model ocid. + * `inference_key` - (Applicable when create_type=CREATE) SaaS friendly name of the model. + * `model_id` - (Required when create_type=CREATE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. +* `model_group_clone_source_details` - (Required when create_type=CLONE) Model Group clone source details. + * `model_group_clone_source_type` - (Required) Source resource for model group clone operation. + * `modify_model_group_details` - (Optional) Overwrites the properties of the source modelGroup. + * `defined_tags` - (Optional) 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) A short description of the modelGroup. + * `display_name` - (Optional) A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. Example: `My ModelGroup` + * `freeform_tags` - (Optional) 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"}` + * `model_group_details` - (Optional) The model group details. + * `base_model_id` - (Required when type=STACKED) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model in the group that represents the base model for stacked deployment. + * `custom_metadata_list` - (Applicable when model_group_clone_source_type=MODEL_GROUP | MODEL_GROUP_VERSION_HISTORY) An array of custom metadata details for the model group. + * `category` - (Applicable when model_group_clone_source_type=MODEL_GROUP | MODEL_GROUP_VERSION_HISTORY) Category of the metadata. + * `description` - (Applicable when model_group_clone_source_type=MODEL_GROUP | MODEL_GROUP_VERSION_HISTORY) Description of model metadata. + * `key` - (Applicable when model_group_clone_source_type=MODEL_GROUP | MODEL_GROUP_VERSION_HISTORY) Key of the metadata. + * `value` - (Applicable when model_group_clone_source_type=MODEL_GROUP | MODEL_GROUP_VERSION_HISTORY) Value of the metadata. + * `type` - (Required) The type of the model group. + * `model_group_version_history_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. + * `version_label` - (Optional) An additional description of the lifecycle state of the model group. + * `patch_model_group_member_model_details` - (Optional) Specifies the list of new models to be added and list of models from source model group to be removed for cloning. + * `items` - (Optional) Array of patch instructions. + * `operation` - (Required) A single instruction to be included as part of Patch request content. Enum type (INSERT and REMOVE). + * `values` - (Required) Array of inference key and model OCID. + * `inference_key` - (Optional) SaaS friendly name of the model. + * `model_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. + * `source_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history. +* `model_group_details` - (Required when create_type=CREATE) The model group details. + * `base_model_id` - (Required when type=STACKED) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model in the group that represents the base model for stacked deployment. + * `custom_metadata_list` - (Applicable when create_type=CREATE) An array of custom metadata details for the model group. + * `category` - (Applicable when create_type=CREATE) Category of the metadata. + * `description` - (Applicable when create_type=CREATE) Description of model metadata. + * `key` - (Applicable when create_type=CREATE) Key of the metadata. + * `value` - (Applicable when create_type=CREATE) Value of the metadata. + * `type` - (Required) The type of the model group. +* `model_group_version_history_id` - (Applicable when create_type=CREATE) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. +* `project_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project to associate with the modelGroup. +* `version_label` - (Applicable when create_type=CREATE) (Updatable) An additional description of the lifecycle state of the model group. + + +** 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 modelGroup's compartment. +* `create_type` - The type of the model group create operation. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroup. +* `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 short description of the modelGroup. +* `display_name` - A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. +* `lifecycle_details` - Details about the lifecycle state of the model group. +* `member_model_entries` - List of member models (inferenceKey & modelId) to be associated with the model group. + * `member_model_details` - Each List item contains inference key and model ocid. + * `inference_key` - SaaS friendly name of the model. + * `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model. +* `model_group_details` - The model group details. + * `base_model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model in the group that represents the base model for stacked deployment. + * `custom_metadata_list` - An array of custom metadata details for the model group. + * `category` - Category of the metadata. + * `description` - Description of model metadata. + * `key` - Key of the metadata. + * `value` - Value of the metadata. + * `type` - The type of the model group. +* `model_group_version_history_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group version history to which the modelGroup is associated. +* `model_group_version_history_name` - The name of the model group version history to which the model group is associated. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroup. +* `source_model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the model group used for the clone operation. +* `state` - The state of the modelGroup. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the resource was created in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `time_updated` - The date and time the resource was last updated in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `version_id` - Unique identifier assigned to each version of the model group. It would be auto-incremented number generated by service. +* `version_label` - An additional description of the lifecycle state of the model group. + +## 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 Model Group + * `update` - (Defaults to 20 minutes), when updating the Model Group + * `delete` - (Defaults to 20 minutes), when destroying the Model Group + + +## Import + +ModelGroups can be imported using the `id`, e.g. + +``` +$ terraform import oci_datascience_model_group.test_model_group "id" +``` + diff --git a/website/docs/r/datascience_model_group_artifact.html.markdown b/website/docs/r/datascience_model_group_artifact.html.markdown new file mode 100644 index 00000000000..f04384754ca --- /dev/null +++ b/website/docs/r/datascience_model_group_artifact.html.markdown @@ -0,0 +1,62 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group_artifact" +sidebar_current: "docs-oci-resource-datascience-model_group_artifact" +description: |- + Provides the Model Group Artifact resource in Oracle Cloud Infrastructure Data Science service +--- + +# oci_datascience_model_group_artifact +This resource provides the Model Group Artifact resource in Oracle Cloud Infrastructure Data Science service. + +Creates artifact for the Model Group. + +## Example Usage + +```hcl +resource "oci_datascience_model_group_artifact" "test_model_group_artifact" { + #Required + model_group_artifact = var.model_group_artifact_model_group_artifact + content_length = var.model_group_artifact_content_length + model_group_id = oci_datascience_model_group.test_model_group.id + + #Optional + content_disposition = var.model_group_artifact_content_disposition +} +``` + +## Argument Reference + +The following arguments are supported: + +* `model_group_artifact` - (Required) The model group artifact to upload. +* `content_disposition` - (Optional) This header allows you to specify a filename during upload. This file name is used to dispose of the file contents while downloading the file. If this optional field is not populated in the request, then the OCID of the model is used for the file name when downloading. Example: `{"Content-Disposition": "attachment" "filename"="model.tar.gz" "Content-Length": "2347" "Content-Type": "application/gzip"}` +* `content_length` - (Required) The content length of the body. +* `model_group_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroup. + + +** IMPORTANT ** +Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values + +## Attributes Reference + +The following attributes are exported: + + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/oracle/oci/latest/docs/guides/changing_timeouts) for certain operations: + * `create` - (Defaults to 20 minutes), when creating the Model Group Artifact + * `update` - (Defaults to 20 minutes), when updating the Model Group Artifact + * `delete` - (Defaults to 20 minutes), when destroying the Model Group Artifact + + +## Import + +ModelGroupArtifacts can be imported using the `id`, e.g. + +``` +$ terraform import oci_datascience_model_group_artifact.test_model_group_artifact "id" +``` + diff --git a/website/docs/r/datascience_model_group_version_history.html.markdown b/website/docs/r/datascience_model_group_version_history.html.markdown new file mode 100644 index 00000000000..e83701bfdfd --- /dev/null +++ b/website/docs/r/datascience_model_group_version_history.html.markdown @@ -0,0 +1,82 @@ +--- +subcategory: "Data Science" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_datascience_model_group_version_history" +sidebar_current: "docs-oci-resource-datascience-model_group_version_history" +description: |- + Provides the Model Group Version History resource in Oracle Cloud Infrastructure Data Science service +--- + +# oci_datascience_model_group_version_history +This resource provides the Model Group Version History resource in Oracle Cloud Infrastructure Data Science service. + +Creates a new modelGroupVersionHistory. + +## Example Usage + +```hcl +resource "oci_datascience_model_group_version_history" "test_model_group_version_history" { + #Required + compartment_id = var.compartment_id + project_id = oci_datascience_project.test_project.id + + #Optional + defined_tags = {"Operations.CostCenter"= "42"} + description = var.model_group_version_history_description + display_name = var.model_group_version_history_display_name + freeform_tags = {"Department"= "Finance"} + latest_model_group_id = oci_datascience_model_group.test_model_group.id +} +``` + +## 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 to create the model group version history in. +* `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 short description of the model version history. +* `display_name` - (Optional) (Updatable) A user-friendly name for the resource. It must be unique and can't be modified. Avoid entering confidential information. Example: `My model version history` +* `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"}` +* `latest_model_group_id` - (Optional) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest version of the model group to be associated. +* `project_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project to associate with the model group version history. + + +** 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 modelGroupVersionHistory's compartment. +* `created_by` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the user who created the modelGroupVersionHistory. +* `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 short description of the modelGroupVersionHistory. +* `display_name` - A user-friendly display name for the resource. It does not have to be unique and can be modified. Avoid entering confidential information. +* `freeform_tags` - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` +* `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the modelGroupVersionHistory. +* `latest_model_group_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the latest version of the model group associated. +* `lifecycle_details` - Details about the lifecycle state of the model group version history. +* `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project associated with the modelGroupVersionHistory. +* `state` - The state of the modelGroupVersionHistory. +* `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The date and time the resource was created in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z +* `time_updated` - The date and time the resource was last updated in the timestamp format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2019-08-25T21:10:29.41Z + +## 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 Model Group Version History + * `update` - (Defaults to 20 minutes), when updating the Model Group Version History + * `delete` - (Defaults to 20 minutes), when destroying the Model Group Version History + + +## Import + +ModelGroupVersionHistories can be imported using the `id`, e.g. + +``` +$ terraform import oci_datascience_model_group_version_history.test_model_group_version_history "id" +``` + diff --git a/website/docs/r/datascience_notebook_session.html.markdown b/website/docs/r/datascience_notebook_session.html.markdown index 5e655bdf5ec..c79c7d6e6ee 100644 --- a/website/docs/r/datascience_notebook_session.html.markdown +++ b/website/docs/r/datascience_notebook_session.html.markdown @@ -33,6 +33,7 @@ resource "oci_datascience_notebook_session" "test_notebook_session" { notebook_session_shape_config_details { #Optional + cpu_baseline = var.notebook_session_notebook_session_config_details_notebook_session_shape_config_details_cpu_baseline 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 } @@ -49,6 +50,7 @@ resource "oci_datascience_notebook_session" "test_notebook_session" { notebook_session_shape_config_details { #Optional + cpu_baseline = var.notebook_session_notebook_session_configuration_details_notebook_session_shape_config_details_cpu_baseline 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 } @@ -94,6 +96,7 @@ The following arguments are supported: * `notebook_session_config_details` - (Optional) Details for the notebook session configuration. * `block_storage_size_in_gbs` - (Optional) A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - (Optional) Details for the notebook session shape configuration. + * `cpu_baseline` - (Optional) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. @@ -102,6 +105,7 @@ The following arguments are supported: * `notebook_session_configuration_details` - (Optional) (Updatable) Details for the notebook session configuration. * `block_storage_size_in_gbs` - (Optional) (Updatable) A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - (Optional) (Updatable) Details for the notebook session shape configuration. + * `cpu_baseline` - (Optional) (Updatable) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. @@ -141,6 +145,7 @@ The following attributes are exported: * `notebook_session_config_details` - Details for the notebook session configuration. * `block_storage_size_in_gbs` - A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. @@ -149,6 +154,7 @@ The following attributes are exported: * `notebook_session_configuration_details` - Details for the notebook session configuration. * `block_storage_size_in_gbs` - A notebook session instance is provided with a block storage volume. This specifies the size of the volume in GBs. * `notebook_session_shape_config_details` - Details for the notebook session shape configuration. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left bank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `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. diff --git a/website/docs/r/datascience_pipeline.html.markdown b/website/docs/r/datascience_pipeline.html.markdown index 1496ae4404b..887dd8e2182 100644 --- a/website/docs/r/datascience_pipeline.html.markdown +++ b/website/docs/r/datascience_pipeline.html.markdown @@ -58,6 +58,7 @@ resource "oci_datascience_pipeline" "test_pipeline" { driver_shape_config_details { #Optional + cpu_baseline = var.pipeline_step_details_step_dataflow_configuration_details_driver_shape_config_details_cpu_baseline memory_in_gbs = var.pipeline_step_details_step_dataflow_configuration_details_driver_shape_config_details_memory_in_gbs ocpus = var.pipeline_step_details_step_dataflow_configuration_details_driver_shape_config_details_ocpus } @@ -65,6 +66,7 @@ resource "oci_datascience_pipeline" "test_pipeline" { executor_shape_config_details { #Optional + cpu_baseline = var.pipeline_step_details_step_dataflow_configuration_details_executor_shape_config_details_cpu_baseline memory_in_gbs = var.pipeline_step_details_step_dataflow_configuration_details_executor_shape_config_details_memory_in_gbs ocpus = var.pipeline_step_details_step_dataflow_configuration_details_executor_shape_config_details_ocpus } @@ -79,6 +81,7 @@ resource "oci_datascience_pipeline" "test_pipeline" { shape_config_details { #Optional + cpu_baseline = var.pipeline_step_details_step_infrastructure_configuration_details_shape_config_details_cpu_baseline memory_in_gbs = var.pipeline_step_details_step_infrastructure_configuration_details_shape_config_details_memory_in_gbs ocpus = var.pipeline_step_details_step_infrastructure_configuration_details_shape_config_details_ocpus } @@ -123,6 +126,7 @@ resource "oci_datascience_pipeline" "test_pipeline" { shape_config_details { #Optional + cpu_baseline = var.pipeline_infrastructure_configuration_details_shape_config_details_cpu_baseline memory_in_gbs = var.pipeline_infrastructure_configuration_details_shape_config_details_memory_in_gbs ocpus = var.pipeline_infrastructure_configuration_details_shape_config_details_ocpus } @@ -169,6 +173,7 @@ The following arguments are supported: * `infrastructure_configuration_details` - (Optional) (Updatable) The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - (Required) (Updatable) The size of the block storage volume to attach to the instance. * `shape_config_details` - (Optional) (Updatable) Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - (Optional) (Updatable) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - (Optional) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - (Optional) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - (Required) (Updatable) The shape used to launch the instance for all step runs in the pipeline. @@ -201,10 +206,12 @@ The following arguments are supported: * `configuration` - (Applicable when step_type=DATAFLOW) (Updatable) The Spark configuration passed to the running process. * `driver_shape` - (Applicable when step_type=DATAFLOW) (Updatable) The VM shape for the driver. * `driver_shape_config_details` - (Applicable when step_type=DATAFLOW) (Updatable) Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - (Applicable when step_type=DATAFLOW) (Updatable) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - (Applicable when step_type=DATAFLOW) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - (Applicable when step_type=DATAFLOW) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - (Applicable when step_type=DATAFLOW) (Updatable) The VM shape for the executors. * `executor_shape_config_details` - (Applicable when step_type=DATAFLOW) (Updatable) Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - (Applicable when step_type=DATAFLOW) (Updatable) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - (Applicable when step_type=DATAFLOW) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - (Applicable when step_type=DATAFLOW) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - (Applicable when step_type=DATAFLOW) (Updatable) An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. @@ -213,6 +220,7 @@ The following arguments are supported: * `step_infrastructure_configuration_details` - (Applicable when step_type=CONTAINER | CUSTOM_SCRIPT) (Updatable) The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - (Required when step_type=CONTAINER | CUSTOM_SCRIPT) (Updatable) The size of the block storage volume to attach to the instance. * `shape_config_details` - (Applicable when step_type=CONTAINER | CUSTOM_SCRIPT) (Updatable) Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - (Applicable when step_type=CONTAINER | CUSTOM_SCRIPT) (Updatable) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - (Applicable when step_type=CONTAINER | CUSTOM_SCRIPT) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - (Applicable when step_type=CONTAINER | CUSTOM_SCRIPT) (Updatable) A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - (Required when step_type=CONTAINER | CUSTOM_SCRIPT) (Updatable) The shape used to launch the instance for all step runs in the pipeline. @@ -261,6 +269,7 @@ The following attributes are exported: * `infrastructure_configuration_details` - The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance. * `shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - The shape used to launch the instance for all step runs in the pipeline. @@ -294,10 +303,12 @@ The following attributes are exported: * `configuration` - The Spark configuration passed to the running process. * `driver_shape` - The VM shape for the driver. * `driver_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - The VM shape for the executors. * `executor_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. @@ -306,6 +317,7 @@ The following attributes are exported: * `step_infrastructure_configuration_details` - The infrastructure configuration details of a pipeline or a step. * `block_storage_size_in_gbs` - The size of the block storage volume to attach to the instance. * `shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `shape_name` - The shape used to launch the instance for all step runs in the pipeline. diff --git a/website/docs/r/datascience_pipeline_run.html.markdown b/website/docs/r/datascience_pipeline_run.html.markdown index 08ee7395970..a5e060478a8 100644 --- a/website/docs/r/datascience_pipeline_run.html.markdown +++ b/website/docs/r/datascience_pipeline_run.html.markdown @@ -75,6 +75,7 @@ resource "oci_datascience_pipeline_run" "test_pipeline_run" { driver_shape_config_details { #Optional + cpu_baseline = var.pipeline_run_step_override_details_step_dataflow_configuration_details_driver_shape_config_details_cpu_baseline memory_in_gbs = var.pipeline_run_step_override_details_step_dataflow_configuration_details_driver_shape_config_details_memory_in_gbs ocpus = var.pipeline_run_step_override_details_step_dataflow_configuration_details_driver_shape_config_details_ocpus } @@ -82,6 +83,7 @@ resource "oci_datascience_pipeline_run" "test_pipeline_run" { executor_shape_config_details { #Optional + cpu_baseline = var.pipeline_run_step_override_details_step_dataflow_configuration_details_executor_shape_config_details_cpu_baseline memory_in_gbs = var.pipeline_run_step_override_details_step_dataflow_configuration_details_executor_shape_config_details_memory_in_gbs ocpus = var.pipeline_run_step_override_details_step_dataflow_configuration_details_executor_shape_config_details_ocpus } @@ -131,10 +133,12 @@ The following arguments are supported: * `configuration` - (Optional) The Spark configuration passed to the running process. * `driver_shape` - (Optional) The VM shape for the driver. * `driver_shape_config_details` - (Optional) Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - (Optional) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - (Optional) A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - (Optional) A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - (Optional) The VM shape for the executors. * `executor_shape_config_details` - (Optional) Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - (Optional) The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - (Optional) A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - (Optional) A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - (Optional) An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. @@ -195,10 +199,12 @@ The following attributes are exported: * `configuration` - The Spark configuration passed to the running process. * `driver_shape` - The VM shape for the driver. * `driver_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `executor_shape` - The VM shape for the executors. * `executor_shape_config_details` - Details for the pipeline step run shape configuration. Specify only when a flex shape is selected. + * `cpu_baseline` - The baseline OCPU utilization for a subcore burstable VM instance. If this attribute is left blank, it will default to `BASELINE_1_1`. The following values are supported: BASELINE_1_8 - baseline usage is 1/8 of an OCPU. BASELINE_1_2 - baseline usage is 1/2 of an OCPU. BASELINE_1_1 - baseline usage is an entire OCPU. This represents a non-burstable instance. * `memory_in_gbs` - A pipeline step run instance of type VM.Standard.E3.Flex allows memory to be specified. This specifies the size of the memory in GBs. * `ocpus` - A pipeline step run instance of type VM.Standard.E3.Flex allows the ocpu count to be specified. * `logs_bucket_uri` - An Oracle Cloud Infrastructure URI of the bucket where the Spark job logs are to be uploaded. diff --git a/website/docs/r/management_dashboard_management_dashboards_import.html.markdown b/website/docs/r/management_dashboard_management_dashboards_import.html.markdown index 2508fba0ecd..86b62fe71e9 100644 --- a/website/docs/r/management_dashboard_management_dashboards_import.html.markdown +++ b/website/docs/r/management_dashboard_management_dashboards_import.html.markdown @@ -23,8 +23,9 @@ Here's an example of how you can use CLI to import: ```hcl resource "oci_management_dashboard_management_dashboards_import" "test_management_dashboards_import" { #Optional - import_details = var.sample_import_details - import_details_file = var.sample_import_details_file_path + override_dashboard_compartment_ocid = var.management_dashboards_import_override_dashboard_compartment_ocid + override_same_name = var.management_dashboards_import_override_same_name + override_saved_search_compartment_ocid = var.management_dashboards_import_override_saved_search_compartment_ocid } ``` @@ -32,8 +33,11 @@ resource "oci_management_dashboard_management_dashboards_import" "test_managemen The following arguments are supported: -* `import_details` - (Optional) Array of Dashboards to import. The `import_details` is mandatory if `import_details_path` is not passed. Value should be stringified JSON of [ManagementDashboardImportDetails](https://docs.cloud.oracle.com/en-us/iaas/api/#/en/managementdashboard/20200901/ManagementDashboardImportDetails/) -* `import_details_path` - (Optional) Array of Dashboards to import. The `import_details_path` is mandatory if `import_details` is not passed. Value should be the path to the JSON file containing [ManagementDashboardImportDetails](https://docs.cloud.oracle.com/en-us/iaas/api/#/en/managementdashboard/20200901/ManagementDashboardImportDetails/) + +* `override_dashboard_compartment_ocid` - (Optional) If this attribute is set, the dashboard resources are created or updated in the compartment specified by OCID. If this attribute is not set, the compartment specified in the JSON metadata is used. +* `override_same_name` - (Optional) By default, if a resource with the same OCID exists in the target compartment, it is updated during the import process, otherwise, a new resource is created. However, if this attribute is set to true, then during the import process if a resource with the same displayName exists in the compartment, then it is updated even if the OCIDs are different. This is useful when importing the same resource multiple times. If the compartment and displayName remain the same, the resource is only updated and multiple copies of a resource are not created. +* `override_saved_search_compartment_ocid` - (Optional) If this attribute is set, the saved search resources are created or updated in the compartment specified by OCID. If this attribute is not set, the compartment specified in the JSON metadata is used. + ** 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 diff --git a/website/docs/r/opsi_database_insight.html.markdown b/website/docs/r/opsi_database_insight.html.markdown index dd366c2e48a..747200bb1f6 100644 --- a/website/docs/r/opsi_database_insight.html.markdown +++ b/website/docs/r/opsi_database_insight.html.markdown @@ -24,6 +24,19 @@ resource "oci_opsi_database_insight" "test_database_insight" { entity_source = var.database_insight_entity_source #Optional + connection_credential_details { + #Required + credential_type = var.database_insight_connection_credential_details_credential_type + + #Optional + credential_source_name = var.database_insight_connection_credential_details_credential_source_name + named_credential_id = oci_database_management_named_credential.test_named_credential.id + password_secret_id = oci_vault_secret.test_secret.id + role = var.database_insight_connection_credential_details_role + user_name = oci_identity_user.test_user.name + wallet_secret_id = oci_vault_secret.test_secret.id + } + connection_details { #Required protocol = var.database_insight_connection_details_protocol @@ -40,25 +53,15 @@ resource "oci_opsi_database_insight" "test_database_insight" { port = var.database_insight_connection_details_port } entity_source = var.database_insight_entity_source - - #Optional - connection_credential_details { - #Required - credential_source_name = var.database_insight_connection_credential_details_credential_source_name - credential_type = var.database_insight_connection_credential_details_credential_type - - #Optional - password_secret_id = oci_vault_secret.test_secret.id - role = var.database_insight_connection_credential_details_role - user_name = oci_identity_user.test_user.name - wallet_secret_id = oci_vault_secret.test_secret.id - } + credential_details { #Required credential_source_name = var.database_insight_credential_details_credential_source_name credential_type = var.database_insight_credential_details_credential_type #Optional + credential_source_name = var.database_insight_credential_details_credential_source_name + named_credential_id = oci_database_management_named_credential.test_named_credential.id password_secret_id = oci_vault_secret.test_secret.id role = var.database_insight_credential_details_role user_name = oci_identity_user.test_user.name @@ -85,24 +88,26 @@ resource "oci_opsi_database_insight" "test_database_insight" { The following arguments are supported: * `compartment_id` - (Required) (Updatable) Compartment Identifier of database -* `connection_credential_details` - (Required when entity_source=MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) User credential details to connect to the database. - * `credential_source_name` - (Required) Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. +* `connection_credential_details` - (Required when entity_source=MACS_MANAGED_AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) User credential details to connect to the database. + * `credential_type` - (Required) CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - (Applicable when credential_type=CREDENTIALS_BY_NAMED_CREDS) The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. * `credential_type` - (Required) Credential type. * `password_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user role. * `user_name` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user name. * `wallet_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. This is used for TCPS support in BM/VM/ExaCS cases. -* `connection_details` - (Required) Connection details to connect to the database. HostName, protocol, and port should be specified. - * `host_name` - (Required when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) Name of the listener host that will be used to create the connect string to the database. +* `connection_details` - (Required when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE | PE_COMANAGED_DATABASE) Connection details to connect to the database. HostName, protocol, and port should be specified. + * `host_name` - (Required when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) Name of the listener host that will be used to create the connect string to the database. * `hosts` - (Required when entity_source=PE_COMANAGED_DATABASE) List of hosts and port for private endpoint accessed database resource. * `host_ip` - (Applicable when entity_source=PE_COMANAGED_DATABASE) Host IP used for connection requests for Cloud DB resource. * `port` - (Applicable when entity_source=PE_COMANAGED_DATABASE) Listener port number used for connection requests for rivate endpoint accessed db resource. - * `port` - (Required when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) Listener port number used for connection requests. - * `protocol` - (Required) Protocol used for connection requests for private endpoint accssed database resource. - * `service_name` - (Required) Database service name used for connection requests. -* `credential_details` - (Required when entity_source=AUTONOMOUS_DATABASE | PE_COMANAGED_DATABASE) User credential details to connect to the database. - * `credential_source_name` - (Required) Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. - * `credential_type` - (Required) Credential type. + * `port` - (Required when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) Listener port number used for connection requests. + * `protocol` - (Required when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE | PE_COMANAGED_DATABASE) Protocol used for connection requests for private endpoint accssed database resource. + * `service_name` - (Required when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE | PE_COMANAGED_DATABASE) Database service name used for connection requests. +* `credential_details` - (Required when entity_source=AUTONOMOUS_DATABASE | PE_COMANAGED_DATABASE) User credential details to connect to the database. + * `credential_source_name` - (Applicable when entity_source=EM_MANAGED_EXTERNAL_DATABASE) Credential source name that had been added in Management Agent wallet. This value is only required when credential set by CREDENTIALS_BY_SOURCE and is optional properties for the others. + * `credential_type` - (Required) CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - (Applicable when credential_type=CREDENTIALS_BY_NAMED_CREDS) The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in the Management Agent to connect the Autonomous Database. * `password_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user role. * `user_name` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user name. @@ -120,11 +125,11 @@ The following arguments are supported: * `exadata_insight_id` - (Applicable when entity_source=EM_MANAGED_EXTERNAL_DATABASE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata insight. * `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_advanced_features_enabled` - (Required when entity_source=AUTONOMOUS_DATABASE) Flag is to identify if advanced features for autonomous database is enabled or not -* `management_agent_id` - (Required when entity_source=MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent +* `management_agent_id` - (Required when entity_source=MACS_MANAGED_AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | MACS_MANAGED_EXTERNAL_DATABASE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent * `opsi_private_endpoint_id` - (Applicable when entity_source=AUTONOMOUS_DATABASE | PE_COMANAGED_DATABASE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint * `dbm_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_DATABASE) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Management private endpoint. This field and opsi_private_endpoint_id are mutually exclusive. If DBM private endpoint ID is provided, a new OPSI private endpoint ID will be created. * `service_name` - (Required when entity_source=PE_COMANAGED_DATABASE) Database service name used for connection requests. -* `system_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_DATABASE | PE_COMANAGED_DATABASE) System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `system_tags` - (Applicable when entity_source=AUTONOMOUS_DATABASE | MACS_MANAGED_AUTONOMOUS_DATABASE | MACS_MANAGED_CLOUD_DATABASE | PE_COMANAGED_DATABASE) System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `status` - (Optional) (Updatable) Status of the resource. Example: "ENABLED", "DISABLED". Resource can be either enabled or disabled by updating the value of status field to either "ENABLED" or "DISABLED" ** IMPORTANT ** @@ -135,13 +140,14 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: * `compartment_id` - Compartment identifier of the database -* `connection_credential_details` - User credential details to connect to the database. This is supplied via the External Database Service. -* `credential_source_name` - Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. -* `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. -* `password_secret_id` - The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. -* `role` - database user role. -* `user_name` - database user name. -* `wallet_secret_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. +* `connection_credential_details` - User credential details to connect to the database. + * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for ther others. + * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. + * `password_secret_id` - The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. + * `role` - database user role. + * `user_name` - database user name. + * `wallet_secret_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. This is used for TCPS support in BM/VM/ExaCS cases. * `connection_details` - Connection details to connect to the database. HostName, protocol, and port should be specified. * `host_name` - Name of the listener host that will be used to create the connect string to the database. * `hosts` - List of hosts and port for private endpoint accessed database resource. @@ -151,9 +157,10 @@ The following attributes are exported: * `protocol` - Protocol used for connection requests for private endpoint accssed database resource. * `service_name` - Database service name used for connection requests. * `connector_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of External Database Connector -* `credential_details` - User credential details to connect to the database. -* `credential_source_name` - Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. -* `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. +* `credential_details` - User credential details to connect to the database. + * `credential_source_name` - Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for ther others. + * `credential_type` - CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. * `password_secret_id` - The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - database user role. * `user_name` - database user name. diff --git a/website/docs/r/opsi_exadata_insight.html.markdown b/website/docs/r/opsi_exadata_insight.html.markdown index cfe4fba476a..55c85268555 100644 --- a/website/docs/r/opsi_exadata_insight.html.markdown +++ b/website/docs/r/opsi_exadata_insight.html.markdown @@ -17,78 +17,128 @@ Create an Exadata insight resource for an Exadata system in Operations Insights. ```hcl resource "oci_opsi_exadata_insight" "test_exadata_insight" { - #Required - compartment_id = var.compartment_id - enterprise_manager_bridge_id = oci_opsi_enterprise_manager_bridge.test_enterprise_manager_bridge.id - enterprise_manager_entity_identifier = var.exadata_insight_enterprise_manager_entity_identifier - enterprise_manager_identifier = var.exadata_insight_enterprise_manager_identifier - entity_source = var.exadata_insight_entity_source - - #Optional - defined_tags = {"foo-namespace.bar-key"= "value"} - freeform_tags = {"bar-key"= "value"} - is_auto_sync_enabled = var.exadata_insight_is_auto_sync_enabled - member_vm_cluster_details { - - #Optional - compartment_id = var.compartment_id - dbm_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id - member_database_details { - - #Optional - compartment_id = var.compartment_id - connection_credential_details { - #Required - credential_type = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_credential_details_credential_type - - #Optional - credential_source_name = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_credential_details_credential_source_name - password_secret_id = oci_vault_secret.test_secret.id - role = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_credential_details_role - user_name = oci_identity_user.test_user.name - wallet_secret_id = oci_vault_secret.test_secret.id - } - connection_details { - - #Optional - host_name = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_host_name - hosts { - - #Optional - host_ip = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_hosts_host_ip - port = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_hosts_port - } - port = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_port - protocol = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_protocol - service_name = oci_core_service.test_service.name - } - credential_details { - #Required - credential_type = var.exadata_insight_member_vm_cluster_details_member_database_details_credential_details_credential_type - - #Optional - credential_source_name = var.exadata_insight_member_vm_cluster_details_member_database_details_credential_details_credential_source_name - password_secret_id = oci_vault_secret.test_secret.id - role = var.exadata_insight_member_vm_cluster_details_member_database_details_credential_details_role - user_name = oci_identity_user.test_user.name - wallet_secret_id = oci_vault_secret.test_secret.id - } - database_id = oci_database_database.test_database.id - database_resource_type = var.exadata_insight_member_vm_cluster_details_member_database_details_database_resource_type - dbm_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id - defined_tags = var.exadata_insight_member_vm_cluster_details_member_database_details_defined_tags - deployment_type = var.exadata_insight_member_vm_cluster_details_member_database_details_deployment_type - entity_source = var.exadata_insight_member_vm_cluster_details_member_database_details_entity_source - freeform_tags = var.exadata_insight_member_vm_cluster_details_member_database_details_freeform_tags - management_agent_id = oci_management_agent_management_agent.test_management_agent.id - opsi_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id - service_name = oci_core_service.test_service.name - system_tags = var.exadata_insight_member_vm_cluster_details_member_database_details_system_tags - } - opsi_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id - vm_cluster_type = var.exadata_insight_member_vm_cluster_details_vm_cluster_type - vmcluster_id = oci_opsi_vmcluster.test_vmcluster.id - } + #Required + compartment_id = var.compartment_id + entity_source = var.exadata_insight_entity_source + + #Optional* `credential_source_name` - (Required) Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. + defined_tags = {"foo-namespace.bar-key"= "value"} + enterprise_manager_bridge_id = oci_opsi_enterprise_manager_bridge.test_enterprise_manager_bridge.id + enterprise_manager_entity_identifier = var.exadata_insight_enterprise_manager_entity_identifier + enterprise_manager_identifier = var.exadata_insight_enterprise_manager_identifier + exadata_infra_id = oci_opsi_exadata_infra.test_exadata_infra.id + freeform_tags = {"bar-key"= "value"} + is_auto_sync_enabled = var.exadata_insight_is_auto_sync_enabled + member_vm_cluster_details { + + #Optional + compartment_id = var.compartment_id + dbm_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id + member_autonomous_details { + + #Optional + compartment_id = var.compartment_id + connection_credential_details { + #Required + credential_type = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_connection_credential_details_credential_type + + #Optional + credential_source_name = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_connection_credential_details_credential_source_name + named_credential_id = oci_database_management_named_credential.test_named_credential.id + password_secret_id = oci_vault_secret.test_secret.id + role = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_connection_credential_details_role + user_name = oci_identity_user.test_user.name + wallet_secret_id = oci_vault_secret.test_secret.id + } + connection_details { + + #Optional + host_name = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_connection_details_host_name + port = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_connection_details_port + protocol = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_connection_details_protocol + service_name = oci_announcements_service_service.test_service.name + } + credential_details { + #Required + credential_type = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_credential_details_credential_type + + #Optional + credential_source_name = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_credential_details_credential_source_name + named_credential_id = oci_database_management_named_credential.test_named_credential.id + password_secret_id = oci_vault_secret.test_secret.id + role = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_credential_details_role + user_name = oci_identity_user.test_user.name + wallet_secret_id = oci_vault_secret.test_secret.id + } + database_id = oci_database_database.test_database.id + database_resource_type = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_database_resource_type + defined_tags = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_defined_tags + deployment_type = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_deployment_type + entity_source = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_entity_source + freeform_tags = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_freeform_tags + is_advanced_features_enabled = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_is_advanced_features_enabled + management_agent_id = oci_management_agent_management_agent.test_management_agent.id + opsi_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id + system_tags = var.exadata_insight_member_vm_cluster_details_member_autonomous_details_system_tags + } + member_database_details { + + #Optional + compartment_id = var.compartment_id + connection_credential_details { + #Required + credential_type = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_credential_details_credential_type + + #Optional + credential_source_name = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_credential_details_credential_source_name + named_credential_id = oci_database_management_named_credential.test_named_credential.id + password_secret_id = oci_vault_secret.test_secret.id + role = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_credential_details_role + user_name = oci_identity_user.test_user.name + wallet_secret_id = oci_vault_secret.test_secret.id + } + connection_details { + + #Optional + host_name = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_host_name + hosts { + + #Optional + host_ip = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_hosts_host_ip + port = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_hosts_port + } + port = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_port + protocol = var.exadata_insight_member_vm_cluster_details_member_database_details_connection_details_protocol + service_name = oci_announcements_service_service.test_service.name + } + credential_details { + #Required + credential_type = var.exadata_insight_member_vm_cluster_details_member_database_details_credential_details_credential_type + + #Optional + credential_source_name = var.exadata_insight_member_vm_cluster_details_member_database_details_credential_details_credential_source_name + named_credential_id = oci_database_management_named_credential.test_named_credential.id + password_secret_id = oci_vault_secret.test_secret.id + role = var.exadata_insight_member_vm_cluster_details_member_database_details_credential_details_role + user_name = oci_identity_user.test_user.name + wallet_secret_id = oci_vault_secret.test_secret.id + } + database_id = oci_database_database.test_database.id + database_resource_type = var.exadata_insight_member_vm_cluster_details_member_database_details_database_resource_type + dbm_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id + defined_tags = var.exadata_insight_member_vm_cluster_details_member_database_details_defined_tags + deployment_type = var.exadata_insight_member_vm_cluster_details_member_database_details_deployment_type + entity_source = var.exadata_insight_member_vm_cluster_details_member_database_details_entity_source + freeform_tags = var.exadata_insight_member_vm_cluster_details_member_database_details_freeform_tags + management_agent_id = oci_management_agent_management_agent.test_management_agent.id + opsi_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id + service_name = oci_announcements_service_service.test_service.name + system_tags = var.exadata_insight_member_vm_cluster_details_member_database_details_system_tags + } + opsi_private_endpoint_id = oci_dataflow_private_endpoint.test_private_endpoint.id + vm_cluster_type = var.exadata_insight_member_vm_cluster_details_vm_cluster_type + vmcluster_id = oci_opsi_vmcluster.test_vmcluster.id + } } ``` @@ -105,47 +155,82 @@ The following arguments are supported: * `exadata_infra_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Exadata Infrastructure. * `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_auto_sync_enabled` - (Applicable when entity_source=EM_MANAGED_EXTERNAL_EXADATA) (Updatable) Set to true to enable automatic enablement and disablement of related targets from Enterprise Manager. New resources (e.g. Database Insights) will be placed in the same compartment as the related Exadata Insight. -* `member_vm_cluster_details` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) - * `compartment_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. - * `dbm_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Management private endpoint - * `member_database_details` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The databases that belong to the VM Cluster - * `compartment_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) (Updatable) Compartment Identifier of database - * `connection_credential_details` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) User credential details to connect to the database. - * `credential_source_name` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. - * `credential_type` - (Required) Credential type. - * `password_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. - * `role` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user role. - * `user_name` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user name. - * `wallet_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. This is used for TCPS support in BM/VM/ExaCS cases. - * `connection_details` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Connection details to connect to the database. HostName, protocol, and port should be specified. - * `host_name` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) Name of the listener host that will be used to create the connect string to the database. - * `hosts` - (Required when entity_source=PE_COMANAGED_EXADATA) List of hosts and port for private endpoint accessed database resource. - * `host_ip` - (Applicable when entity_source=PE_COMANAGED_EXADATA) Host IP used for connection requests for Cloud DB resource. - * `port` - (Applicable when entity_source=PE_COMANAGED_EXADATA) Listener port number used for connection requests for rivate endpoint accessed db resource. - * `port` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) Listener port number used for connection requests. - * `protocol` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Protocol used for connection requests for private endpoint accssed database resource. - * `service_name` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Database service name used for connection requests. - * `credential_details` - (Required when entity_source=PE_COMANAGED_EXADATA) User credential details to connect to the database. - * `credential_source_name` - (Required when entity_source=PE_COMANAGED_EXADATA) Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service. +* `member_vm_cluster_details` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) + * `compartment_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + * `dbm_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Management private endpoint + * `member_autonomous_details` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The autonomous databases that belong to the Autonomous VM Cluster + * `compartment_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) (Updatable) Compartment Identifier of database + * `connection_credential_details` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) User credential details to connect to the database. + * `credential_source_name` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA) Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for ther others. + * `credential_type` - (Required) CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - (Applicable when credential_type=CREDENTIALS_BY_NAMED_CREDS) The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. + * `password_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. + * `role` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user role. + * `user_name` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user name. + * `wallet_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. This is used for TCPS support in BM/VM/ExaCS cases. + * `connection_details` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Connection details to connect to the database. HostName, protocol, and port should be specified. + * `host_name` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Name of the listener host that will be used to create the connect string to the database. + * `port` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Listener port number used for connection requests. + * `protocol` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Protocol used for connection requests. + * `service_name` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Database service name used for connection requests. + * `credential_details` - (Applicable when entity_source=PE_COMANAGED_EXADATA) User credential details to connect to the database. + * `credential_source_name` - (Applicable when entity_source=PE_COMANAGED_EXADATA) Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for ther others. + * `credential_type` - (Required) CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - (Applicable when credential_type=CREDENTIALS_BY_NAMED_CREDS) The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. + * `password_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. + * `role` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user role. + * `user_name` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user name. + * `wallet_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. This is used for TCPS support in BM/VM/ExaCS cases. + * `database_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database. + * `database_resource_type` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Oracle Cloud Infrastructure database resource type + * `defined_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` + * `deployment_type` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) Database Deployment Type + * `entity_source` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Source of the database entity. + * `freeform_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` + * `is_advanced_features_enabled` - (Required when entity_source=PE_COMANAGED_EXADATA) Flag is to identify if advanced features for autonomous database is enabled or not + * `management_agent_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent + * `opsi_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint + * `system_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` + * `member_database_details` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The databases that belong to the VM Cluster + * `compartment_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) (Updatable) Compartment Identifier of database + * `connection_credential_details` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) User credential details to connect to the database. + * `credential_source_name` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA) Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for ther others. + * `credential_type` - (Required) CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - (Applicable when credential_type=CREDENTIALS_BY_NAMED_CREDS) The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. + * `password_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. + * `role` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user role. + * `user_name` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user name. + * `wallet_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. This is used for TCPS support in BM/VM/ExaCS cases. + * `connection_details` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Connection details to connect to the database. HostName, protocol, and port should be specified. + * `host_name` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) Name of the listener host that will be used to create the connect string to the database. + * `hosts` - (Required when entity_source=PE_COMANAGED_EXADATA) List of hosts and port for private endpoint accessed database resource. + * `host_ip` - (Applicable when entity_source=PE_COMANAGED_EXADATA) Host IP used for connection requests for Cloud DB resource. + * `port` - (Applicable when entity_source=PE_COMANAGED_EXADATA) Listener port number used for connection requests for rivate endpoint accessed db resource. + * `port` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) Listener port number used for connection requests. + * `protocol` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Protocol used for connection requests for private endpoint accssed database resource. + * `service_name` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Database service name used for connection requests. + * `credential_details` - (Required when entity_source=PE_COMANAGED_EXADATA) User credential details to connect to the database. + * `credential_source_name` - (Applicable when entity_source=PE_COMANAGED_EXADATA) Credential source name that had been added in Management Agent wallet. This value is only required when Credential set by CREDENTIALS_BY_SOURCE and is optional properties for ther others. * `credential_type` - (Required) CREDENTIALS_BY_SOURCE is supplied via the External Database Service. CREDENTIALS_BY_VAULT is supplied by secret service to connection PE_COMANAGED_DATABASE and ADB as well. CREDENTIALS_BY_IAM is used db-token to connect only for Autonomous Database. + * `named_credential_id` - (Applicable when credential_type=CREDENTIALS_BY_NAMED_CREDS) The credential [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) stored in management agent. * `password_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The secret [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) mapping to the database credentials. * `role` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user role. * `user_name` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) database user name. - * `wallet_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored.This is used for TCPS support in BM/VM/ExaCS cases. - * `database_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database. - * `database_resource_type` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Oracle Cloud Infrastructure database resource type - * `dbm_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Management private endpoint - * `defined_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` - * `deployment_type` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Database Deployment Type (EXACS will be supported in the future) - * `entity_source` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Source of the database entity. - * `freeform_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` - * `management_agent_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent - * `opsi_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint - * `service_name` - (Required when entity_source=PE_COMANAGED_EXADATA) Database service name used for connection requests. - * `system_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` - * `opsi_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint - * `vm_cluster_type` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA) Exadata VMCluster type - * `vmcluster_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM Cluster. + * `wallet_secret_id` - (Applicable when credential_type=CREDENTIALS_BY_VAULT) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Secret where the database keystore contents are stored. This is used for TCPS support in BM/VM/ExaCS cases. + * `database_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database. + * `database_resource_type` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Oracle Cloud Infrastructure database resource type + * `dbm_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Database Management private endpoint + * `defined_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` + * `deployment_type` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Database Deployment Type (EXACS will be supported in the future) + * `entity_source` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Source of the database entity. + * `freeform_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}` + * `management_agent_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Management Agent + * `opsi_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint + * `service_name` - (Required when entity_source=PE_COMANAGED_EXADATA) Database service name used for connection requests. + * `system_tags` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` + * `opsi_private_endpoint_id` - (Applicable when entity_source=PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the OPSI private endpoint + * `vm_cluster_type` - (Applicable when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) Exadata VMCluster type + * `vmcluster_id` - (Required when entity_source=MACS_MANAGED_CLOUD_EXADATA | PE_COMANAGED_EXADATA) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM Cluster. * `status` - (Optional) (Updatable) Status of the resource. Example: "ENABLED", "DISABLED". Resource can be either enabled or disabled by updating the value of status field to either "ENABLED" or "DISABLED" diff --git a/website/docs/r/psql_configuration.html.markdown b/website/docs/r/psql_configuration.html.markdown index 953d2044973..0d105e33a4c 100644 --- a/website/docs/r/psql_configuration.html.markdown +++ b/website/docs/r/psql_configuration.html.markdown @@ -29,15 +29,16 @@ resource "oci_psql_configuration" "test_configuration" { } db_version = var.configuration_db_version display_name = var.configuration_display_name - shape = var.configuration_shape #Optional + compatible_shapes = var.configuration_compatible_shapes defined_tags = {"foo-namespace.bar-key"= "value"} description = var.configuration_description freeform_tags = {"bar-key"= "value"} instance_memory_size_in_gbs = var.configuration_instance_memory_size_in_gbs instance_ocpu_count = var.configuration_instance_ocpu_count is_flexible = var.configuration_is_flexible + shape = var.configuration_shape system_tags = var.configuration_system_tags } ``` @@ -47,6 +48,7 @@ resource "oci_psql_configuration" "test_configuration" { 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 that contains the configuration. +* `compatible_shapes` - (Optional) (Updatable) Indicates the collection of compatible shapes for this configuration. * `db_configuration_overrides` - (Required) Configuration overrides for a PostgreSQL instance. * `items` - (Required) List of configuration overridden values. * `config_key` - (Required) Configuration variable name. @@ -63,7 +65,9 @@ The following arguments are supported: Skip or set it's value to 0 if configuration is for a flexible shape. * `is_flexible` - (Optional) Whether the configuration supports flexible shapes. -* `shape` - (Required) The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `shape` - (Optional) The name of the shape for the configuration. + + For multi-shape enabled configurations, it is set to PostgreSQL.X86 or similar. Please use compatibleShapes property to set the list of supported shapes. * `system_tags` - (Optional) System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` @@ -75,6 +79,7 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: * `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment that contains the configuration. +* `compatible_shapes` - Indicates the collection of compatible shapes for this configuration. * `config_type` - The type of configuration. Either user-created or a default configuration. * `configuration_details` - List of configuration details. * `items` - List of ConfigParms object. @@ -87,6 +92,7 @@ The following attributes are exported: * `is_restart_required` - If true, modifying this configuration value will require a restart of the database. * `overriden_config_value` - User-selected configuration variable value. * `db_version` - Version of the PostgreSQL database. +* `default_config_id` - The Default configuration used for this configuration. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` * `description` - A description for the configuration. * `display_name` - A user-friendly display name for the configuration. Avoid entering confidential information. @@ -100,7 +106,9 @@ The following attributes are exported: It's value is set to 0 if configuration is for a flexible shape. * `is_flexible` - Whether the configuration supports flexible shapes. * `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. -* `shape` - The name of the shape for the configuration. Example: `VM.Standard.E4.Flex` +* `shape` - The name of the shape for the configuration. + + For multi-shape enabled configurations, it is set to PostgreSQL. Please use compatibleShapes property to get list of supported shapes for such configurations. * `state` - The current state of the configuration. * `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` * `time_created` - The date and time that the configuration was created, expressed in [RFC 3339](https://tools.ietf.org/rfc/rfc3339) timestamp format. Example: `2016-08-25T21:10:29.600Z` diff --git a/website/docs/r/psql_db_system.html.markdown b/website/docs/r/psql_db_system.html.markdown index a9d0a556f81..3282eb6dba0 100644 --- a/website/docs/r/psql_db_system.html.markdown +++ b/website/docs/r/psql_db_system.html.markdown @@ -158,12 +158,12 @@ The following arguments are supported: * `nsg_ids` - (Optional) (Updatable) List of customer Network Security Group [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with the database system. * `primary_db_endpoint_private_ip` - (Optional) Private IP in customer subnet. The value is optional. If the IP is not provided, the IP will be chosen from the available IP addresses from the specified subnet. * `subnet_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the customer subnet associated with the database system. -* `shape` - (Required) (Updatable) The name of the shape for the database instance node. Use the /shapes API for accepted shapes. Example: `VM.Standard.E4.Flex` +* `shape` - (Required) (Updatable) The name of the shape for the database instance node. Use the /shapes API for accepted shapes. Example: `VM.Standard.E4.Flex` * `patch_operations` - (Optional) (Updatable) For adding and removing from read replica database instances. Please remove the patch_operations after it is applied. Update the instance_count arrodrandly. Cannot be specified when creating the resource. * `operation` - (Required) The operation can be one of these values: `INSERT`, `REMOVE`. * `selection` - (Required) In case of `INSERT`, selection is `instances`. In case of `REMOVE`, selection is `instances[?id == '${var.instance_id}']`. * `value` - (Required when operation=INSERT) Specify instance details such as displayName, description or privateIp. Example: `{"displayName": "value"}`. -* `source` - (Optional) The source used to restore the database system. +* `source` - (Optional) The source of the database system. * `backup_id` - (Required when source_type=BACKUP) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database system backup. * `is_having_restore_config_overrides` - (Applicable when source_type=BACKUP) Deprecated. Don't use. * `source_type` - (Required) The source descriminator. Example: `{"source_type": "BACKUP"}`. @@ -221,8 +221,8 @@ The following attributes are exported: * `nsg_ids` - List of customer Network Security Group [OCIDs](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) associated with the database system. * `primary_db_endpoint_private_ip` - Private IP in customer subnet. The value is optional. If the IP is not provided, the IP will be chosen from the available IP addresses from the specified subnet. * `subnet_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the customer subnet associated with the database system. -* `shape` - The name of the shape for the database instance. Example: `PostgreSQL.VM.Standard.E4.Flex.2.32GB`. -* `source` - The source used to restore the database system. +* `shape` - The name of the shape for the database instance. Example: `VM.Standard.E4.Flex` +* `source` - The source of the database system. * `backup_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the database system backup. * `is_having_restore_config_overrides` - Deprecated. Don't use. * `source_type` - The source descriminator. diff --git a/website/docs/r/vault_secret.html.markdown b/website/docs/r/vault_secret.html.markdown index 5cc007f8ff8..c4590a80457 100644 --- a/website/docs/r/vault_secret.html.markdown +++ b/website/docs/r/vault_secret.html.markdown @@ -29,6 +29,21 @@ resource "oci_vault_secret" "test_secret" { enable_auto_generation = var.secret_enable_auto_generation freeform_tags = {"Department"= "Finance"} metadata = var.secret_metadata + replication_config { + #Required + replication_targets { + #Required + target_key_id = oci_kms_key.test_key.id + target_region = var.secret_replication_config_replication_targets_target_region + target_vault_id = oci_kms_vault.test_vault.id + } + + #Optional + ## Note: Replica Secrets can be created with is_write_forward_enabled= true/false via Terraform. + ## Note: Update/Delete operations on Replica Secrets is not allowed via Terraform. Please + ## use SDK/CLI/Console to perform Write Operations on replica secrets + is_write_forward_enabled = var.secret_replication_config_is_write_forward_enabled + } rotation_config { #Required target_system_details { @@ -84,8 +99,14 @@ The following arguments are supported: * `description` - (Optional) (Updatable) A brief description of the secret. Avoid entering confidential information. * `enable_auto_generation` - (Optional) (Updatable) The value of this flag determines whether or not secret content will be generated automatically. If not set, it defaults to false. * `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_id` - (Required) The OCID of the master encryption key that is used to encrypt the secret. You must specify a symmetric key to encrypt the secret during import to the vault. You cannot encrypt secrets with asymmetric keys. Furthermore, the key must exist in the vault that you specify. -* `metadata` - (Optional) (Updatable) Additional metadata that you can use to provide context about how to use the secret during rotation or other administrative tasks. For example, for a secret that you use to connect to a database, the additional metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. +* `key_id` - (Required) The OCID of the master encryption key that is used to encrypt the secret. You must specify a symmetric key to encrypt the secret during import to the vault. You cannot encrypt secrets with asymmetric keys. Furthermore, the key must exist in the vault that you specify. +* `metadata` - (Optional) (Updatable) Additional metadata that you can use to provide context about how to use the secret during rotation or other administrative tasks. For example, for a secret that you use to connect to a database, the additional metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. +* `replication_config` - (Optional) (Updatable) Defines the configuration that enables cross-region secret replication. + * `is_write_forward_enabled` - (Optional) (Updatable) (Optional) A Boolean value to enable forwarding of write requests from replicated secrets to the source secrets. The default value of false disables this option. + * `replication_targets` - (Required) (Updatable) List of the secret replication targets. By default, a maximum of 3 targets is allowed. To configure more than 3 targets, an override is required. + * `target_key_id` - (Required) (Updatable) The OCID of the target region KMS key. + * `target_region` - (Required) (Updatable) The name of the target's region. + * `target_vault_id` - (Required) (Updatable) The OCID of the target region's Vault. * `rotation_config` - (Optional) (Updatable) Defines the frequency of the rotation and the information about the target system * `is_scheduled_rotation_enabled` - (Optional) (Updatable) Enables auto rotation, when set to true rotationInterval must be set. * `rotation_interval` - (Optional) (Updatable) The time interval that indicates the frequency for rotating secret data, as described in ISO 8601 format. The minimum value is 1 day and maximum value is 360 days. For example, if you want to set the time interval for rotating a secret data as 30 days, the duration is expressed as "P30D." @@ -127,11 +148,18 @@ The following attributes are exported: * `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 secret. * `is_auto_generation_enabled` - The value of this flag determines whether or not secret content will be generated automatically. +* `is_replica` - A Boolean value that indicates whether the secret is a source or replica secret. * `key_id` - The OCID of the master encryption key that is used to encrypt the secret. You must specify a symmetric key to encrypt the secret during import to the vault. You cannot encrypt secrets with asymmetric keys. Furthermore, the key must exist in the vault that you specify. * `last_rotation_time` - A property indicating when the secret was last rotated successfully, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` * `lifecycle_details` - Additional information about the current lifecycle state of the secret. * `metadata` - Additional metadata that you can use to provide context about how to use the secret or during rotation or other administrative tasks. For example, for a secret that you use to connect to a database, the additional metadata might specify the connection endpoint and the connection string. Provide additional metadata as key-value pairs. * `next_rotation_time` - A property indicating when the secret is scheduled to be rotated, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` +* `replication_config` - Defines the configuration that enables cross-region secret replication. + * `is_write_forward_enabled` - (Optional) A Boolean value to enable forwarding of write requests from replicated secrets to the source secrets. The default value of false disables this option. + * `replication_targets` - List of the secret replication targets. By default, a maximum of 3 targets is allowed. To configure more than 3 targets, an override is required. + * `target_key_id` - The OCID of the target region KMS key. + * `target_region` - The name of the target's region. + * `target_vault_id` - The OCID of the target region's Vault. * `rotation_config` - Defines the frequency of the rotation and the information about the target system * `is_scheduled_rotation_enabled` - Enables auto rotation, when set to true rotationInterval must be set. * `rotation_interval` - The time interval that indicates the frequency for rotating secret data, as described in ISO 8601 format. The minimum value is 1 day and maximum value is 360 days. For example, if you want to set the time interval for rotating a secret data as 30 days, the duration is expressed as "P30D." @@ -152,6 +180,10 @@ The following attributes are exported: * `rule_type` - The type of rule, which either controls when the secret contents expire or whether they can be reused. * `secret_version_expiry_interval` - A property indicating how long the secret contents will be considered valid, expressed in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. The secret needs to be updated when the secret content expires. The timer resets after you update the secret contents. The minimum value is 1 day and the maximum value is 90 days for this property. Currently, only intervals expressed in days are supported. For example, pass `P3D` to have the secret version expire every 3 days. * `time_of_absolute_expiry` - An optional property indicating the absolute time when this secret will expire, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. The minimum number of days from current time is 1 day and the maximum number of days from current time is 365 days. Example: `2019-04-03T21:10:29.600Z` +* `source_region_information` - Details for the source that the source secret has. + * `source_key_id` - The OCID of the source region KMS key. + * `source_region` - The name of the source's region. + * `source_vault_id` - The OCID of the source region's Vault. * `state` - The current lifecycle state of the secret. * `time_created` - A property indicating when the secret was created, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` * `time_of_current_version_expiry` - An optional property indicating when the current secret version will expire, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. Example: `2019-04-03T21:10:29.600Z` diff --git a/website/oci.erb b/website/oci.erb index 0dc823ba1ff..cfd5e05080c 100644 --- a/website/oci.erb +++ b/website/oci.erb @@ -388,6 +388,30 @@ + > + Api Platform + + > Apiaccesscontrol @@ -3220,12 +3259,33 @@
  • oci_datascience_model_deployment
  • +
  • + oci_datascience_model_deployment_model_states +
  • oci_datascience_model_deployment_shapes
  • oci_datascience_model_deployments
  • +
  • + oci_datascience_model_group +
  • +
  • + oci_datascience_model_group_artifact_content +
  • +
  • + oci_datascience_model_group_models +
  • +
  • + oci_datascience_model_group_version_histories +
  • +
  • + oci_datascience_model_group_version_history +
  • +
  • + oci_datascience_model_groups +
  • oci_datascience_model_provenance
  • @@ -3294,6 +3354,15 @@
  • oci_datascience_model_deployment
  • +
  • + oci_datascience_model_group +
  • +
  • + oci_datascience_model_group_artifact +
  • +
  • + oci_datascience_model_group_version_history +
  • oci_datascience_model_provenance