diff --git a/CHANGELOG.md b/CHANGELOG.md index 1274c83c46b..54ef035dfe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ -## 5.5.0 (Unreleased) +## 5.7.0 (August 01, 2023) + +### Added +- Support for TLS & ORDS BYO Certificates (Phase 2) | ADB-C@C +- Support for OPSI News Reports +- Support for Budgets - Single Use Budgets + +## 5.6.0 (July 26, 2023) + +### Added +- Support for Tersi for Test Connectivity feature GoldenGate Test Connectivity for Connections associated with Deployments +- Model Compose and Model Alias features to custom Models in document service +- Support for Budgets - Single Use Budgets +- Support for Custom hostname Terraform Instance Pools - Custom hostname support + +## 5.5.0 (July 19, 2023) ### Added - Support for Remove internal-only additionalCapabilities parameter from Container Instances Public SDK/CLI and Terraform diff --git a/examples/aiDocument/main.tf b/examples/aiDocument/main.tf index 7dbb63fd2ac..74012075e25 100644 --- a/examples/aiDocument/main.tf +++ b/examples/aiDocument/main.tf @@ -22,7 +22,7 @@ resource "oci_ai_document_project" "test_project" { compartment_id = var.compartment_id } -resource "oci_ai_document_model" "test_model" { +resource "oci_ai_document_model" "test_model1" { #Required compartment_id = var.compartment_id model_type = "KEY_VALUE_EXTRACTION" @@ -38,6 +38,44 @@ resource "oci_ai_document_model" "test_model" { #Optional display_name = "test_tf_model" is_quick_mode = "false" - max_training_time_in_hours = "0.5" + model_version = var.model_model_version +} + +resource "oci_ai_document_model" "test_model2" { + #Required + compartment_id = var.compartment_id + model_type = "KEY_VALUE_EXTRACTION" + project_id = oci_ai_document_project.test_project.id + + training_dataset { + bucket = "tf_test_bucket" + dataset_type = "OBJECT_STORAGE" + namespace = "axgexwaxnm7k" + object = "tf_test_aadhar_1686719828190.jsonl" + } + + #Optional + display_name = "test_tf_model2" + is_quick_mode = "false" + model_version = var.model_model_version +} + +resource "oci_ai_document_model" "test_compose_model" { + #Required + compartment_id = var.compartment_id + model_type = "KEY_VALUE_EXTRACTION" + project_id = oci_ai_document_project.test_project.id + + component_models { + model_id = oci_ai_document_model.test_model1.id + } + + component_models { + model_id = oci_ai_document_model.test_model2.id + } + + #Optional + display_name = "test_compose_model" + is_quick_mode = "false" model_version = var.model_model_version } diff --git a/examples/budget/main.tf b/examples/budget/budget/main.tf similarity index 52% rename from examples/budget/main.tf rename to examples/budget/budget/main.tf index 36fcb484fd6..f55c97cdb28 100644 --- a/examples/budget/main.tf +++ b/examples/budget/budget/main.tf @@ -27,7 +27,7 @@ variable "subscription_id" { } provider "oci" { - provider = "4.67.0" + # version = "4.67.0" region = var.region tenancy_ocid = var.tenancy_ocid user_ocid = var.user_ocid @@ -52,40 +52,6 @@ resource "oci_budget_budget" "test_budget" { budget_processing_period_start_offset = "11" } -resource "oci_budget_budget" "test_budget_invoice" { - #Required - amount = "1" - compartment_id = var.tenancy_ocid - reset_period = "MONTHLY" - target_type = "COMPARTMENT" - - targets = [ - var.subscription_id - ] - - #Optional - description = "budget invoice description" - display_name = "budget_invoice" - processing_period_type = "INVOICE" -} - -# get budget should happen after alert rule is successful -# as alert rule creation updates the `alert_rule_count` field -data "oci_budget_budget" "budget1" { - budget_id = oci_budget_budget.test_budget.id - depends_on = [ - data.oci_budget_alert_rule.test_alert_rule - ] -} - -data "oci_budget_budget" "budget_invoice" { - budget_id = oci_budget_budget.test_budget_invoice.id - depends_on = [ - data.oci_budget_alert_rule.test_alert_rule - ] -} - - data "oci_budget_budgets" "test_budgets" { #Required compartment_id = var.tenancy_ocid @@ -96,40 +62,22 @@ data "oci_budget_budgets" "test_budgets" { output "budget" { value = { - amount = data.oci_budget_budget.budget1.amount - compartment_id = data.oci_budget_budget.budget1.compartment_id - reset_period = data.oci_budget_budget.budget1.reset_period - targets = data.oci_budget_budget.budget1.targets[0] - description = data.oci_budget_budget.budget1.description - display_name = data.oci_budget_budget.budget1.display_name - alert_rule_count = data.oci_budget_budget.budget1.alert_rule_count - state = data.oci_budget_budget.budget1.state - time_created = data.oci_budget_budget.budget1.time_created - time_updated = data.oci_budget_budget.budget1.time_updated - version = data.oci_budget_budget.budget1.version + amount = oci_budget_budget.test_budget.amount + compartment_id = oci_budget_budget.test_budget.compartment_id + reset_period = oci_budget_budget.test_budget.reset_period + targets = oci_budget_budget.test_budget.targets[0] + description = oci_budget_budget.test_budget.description + display_name = oci_budget_budget.test_budget.display_name + alert_rule_count = oci_budget_budget.test_budget.alert_rule_count + state = oci_budget_budget.test_budget.state + time_created = oci_budget_budget.test_budget.time_created + time_updated = oci_budget_budget.test_budget.time_updated + version = oci_budget_budget.test_budget.version } # These values are not always present - // actual_spend = data.oci_budget_budget.budget1.actual_spend - // forecasted_spend = data.oci_budget_budget.budget1.forecasted_spend - // time_spend_computed = data.oci_budget_budget.budget1.time_spend_computed -} - -output "budget_invoice" { - value = { - amount = data.oci_budget_budget.budget_invoice.amount - compartment_id = data.oci_budget_budget.budget_invoice.compartment_id - reset_period = data.oci_budget_budget.budget_invoice.reset_period - targets = data.oci_budget_budget.budget_invoice.targets[0] - description = data.oci_budget_budget.budget_invoice.description - display_name = data.oci_budget_budget.budget_invoice.display_name - alert_rule_count = data.oci_budget_budget.budget_invoice.alert_rule_count - state = data.oci_budget_budget.budget_invoice.state - time_created = data.oci_budget_budget.budget_invoice.time_created - time_updated = data.oci_budget_budget.budget_invoice.time_updated - version = data.oci_budget_budget.budget_invoice.version - - processing_period_type = data.oci_budget_budget.budget_invoice.processing_period_type - } + // actual_spend = oci_budget_budget.test_budget.actual_spend + // forecasted_spend = oci_budget_budget.test_budget.forecasted_spend + // time_spend_computed = oci_budget_budget.test_budget.time_spend_computed } resource "oci_budget_alert_rule" "test_alert_rule" { @@ -178,6 +126,4 @@ data "oci_budget_alert_rules" "test_alert_rules" { #Optional // display_name = oci_budget_alert_rule.test_alert_rule.display_name state = "ACTIVE" -} - - +} \ No newline at end of file diff --git a/examples/budget/single_use_budget/main.tf b/examples/budget/single_use_budget/main.tf new file mode 100644 index 00000000000..26975f12238 --- /dev/null +++ b/examples/budget/single_use_budget/main.tf @@ -0,0 +1,128 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +/* + * This example shows how to use the single use budget and alert rule resources. + */ + +variable "tenancy_ocid" { +} + +variable "user_ocid" { +} + +variable "fingerprint" { +} + +variable "private_key_path" { +} + +variable "compartment_ocid" { +} + +variable "region" { +} + +variable "subscription_id" { +} + +provider "oci" { + # version = "4.67.0" + region = var.region + tenancy_ocid = var.tenancy_ocid + user_ocid = var.user_ocid + fingerprint = var.fingerprint + private_key_path = var.private_key_path +} + +resource "oci_budget_budget" "test_single_use_budget" { + # Required + amount = "1" + compartment_id = var.tenancy_ocid + reset_period = "MONTHLY" + target_type = "COMPARTMENT" + + targets = [ + var.compartment_ocid, + ] + + # Optional + description = "budget single use" + display_name = "budget2" + processing_period_type = "SINGLE_USE" + start_date = "2023-07-12T16:01:19.847222+05:30" + end_date = "2023-08-12T16:01:19.847222+05:30" +} + + +data "oci_budget_budgets" "test_budgets" { + #Required + compartment_id = var.tenancy_ocid + #Optional + // display_name = oci_budget_budget.test_budget.display_name + // state = "ACTIVE" +} + +output "budget_single_use" { + value = { + amount = oci_budget_budget.test_single_use_budget.amount + compartment_id = oci_budget_budget.test_single_use_budget.compartment_id + reset_period = oci_budget_budget.test_single_use_budget.reset_period + targets = oci_budget_budget.test_single_use_budget.targets[0] + description = oci_budget_budget.test_single_use_budget.description + display_name = oci_budget_budget.test_single_use_budget.display_name + alert_rule_count = oci_budget_budget.test_single_use_budget.alert_rule_count + state = oci_budget_budget.test_single_use_budget.state + time_created = oci_budget_budget.test_single_use_budget.time_created + time_updated = oci_budget_budget.test_single_use_budget.time_updated + version = oci_budget_budget.test_single_use_budget.version + processing_period_type = oci_budget_budget.test_single_use_budget.processing_period_type + } +} + +resource "oci_budget_alert_rule" "test_alert_rule" { + #Required + budget_id = oci_budget_budget.test_single_use_budget.id + threshold = "100" + threshold_type = "ABSOLUTE" + type = "ACTUAL" + + #Optional + description = "alertRuleDescription" + display_name = "alertRule" + message = "possible overspend" + recipients = "JohnSmith@example.com" +} + +output "alert_rule" { + value = { + budget_id = data.oci_budget_alert_rule.test_alert_rule.budget_id + recipients = data.oci_budget_alert_rule.test_alert_rule.recipients + description = data.oci_budget_alert_rule.test_alert_rule.description + display_name = data.oci_budget_alert_rule.test_alert_rule.display_name + message = data.oci_budget_alert_rule.test_alert_rule.message + recipients = data.oci_budget_alert_rule.test_alert_rule.recipients + state = data.oci_budget_alert_rule.test_alert_rule.state + threshold = data.oci_budget_alert_rule.test_alert_rule.threshold + threshold_type = data.oci_budget_alert_rule.test_alert_rule.threshold_type + time_created = data.oci_budget_alert_rule.test_alert_rule.time_created + time_updated = data.oci_budget_alert_rule.test_alert_rule.time_updated + type = data.oci_budget_alert_rule.test_alert_rule.type + version = data.oci_budget_alert_rule.test_alert_rule.version + } +} + +data "oci_budget_alert_rule" "test_alert_rule" { + #Required + budget_id = oci_budget_budget.test_single_use_budget.id + alert_rule_id = oci_budget_alert_rule.test_alert_rule.id +} + +data "oci_budget_alert_rules" "test_alert_rules" { + #Required + budget_id = oci_budget_budget.test_single_use_budget.id + + #Optional + // display_name = oci_budget_alert_rule.test_alert_rule.display_name + state = "ACTIVE" +} \ No newline at end of file diff --git a/examples/compute/instance_pool/instance_pool.tf b/examples/compute/instance_pool/instance_pool.tf index 9a9975e3951..11c31ee449e 100644 --- a/examples/compute/instance_pool/instance_pool.tf +++ b/examples/compute/instance_pool/instance_pool.tf @@ -270,6 +270,8 @@ resource "oci_core_instance_pool" "test_instance_pool" { size = 2 state = "RUNNING" display_name = "TestInstancePool" + instance_display_name_formatter = "host-$${launchCount}" + instance_hostname_formatter = "host-$${launchCount}" placement_configurations { availability_domain = data.oci_identity_availability_domain.ad.name diff --git a/examples/container_engine/credential_rotation/main.tf b/examples/container_engine/credential_rotation/main.tf new file mode 100644 index 00000000000..958323eb7ba --- /dev/null +++ b/examples/container_engine/credential_rotation/main.tf @@ -0,0 +1,139 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" { + default = "us-ashburn-1" +} +variable "compartment_ocid" {} + +variable "cluster_start_credential_rotation_management_auto_completion_delay_duration" { + default = "P5D" +} + +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_identity_availability_domain" "ad1" { + compartment_id = var.tenancy_ocid + ad_number = 1 +} + +data "oci_identity_availability_domain" "ad2" { + compartment_id = var.tenancy_ocid + ad_number = 2 +} + +data "oci_containerengine_cluster_option" "test_cluster_option" { + cluster_option_id = "all" +} + +resource "oci_core_vcn" "test_vcn" { + cidr_block = "10.0.0.0/16" + compartment_id = var.compartment_ocid + display_name = "tfVcnForClusters" +} + +resource "oci_core_internet_gateway" "test_ig" { + compartment_id = var.compartment_ocid + display_name = "tfClusterInternetGateway" + vcn_id = oci_core_vcn.test_vcn.id +} + +resource "oci_core_route_table" "test_route_table" { + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn.id + display_name = "tfClustersRouteTable" + + route_rules { + destination = "0.0.0.0/0" + destination_type = "CIDR_BLOCK" + network_entity_id = oci_core_internet_gateway.test_ig.id + } +} + +resource "oci_core_subnet" "clusterSubnet_1" { + #Required + availability_domain = data.oci_identity_availability_domain.ad1.name + cidr_block = "10.0.20.0/24" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn.id + + # Provider code tries to maintain compatibility with old versions. + security_list_ids = [oci_core_vcn.test_vcn.default_security_list_id] + display_name = "tfSubNet1ForClusters" + route_table_id = oci_core_route_table.test_route_table.id +} + +resource "oci_core_subnet" "clusterSubnet_2" { + #Required + availability_domain = data.oci_identity_availability_domain.ad2.name + cidr_block = "10.0.21.0/24" + compartment_id = var.compartment_ocid + vcn_id = oci_core_vcn.test_vcn.id + display_name = "tfSubNet1ForClusters" + + # Provider code tries to maintain compatibility with old versions. + security_list_ids = [oci_core_vcn.test_vcn.default_security_list_id] + route_table_id = oci_core_route_table.test_route_table.id +} + +resource "oci_containerengine_cluster" "test_cluster" { + #Required + compartment_id = var.compartment_ocid + kubernetes_version = reverse(data.oci_containerengine_cluster_option.test_cluster_option.kubernetes_versions)[0] + name = "tfTestCluster" + vcn_id = oci_core_vcn.test_vcn.id + + #Optional + options { + service_lb_subnet_ids = [oci_core_subnet.clusterSubnet_1.id, oci_core_subnet.clusterSubnet_2.id] + + #Optional + add_ons { + #Optional + is_kubernetes_dashboard_enabled = "true" + is_tiller_enabled = "true" + } + + admission_controller_options { + #Optional + is_pod_security_policy_enabled = false + } + + kubernetes_network_config { + #Optional + pods_cidr = "10.1.0.0/16" + services_cidr = "10.2.0.0/16" + } + } +} + +// start credential rotation on a cluster +resource "oci_containerengine_cluster_start_credential_rotation_management" "test_cluster_start_credential_rotation_management" { + #Required + auto_completion_delay_duration = var.cluster_start_credential_rotation_management_auto_completion_delay_duration + cluster_id = oci_containerengine_cluster.test_cluster.id +} + +// get credential rotation status +data "oci_containerengine_cluster_credential_rotation_status" "test_cluster_credential_rotation_status" { + #Required + cluster_id = oci_containerengine_cluster.test_cluster.id +} + +// complete credential rotation on a cluster +resource "oci_containerengine_cluster_complete_credential_rotation_management" "test_cluster_complete_credential_rotation_management" { + #Required + cluster_id = oci_containerengine_cluster.test_cluster.id + depends_on = [oci_containerengine_cluster_start_credential_rotation_management.test_cluster_start_credential_rotation_management] +} + diff --git a/examples/container_engine/main.tf b/examples/container_engine/main.tf index c50848345d7..00f4da2939c 100644 --- a/examples/container_engine/main.tf +++ b/examples/container_engine/main.tf @@ -289,7 +289,7 @@ resource "oci_containerengine_node_pool" "test_flex_shape_node_pool" { node_source_details { #Required - image_id = local.oracle_linux_images.0 + image_id = local.image_id source_type = "IMAGE" } diff --git a/examples/database/exadata_cc/adbd/adb.tf b/examples/database/exadata_cc/adbd/adb.tf index d098f7610a4..28dcc9259c7 100644 --- a/examples/database/exadata_cc/adbd/adb.tf +++ b/examples/database/exadata_cc/adbd/adb.tf @@ -10,7 +10,7 @@ resource "oci_database_autonomous_database" "test_autonomous_database" { #Required admin_password = random_string.autonomous_database_admin_password.result compartment_id = var.compartment_ocid - compute_count = "2" + ocpu_count = "2" data_storage_size_in_tbs = "1" db_name = "atpdb1" diff --git a/examples/database/exadata_cc/adbd/autonomous_vm_cluster_ords_certificate_management.tf b/examples/database/exadata_cc/adbd/autonomous_vm_cluster_ords_certificate_management.tf new file mode 100644 index 00000000000..f08877b7ee5 --- /dev/null +++ b/examples/database/exadata_cc/adbd/autonomous_vm_cluster_ords_certificate_management.tf @@ -0,0 +1,6 @@ +resource "oci_database_autonomous_vm_cluster_ords_certificate_management" "test_avm_ords_mgmt_res"{ + autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id + certificate_generation_type = "BYOC" + certificate_id = var.avm_certificate_id +} + diff --git a/examples/database/exadata_cc/adbd/autonomous_vm_cluster_ssl_certificate_management.tf b/examples/database/exadata_cc/adbd/autonomous_vm_cluster_ssl_certificate_management.tf new file mode 100644 index 00000000000..61c84810e3b --- /dev/null +++ b/examples/database/exadata_cc/adbd/autonomous_vm_cluster_ssl_certificate_management.tf @@ -0,0 +1,5 @@ +resource "oci_database_autonomous_vm_cluster_ssl_certificate_management" "test_avm_db_mgmt_res"{ + autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id + certificate_generation_type = "SYSTEM" +} + diff --git a/examples/database/exadata_cc/adbd/variables.tf b/examples/database/exadata_cc/adbd/variables.tf index 82a0804265a..9975eeb8e93 100644 --- a/examples/database/exadata_cc/adbd/variables.tf +++ b/examples/database/exadata_cc/adbd/variables.tf @@ -17,4 +17,8 @@ variable "compartment_ocid" { } variable "ssh_public_key" { +} + +variable "avm_certificate_id"{ + } \ No newline at end of file diff --git a/examples/opsi/news_report/news_report.tf b/examples/opsi/news_report/news_report.tf new file mode 100644 index 00000000000..a782f6cb2de --- /dev/null +++ b/examples/opsi/news_report/news_report.tf @@ -0,0 +1,103 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + + +variable "tenancy_ocid" {} +variable "user_ocid" {} +variable "fingerprint" {} +variable "private_key_path" {} +variable "region" {} +variable "topic_id" {} +variable "compartment_ocid" {} + +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 "news_frequency" { + default = "WEEKLY" +} + +variable "news_locale" { + default = "EN" +} + +variable "news_report_name" { + default = "Example_Report" +} + +variable "news_report_description" { + default = "Example Report Description" +} + +variable "cp_resources" { + default = [ "HOST","DATABASE","EXADATA" ] +} + + +variable "news_report_defined_tags_value" { + default = "value" +} + +variable "news_report_freeform_tags" { + default = { "bar-key" = "value" } +} + +variable "resource_status" { + default = "ENABLED" +} + +// To Create a News Report +resource "oci_opsi_news_report" "test_news_report" { + compartment_id = var.compartment_ocid + locale = var.news_locale + name = var.news_report_name + description = var.news_report_description + news_frequency = var.news_frequency + content_types { + capacity_planning_resources = var.cp_resources + } + ons_topic_id = var.topic_id + freeform_tags = var.news_report_freeform_tags + status = var.resource_status +} + +variable "news_report_state" { + default = ["ACTIVE"] +} + +variable "news_report_status" { + default = ["ENABLED"] +} + +// List news reports +data "oci_opsi_news_reports" "test_news_reports" { + compartment_id = var.compartment_ocid + state = var.news_report_state + status = var.news_report_status +} + +// Get a news report +data "oci_opsi_news_report" "test_news_report" { + news_report_id = oci_opsi_news_report.test_news_report.id +} + diff --git a/examples/zips/adm.zip b/examples/zips/adm.zip index 5e067fa99c1..ad072937f46 100644 Binary files a/examples/zips/adm.zip and b/examples/zips/adm.zip differ diff --git a/examples/zips/aiAnomalyDetection.zip b/examples/zips/aiAnomalyDetection.zip index 82ac1554126..3afe51f38d0 100644 Binary files a/examples/zips/aiAnomalyDetection.zip and b/examples/zips/aiAnomalyDetection.zip differ diff --git a/examples/zips/aiDocument.zip b/examples/zips/aiDocument.zip index 7020e5ee71f..771a351cda5 100644 Binary files a/examples/zips/aiDocument.zip and b/examples/zips/aiDocument.zip differ diff --git a/examples/zips/aiVision.zip b/examples/zips/aiVision.zip index 3f0857abc20..9f86b86e082 100644 Binary files a/examples/zips/aiVision.zip and b/examples/zips/aiVision.zip differ diff --git a/examples/zips/always_free.zip b/examples/zips/always_free.zip index 13fb6d348d5..a77a65bee8e 100644 Binary files a/examples/zips/always_free.zip and b/examples/zips/always_free.zip differ diff --git a/examples/zips/analytics.zip b/examples/zips/analytics.zip index 82566d609fd..c0bc6b639d4 100644 Binary files a/examples/zips/analytics.zip and b/examples/zips/analytics.zip differ diff --git a/examples/zips/announcements_service.zip b/examples/zips/announcements_service.zip index 79033bfd82e..4b9b03bfe65 100644 Binary files a/examples/zips/announcements_service.zip and b/examples/zips/announcements_service.zip differ diff --git a/examples/zips/api_gateway.zip b/examples/zips/api_gateway.zip index 9c9fad0b573..39e5b3d3f9a 100644 Binary files a/examples/zips/api_gateway.zip and b/examples/zips/api_gateway.zip differ diff --git a/examples/zips/apm.zip b/examples/zips/apm.zip index b95a0c1dd33..0e59b1f4175 100644 Binary files a/examples/zips/apm.zip and b/examples/zips/apm.zip differ diff --git a/examples/zips/appmgmt_control.zip b/examples/zips/appmgmt_control.zip index 7b99da0cfc4..5467200e85f 100644 Binary files a/examples/zips/appmgmt_control.zip and b/examples/zips/appmgmt_control.zip differ diff --git a/examples/zips/artifacts.zip b/examples/zips/artifacts.zip index d68960944fa..02b040b3e26 100644 Binary files a/examples/zips/artifacts.zip and b/examples/zips/artifacts.zip differ diff --git a/examples/zips/audit.zip b/examples/zips/audit.zip index df73827ad66..b7d164b840a 100644 Binary files a/examples/zips/audit.zip and b/examples/zips/audit.zip differ diff --git a/examples/zips/autoscaling.zip b/examples/zips/autoscaling.zip index b0f49367270..d253900fe6f 100644 Binary files a/examples/zips/autoscaling.zip and b/examples/zips/autoscaling.zip differ diff --git a/examples/zips/bastion.zip b/examples/zips/bastion.zip index 8318d805b2a..30d2d68736b 100644 Binary files a/examples/zips/bastion.zip and b/examples/zips/bastion.zip differ diff --git a/examples/zips/big_data_service.zip b/examples/zips/big_data_service.zip index 8dce65c4503..f2ce62587f8 100644 Binary files a/examples/zips/big_data_service.zip and b/examples/zips/big_data_service.zip differ diff --git a/examples/zips/blockchain.zip b/examples/zips/blockchain.zip index beabc127c44..29895c90668 100644 Binary files a/examples/zips/blockchain.zip and b/examples/zips/blockchain.zip differ diff --git a/examples/zips/budget.zip b/examples/zips/budget.zip index ef53365e877..b6b2a5aecf7 100644 Binary files a/examples/zips/budget.zip and b/examples/zips/budget.zip differ diff --git a/examples/zips/certificatesManagement.zip b/examples/zips/certificatesManagement.zip index 82c34084c65..456ac3f6cc1 100644 Binary files a/examples/zips/certificatesManagement.zip and b/examples/zips/certificatesManagement.zip differ diff --git a/examples/zips/cloudBridge.zip b/examples/zips/cloudBridge.zip index e27149f7036..82b6f20e8a4 100644 Binary files a/examples/zips/cloudBridge.zip and b/examples/zips/cloudBridge.zip differ diff --git a/examples/zips/cloudMigrations.zip b/examples/zips/cloudMigrations.zip index 09261970e58..a88fc5d5513 100644 Binary files a/examples/zips/cloudMigrations.zip and b/examples/zips/cloudMigrations.zip differ diff --git a/examples/zips/cloudguard.zip b/examples/zips/cloudguard.zip index 4785de2a4a1..2742987a996 100644 Binary files a/examples/zips/cloudguard.zip and b/examples/zips/cloudguard.zip differ diff --git a/examples/zips/compute.zip b/examples/zips/compute.zip index 89a5a61a4d1..7dbe493ff71 100644 Binary files a/examples/zips/compute.zip and b/examples/zips/compute.zip differ diff --git a/examples/zips/computeinstanceagent.zip b/examples/zips/computeinstanceagent.zip index c84ad405fe1..b92d333854f 100644 Binary files a/examples/zips/computeinstanceagent.zip and b/examples/zips/computeinstanceagent.zip differ diff --git a/examples/zips/concepts.zip b/examples/zips/concepts.zip index 010d8d41be5..cc174da571a 100644 Binary files a/examples/zips/concepts.zip and b/examples/zips/concepts.zip differ diff --git a/examples/zips/container_engine.zip b/examples/zips/container_engine.zip index c59d867562b..6cb1bd5f2ea 100644 Binary files a/examples/zips/container_engine.zip and b/examples/zips/container_engine.zip differ diff --git a/examples/zips/container_instances.zip b/examples/zips/container_instances.zip index 3b57ca856e4..ed563e222c6 100644 Binary files a/examples/zips/container_instances.zip and b/examples/zips/container_instances.zip differ diff --git a/examples/zips/database.zip b/examples/zips/database.zip index 5ae1880f8ae..072ca6c2665 100644 Binary files a/examples/zips/database.zip and b/examples/zips/database.zip differ diff --git a/examples/zips/databaseTools.zip b/examples/zips/databaseTools.zip index 488f1c63327..b2293072036 100644 Binary files a/examples/zips/databaseTools.zip and b/examples/zips/databaseTools.zip differ diff --git a/examples/zips/databasemanagement.zip b/examples/zips/databasemanagement.zip index 1fd53748c0e..bd72464e32c 100644 Binary files a/examples/zips/databasemanagement.zip and b/examples/zips/databasemanagement.zip differ diff --git a/examples/zips/databasemigration.zip b/examples/zips/databasemigration.zip index 1fbaf9c6ca3..ad284dfd819 100644 Binary files a/examples/zips/databasemigration.zip and b/examples/zips/databasemigration.zip differ diff --git a/examples/zips/datacatalog.zip b/examples/zips/datacatalog.zip index 04662d39611..95b683333c3 100644 Binary files a/examples/zips/datacatalog.zip and b/examples/zips/datacatalog.zip differ diff --git a/examples/zips/dataflow.zip b/examples/zips/dataflow.zip index e40453ac3f2..6d6c2539d68 100644 Binary files a/examples/zips/dataflow.zip and b/examples/zips/dataflow.zip differ diff --git a/examples/zips/dataintegration.zip b/examples/zips/dataintegration.zip index 103bc9f6cef..7656af29785 100644 Binary files a/examples/zips/dataintegration.zip and b/examples/zips/dataintegration.zip differ diff --git a/examples/zips/datalabeling.zip b/examples/zips/datalabeling.zip index eaca5e69be8..b616999aceb 100644 Binary files a/examples/zips/datalabeling.zip and b/examples/zips/datalabeling.zip differ diff --git a/examples/zips/datasafe.zip b/examples/zips/datasafe.zip index 2d2291be396..ae5376cd71c 100644 Binary files a/examples/zips/datasafe.zip and b/examples/zips/datasafe.zip differ diff --git a/examples/zips/datascience.zip b/examples/zips/datascience.zip index fa41426cb9a..21b7b2928f2 100644 Binary files a/examples/zips/datascience.zip and b/examples/zips/datascience.zip differ diff --git a/examples/zips/devops.zip b/examples/zips/devops.zip index 8a7bfc015be..2cc48c6a802 100644 Binary files a/examples/zips/devops.zip and b/examples/zips/devops.zip differ diff --git a/examples/zips/disaster_recovery.zip b/examples/zips/disaster_recovery.zip index 3659b9b405d..a907bc47868 100644 Binary files a/examples/zips/disaster_recovery.zip and b/examples/zips/disaster_recovery.zip differ diff --git a/examples/zips/dns.zip b/examples/zips/dns.zip index f27cc1949fc..7625453d377 100644 Binary files a/examples/zips/dns.zip and b/examples/zips/dns.zip differ diff --git a/examples/zips/em_warehouse.zip b/examples/zips/em_warehouse.zip index 2e91e89431a..42cca48d789 100644 Binary files a/examples/zips/em_warehouse.zip and b/examples/zips/em_warehouse.zip differ diff --git a/examples/zips/email.zip b/examples/zips/email.zip index 64947de17cd..e2d5e3507b2 100644 Binary files a/examples/zips/email.zip and b/examples/zips/email.zip differ diff --git a/examples/zips/events.zip b/examples/zips/events.zip index fea5123cc44..26f5e56f8ce 100644 Binary files a/examples/zips/events.zip and b/examples/zips/events.zip differ diff --git a/examples/zips/fast_connect.zip b/examples/zips/fast_connect.zip index e8bad3d98c8..51b8c5a505f 100644 Binary files a/examples/zips/fast_connect.zip and b/examples/zips/fast_connect.zip differ diff --git a/examples/zips/functions.zip b/examples/zips/functions.zip index 01f6f851cec..2f94a5d72c8 100644 Binary files a/examples/zips/functions.zip and b/examples/zips/functions.zip differ diff --git a/examples/zips/fusionapps.zip b/examples/zips/fusionapps.zip index 5034048f641..43fb870385b 100644 Binary files a/examples/zips/fusionapps.zip and b/examples/zips/fusionapps.zip differ diff --git a/examples/zips/goldengate.zip b/examples/zips/goldengate.zip index 1d18712d179..e5bef963ef2 100644 Binary files a/examples/zips/goldengate.zip and b/examples/zips/goldengate.zip differ diff --git a/examples/zips/health_checks.zip b/examples/zips/health_checks.zip index 7a62537d3c1..0ac81b90261 100644 Binary files a/examples/zips/health_checks.zip and b/examples/zips/health_checks.zip differ diff --git a/examples/zips/id6.zip b/examples/zips/id6.zip index c059a3401bb..a77d7264422 100644 Binary files a/examples/zips/id6.zip and b/examples/zips/id6.zip differ diff --git a/examples/zips/identity.zip b/examples/zips/identity.zip index 49266b367f0..1d7c7ab7b15 100644 Binary files a/examples/zips/identity.zip and b/examples/zips/identity.zip differ diff --git a/examples/zips/identity_data_plane.zip b/examples/zips/identity_data_plane.zip index 7bf150253b1..5aaf1c26a51 100644 Binary files a/examples/zips/identity_data_plane.zip and b/examples/zips/identity_data_plane.zip differ diff --git a/examples/zips/identity_domains.zip b/examples/zips/identity_domains.zip index a6e9545374a..5a42ff9b4a8 100644 Binary files a/examples/zips/identity_domains.zip and b/examples/zips/identity_domains.zip differ diff --git a/examples/zips/integration.zip b/examples/zips/integration.zip index e10b20edd3d..043dfbe9469 100644 Binary files a/examples/zips/integration.zip and b/examples/zips/integration.zip differ diff --git a/examples/zips/jms.zip b/examples/zips/jms.zip index b6adc7f620e..68a9e0dda9f 100644 Binary files a/examples/zips/jms.zip and b/examples/zips/jms.zip differ diff --git a/examples/zips/kms.zip b/examples/zips/kms.zip index a6d0d3daaf0..9546e89db05 100644 Binary files a/examples/zips/kms.zip and b/examples/zips/kms.zip differ diff --git a/examples/zips/license_manager.zip b/examples/zips/license_manager.zip index 2bb7f3e5e08..ab49b93abc8 100644 Binary files a/examples/zips/license_manager.zip and b/examples/zips/license_manager.zip differ diff --git a/examples/zips/limits.zip b/examples/zips/limits.zip index 5ff097423cf..bf030972d6a 100644 Binary files a/examples/zips/limits.zip and b/examples/zips/limits.zip differ diff --git a/examples/zips/load_balancer.zip b/examples/zips/load_balancer.zip index 4f991b16a9b..427121d095e 100644 Binary files a/examples/zips/load_balancer.zip and b/examples/zips/load_balancer.zip differ diff --git a/examples/zips/log_analytics.zip b/examples/zips/log_analytics.zip index 6a057d71db6..e9d20e3a410 100644 Binary files a/examples/zips/log_analytics.zip and b/examples/zips/log_analytics.zip differ diff --git a/examples/zips/logging.zip b/examples/zips/logging.zip index 56c06c77c63..39fa48ff4e5 100644 Binary files a/examples/zips/logging.zip and b/examples/zips/logging.zip differ diff --git a/examples/zips/management_agent.zip b/examples/zips/management_agent.zip index 7d5b986b2ce..18d406986c2 100644 Binary files a/examples/zips/management_agent.zip and b/examples/zips/management_agent.zip differ diff --git a/examples/zips/management_dashboard.zip b/examples/zips/management_dashboard.zip index cef4da902f8..d6b35a34a05 100644 Binary files a/examples/zips/management_dashboard.zip and b/examples/zips/management_dashboard.zip differ diff --git a/examples/zips/marketplace.zip b/examples/zips/marketplace.zip index a9809f1447e..e39da259b73 100644 Binary files a/examples/zips/marketplace.zip and b/examples/zips/marketplace.zip differ diff --git a/examples/zips/media_services.zip b/examples/zips/media_services.zip index 4d29b064b55..bae964731af 100644 Binary files a/examples/zips/media_services.zip and b/examples/zips/media_services.zip differ diff --git a/examples/zips/metering_computation.zip b/examples/zips/metering_computation.zip index 08eb0e8c74b..f4f5dba25b8 100644 Binary files a/examples/zips/metering_computation.zip and b/examples/zips/metering_computation.zip differ diff --git a/examples/zips/monitoring.zip b/examples/zips/monitoring.zip index 7c8b8ab830b..7ec127a3057 100644 Binary files a/examples/zips/monitoring.zip and b/examples/zips/monitoring.zip differ diff --git a/examples/zips/mysql.zip b/examples/zips/mysql.zip index 448c9ad0b40..26d9f784a02 100644 Binary files a/examples/zips/mysql.zip and b/examples/zips/mysql.zip differ diff --git a/examples/zips/network_firewall.zip b/examples/zips/network_firewall.zip index 3378b7c76c9..47fa9e69a85 100644 Binary files a/examples/zips/network_firewall.zip and b/examples/zips/network_firewall.zip differ diff --git a/examples/zips/network_load_balancer.zip b/examples/zips/network_load_balancer.zip index 49b24d5d990..5033dd06ba1 100644 Binary files a/examples/zips/network_load_balancer.zip and b/examples/zips/network_load_balancer.zip differ diff --git a/examples/zips/networking.zip b/examples/zips/networking.zip index 8b7336fb560..738a9be0b12 100644 Binary files a/examples/zips/networking.zip and b/examples/zips/networking.zip differ diff --git a/examples/zips/nosql.zip b/examples/zips/nosql.zip index 822e9c523e1..efb37455a72 100644 Binary files a/examples/zips/nosql.zip and b/examples/zips/nosql.zip differ diff --git a/examples/zips/notifications.zip b/examples/zips/notifications.zip index fb964c5aceb..f6f7d26ab8d 100644 Binary files a/examples/zips/notifications.zip and b/examples/zips/notifications.zip differ diff --git a/examples/zips/object_storage.zip b/examples/zips/object_storage.zip index b1ef84426b6..354e575283d 100644 Binary files a/examples/zips/object_storage.zip and b/examples/zips/object_storage.zip differ diff --git a/examples/zips/ocvp.zip b/examples/zips/ocvp.zip index e8c6e996fc0..c055b417aad 100644 Binary files a/examples/zips/ocvp.zip and b/examples/zips/ocvp.zip differ diff --git a/examples/zips/onesubscription.zip b/examples/zips/onesubscription.zip index 7b935c6ce80..2ac65c0bfb7 100644 Binary files a/examples/zips/onesubscription.zip and b/examples/zips/onesubscription.zip differ diff --git a/examples/zips/opa.zip b/examples/zips/opa.zip index 73af5e54c0b..4959bfb4c49 100644 Binary files a/examples/zips/opa.zip and b/examples/zips/opa.zip differ diff --git a/examples/zips/opensearch.zip b/examples/zips/opensearch.zip index da6b824ddd5..c0121a951ab 100644 Binary files a/examples/zips/opensearch.zip and b/examples/zips/opensearch.zip differ diff --git a/examples/zips/operator_access_control.zip b/examples/zips/operator_access_control.zip index 59f45b895f6..ef1e762904f 100644 Binary files a/examples/zips/operator_access_control.zip and b/examples/zips/operator_access_control.zip differ diff --git a/examples/zips/opsi.zip b/examples/zips/opsi.zip index 148bca835af..583f4996958 100644 Binary files a/examples/zips/opsi.zip and b/examples/zips/opsi.zip differ diff --git a/examples/zips/optimizer.zip b/examples/zips/optimizer.zip index 14f3aa5d88f..eafb08da25d 100644 Binary files a/examples/zips/optimizer.zip and b/examples/zips/optimizer.zip differ diff --git a/examples/zips/oracle_cloud_vmware_solution.zip b/examples/zips/oracle_cloud_vmware_solution.zip index a700c00665d..6442fd9f350 100644 Binary files a/examples/zips/oracle_cloud_vmware_solution.zip and b/examples/zips/oracle_cloud_vmware_solution.zip differ diff --git a/examples/zips/oracle_content_experience.zip b/examples/zips/oracle_content_experience.zip index 7f1693039b5..1663d9f8b44 100644 Binary files a/examples/zips/oracle_content_experience.zip and b/examples/zips/oracle_content_experience.zip differ diff --git a/examples/zips/oracle_digital_assistant.zip b/examples/zips/oracle_digital_assistant.zip index 1425e8b0447..4ef40f43056 100644 Binary files a/examples/zips/oracle_digital_assistant.zip and b/examples/zips/oracle_digital_assistant.zip differ diff --git a/examples/zips/osmanagement.zip b/examples/zips/osmanagement.zip index a187d365d1f..3d3071ec6a2 100644 Binary files a/examples/zips/osmanagement.zip and b/examples/zips/osmanagement.zip differ diff --git a/examples/zips/osp_gateway.zip b/examples/zips/osp_gateway.zip index 0ab6cc577b7..03a29a21ab9 100644 Binary files a/examples/zips/osp_gateway.zip and b/examples/zips/osp_gateway.zip differ diff --git a/examples/zips/osub_billing_schedule.zip b/examples/zips/osub_billing_schedule.zip index ddf5852dfb6..6a5489888e7 100644 Binary files a/examples/zips/osub_billing_schedule.zip and b/examples/zips/osub_billing_schedule.zip differ diff --git a/examples/zips/osub_organization_subscription.zip b/examples/zips/osub_organization_subscription.zip index e6eccb67348..c26408e3d79 100644 Binary files a/examples/zips/osub_organization_subscription.zip and b/examples/zips/osub_organization_subscription.zip differ diff --git a/examples/zips/osub_subscription.zip b/examples/zips/osub_subscription.zip index 61216d9c52b..17dd8c8f60f 100644 Binary files a/examples/zips/osub_subscription.zip and b/examples/zips/osub_subscription.zip differ diff --git a/examples/zips/osub_usage.zip b/examples/zips/osub_usage.zip index 0ce9097509e..c5ff1ab4f3e 100644 Binary files a/examples/zips/osub_usage.zip and b/examples/zips/osub_usage.zip differ diff --git a/examples/zips/pic.zip b/examples/zips/pic.zip index b461f3977ad..fc6b469290b 100644 Binary files a/examples/zips/pic.zip and b/examples/zips/pic.zip differ diff --git a/examples/zips/queue.zip b/examples/zips/queue.zip index 2a8e1df98e7..d7395445b1d 100644 Binary files a/examples/zips/queue.zip and b/examples/zips/queue.zip differ diff --git a/examples/zips/recovery.zip b/examples/zips/recovery.zip index 853093da94c..ce9568a293a 100644 Binary files a/examples/zips/recovery.zip and b/examples/zips/recovery.zip differ diff --git a/examples/zips/resourcemanager.zip b/examples/zips/resourcemanager.zip index c3505f731c0..be9a833802f 100644 Binary files a/examples/zips/resourcemanager.zip and b/examples/zips/resourcemanager.zip differ diff --git a/examples/zips/serviceManagerProxy.zip b/examples/zips/serviceManagerProxy.zip index c0c6f8f5243..e19c962fd5c 100644 Binary files a/examples/zips/serviceManagerProxy.zip and b/examples/zips/serviceManagerProxy.zip differ diff --git a/examples/zips/service_catalog.zip b/examples/zips/service_catalog.zip index 2b7715d08c7..9cba1e0f285 100644 Binary files a/examples/zips/service_catalog.zip and b/examples/zips/service_catalog.zip differ diff --git a/examples/zips/service_connector_hub.zip b/examples/zips/service_connector_hub.zip index da4d8f654d8..cb386c441b1 100644 Binary files a/examples/zips/service_connector_hub.zip and b/examples/zips/service_connector_hub.zip differ diff --git a/examples/zips/service_mesh.zip b/examples/zips/service_mesh.zip index bf424addca7..c8cdd0f023b 100644 Binary files a/examples/zips/service_mesh.zip and b/examples/zips/service_mesh.zip differ diff --git a/examples/zips/stack_monitoring.zip b/examples/zips/stack_monitoring.zip index 42ffdb5b21d..3a6f3b6af9a 100644 Binary files a/examples/zips/stack_monitoring.zip and b/examples/zips/stack_monitoring.zip differ diff --git a/examples/zips/storage.zip b/examples/zips/storage.zip index bb7359af1e0..a8e074949ba 100644 Binary files a/examples/zips/storage.zip and b/examples/zips/storage.zip differ diff --git a/examples/zips/streaming.zip b/examples/zips/streaming.zip index 7697e5fa6e9..e03bb47ce7e 100644 Binary files a/examples/zips/streaming.zip and b/examples/zips/streaming.zip differ diff --git a/examples/zips/usage_proxy.zip b/examples/zips/usage_proxy.zip index 8563a73df7e..f90145f653d 100644 Binary files a/examples/zips/usage_proxy.zip and b/examples/zips/usage_proxy.zip differ diff --git a/examples/zips/vault_secret.zip b/examples/zips/vault_secret.zip index 524116248dc..02d6f17c5a4 100644 Binary files a/examples/zips/vault_secret.zip and b/examples/zips/vault_secret.zip differ diff --git a/examples/zips/vbs_inst.zip b/examples/zips/vbs_inst.zip index c0bd078c085..f54d7a8cd61 100644 Binary files a/examples/zips/vbs_inst.zip and b/examples/zips/vbs_inst.zip differ diff --git a/examples/zips/visual_builder.zip b/examples/zips/visual_builder.zip index 30e9368ea6b..82b45fede73 100644 Binary files a/examples/zips/visual_builder.zip and b/examples/zips/visual_builder.zip differ diff --git a/examples/zips/vn_monitoring.zip b/examples/zips/vn_monitoring.zip index 166aaf4139f..f5218c750dd 100644 Binary files a/examples/zips/vn_monitoring.zip and b/examples/zips/vn_monitoring.zip differ diff --git a/examples/zips/vulnerability_scanning_service.zip b/examples/zips/vulnerability_scanning_service.zip index 7384bc8937f..3acac091c29 100644 Binary files a/examples/zips/vulnerability_scanning_service.zip and b/examples/zips/vulnerability_scanning_service.zip differ diff --git a/examples/zips/web_app_acceleration.zip b/examples/zips/web_app_acceleration.zip index 1606e735c8c..0385327cead 100644 Binary files a/examples/zips/web_app_acceleration.zip and b/examples/zips/web_app_acceleration.zip differ diff --git a/examples/zips/web_app_firewall.zip b/examples/zips/web_app_firewall.zip index f414171fd32..ecdbb81f3e6 100644 Binary files a/examples/zips/web_app_firewall.zip and b/examples/zips/web_app_firewall.zip differ diff --git a/examples/zips/web_application_acceleration_and_security.zip b/examples/zips/web_application_acceleration_and_security.zip index 85f1d4d71cc..40094cc1103 100644 Binary files a/examples/zips/web_application_acceleration_and_security.zip and b/examples/zips/web_application_acceleration_and_security.zip differ diff --git a/go.mod b/go.mod index 2d8afafc55d..5ff4e126ab1 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect github.com/golang/protobuf v1.4.2 // indirect - github.com/google/go-cmp v0.5.6 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/googleapis/gax-go/v2 v2.0.5 // indirect github.com/hashicorp/errwrap v1.0.0 // indirect github.com/hashicorp/go-checkpoint v0.5.0 // indirect @@ -35,10 +35,10 @@ require ( github.com/hashicorp/go-plugin v1.4.1 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-uuid v1.0.1 // indirect - github.com/hashicorp/go-version v1.3.0 + github.com/hashicorp/go-version v1.6.0 github.com/hashicorp/hcl/v2 v2.8.2 // indirect github.com/hashicorp/logutils v1.0.0 // indirect - github.com/hashicorp/terraform-json v0.12.0 // indirect + github.com/hashicorp/terraform-json v0.15.0 // indirect github.com/hashicorp/terraform-plugin-go v0.3.0 // indirect github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect @@ -53,12 +53,12 @@ require ( github.com/mitchellh/mapstructure v1.1.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect - github.com/oracle/oci-go-sdk/v65 v65.44.0 + github.com/oracle/oci-go-sdk/v65 v65.46.0 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sony/gobreaker v0.5.0 // indirect github.com/ulikunitz/xz v0.5.8 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect - github.com/zclconf/go-cty v1.8.4 // indirect + github.com/zclconf/go-cty v1.10.0 // indirect go.opencensus.io v0.22.4 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect diff --git a/go.sum b/go.sum index 8c236e4188a..c38410b2ea6 100644 --- a/go.sum +++ b/go.sum @@ -149,6 +149,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= @@ -195,6 +197,8 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= @@ -208,6 +212,8 @@ github.com/hashicorp/terraform-exec v0.14.0 h1:UQoUcxKTZZXhyyK68Cwn4mApT4mnFPmEX github.com/hashicorp/terraform-exec v0.14.0/go.mod h1:qrAASDq28KZiMPDnQ02sFS9udcqEkRly002EA2izXTA= github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI= +github.com/hashicorp/terraform-json v0.15.0 h1:/gIyNtR6SFw6h5yzlbDbACyGvIhKtQi8mTsbkNd79lE= +github.com/hashicorp/terraform-json v0.15.0/go.mod h1:+L1RNzjDU5leLFZkHTFTbJXaoqUC6TqXlFgDoOXrtvk= github.com/hashicorp/terraform-plugin-go v0.3.0 h1:AJqYzP52JFYl9NABRI7smXI1pNjgR5Q/y2WyVJ/BOZA= github.com/hashicorp/terraform-plugin-go v0.3.0/go.mod h1:dFHsQMaTLpON2gWhVWT96fvtlc/MF1vSy3OdMhWBzdM= github.com/hashicorp/terraform-plugin-sdk/v2 v2.7.0 h1:SuI59MqNjYDrL7EfqHX9V6P/24isgqYx/FdglwVs9bg= @@ -289,8 +295,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/oracle/oci-go-sdk/v65 v65.44.0 h1:zTZNvfw0L60OIg3DDHoNMp8s76nD4DtueJyCPL/oXBs= -github.com/oracle/oci-go-sdk/v65 v65.44.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= +github.com/oracle/oci-go-sdk/v65 v65.46.0 h1:4Tk81VNjCsnuAtVtICM+cLlcZw6AOiMtIvuVEwk78Lc= +github.com/oracle/oci-go-sdk/v65 v65.46.0/go.mod h1:IBEV9l1qBzUpo7zgGaRUhbB05BVfcDGYRFBCPlTcPp0= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -340,6 +346,8 @@ github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.8.4 h1:pwhhz5P+Fjxse7S7UriBrMu6AUJSZM5pKqGem1PjGAs= github.com/zclconf/go-cty v1.8.4/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.10.0 h1:mp9ZXQeIcN8kAwuqorjH+Q+njbJKjLrvB2yIh4q7U+0= +github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= diff --git a/internal/client/certificates_clients.go b/internal/client/certificates_clients.go new file mode 100644 index 00000000000..3956410e043 --- /dev/null +++ b/internal/client/certificates_clients.go @@ -0,0 +1,33 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package client + +import ( + oci_certificates "github.com/oracle/oci-go-sdk/v65/certificates" + oci_common "github.com/oracle/oci-go-sdk/v65/common" +) + +func init() { + RegisterOracleClient("oci_certificates.CertificatesClient", &OracleClient{InitClientFn: initCertificatesCertificatesClient}) +} + +func initCertificatesCertificatesClient(configProvider oci_common.ConfigurationProvider, configureClient ConfigureClient, serviceClientOverrides ServiceClientOverrides) (interface{}, error) { + client, err := oci_certificates.NewCertificatesClientWithConfigurationProvider(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) CertificatesClient() *oci_certificates.CertificatesClient { + return m.GetClient("oci_certificates.CertificatesClient").(*oci_certificates.CertificatesClient) +} diff --git a/internal/globalvar/version.go b/internal/globalvar/version.go index ab6154cea7f..7dee63ed500 100644 --- a/internal/globalvar/version.go +++ b/internal/globalvar/version.go @@ -7,8 +7,8 @@ import ( "log" ) -const Version = "5.5.0" -const ReleaseDate = "2023-07-19" +const Version = "5.7.0" +const ReleaseDate = "2023-08-02" func PrintVersion() { log.Printf("[INFO] terraform-provider-oci %s\n", Version) diff --git a/internal/integrationtest/ai_document_model_test.go b/internal/integrationtest/ai_document_model_test.go index f4a7413a593..1a51bc340db 100644 --- a/internal/integrationtest/ai_document_model_test.go +++ b/internal/integrationtest/ai_document_model_test.go @@ -61,6 +61,46 @@ var ( "model_version": acctest.Representation{RepType: acctest.Optional, Create: `modelVersion`}, "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreAiDocumentDefinedTagsChangesRepresentation}, } + + AiDocumentModelRepresentation2 = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "model_type": acctest.Representation{RepType: acctest.Required, Create: `KEY_VALUE_EXTRACTION`}, + "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_ai_document_project.test_project.id}`}, + "training_dataset": acctest.RepresentationGroup{RepType: acctest.Required, Group: AiDocumentModelTrainingDatasetRepresentation2}, + "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{"freeformTags": "freeformTags"}, Update: map[string]string{"freeformTags": "freeformTags2"}}, + "is_quick_mode": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "max_training_time_in_hours": acctest.Representation{RepType: acctest.Optional, Create: `0.5`}, + "model_version": acctest.Representation{RepType: acctest.Optional, Create: `modelVersion`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreAiDocumentDefinedTagsChangesRepresentation}, + } + + AiDocumentComposeModelRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "model_type": acctest.Representation{RepType: acctest.Required, Create: `KEY_VALUE_EXTRACTION`}, + "project_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_ai_document_project.test_project.id}`}, + "component_models": []acctest.RepresentationGroup{ + {RepType: acctest.Optional, Group: AiDocumentModelComponentModelRepresentation1}, + {RepType: acctest.Optional, Group: AiDocumentModelComponentModelRepresentation2}, + }, + "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{"freeformTags": "freeformTags"}, Update: map[string]string{"freeformTags": "freeformTags2"}}, + "is_quick_mode": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "max_training_time_in_hours": acctest.Representation{RepType: acctest.Optional, Create: `0.5`}, + "model_version": acctest.Representation{RepType: acctest.Optional, Create: `modelVersion`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreAiDocumentDefinedTagsChangesRepresentation}, + } + AiDocumentModelComponentModelRepresentation1 = map[string]interface{}{ + "model_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_ai_document_model.test_model.id}`}, + } + AiDocumentModelComponentModelRepresentation2 = map[string]interface{}{ + "model_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_ai_document_model.test_model2.id}`}, + } + AiDocumentModelTrainingDatasetRepresentation = map[string]interface{}{ "dataset_type": acctest.Representation{RepType: acctest.Required, Create: `OBJECT_STORAGE`}, "bucket": acctest.Representation{RepType: acctest.Required, Create: `tf_test_bucket`}, @@ -68,8 +108,20 @@ var ( "object": acctest.Representation{RepType: acctest.Required, Create: `tf_test_dataset_1680065500556.jsonl`}, } + AiDocumentModelTrainingDatasetRepresentation2 = map[string]interface{}{ + "dataset_type": acctest.Representation{RepType: acctest.Required, Create: `OBJECT_STORAGE`}, + "bucket": acctest.Representation{RepType: acctest.Required, Create: `tf_test_bucket`}, + "namespace": acctest.Representation{RepType: acctest.Required, Create: `axgexwaxnm7k`}, + "object": acctest.Representation{RepType: acctest.Required, Create: `tf_test_aadhar_1686719828190.jsonl`}, + } + AiDocumentModelResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_ai_document_project", "test_project", acctest.Required, acctest.Create, AiDocumentProjectRepresentation) + DefinedTagsDependencies + + AiDocumentComposeModelResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_ai_document_project", "test_project", acctest.Required, acctest.Create, AiDocumentProjectRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_ai_document_model", "test_model", acctest.Required, acctest.Create, AiDocumentModelRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_ai_document_model", "test_model2", acctest.Required, acctest.Create, AiDocumentModelRepresentation2) + + DefinedTagsDependencies ) // issue-routing-tag: ai_document/default @@ -88,6 +140,7 @@ func TestAiDocumentModelResource_basic(t *testing.T) { resourceName := "oci_ai_document_model.test_model" datasourceName := "data.oci_ai_document_models.test_models" singularDatasourceName := "data.oci_ai_document_model.test_model" + composeResourceName := "oci_ai_document_model.test_compose_model" 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. @@ -120,6 +173,39 @@ func TestAiDocumentModelResource_basic(t *testing.T) { { Config: config + compartmentIdVariableStr + AiDocumentModelResourceDependencies, }, + + // verify Create Compose Model + { + Config: config + compartmentIdVariableStr + AiDocumentComposeModelResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_ai_document_model", "test_compose_model", acctest.Optional, acctest.Create, AiDocumentComposeModelRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(composeResourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(composeResourceName, "description", "description"), + resource.TestCheckResourceAttr(composeResourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(composeResourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(composeResourceName, "id"), + resource.TestCheckResourceAttr(composeResourceName, "is_quick_mode", "false"), + resource.TestCheckResourceAttr(composeResourceName, "max_training_time_in_hours", "0.5"), + resource.TestCheckResourceAttr(composeResourceName, "model_type", "KEY_VALUE_EXTRACTION"), + resource.TestCheckResourceAttr(composeResourceName, "model_version", "modelVersion"), + resource.TestCheckResourceAttrSet(composeResourceName, "project_id"), + resource.TestCheckResourceAttr(composeResourceName, "component_models.#", "2"), + resource.TestCheckResourceAttrSet(composeResourceName, "component_models.0.model_id"), + resource.TestCheckResourceAttrSet(composeResourceName, "state"), + resource.TestCheckResourceAttrSet(composeResourceName, "time_created"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, composeResourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + AiDocumentModelResourceDependencies, + }, + // verify Create with optionals { Config: config + compartmentIdVariableStr + AiDocumentModelResourceDependencies + @@ -246,13 +332,14 @@ func TestAiDocumentModelResource_basic(t *testing.T) { acctest.GenerateDataSourceFromRepresentationMap("oci_ai_document_model", "test_model", acctest.Required, acctest.Create, AiDocumentAiDocumentModelSingularDataSourceRepresentation) + compartmentIdVariableStr + AiDocumentModelResourceConfig, Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttrSet(singularDatasourceName, "model_id"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "component_models.#", "0"), resource.TestCheckResourceAttr(singularDatasourceName, "description", "description2"), resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "is_composed_model"), resource.TestCheckResourceAttr(singularDatasourceName, "is_quick_mode", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "max_training_time_in_hours", "0.5"), resource.TestCheckResourceAttr(singularDatasourceName, "metrics.#", "1"), @@ -271,11 +358,10 @@ func TestAiDocumentModelResource_basic(t *testing.T) { }, // verify resource import { - Config: config + AiDocumentModelRequiredOnlyResource, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{}, - ResourceName: resourceName, + Config: config + AiDocumentModelRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ResourceName: resourceName, }, }) } diff --git a/internal/integrationtest/ai_document_processor_job_test.go b/internal/integrationtest/ai_document_processor_job_test.go index 8c114bcc7b4..a6a680e163a 100644 --- a/internal/integrationtest/ai_document_processor_job_test.go +++ b/internal/integrationtest/ai_document_processor_job_test.go @@ -52,7 +52,7 @@ var ( AiDocumentProcessorJobProcessorConfigFeaturesRepresentation = map[string]interface{}{ "feature_type": acctest.Representation{RepType: acctest.Required, Create: `DOCUMENT_CLASSIFICATION`}, "generate_searchable_pdf": acctest.Representation{RepType: acctest.Optional, Create: `false`}, - "max_results": acctest.Representation{RepType: acctest.Optional, Create: `5`}, + "max_results": acctest.Representation{RepType: acctest.Optional, Create: `10`}, } ) @@ -121,7 +121,7 @@ func TestAiDocumentProcessorJobResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "processor_config.0.features.#", "1"), resource.TestCheckResourceAttr(resourceName, "processor_config.0.features.0.feature_type", "DOCUMENT_CLASSIFICATION"), resource.TestCheckResourceAttr(resourceName, "processor_config.0.features.0.generate_searchable_pdf", "false"), - resource.TestCheckResourceAttr(resourceName, "processor_config.0.features.0.max_results", "5"), + resource.TestCheckResourceAttr(resourceName, "processor_config.0.features.0.max_results", "10"), resource.TestCheckResourceAttr(resourceName, "processor_config.0.is_zip_output_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "processor_config.0.processor_type", "GENERAL"), resource.TestCheckResourceAttrSet(resourceName, "state"), @@ -155,7 +155,7 @@ func TestAiDocumentProcessorJobResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "processor_config.0.features.#", "1"), resource.TestCheckResourceAttr(singularDatasourceName, "processor_config.0.features.0.feature_type", "DOCUMENT_CLASSIFICATION"), resource.TestCheckResourceAttr(singularDatasourceName, "processor_config.0.features.0.generate_searchable_pdf", "false"), - resource.TestCheckResourceAttr(singularDatasourceName, "processor_config.0.features.0.max_results", "5"), + resource.TestCheckResourceAttr(singularDatasourceName, "processor_config.0.features.0.max_results", "10"), resource.TestCheckResourceAttr(singularDatasourceName, "processor_config.0.is_zip_output_enabled", "false"), resource.TestCheckResourceAttr(singularDatasourceName, "processor_config.0.processor_type", "GENERAL"), resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), diff --git a/internal/integrationtest/budget_budget_test.go b/internal/integrationtest/budget_budget_test.go index 76057777443..59fd7fe9124 100644 --- a/internal/integrationtest/budget_budget_test.go +++ b/internal/integrationtest/budget_budget_test.go @@ -8,6 +8,7 @@ import ( "fmt" "strconv" "testing" + "time" tf_client "github.com/oracle/terraform-provider-oci/internal/client" "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" @@ -60,7 +61,8 @@ var ( "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"}}, "processing_period_type": acctest.Representation{RepType: acctest.Optional, Create: `MONTH`}, - "target_compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "target_compartment_id": acctest.Representation{RepType: acctest.Optional, Create: `${var.compartment_id}`}, + "target_type": acctest.Representation{RepType: acctest.Optional, Create: `COMPARTMENT`}, "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagChange}, } @@ -93,19 +95,31 @@ var ( "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagChange}, } - //Budget with Processing Period Type = INVOICE - budgetRepresentationWithInvoicePeriod = map[string]interface{}{ - "amount": acctest.Representation{RepType: acctest.Required, Create: `100`, Update: `200`}, - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.tenancy_ocid}`}, - "reset_period": acctest.Representation{RepType: acctest.Required, Create: `MONTHLY`}, - "budget_processing_period_start_offset": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`}, - "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"})}`}, - "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"}}, - "processing_period_type": acctest.Representation{RepType: acctest.Required, Create: `INVOICE`, Update: `MONTH`}, - "target_type": acctest.Representation{RepType: acctest.Required, Create: `COMPARTMENT`}, - "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDefinedTagChange}, + timeNow = time.Date(2050, 8, 15, 14, 30, 45, 100, time.UTC) + timeNowTruncated = time.Date(timeNow.Year(), timeNow.Month(), timeNow.Day(), 0, 0, 0, 0, time.UTC) + endDate = timeNow.AddDate(0, 2, 0).Format(time.RFC3339Nano) + expectedEndDate = timeNowTruncated.AddDate(0, 2, 0).Format(time.RFC3339Nano) + startDate = timeNow.AddDate(0, 1, 0).Format(time.RFC3339Nano) + expectedStartDate = timeNowTruncated.AddDate(0, 1, 0).Format(time.RFC3339Nano) + + // Single Usage Budgets + budgetRepresentationWithSingleUseBudget = map[string]interface{}{ + "amount": acctest.Representation{RepType: acctest.Required, Create: `10000`, Update: `20000`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.tenancy_ocid}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `displayName`, Update: `displayName2`}, + "description": acctest.Representation{RepType: acctest.Optional, Create: `test`, Update: `test2`}, + "reset_period": acctest.Representation{RepType: acctest.Required, Create: `MONTHLY`}, + "processing_period_type": acctest.Representation{RepType: acctest.Optional, Create: `SINGLE_USE`}, + "targets": acctest.Representation{RepType: acctest.Required, Create: []string{`${var.compartment_id}`}}, + "target_type": acctest.Representation{RepType: acctest.Required, Create: `COMPARTMENT`}, + "start_date": acctest.Representation{RepType: acctest.Optional, Create: startDate}, + "end_date": acctest.Representation{RepType: acctest.Optional, Create: endDate}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreDateChange}, + } + + // Ignore changes to start and end dates once created + ignoreDateChange = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`start_date`, `end_date`}}, } // Ignore changes in defined tag in case a tenancy has a `tag default` @@ -126,8 +140,6 @@ func TestBudgetBudgetResource_basic(t *testing.T) { compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) tenancyId := utils.GetEnvSettingWithBlankDefault("tenancy_ocid") - subscriptionId := utils.GetEnvSettingWithBlankDefault("subscription_id") - subIdVariableStr := fmt.Sprintf("variable \"subscription_id\" { default = \"%s\" }\n", subscriptionId) resourceName := "oci_budget_budget.test_budget" datasourceName := "data.oci_budget_budgets.test_budgets" singularDatasourceName := "data.oci_budget_budget.test_budget" @@ -138,61 +150,6 @@ func TestBudgetBudgetResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_budget_budget", "test_budget", acctest.Optional, acctest.Create, budgetRepresentationWithTargetTypeAsCompartmentAndTargets), "budget", "budget", t) acctest.ResourceTest(t, testAccCheckBudgetBudgetDestroy, []resource.TestStep{ - { - // verify create invoice type budget - Config: config + compartmentIdVariableStr + subIdVariableStr + BudgetResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_budget_budget", "test_budget", acctest.Required, acctest.Create, - acctest.RepresentationCopyWithNewProperties(budgetRepresentationWithInvoicePeriod, map[string]interface{}{ - "targets": acctest.Representation{RepType: acctest.Required, Create: []string{`${var.subscription_id}`}}, - })), - Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttr(resourceName, "amount", "100"), - resource.TestCheckResourceAttr(resourceName, "compartment_id", tenancyId), - resource.TestCheckResourceAttr(resourceName, "reset_period", "MONTHLY"), - resource.TestCheckResourceAttr(resourceName, "target_type", "COMPARTMENT"), - resource.TestCheckResourceAttr(resourceName, "targets.#", "1"), - resource.TestCheckResourceAttr(resourceName, "target_compartment_id", subscriptionId), - resource.TestCheckResourceAttr(resourceName, "processing_period_type", "INVOICE"), - - func(s *terraform.State) (err error) { - resId, err = acctest.FromInstanceState(s, resourceName, "id") - return err - }, - ), - }, - - { - // verify update invoice type budget - Config: config + compartmentIdVariableStr + subIdVariableStr + BudgetResourceDependencies + - acctest.GenerateResourceFromRepresentationMap("oci_budget_budget", "test_budget", acctest.Optional, acctest.Update, - acctest.RepresentationCopyWithNewProperties(budgetRepresentationWithInvoicePeriod, map[string]interface{}{ - "targets": acctest.Representation{RepType: acctest.Required, Create: []string{`${var.subscription_id}`}}, - })), - Check: acctest.ComposeAggregateTestCheckFuncWrapper( - resource.TestCheckResourceAttr(resourceName, "amount", "200"), - resource.TestCheckResourceAttr(resourceName, "compartment_id", tenancyId), - resource.TestCheckResourceAttr(resourceName, "reset_period", "MONTHLY"), - resource.TestCheckResourceAttr(resourceName, "target_type", "COMPARTMENT"), - resource.TestCheckResourceAttr(resourceName, "targets.#", "1"), - resource.TestCheckResourceAttr(resourceName, "description", "description2"), - resource.TestCheckResourceAttr(resourceName, "display_name", "displayName2"), - resource.TestCheckResourceAttr(resourceName, "processing_period_type", "MONTH"), - resource.TestCheckResourceAttr(resourceName, "budget_processing_period_start_offset", "11"), - - func(s *terraform.State) (err error) { - resId2, err = acctest.FromInstanceState(s, resourceName, "id") - if resId != resId2 { - return fmt.Errorf("Resource recreated when it was supposed to be updated.") - } - return err - }, - ), - }, - - { - // delete before next Creat - Config: config + compartmentIdVariableStr + BudgetResourceDependencies, - }, // verify Create for TargetType = Compartment { @@ -214,6 +171,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) { { Config: config + compartmentIdVariableStr + BudgetResourceDependencies, }, + // verify Create with optionals for TargetType = Compartment { Config: config + compartmentIdVariableStr + BudgetResourceDependencies + @@ -270,6 +228,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) { }, ), }, + // verify Create for TargetType = Tag { Config: config + compartmentIdVariableStr + BudgetResourceDependencies + @@ -290,6 +249,37 @@ func TestBudgetBudgetResource_basic(t *testing.T) { { Config: config + compartmentIdVariableStr + BudgetResourceDependencies, }, + + // create Single Use Budget + { + Config: config + compartmentIdVariableStr + BudgetResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_budget_budget", "test_budget", acctest.Optional, acctest.Create, budgetRepresentationWithSingleUseBudget), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "amount", "10000"), + resource.TestCheckResourceAttr(resourceName, "compartment_id", tenancyId), + resource.TestCheckResourceAttr(resourceName, "display_name", "displayName"), + resource.TestCheckResourceAttr(resourceName, "description", "test"), + resource.TestCheckResourceAttr(resourceName, "reset_period", "MONTHLY"), + resource.TestCheckResourceAttr(resourceName, "processing_period_type", "SINGLE_USE"), + resource.TestCheckResourceAttr(resourceName, "targets.#", "1"), + resource.TestCheckResourceAttr(resourceName, "target_type", "COMPARTMENT"), + resource.TestCheckResourceAttr(resourceName, "start_date", expectedStartDate), + resource.TestCheckResourceAttr(resourceName, "end_date", expectedEndDate), + resource.TestCheckResourceAttrSet(resourceName, "time_created"), + resource.TestCheckResourceAttrSet(resourceName, "time_updated"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + BudgetResourceDependencies, + }, + // verify Create with optionals for TargetType = Tag { Config: config + compartmentIdVariableStr + BudgetResourceDependencies + @@ -430,6 +420,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) { }, ), }, + // verify datasource { Config: config + @@ -441,7 +432,6 @@ func TestBudgetBudgetResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(datasourceName, "state", "ACTIVE"), resource.TestCheckResourceAttr(datasourceName, "target_type", "COMPARTMENT"), - resource.TestCheckResourceAttr(datasourceName, "budgets.#", "1"), resource.TestCheckResourceAttrSet(datasourceName, "budgets.0.actual_spend"), resource.TestCheckResourceAttrSet(datasourceName, "budgets.0.alert_rule_count"), @@ -464,6 +454,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "budgets.0.version"), ), }, + // verify singular datasource { Config: config + @@ -490,6 +481,7 @@ func TestBudgetBudgetResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(singularDatasourceName, "version"), ), }, + // verify resource import { Config: config + BudgetRequiredOnlyResource, diff --git a/internal/integrationtest/certificates_certificate_authority_bundle_test.go b/internal/integrationtest/certificates_certificate_authority_bundle_test.go new file mode 100644 index 00000000000..fd5356f6033 --- /dev/null +++ b/internal/integrationtest/certificates_certificate_authority_bundle_test.go @@ -0,0 +1,61 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + CertificatesCertificateAuthorityBundleSingularDataSourceRepresentation = map[string]interface{}{ + "certificate_authority_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_certificates_management_certificate_authority.test_certificate_authority.id}`}, + "stage": acctest.Representation{RepType: acctest.Optional, Create: `CURRENT`}, + } + + CertificatesCertificateAuthorityBundleResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_certificates_management_certificate_authority", "test_certificate_authority", acctest.Required, acctest.Create, certificateAuthorityRepresentation) +) + +// issue-routing-tag: certificates/default +func TestCertificatesCertificateAuthorityBundleResource_basic(t *testing.T) { + httpreplay.SetScenario("TestCertificatesCertificateAuthorityBundleResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + singularDatasourceName := "data.oci_certificates_certificate_authority_bundle.test_certificate_authority_bundle" + + acctest.SaveConfigContent("", "", "", t) + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_certificates_certificate_authority_bundle", "test_certificate_authority_bundle", acctest.Optional, acctest.Create, CertificatesCertificateAuthorityBundleSingularDataSourceRepresentation) + + compartmentIdVariableStr + CertificatesCertificateAuthorityBundleResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "cert_chain_pem"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "certificate_authority_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "certificate_authority_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "certificate_pem"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "serial_number"), + resource.TestCheckResourceAttr(singularDatasourceName, "stages.#", "2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttr(singularDatasourceName, "validity.#", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "validity.0.time_of_validity_not_before"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "validity.0.time_of_validity_not_after"), + resource.TestCheckResourceAttr(singularDatasourceName, "version_number", "1"), + ), + }, + }) +} diff --git a/internal/integrationtest/certificates_certificate_bundle_test.go b/internal/integrationtest/certificates_certificate_bundle_test.go new file mode 100644 index 00000000000..d8aae41c73a --- /dev/null +++ b/internal/integrationtest/certificates_certificate_bundle_test.go @@ -0,0 +1,64 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + CertificatesCertificateBundleSingularDataSourceRepresentation = map[string]interface{}{ + "certificate_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_certificates_management_certificate.test_certificate.id}`}, + "certificate_bundle_type": acctest.Representation{RepType: acctest.Optional, Create: `CERTIFICATE_CONTENT_WITH_PRIVATE_KEY`}, + "stage": acctest.Representation{RepType: acctest.Optional, Create: `CURRENT`}, + } + + CertificatesCertificateBundleResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_certificates_management_certificate", "test_certificate", acctest.Required, acctest.Create, certificatesManagementCertificateRepresentation) +) + +// issue-routing-tag: certificates/default +func TestCertificatesCertificateBundleResource_basic(t *testing.T) { + httpreplay.SetScenario("TestCertificatesCertificateBundleResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + singularDatasourceName := "data.oci_certificates_certificate_bundle.test_certificate_bundle" + + acctest.SaveConfigContent("", "", "", t) + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_certificates_certificate_bundle", "test_certificate_bundle", acctest.Optional, acctest.Create, CertificatesCertificateBundleSingularDataSourceRepresentation) + + compartmentIdVariableStr + CertificatesCertificateBundleResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "cert_chain_pem"), + resource.TestCheckResourceAttr(singularDatasourceName, "certificate_bundle_type", "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "certificate_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "certificate_name"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "certificate_pem"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "private_key_pem"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "serial_number"), + resource.TestCheckResourceAttr(singularDatasourceName, "stages.#", "2"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttr(singularDatasourceName, "validity.#", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "validity.0.time_of_validity_not_before"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "validity.0.time_of_validity_not_after"), + resource.TestCheckResourceAttr(singularDatasourceName, "version_number", "1"), + ), + }, + }) +} diff --git a/internal/integrationtest/containerengine_cluster_complete_credential_rotation_management_test.go b/internal/integrationtest/containerengine_cluster_complete_credential_rotation_management_test.go new file mode 100644 index 00000000000..54f1e717ac6 --- /dev/null +++ b/internal/integrationtest/containerengine_cluster_complete_credential_rotation_management_test.go @@ -0,0 +1,111 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ContainerengineClusterCompleteCredentialRotationManagementRepresentation = map[string]interface{}{ + "cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_containerengine_cluster.test_cluster.id}`}, + } +) + +// issue-routing-tag: containerengine/default +func TestContainerengineClusterCompleteCredentialRotationManagementResource_basic(t *testing.T) { + httpreplay.SetScenario("TestContainerengineClusterCompleteCredentialRotationManagementResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_containerengine_cluster.test_cluster" + singularDatasourceName := "data.oci_containerengine_cluster_credential_rotation_status.test_cluster_credential_rotation_status" + + // Save TF content to Create resource with only required properties. This has to be exactly the same as the config part in the create step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+ContainerengineClusterResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_complete_credential_rotation_management", "test_cluster_complete_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterCompleteCredentialRotationManagementRepresentation), "containerengine", "clusterCompleteCredentialRotationManagement", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // create cluster + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "kubernetes_version"), + resource.TestCheckResourceAttr(resourceName, "name", "name"), + resource.TestCheckResourceAttrSet(resourceName, "vcn_id"), + resource.TestCheckResourceAttrSet(resourceName, "metadata.0.time_credential_expiration"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // start rotation + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_start_credential_rotation_management", "test_cluster_start_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterStartCredentialRotationManagementRepresentation), + }, + + // verify rotation status + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_start_credential_rotation_management", "test_cluster_start_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterStartCredentialRotationManagementRepresentation) + + acctest.GenerateDataSourceFromRepresentationMap("oci_containerengine_cluster_credential_rotation_status", "test_cluster_credential_rotation_status", + acctest.Optional, acctest.Create, ContainerengineClusterCredentialRotationStatusSingularDataSourceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "cluster_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "status", "WAITING"), + resource.TestCheckResourceAttr(singularDatasourceName, "status_details", "NEW_CREDENTIALS_ISSUED"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_auto_completion_scheduled"), + ), + }, + // complete rotation + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_complete_credential_rotation_management", "test_cluster_complete_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterCompleteCredentialRotationManagementRepresentation), + }, + // verify complete rotation status + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_complete_credential_rotation_management", "test_cluster_complete_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterCompleteCredentialRotationManagementRepresentation) + + acctest.GenerateDataSourceFromRepresentationMap("oci_containerengine_cluster_credential_rotation_status", "test_cluster_credential_rotation_status", + acctest.Optional, acctest.Create, ContainerengineClusterCredentialRotationStatusSingularDataSourceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "cluster_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "status", "COMPLETED"), + resource.TestCheckResourceAttr(singularDatasourceName, "status_details", "COMPLETED"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_auto_completion_scheduled"), + ), + }, + }) +} diff --git a/internal/integrationtest/containerengine_cluster_credential_rotation_status_test.go b/internal/integrationtest/containerengine_cluster_credential_rotation_status_test.go new file mode 100644 index 00000000000..d821874e51f --- /dev/null +++ b/internal/integrationtest/containerengine_cluster_credential_rotation_status_test.go @@ -0,0 +1,83 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ContainerengineClusterCredentialRotationStatusSingularDataSourceRepresentation = map[string]interface{}{ + "cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_containerengine_cluster.test_cluster.id}`}, + } +) + +// issue-routing-tag: containerengine/default +func TestContainerengineClusterCredentialRotationStatusResource_basic(t *testing.T) { + httpreplay.SetScenario("TestContainerengineClusterCredentialRotationStatusResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_containerengine_cluster.test_cluster" + singularDatasourceName := "data.oci_containerengine_cluster_credential_rotation_status.test_cluster_credential_rotation_status" + + acctest.SaveConfigContent("", "", "", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // create cluster + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "kubernetes_version"), + resource.TestCheckResourceAttr(resourceName, "name", "name"), + resource.TestCheckResourceAttrSet(resourceName, "vcn_id"), + resource.TestCheckResourceAttrSet(resourceName, "metadata.0.time_credential_expiration"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // start rotation + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_start_credential_rotation_management", "test_cluster_start_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterStartCredentialRotationManagementRepresentation), + }, + + // verify rotation status + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_start_credential_rotation_management", "test_cluster_start_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterStartCredentialRotationManagementRepresentation) + + acctest.GenerateDataSourceFromRepresentationMap("oci_containerengine_cluster_credential_rotation_status", "test_cluster_credential_rotation_status", + acctest.Optional, acctest.Create, ContainerengineClusterCredentialRotationStatusSingularDataSourceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "cluster_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "status", "WAITING"), + resource.TestCheckResourceAttr(singularDatasourceName, "status_details", "NEW_CREDENTIALS_ISSUED"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_auto_completion_scheduled"), + ), + }, + }) +} diff --git a/internal/integrationtest/containerengine_cluster_start_credential_rotation_management_test.go b/internal/integrationtest/containerengine_cluster_start_credential_rotation_management_test.go new file mode 100644 index 00000000000..46f2867086e --- /dev/null +++ b/internal/integrationtest/containerengine_cluster_start_credential_rotation_management_test.go @@ -0,0 +1,154 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + ContainerengineClusterRepresentationForCredentialRotation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "kubernetes_version": acctest.Representation{RepType: acctest.Required, Create: `${data.oci_containerengine_cluster_option.test_cluster_option.kubernetes_versions[length(data.oci_containerengine_cluster_option.test_cluster_option.kubernetes_versions)-2]}`}, + "name": acctest.Representation{RepType: acctest.Required, Create: `name`}, + "vcn_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_vcn.test_vcn.id}`}, + "cluster_pod_network_options": acctest.RepresentationGroup{RepType: acctest.Optional, Group: clusterClusterPodNetworkOptionsRepresentationForCredentialRotation}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`}, + "endpoint_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterEndpointConfigRepresentationForCredentialRotation}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "image_policy_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterImagePolicyConfigRepresentationForCredentialRotation}, + "kms_key_id": acctest.Representation{RepType: acctest.Optional, Create: `${lookup(data.oci_kms_keys.test_keys_dependency.keys[0], "id")}`}, + "options": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterOptionsRepresentationForCredentialRotation}, + } + clusterClusterPodNetworkOptionsRepresentationForCredentialRotation = map[string]interface{}{ + "cni_type": acctest.Representation{RepType: acctest.Required, Create: `FLANNEL_OVERLAY`}, + } + ContainerengineClusterEndpointConfigRepresentationForCredentialRotation = map[string]interface{}{ + "is_public_ip_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + "nsg_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${oci_core_network_security_group.test_network_security_group.id}`}}, + "subnet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_subnet.test_subnet.id}`}, + } + ContainerengineClusterImagePolicyConfigRepresentationForCredentialRotation = map[string]interface{}{ + "is_policy_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + "key_details": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterImagePolicyConfigKeyDetailsRepresentationForCredentialRotation}, + } + ContainerengineClusterOptionsRepresentationForCredentialRotation = map[string]interface{}{ + "add_ons": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterOptionsAddOnsRepresentationForCredentialRotation}, + "admission_controller_options": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterOptionsAdmissionControllerOptionsRepresentationForCredentialRotation}, + "kubernetes_network_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterOptionsKubernetesNetworkConfigRepresentationForCredentialRotation}, + "persistent_volume_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterOptionsPersistentVolumeConfigRepresentationForCredentialRotation}, + "service_lb_config": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineClusterOptionsServiceLbConfigRepresentationForCredentialRotation}, + "service_lb_subnet_ids": acctest.Representation{RepType: acctest.Optional, Create: []string{`${oci_core_subnet.clusterSubnet_1.id}`, `${oci_core_subnet.clusterSubnet_2.id}`}}, + } + ContainerengineClusterImagePolicyConfigKeyDetailsRepresentationForCredentialRotation = map[string]interface{}{ + "kms_key_id": acctest.Representation{RepType: acctest.Optional, Create: `${lookup(data.oci_kms_keys.test_keys_dependency_RSA.keys[0], "id")}`}, + } + ContainerengineClusterOptionsAddOnsRepresentationForCredentialRotation = map[string]interface{}{ + "is_kubernetes_dashboard_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + "is_tiller_enabled": acctest.Representation{RepType: acctest.Optional, Create: `true`}, + } + ContainerengineClusterOptionsAdmissionControllerOptionsRepresentationForCredentialRotation = map[string]interface{}{ + "is_pod_security_policy_enabled": acctest.Representation{RepType: acctest.Optional, Create: `false`}, + } + ContainerengineClusterOptionsKubernetesNetworkConfigRepresentationForCredentialRotation = map[string]interface{}{ + "pods_cidr": acctest.Representation{RepType: acctest.Optional, Create: `10.1.0.0/16`}, + "services_cidr": acctest.Representation{RepType: acctest.Optional, Create: `10.2.0.0/16`}, + } + ContainerengineClusterOptionsPersistentVolumeConfigRepresentationForCredentialRotation = map[string]interface{}{ + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}}, + } + ContainerengineClusterOptionsServiceLbConfigRepresentationForCredentialRotation = map[string]interface{}{ + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}}, + } + + ContainerengineStartCredentialRotationRepresentationForStartCredentialRotationForStartCredentialRotation = map[string]interface{}{ + "start_credential_rotation": acctest.RepresentationGroup{RepType: acctest.Optional, Group: ContainerengineStartCredentialRotationConfigRepresentationForStartCredentialRotationForCredentialRotation}, + } + + ContainerengineStartCredentialRotationConfigRepresentationForStartCredentialRotationForCredentialRotation = map[string]interface{}{ + "auto_completion_delay_duration": acctest.Representation{RepType: acctest.Optional, Create: `NONE`, Update: `P5D`}, + "start_credential_rotation_state": acctest.Representation{RepType: acctest.Optional, Create: `NONE`, Update: `NEW_CREDENTIALS_ISSUED`}, + } + + ContainerengineClusterStartCredentialRotationManagementRepresentation = map[string]interface{}{ + "auto_completion_delay_duration": acctest.Representation{RepType: acctest.Required, Create: `P5D`}, + "cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_containerengine_cluster.test_cluster.id}`}, + } +) + +// issue-routing-tag: containerengine/default +func TestContainerengineClusterStartCredentialRotationManagementResource_basic(t *testing.T) { + httpreplay.SetScenario("TestContainerengineClusterStartCredentialRotationManagementResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_containerengine_cluster.test_cluster" + singularDatasourceName := "data.oci_containerengine_cluster_credential_rotation_status.test_cluster_credential_rotation_status" + + // Save TF content to Create resource with only required properties. This has to be exactly the same as the config part in the create step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+ContainerengineClusterResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_start_credential_rotation_management", "test_cluster_start_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterStartCredentialRotationManagementRepresentation), "containerengine", "clusterStartCredentialRotationManagement", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // create cluster + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttrSet(resourceName, "kubernetes_version"), + resource.TestCheckResourceAttr(resourceName, "name", "name"), + resource.TestCheckResourceAttrSet(resourceName, "vcn_id"), + resource.TestCheckResourceAttrSet(resourceName, "metadata.0.time_credential_expiration"), + + func(s *terraform.State) (err error) { + _, err = acctest.FromInstanceState(s, resourceName, "id") + return err + }, + ), + }, + + // start rotation + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_start_credential_rotation_management", "test_cluster_start_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterStartCredentialRotationManagementRepresentation), + }, + + // verify rotation status + { + Config: config + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster", "test_cluster", acctest.Optional, acctest.Create, ContainerengineClusterRepresentationForCredentialRotation) + + compartmentIdVariableStr + ContainerengineClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_containerengine_cluster_start_credential_rotation_management", "test_cluster_start_credential_rotation_management", acctest.Required, acctest.Create, ContainerengineClusterStartCredentialRotationManagementRepresentation) + + acctest.GenerateDataSourceFromRepresentationMap("oci_containerengine_cluster_credential_rotation_status", "test_cluster_credential_rotation_status", + acctest.Optional, acctest.Create, ContainerengineClusterCredentialRotationStatusSingularDataSourceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "cluster_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "status", "WAITING"), + resource.TestCheckResourceAttr(singularDatasourceName, "status_details", "NEW_CREDENTIALS_ISSUED"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_auto_completion_scheduled"), + ), + }, + }) +} diff --git a/internal/integrationtest/core_cluster_network_test.go b/internal/integrationtest/core_cluster_network_test.go index c036c1cae93..db05f332ad7 100644 --- a/internal/integrationtest/core_cluster_network_test.go +++ b/internal/integrationtest/core_cluster_network_test.go @@ -171,6 +171,8 @@ func TestCoreClusterNetworkResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "instance_pools.0.display_name", "hpc-cluster-network-pool"), resource.TestCheckResourceAttr(resourceName, "instance_pools.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "instance_pools.0.id"), + resource.TestCheckResourceAttr(resourceName, "instance_pools.0.instance_display_name_formatter", ""), + resource.TestCheckResourceAttr(resourceName, "instance_pools.0.instance_hostname_formatter", ""), resource.TestCheckResourceAttrSet(resourceName, "instance_pools.0.instance_configuration_id"), resource.TestCheckResourceAttr(resourceName, "instance_pools.0.placement_configurations.#", "1"), resource.TestCheckResourceAttr(resourceName, "instance_pools.0.size", "1"), @@ -219,6 +221,8 @@ func TestCoreClusterNetworkResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "instance_pools.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "instance_pools.0.id"), resource.TestCheckResourceAttrSet(resourceName, "instance_pools.0.instance_configuration_id"), + resource.TestCheckResourceAttr(resourceName, "instance_pools.0.instance_display_name_formatter", ""), + resource.TestCheckResourceAttr(resourceName, "instance_pools.0.instance_hostname_formatter", ""), resource.TestCheckResourceAttr(resourceName, "instance_pools.0.placement_configurations.#", "1"), resource.TestCheckResourceAttr(resourceName, "instance_pools.0.size", "1"), resource.TestCheckResourceAttrSet(resourceName, "instance_pools.0.state"), @@ -309,6 +313,8 @@ func TestCoreClusterNetworkResource_basic(t *testing.T) { resource.TestCheckResourceAttr(datasourceName, "cluster_networks.0.instance_pools.0.display_name", "hpc-cluster-network-pool2"), resource.TestCheckResourceAttr(datasourceName, "cluster_networks.0.instance_pools.0.freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(datasourceName, "cluster_networks.0.instance_pools.0.id"), + resource.TestCheckResourceAttr(datasourceName, "cluster_networks.0.instance_pools.0.instance_display_name_formatter", ""), + resource.TestCheckResourceAttr(datasourceName, "cluster_networks.0.instance_pools.0.instance_hostname_formatter", ""), resource.TestCheckResourceAttrSet(datasourceName, "cluster_networks.0.instance_pools.0.instance_configuration_id"), resource.TestCheckResourceAttr(datasourceName, "cluster_networks.0.instance_pools.0.placement_configurations.#", "0"), resource.TestCheckResourceAttr(datasourceName, "cluster_networks.0.instance_pools.0.size", "2"), diff --git a/internal/integrationtest/core_instance_pool_test.go b/internal/integrationtest/core_instance_pool_test.go index 7c1b1390766..e571980c8f8 100644 --- a/internal/integrationtest/core_instance_pool_test.go +++ b/internal/integrationtest/core_instance_pool_test.go @@ -46,15 +46,17 @@ var ( } CoreInstancePoolRepresentation = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "instance_configuration_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_instance_configuration.test_instance_configuration.id}`}, - "placement_configurations": acctest.RepresentationGroup{RepType: acctest.Required, Group: CoreInstancePoolPlacementConfigurationsRepresentation}, - "size": acctest.Representation{RepType: acctest.Required, Create: `2`, Update: `3`}, - "state": acctest.Representation{RepType: acctest.Optional, Create: `Running`}, - "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`}, - "display_name": acctest.Representation{RepType: acctest.Optional, Create: `backend-servers-pool`, Update: `displayName2`}, - "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, - "load_balancers": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstancePoolLoadBalancersRepresentation}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "instance_configuration_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_core_instance_configuration.test_instance_configuration.id}`}, + "placement_configurations": acctest.RepresentationGroup{RepType: acctest.Required, Group: CoreInstancePoolPlacementConfigurationsRepresentation}, + "size": acctest.Representation{RepType: acctest.Required, Create: `2`, Update: `3`}, + "state": acctest.Representation{RepType: acctest.Optional, Create: `Running`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`}, + "display_name": acctest.Representation{RepType: acctest.Optional, Create: `backend-servers-pool`, Update: `displayName2`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"Department": "Finance"}, Update: map[string]string{"Department": "Accounting"}}, + "load_balancers": acctest.RepresentationGroup{RepType: acctest.Optional, Group: CoreInstancePoolLoadBalancersRepresentation}, + "instance_display_name_formatter": acctest.Representation{RepType: acctest.Optional, Create: `host-$${launchCount}`, Update: `host2-$${launchCount}`}, + "instance_hostname_formatter": acctest.Representation{RepType: acctest.Optional, Create: `host-$${launchCount}`, Update: `host2-$${launchCount}`}, } CoreInstancePoolRepresentationWithLifecycleSizeIgnoreChanges = map[string]interface{}{ @@ -148,8 +150,8 @@ var ( CoreInstancePoolResourceDependencies = utils.OciImageIdsVariable + acctest.GenerateResourceFromRepresentationMap("oci_core_instance_configuration", "test_instance_configuration", acctest.Optional, acctest.Create, acctest.GetUpdatedRepresentationCopy("instance_details.launch_details.launch_options", instanceLaunchOptionsRepresentationForInstanceConfiguration, CoreInstancePoolConfigurationPoolRepresentation)) + acctest.GenerateResourceFromRepresentationMap("oci_core_instance", "test_instance", acctest.Required, acctest.Create, CoreInstanceRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Required, acctest.Create, CoreSubnetRepresentation) + - acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Required, acctest.Create, CoreVcnRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_subnet", "test_subnet", acctest.Optional, acctest.Create, CoreSubnetRepresentation) + + acctest.GenerateResourceFromRepresentationMap("oci_core_vcn", "test_vcn", acctest.Optional, acctest.Create, CoreVcnRepresentation) + AvailabilityDomainConfig + DefinedTagsDependencies + acctest.GenerateResourceFromRepresentationMap("oci_load_balancer_backend_set", "test_backend_set", acctest.Required, acctest.Create, backendSetRepresentation) + @@ -216,6 +218,8 @@ func TestCoreInstancePoolResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "instance_configuration_id"), + resource.TestCheckResourceAttr(resourceName, "instance_display_name_formatter", "host-${launchCount}"), + resource.TestCheckResourceAttr(resourceName, "instance_hostname_formatter", "host-${launchCount}"), resource.TestCheckResourceAttr(resourceName, "load_balancers.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "load_balancers.0.backend_set_name"), resource.TestCheckResourceAttrSet(resourceName, "load_balancers.0.id"), @@ -260,6 +264,8 @@ func TestCoreInstancePoolResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "instance_configuration_id"), + resource.TestCheckResourceAttr(resourceName, "instance_display_name_formatter", "host-${launchCount}"), + resource.TestCheckResourceAttr(resourceName, "instance_hostname_formatter", "host-${launchCount}"), resource.TestCheckResourceAttr(resourceName, "load_balancers.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "load_balancers.0.backend_set_name"), resource.TestCheckResourceAttrSet(resourceName, "load_balancers.0.id"), @@ -296,6 +302,8 @@ func TestCoreInstancePoolResource_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(resourceName, "id"), resource.TestCheckResourceAttrSet(resourceName, "instance_configuration_id"), + resource.TestCheckResourceAttr(resourceName, "instance_display_name_formatter", "host2-${launchCount}"), + resource.TestCheckResourceAttr(resourceName, "instance_hostname_formatter", "host2-${launchCount}"), resource.TestCheckResourceAttr(resourceName, "load_balancers.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "load_balancers.0.backend_set_name"), resource.TestCheckResourceAttrSet(resourceName, "load_balancers.0.id"), @@ -487,6 +495,8 @@ func TestCoreInstancePoolResource_basic(t *testing.T) { resource.TestCheckResourceAttr(singularDatasourceName, "display_name", "displayName2"), resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "instance_display_name_formatter", "host2-${launchCount}"), + resource.TestCheckResourceAttr(singularDatasourceName, "instance_hostname_formatter", "host2-${launchCount}"), resource.TestCheckResourceAttr(singularDatasourceName, "load_balancers.#", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "load_balancers.0.id"), resource.TestCheckResourceAttrSet(singularDatasourceName, "load_balancers.0.instance_pool_id"), diff --git a/internal/integrationtest/database_autonomous_vm_cluster_ords_certificate_management_test.go b/internal/integrationtest/database_autonomous_vm_cluster_ords_certificate_management_test.go new file mode 100644 index 00000000000..dccf34ed9a1 --- /dev/null +++ b/internal/integrationtest/database_autonomous_vm_cluster_ords_certificate_management_test.go @@ -0,0 +1,102 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "strconv" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + certificateId = utils.GetEnvSettingWithBlankDefault("avm_certificate_id") + certificateVariableStr = fmt.Sprintf("variable \"avm_certificate_id\" { default = \"%s\" }\n", certificateId) + DatabaseAutonomousVmClusterOrdsCertificateManagementRepresentation = map[string]interface{}{ + "autonomous_vm_cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id}`}, + "certificate_generation_type": acctest.Representation{RepType: acctest.Required, Create: `BYOC`}, + "certificate_id": acctest.Representation{RepType: acctest.Required, Create: `${var.avm_certificate_id}`}, + } + + //DatabaseAutonomousVmClusterOrdsSystemCertificateManagementRepresentation = map[string]interface{}{ + // "autonomous_vm_cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id}`}, + // "certificate_generation_type": acctest.Representation{RepType: acctest.Required, Create: `SYSTEM`}, + //} + + DatabaseAutonomousVmClusterOrdsManagementResourceDependencies = certificateVariableStr + DatabaseAutonomousVmClusterResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster", acctest.Required, acctest.Create, DatabaseAutonomousVmClusterRepresentation) +) + +// issue-routing-tag: database/ExaCC +func TestDatabaseAutonomousVmClusterOrdsCertificateManagementResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatabaseAutonomousVmClusterOrdsCertificateManagementResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_database_autonomous_vm_cluster_ords_certificate_management.test_autonomous_vm_cluster_ords_certificate_management" + singularDatasourceName := "data.oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster" + + var resId string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+DatabaseAutonomousVmClusterOrdsManagementResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster_ords_certificate_management", "test_autonomous_vm_cluster_ords_certificate_management", acctest.Required, acctest.Create, DatabaseAutonomousVmClusterOrdsCertificateManagementRepresentation), "database", "autonomousVmClusterOrdsCertificateManagement", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterOrdsManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster_ords_certificate_management", "test_autonomous_vm_cluster_ords_certificate_management", acctest.Required, acctest.Create, DatabaseAutonomousVmClusterOrdsCertificateManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "autonomous_vm_cluster_id"), + resource.TestCheckResourceAttr(resourceName, "certificate_generation_type", "BYOC"), + resource.TestCheckResourceAttrSet(resourceName, "certificate_id"), + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterOrdsManagementResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterOrdsManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster_ords_certificate_management", "test_autonomous_vm_cluster_ords_certificate_management", acctest.Optional, acctest.Create, DatabaseAutonomousVmClusterOrdsCertificateManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "autonomous_vm_cluster_id"), + resource.TestCheckResourceAttr(resourceName, "certificate_generation_type", "BYOC"), + resource.TestCheckResourceAttrSet(resourceName, "certificate_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterOrdsManagementResourceDependencies + + acctest.GenerateDataSourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster", acctest.Required, acctest.Create, DatabaseDatabaseAutonomousVmClusterSingularDataSourceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "autonomous_vm_cluster_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_ords_certificate_expires"), + ), + }, + }) +} diff --git a/internal/integrationtest/database_autonomous_vm_cluster_ssl_certificate_management_test.go b/internal/integrationtest/database_autonomous_vm_cluster_ssl_certificate_management_test.go new file mode 100644 index 00000000000..507f2257887 --- /dev/null +++ b/internal/integrationtest/database_autonomous_vm_cluster_ssl_certificate_management_test.go @@ -0,0 +1,106 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "fmt" + "strconv" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + + "github.com/oracle/terraform-provider-oci/httpreplay" + "github.com/oracle/terraform-provider-oci/internal/acctest" + "github.com/oracle/terraform-provider-oci/internal/resourcediscovery" + + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + DatabaseAutonomousVmClusterSslCertificateManagementRepresentation = map[string]interface{}{ + "autonomous_vm_cluster_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id}`}, + "certificate_generation_type": acctest.Representation{RepType: acctest.Required, Create: `BYOC`}, + "certificate_id": acctest.Representation{RepType: acctest.Required, Create: `${var.avm_certificate_id}`}, + } + + DatabaseAutonomousVmClusterSslManagementResourceDependencies = DatabaseAutonomousVmClusterResourceDependencies + certificateVariableStr + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster", acctest.Required, acctest.Create, DatabaseAutonomousVmClusterRepresentation) + + //DatabaseAutonomousVmClusterSslCertificateManagementResourceDependencies = acctest.GenerateResourceFromRepresentationMap("oci_apigateway_certificate", "test_certificate", acctest.Required, acctest.Create, certificateRepresentation) + + // GenerateResourceFromRepresentationMap("oci_apigateway_certificate", "test_certificate", Required, Create, apiGatewaycertificateRepresentation) + + // acctest.GenerateResourceFromRepresentationMap("oci_certificates_management_ca_bundle", "test_ca_bundle", acctest.Required, acctest.Create, caBundleRepresentation) + + // acctest.GenerateResourceFromRepresentationMap("oci_certificates_management_certificate_authority", "test_certificate_authority", acctest.Required, acctest.Create, certificateAuthorityRepresentation) + + // acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster", acctest.Required, acctest.Create, autonomousVmClusterRepresentation) + + // acctest.GenerateResourceFromRepresentationMap("oci_database_exadata_infrastructure", "test_exadata_infrastructure", acctest.Required, acctest.Create, exadataInfrastructureRepresentation) + + // acctest.GenerateResourceFromRepresentationMap("oci_database_vm_cluster_network", "test_vm_cluster_network", acctest.Required, acctest.Create, vmClusterNetworkRepresentation) + + // KeyResourceDependencyConfig + + // acctest.GenerateResourceFromRepresentationMap("oci_objectstorage_bucket", "test_bucket", acctest.Required, acctest.Create, bucketRepresentation) + + // GenerateDataSourceFromRepresentationMap("oci_objectstorage_namespace", "test_namespace", Required, Create, namespaceSingularDataSourceRepresentation) +) + +// issue-routing-tag: database/ExaCC +func TestDatabaseAutonomousVmClusterSslCertificateManagementResource_basic(t *testing.T) { + httpreplay.SetScenario("TestDatabaseAutonomousVmClusterSslCertificateManagementResource_basic") + defer httpreplay.SaveScenario() + + config := acctest.ProviderTestConfig() + + compartmentId := utils.GetEnvSettingWithBlankDefault("compartment_ocid") + compartmentIdVariableStr := fmt.Sprintf("variable \"compartment_id\" { default = \"%s\" }\n", compartmentId) + + resourceName := "oci_database_autonomous_vm_cluster_ssl_certificate_management.test_autonomous_vm_cluster_ssl_certificate_management" + singularDatasourceName := "data.oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster" + + var resId string + // Save TF content to Create resource with optional properties. This has to be exactly the same as the config part in the "create with optionals" step in the test. + acctest.SaveConfigContent(config+compartmentIdVariableStr+DatabaseAutonomousVmClusterSslManagementResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster_ssl_certificate_management", "test_autonomous_vm_cluster_ssl_certificate_management", acctest.Required, acctest.Create, DatabaseAutonomousVmClusterSslCertificateManagementRepresentation), "database", "autonomousVmClusterSslCertificateManagement", t) + + acctest.ResourceTest(t, nil, []resource.TestStep{ + // verify Create + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterSslManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster_ssl_certificate_management", "test_autonomous_vm_cluster_ssl_certificate_management", acctest.Required, acctest.Create, DatabaseAutonomousVmClusterSslCertificateManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "autonomous_vm_cluster_id"), + resource.TestCheckResourceAttr(resourceName, "certificate_generation_type", "BYOC"), + resource.TestCheckResourceAttrSet(resourceName, "certificate_id"), + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterSslManagementResourceDependencies, + }, + // verify Create with optionals + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterSslManagementResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster_ssl_certificate_management", "test_autonomous_vm_cluster_ssl_certificate_management", acctest.Optional, acctest.Create, DatabaseAutonomousVmClusterSslCertificateManagementRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(resourceName, "autonomous_vm_cluster_id"), + resource.TestCheckResourceAttr(resourceName, "certificate_generation_type", "BYOC"), + resource.TestCheckResourceAttrSet(resourceName, "certificate_id"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + { + Config: config + compartmentIdVariableStr + DatabaseAutonomousVmClusterOrdsManagementResourceDependencies + + acctest.GenerateDataSourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster", acctest.Required, acctest.Create, DatabaseDatabaseAutonomousVmClusterSingularDataSourceRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "autonomous_vm_cluster_id"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_database_ssl_certificate_expires"), + ), + }, + }) +} diff --git a/internal/integrationtest/database_autonomous_vm_cluster_test.go b/internal/integrationtest/database_autonomous_vm_cluster_test.go index f171c3c426d..4bcca4173cd 100644 --- a/internal/integrationtest/database_autonomous_vm_cluster_test.go +++ b/internal/integrationtest/database_autonomous_vm_cluster_test.go @@ -48,11 +48,11 @@ var ( } DatabaseAutonomousVmClusterRepresentation = map[string]interface{}{ - "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, - "display_name": acctest.Representation{RepType: acctest.Required, Create: `autonomousVmCluster`}, - "exadata_infrastructure_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_exadata_infrastructure.test_exadata_infrastructure.id}`}, - "vm_cluster_network_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_vm_cluster_network.test_vm_cluster_network.id}`}, - "compute_model": acctest.Representation{RepType: acctest.Optional, Create: `OCPU`}, + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "display_name": acctest.Representation{RepType: acctest.Required, Create: `autonomousVmCluster`}, + "exadata_infrastructure_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_exadata_infrastructure.test_exadata_infrastructure.id}`}, + "vm_cluster_network_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_database_vm_cluster_network.test_vm_cluster_network.id}`}, + //"compute_model": acctest.Representation{RepType: acctest.Optional, Create: `OCPU`}, "autonomous_data_storage_size_in_tbs": acctest.Representation{RepType: acctest.Required, Create: `2.0`}, "cpu_core_count_per_node": acctest.Representation{RepType: acctest.Required, Create: `10`}, "db_servers": acctest.Representation{RepType: acctest.Optional, Create: []string{`${data.oci_database_db_servers.test_db_servers.db_servers.0.id}`, `${data.oci_database_db_servers.test_db_servers.db_servers.1.id}`}}, @@ -166,14 +166,14 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster", acctest.Optional, acctest.Create, DatabaseAutonomousVmClusterRepresentation) + acctest.GenerateResourceFromRepresentationMap("oci_database_autonomous_vm_cluster", "test_autonomous_vm_cluster1", acctest.Optional, acctest.Create, acctest.RepresentationCopyWithNewProperties(DatabaseAutonomousVmClusterRepresentation, map[string]interface{}{ - "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, + // "compute_model": acctest.Representation{RepType: acctest.Required, Create: `ECPU`}, "display_name": acctest.Representation{RepType: acctest.Required, Create: "testAVM2"}, "vm_cluster_network_id": acctest.Representation{RepType: acctest.Required, Create: "${oci_database_vm_cluster_network.test_vm_cluster_network2.id}"}, })), Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName1, "compartment_id", compartmentId), resource.TestCheckResourceAttr(resourceName1, "display_name", "testAVM2"), - resource.TestCheckResourceAttr(resourceName1, "compute_model", "ECPU"), + //resource.TestCheckResourceAttr(resourceName1, "compute_model", "OCPU"), resource.TestCheckResourceAttrSet(resourceName1, "exadata_infrastructure_id"), resource.TestCheckResourceAttrSet(resourceName1, "vm_cluster_network_id"), @@ -195,7 +195,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "autonomous_data_storage_size_in_tbs", "2"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttr(resourceName, "compute_model", "OCPU"), + //resource.TestCheckResourceAttr(resourceName, "compute_model", "OCPU"), resource.TestCheckResourceAttr(resourceName, "cpu_core_count_per_node", "10"), resource.TestCheckResourceAttr(resourceName, "db_servers.#", "2"), resource.TestCheckResourceAttr(resourceName, "display_name", "autonomousVmCluster"), @@ -244,7 +244,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "autonomous_data_storage_size_in_tbs", "2"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentIdU), - resource.TestCheckResourceAttr(resourceName, "compute_model", "OCPU"), + //resource.TestCheckResourceAttr(resourceName, "compute_model", "OCPU"), resource.TestCheckResourceAttr(resourceName, "cpu_core_count_per_node", "10"), resource.TestCheckResourceAttr(resourceName, "db_servers.#", "2"), resource.TestCheckResourceAttr(resourceName, "display_name", "autonomousVmCluster"), @@ -288,7 +288,7 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { Check: acctest.ComposeAggregateTestCheckFuncWrapper( resource.TestCheckResourceAttr(resourceName, "autonomous_data_storage_size_in_tbs", "2"), resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttr(resourceName, "compute_model", "OCPU"), + //resource.TestCheckResourceAttr(resourceName, "compute_model", "OCPU"), resource.TestCheckResourceAttr(resourceName, "cpu_core_count_per_node", "10"), resource.TestCheckResourceAttr(resourceName, "db_servers.#", "2"), resource.TestCheckResourceAttr(resourceName, "display_name", "autonomousVmCluster"), @@ -342,10 +342,10 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.available_container_databases"), //resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.autonomous_data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.available_cpus"), - resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.compute_model", "OCPU"), + //resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.compute_model", "OCPU"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.available_data_storage_size_in_tbs"), resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.compartment_id", compartmentId), - resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.compute_model", "OCPU"), + //resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.compute_model", "OCPU"), resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.cpu_core_count_per_node", "10"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.cpus_enabled"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.data_storage_size_in_tbs"), @@ -369,6 +369,9 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { //resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.ocpus_enabled"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.state"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.time_created"), + // these are set only when certificate is rotated + //resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.time_database_ssl_certificate_expires"), + //resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.time_ords_certificate_expires"), resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.time_zone", "US/Pacific"), resource.TestCheckResourceAttr(datasourceName, "autonomous_vm_clusters.0.total_container_databases", "2"), resource.TestCheckResourceAttrSet(datasourceName, "autonomous_vm_clusters.0.vm_cluster_network_id"), @@ -388,9 +391,9 @@ func TestDatabaseAutonomousVmClusterResource_basic(t *testing.T) { //resource.TestCheckResourceAttr(singularDatasourceName, "autonomous_data_storage_size_in_tbs", "1"), resource.TestCheckResourceAttrSet(singularDatasourceName, "available_cpus"), resource.TestCheckResourceAttrSet(singularDatasourceName, "available_data_storage_size_in_tbs"), - resource.TestCheckResourceAttr(singularDatasourceName, "compute_model", "OCPU"), + //resource.TestCheckResourceAttr(singularDatasourceName, "compute_model", "OCPU"), resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), - resource.TestCheckResourceAttr(singularDatasourceName, "compute_model", "OCPU"), + //resource.TestCheckResourceAttr(singularDatasourceName, "compute_model", "OCPU"), resource.TestCheckResourceAttr(singularDatasourceName, "cpu_core_count_per_node", "10"), resource.TestCheckResourceAttrSet(singularDatasourceName, "cpus_enabled"), resource.TestCheckResourceAttrSet(singularDatasourceName, "data_storage_size_in_tbs"), diff --git a/internal/integrationtest/opsi_news_report_test.go b/internal/integrationtest/opsi_news_report_test.go new file mode 100644 index 00000000000..6e2fde51c9d --- /dev/null +++ b/internal/integrationtest/opsi_news_report_test.go @@ -0,0 +1,395 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package integrationtest + +import ( + "context" + "fmt" + "strconv" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/oracle/oci-go-sdk/v65/common" + oci_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/resourcediscovery" + "github.com/oracle/terraform-provider-oci/internal/tfresource" + "github.com/oracle/terraform-provider-oci/internal/utils" +) + +var ( + OpsiNewsReportRequiredOnlyResource = OpsiNewsReportResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Required, acctest.Create, OpsiNewsReportRepresentation) + + OpsiNewsReportResourceConfig = OpsiNewsReportResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Optional, acctest.Update, OpsiNewsReportRepresentation) + + OpsiNewsReportSingularDataSourceRepresentation = map[string]interface{}{ + "news_report_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_opsi_news_report.test_news_report.id}`}, + } + + OpsiNewsReportDataSourceRepresentation = 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`}, + "news_report_id": acctest.Representation{RepType: acctest.Optional, Create: `${oci_opsi_news_report.test_news_report.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: OpsiNewsReportDataSourceFilterRepresentation}, + } + + OpsiNewsReportDataSourceFilterRepresentation = map[string]interface{}{ + "name": acctest.Representation{RepType: acctest.Required, Create: `id`}, + "values": acctest.Representation{RepType: acctest.Required, Create: []string{`${oci_opsi_news_report.test_news_report.id}`}}, + } + + OpsiNewsReportRepresentation = map[string]interface{}{ + "compartment_id": acctest.Representation{RepType: acctest.Required, Create: `${var.compartment_id}`}, + "content_types": acctest.RepresentationGroup{RepType: acctest.Required, Group: OpsiNewsReportContentTypesRepresentation}, + "description": acctest.Representation{RepType: acctest.Required, Create: `TF_TEST_REPORT`}, + "locale": acctest.Representation{RepType: acctest.Required, Create: `EN`}, + "name": acctest.Representation{RepType: acctest.Required, Create: `TF_TEST_REPORT`}, + "news_frequency": acctest.Representation{RepType: acctest.Required, Create: `WEEKLY`}, + "ons_topic_id": acctest.Representation{RepType: acctest.Required, Create: `${var.topic_id}`}, + "defined_tags": acctest.Representation{RepType: acctest.Optional, Create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, Update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`}, + "freeform_tags": acctest.Representation{RepType: acctest.Optional, Create: map[string]string{"bar-key": "value"}, Update: map[string]string{"Department": "Accounting"}}, + "status": acctest.Representation{RepType: acctest.Optional, Create: `ENABLED`, Update: `DISABLED`}, + "lifecycle": acctest.RepresentationGroup{RepType: acctest.Required, Group: ignoreChangesNewsReportRepresentation}, + } + + OpsiNewsReportContentTypesRepresentation = map[string]interface{}{ + "capacity_planning_resources": acctest.Representation{RepType: acctest.Required, Create: []string{`HOST`, `DATABASE`}, Update: []string{`HOST`, `DATABASE`, `EXADATA`}}, + } + + ignoreChangesNewsReportRepresentation = map[string]interface{}{ + "ignore_changes": acctest.Representation{RepType: acctest.Required, Create: []string{`defined_tags`}}, + } + + OpsiNewsReportResourceDependencies = DefinedTagsDependencies +) + +// issue-routing-tag: opsi/controlPlane +func TestOpsiNewsReportResource_basic(t *testing.T) { + httpreplay.SetScenario("TestOpsiNewsReportResource_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) + + onsTopicId := utils.GetEnvSettingWithBlankDefault("topic_id") + if onsTopicId == "" { + t.Skip("Provision topic and set topic id to run this test") + } + topicIdVariableStr := fmt.Sprintf("variable \"topic_id\" { default = \"%s\" }\n", onsTopicId) + + resourceName := "oci_opsi_news_report.test_news_report" + datasourceName := "data.oci_opsi_news_reports.test_news_reports" + singularDatasourceName := "data.oci_opsi_news_report.test_news_report" + + 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+topicIdVariableStr+OpsiNewsReportResourceDependencies+ + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Optional, acctest.Create, OpsiNewsReportRepresentation), "opsi", "newsReport", t) + + acctest.ResourceTest(t, testAccCheckOpsiNewsReportDestroy, []resource.TestStep{ + //Step - Verify Create with Required + { + Config: config + compartmentIdVariableStr + topicIdVariableStr + OpsiNewsReportResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Required, acctest.Create, OpsiNewsReportRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "content_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "content_types.0.capacity_planning_resources.#", "2"), + resource.TestCheckResourceAttr(resourceName, "description", "TF_TEST_REPORT"), + //resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "locale", "EN"), + resource.TestCheckResourceAttr(resourceName, "name", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(resourceName, "news_frequency", "WEEKLY"), + resource.TestCheckResourceAttrSet(resourceName, "ons_topic_id"), + //resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + + // delete before next Create + { + Config: config + compartmentIdVariableStr + OpsiNewsReportResourceDependencies, + }, + + //Step - Verify Create with Optionals + { + Config: config + compartmentIdVariableStr + topicIdVariableStr + OpsiNewsReportResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Optional, acctest.Create, OpsiNewsReportRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "content_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "content_types.0.capacity_planning_resources.#", "2"), + resource.TestCheckResourceAttr(resourceName, "description", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "locale", "EN"), + resource.TestCheckResourceAttr(resourceName, "name", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(resourceName, "news_frequency", "WEEKLY"), + resource.TestCheckResourceAttrSet(resourceName, "ons_topic_id"), + resource.TestCheckResourceAttr(resourceName, "status", "ENABLED"), + + func(s *terraform.State) (err error) { + resId, err = acctest.FromInstanceState(s, resourceName, "id") + if isEnableExportCompartment, _ := strconv.ParseBool(utils.GetEnvSettingWithDefault("enable_export_compartment", "true")); isEnableExportCompartment { + if errExport := resourcediscovery.TestExportCompartmentWithResourceName(&resId, &compartmentId, resourceName); errExport != nil { + return errExport + } + } + return err + }, + ), + }, + + //Step 1 - verify Update to the compartment (the compartment will be switched back in the next step) + { + Config: config + compartmentIdVariableStr + topicIdVariableStr + compartmentIdUVariableStr + OpsiNewsReportResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Optional, acctest.Create, + acctest.RepresentationCopyWithNewProperties(OpsiNewsReportRepresentation, 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, "content_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "content_types.0.capacity_planning_resources.#", "2"), + resource.TestCheckResourceAttr(resourceName, "description", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "locale", "EN"), + resource.TestCheckResourceAttr(resourceName, "name", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(resourceName, "news_frequency", "WEEKLY"), + resource.TestCheckResourceAttrSet(resourceName, "ons_topic_id"), + 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 + }, + ), + }, + + //Step 2 - verify updates to updatable parameters + { + Config: config + compartmentIdVariableStr + topicIdVariableStr + OpsiNewsReportResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Optional, acctest.Update, OpsiNewsReportRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(resourceName, "content_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "content_types.0.capacity_planning_resources.#", "3"), + resource.TestCheckResourceAttr(resourceName, "description", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(resourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "locale", "EN"), + resource.TestCheckResourceAttr(resourceName, "name", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(resourceName, "news_frequency", "WEEKLY"), + resource.TestCheckResourceAttrSet(resourceName, "ons_topic_id"), + resource.TestCheckResourceAttr(resourceName, "status", "DISABLED"), + + 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 3 - verify datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_opsi_news_reports", "test_news_reports", acctest.Optional, acctest.Update, OpsiNewsReportDataSourceRepresentation) + + compartmentIdVariableStr + topicIdVariableStr + OpsiNewsReportResourceDependencies + + acctest.GenerateResourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Optional, acctest.Update, OpsiNewsReportRepresentation), + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttr(datasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"), + resource.TestCheckResourceAttrSet(datasourceName, "news_report_id"), + resource.TestCheckResourceAttr(datasourceName, "state.#", "1"), + //resource.TestCheckResourceAttr(datasourceName, "status.#", "1"), //status is not a list + + resource.TestCheckResourceAttr(datasourceName, "news_report_collection.#", "1"), + resource.TestCheckResourceAttr(datasourceName, "news_report_collection.0.items.#", "1"), + ), + }, + //Step 4 - verify singular datasource + { + Config: config + + acctest.GenerateDataSourceFromRepresentationMap("oci_opsi_news_report", "test_news_report", acctest.Required, acctest.Create, OpsiNewsReportSingularDataSourceRepresentation) + + compartmentIdVariableStr + topicIdVariableStr + OpsiNewsReportResourceConfig, + Check: acctest.ComposeAggregateTestCheckFuncWrapper( + resource.TestCheckResourceAttrSet(singularDatasourceName, "news_report_id"), + + resource.TestCheckResourceAttr(singularDatasourceName, "compartment_id", compartmentId), + resource.TestCheckResourceAttr(singularDatasourceName, "content_types.#", "1"), + resource.TestCheckResourceAttr(singularDatasourceName, "content_types.0.capacity_planning_resources.#", "3"), + resource.TestCheckResourceAttr(singularDatasourceName, "description", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(singularDatasourceName, "freeform_tags.%", "1"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "id"), + resource.TestCheckResourceAttr(singularDatasourceName, "locale", "EN"), + resource.TestCheckResourceAttr(singularDatasourceName, "name", "TF_TEST_REPORT"), + resource.TestCheckResourceAttr(singularDatasourceName, "news_frequency", "WEEKLY"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "state"), + resource.TestCheckResourceAttr(singularDatasourceName, "status", "DISABLED"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_created"), + resource.TestCheckResourceAttrSet(singularDatasourceName, "time_updated"), + ), + }, + //Step 5 - verify resource import + { + Config: config + OpsiNewsReportRequiredOnlyResource, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{}, + ResourceName: resourceName, + }, + }) +} + +func testAccCheckOpsiNewsReportDestroy(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_news_report" { + noResourceFound = false + request := oci_opsi.GetNewsReportRequest{} + + tmp := rs.Primary.ID + request.NewsReportId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + + response, err := client.GetNewsReport(context.Background(), request) + + if err == nil { + deletedLifecycleStates := map[string]bool{ + string(oci_opsi.LifecycleStateDeleted): 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("OpsiNewsReport") { + resource.AddTestSweepers("OpsiNewsReport", &resource.Sweeper{ + Name: "OpsiNewsReport", + Dependencies: acctest.DependencyGraph["newsReport"], + F: sweepOpsiNewsReportResource, + }) + } +} + +func sweepOpsiNewsReportResource(compartment string) error { + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + newsReportIds, err := getOpsiNewsReportIds(compartment) + if err != nil { + return err + } + for _, newsReportId := range newsReportIds { + if ok := acctest.SweeperDefaultResourceId[newsReportId]; !ok { + deleteNewsReportRequest := oci_opsi.DeleteNewsReportRequest{} + + deleteNewsReportRequest.NewsReportId = &newsReportId + + deleteNewsReportRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(true, "opsi") + _, error := operationsInsightsClient.DeleteNewsReport(context.Background(), deleteNewsReportRequest) + if error != nil { + fmt.Printf("Error deleting NewsReport %s %s, It is possible that the resource is already deleted. Please verify manually \n", newsReportId, error) + continue + } + acctest.WaitTillCondition(acctest.TestAccProvider, &newsReportId, OpsiNewsReportSweepWaitCondition, time.Duration(3*time.Minute), + OpsiNewsReportSweepResponseFetchOperation, "opsi", true) + } + } + return nil +} + +func getOpsiNewsReportIds(compartment string) ([]string, error) { + ids := acctest.GetResourceIdsToSweep(compartment, "NewsReportId") + if ids != nil { + return ids, nil + } + var resourceIds []string + compartmentId := compartment + operationsInsightsClient := acctest.GetTestClients(&schema.ResourceData{}).OperationsInsightsClient() + + listNewsReportsRequest := oci_opsi.ListNewsReportsRequest{} + listNewsReportsRequest.CompartmentId = &compartmentId + //listNewsReportsRequest.LifecycleState = oci_opsi.ListNewsReportsLifecycleStateActiveNeedsAttention + listNewsReportsResponse, err := operationsInsightsClient.ListNewsReports(context.Background(), listNewsReportsRequest) + + if err != nil { + return resourceIds, fmt.Errorf("Error getting NewsReport list for compartment id : %s , %s \n", compartmentId, err) + } + for _, newsReport := range listNewsReportsResponse.Items { + id := *newsReport.Id + resourceIds = append(resourceIds, id) + acctest.AddResourceIdToSweeperResourceIdMap(compartmentId, "NewsReportId", id) + } + return resourceIds, nil +} + +func OpsiNewsReportSweepWaitCondition(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 newsReportResponse, ok := response.Response.(oci_opsi.GetNewsReportResponse); ok { + return newsReportResponse.LifecycleState != oci_opsi.LifecycleStateDeleted + } + return false +} + +func OpsiNewsReportSweepResponseFetchOperation(client *tf_client.OracleClients, resourceId *string, retryPolicy *common.RetryPolicy) error { + _, err := client.OperationsInsightsClient().GetNewsReport(context.Background(), oci_opsi.GetNewsReportRequest{ + NewsReportId: resourceId, + RequestMetadata: common.RequestMetadata{ + RetryPolicy: retryPolicy, + }, + }) + return err +} diff --git a/internal/provider/register_datasource.go b/internal/provider/register_datasource.go index 9aec070b572..80b52742071 100644 --- a/internal/provider/register_datasource.go +++ b/internal/provider/register_datasource.go @@ -23,6 +23,7 @@ import ( tf_bds "github.com/oracle/terraform-provider-oci/internal/service/bds" tf_blockchain "github.com/oracle/terraform-provider-oci/internal/service/blockchain" tf_budget "github.com/oracle/terraform-provider-oci/internal/service/budget" + tf_certificates "github.com/oracle/terraform-provider-oci/internal/service/certificates" tf_certificates_management "github.com/oracle/terraform-provider-oci/internal/service/certificates_management" tf_cloud_bridge "github.com/oracle/terraform-provider-oci/internal/service/cloud_bridge" tf_cloud_guard "github.com/oracle/terraform-provider-oci/internal/service/cloud_guard" @@ -132,6 +133,7 @@ func init() { tf_bds.RegisterDatasource() tf_blockchain.RegisterDatasource() tf_budget.RegisterDatasource() + tf_certificates.RegisterDatasource() tf_certificates_management.RegisterDatasource() tf_cloud_bridge.RegisterDatasource() tf_cloud_guard.RegisterDatasource() diff --git a/internal/service/ai_document/ai_document_model_data_source.go b/internal/service/ai_document/ai_document_model_data_source.go index 79bf548eb3a..c5a8f8788d4 100644 --- a/internal/service/ai_document/ai_document_model_data_source.go +++ b/internal/service/ai_document/ai_document_model_data_source.go @@ -66,10 +66,20 @@ func (s *AiDocumentModelDataSourceCrud) SetData() error { s.D.SetId(*s.Res.Id) + if s.Res.AliasName != nil { + s.D.Set("alias_name", *s.Res.AliasName) + } + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } + componentModels := []interface{}{} + for _, item := range s.Res.ComponentModels { + componentModels = append(componentModels, ComponentModelToMap(item)) + } + s.D.Set("component_models", componentModels) + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } @@ -85,6 +95,10 @@ func (s *AiDocumentModelDataSourceCrud) SetData() error { s.D.Set("freeform_tags", s.Res.FreeformTags) s.D.Set("freeform_tags", s.Res.FreeformTags) + if s.Res.IsComposedModel != nil { + s.D.Set("is_composed_model", *s.Res.IsComposedModel) + } + if s.Res.IsQuickMode != nil { s.D.Set("is_quick_mode", *s.Res.IsQuickMode) } @@ -126,6 +140,10 @@ func (s *AiDocumentModelDataSourceCrud) SetData() error { s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) } + if s.Res.TenancyId != nil { + s.D.Set("tenancy_id", *s.Res.TenancyId) + } + if s.Res.TestingDataset != nil { testingDatasetArray := []interface{}{} if testingDatasetMap := DatasetToMap(&s.Res.TestingDataset); testingDatasetMap != nil { diff --git a/internal/service/ai_document/ai_document_model_resource.go b/internal/service/ai_document/ai_document_model_resource.go index ffaa1533e6b..5f4463a8984 100644 --- a/internal/service/ai_document/ai_document_model_resource.go +++ b/internal/service/ai_document/ai_document_model_resource.go @@ -46,6 +46,11 @@ func AiDocumentModelResource() *schema.Resource { Type: schema.TypeString, Required: true, }, + "model_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, "model_type": { Type: schema.TypeString, Required: true, @@ -56,46 +61,19 @@ func AiDocumentModelResource() *schema.Resource { Required: true, ForceNew: true, }, - "training_dataset": { + + // Optional + "component_models": { Type: schema.TypeList, - Required: true, + Optional: true, + Computed: true, ForceNew: true, - MaxItems: 1, - MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // Required - "dataset_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, - ValidateFunc: validation.StringInSlice([]string{ - "DATA_SCIENCE_LABELING", - "OBJECT_STORAGE", - }, true), - }, // Optional - "bucket": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "dataset_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "namespace": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "object": { + "model_id": { Type: schema.TypeString, Optional: true, Computed: true, @@ -106,8 +84,6 @@ func AiDocumentModelResource() *schema.Resource { }, }, }, - - // Optional "defined_tags": { Type: schema.TypeMap, Optional: true, @@ -200,6 +176,57 @@ func AiDocumentModelResource() *schema.Resource { }, }, }, + "training_dataset": { + Type: schema.TypeList, + Optional: true, + Computed: true, + ForceNew: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "dataset_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "DATA_SCIENCE_LABELING", + "OBJECT_STORAGE", + }, true), + }, + + // Optional + "bucket": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "dataset_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "namespace": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "object": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + }, + }, "validation_dataset": { Type: schema.TypeList, Optional: true, @@ -253,6 +280,10 @@ func AiDocumentModelResource() *schema.Resource { }, // Computed + "is_composed_model": { + Type: schema.TypeBool, + Computed: true, + }, "labels": { Type: schema.TypeList, Computed: true, @@ -427,6 +458,10 @@ func AiDocumentModelResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "tenancy_id": { + Type: schema.TypeString, + Computed: true, + }, "time_created": { Type: schema.TypeString, Computed: true, @@ -519,6 +554,23 @@ func (s *AiDocumentModelResourceCrud) Create() error { request.CompartmentId = &tmp } + if componentModels, ok := s.D.GetOkExists("component_models"); ok { + interfaces := componentModels.([]interface{}) + tmp := make([]oci_ai_document.ComponentModel, len(interfaces)) + for i := range interfaces { + stateDataIndex := i + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "component_models", stateDataIndex) + converted, err := s.mapToComponentModel(fieldKeyFormat) + if err != nil { + return err + } + tmp[i] = converted + } + if len(tmp) != 0 || s.D.HasChange("component_models") { + request.ComponentModels = tmp + } + } + if definedTags, ok := s.D.GetOkExists("defined_tags"); ok { convertedDefinedTags, err := tfresource.MapToDefinedTags(definedTags.(map[string]interface{})) if err != nil { @@ -606,7 +658,18 @@ func (s *AiDocumentModelResourceCrud) Create() error { } workId := response.OpcWorkRequestId - return s.getModelFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_document"), oci_ai_document.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) + var identifier *string + identifier = response.Id + if identifier != nil { + s.D.SetId(*identifier) + } + + err = s.getModelFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_document"), oci_ai_document.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) + if err != nil { + return err + } + + return nil } func (s *AiDocumentModelResourceCrud) getModelFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, @@ -798,7 +861,12 @@ func (s *AiDocumentModelResourceCrud) Update() error { } workId := response.OpcWorkRequestId - return s.getModelFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_document"), oci_ai_document.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + err = s.getModelFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "ai_document"), oci_ai_document.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) + if err != nil { + return err + } + + return nil } func (s *AiDocumentModelResourceCrud) Delete() error { @@ -822,10 +890,17 @@ func (s *AiDocumentModelResourceCrud) Delete() error { } func (s *AiDocumentModelResourceCrud) SetData() error { + if s.Res.CompartmentId != nil { s.D.Set("compartment_id", *s.Res.CompartmentId) } + componentModels := []interface{}{} + for _, item := range s.Res.ComponentModels { + componentModels = append(componentModels, ComponentModelToMap(item)) + } + s.D.Set("component_models", componentModels) + if s.Res.DefinedTags != nil { s.D.Set("defined_tags", tfresource.DefinedTagsToMap(s.Res.DefinedTags)) } @@ -841,6 +916,10 @@ func (s *AiDocumentModelResourceCrud) SetData() error { s.D.Set("freeform_tags", s.Res.FreeformTags) s.D.Set("freeform_tags", s.Res.FreeformTags) + if s.Res.IsComposedModel != nil { + s.D.Set("is_composed_model", *s.Res.IsComposedModel) + } + if s.Res.IsQuickMode != nil { s.D.Set("is_quick_mode", *s.Res.IsQuickMode) } @@ -882,6 +961,10 @@ func (s *AiDocumentModelResourceCrud) SetData() error { s.D.Set("system_tags", tfresource.SystemTagsToMap(s.Res.SystemTags)) } + if s.Res.TenancyId != nil { + s.D.Set("tenancy_id", *s.Res.TenancyId) + } + if s.Res.TestingDataset != nil { testingDatasetArray := []interface{}{} if testingDatasetMap := DatasetToMap(&s.Res.TestingDataset); testingDatasetMap != nil { @@ -927,6 +1010,27 @@ func (s *AiDocumentModelResourceCrud) SetData() error { return nil } +func ComponentModelToMap(obj oci_ai_document.ComponentModel) map[string]interface{} { + result := map[string]interface{}{} + + if obj.ModelId != nil { + result["model_id"] = string(*obj.ModelId) + } + + return result +} + +func (s *AiDocumentModelResourceCrud) mapToComponentModel(fieldKeyFormat string) (oci_ai_document.ComponentModel, error) { + var componentModel oci_ai_document.ComponentModel + + if modelId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "model_id")); ok { + tmp := modelId.(string) + componentModel.ModelId = &tmp + } + + return componentModel, nil +} + func (s *AiDocumentModelResourceCrud) mapToDataset(fieldKeyFormat string) (oci_ai_document.Dataset, error) { var baseObject oci_ai_document.Dataset //discriminator @@ -1382,6 +1486,12 @@ func ModelSummaryToMap(obj oci_ai_document.ModelSummary) map[string]interface{} result["compartment_id"] = string(*obj.CompartmentId) } + componentModels := []interface{}{} + for _, item := range obj.ComponentModels { + componentModels = append(componentModels, ComponentModelToMap(item)) + } + result["component_models"] = componentModels + if obj.DefinedTags != nil { result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) } @@ -1401,6 +1511,10 @@ func ModelSummaryToMap(obj oci_ai_document.ModelSummary) map[string]interface{} result["id"] = string(*obj.Id) } + if obj.IsComposedModel != nil { + result["is_composed_model"] = bool(*obj.IsComposedModel) + } + if obj.LifecycleDetails != nil { result["lifecycle_details"] = string(*obj.LifecycleDetails) } @@ -1425,6 +1539,10 @@ func ModelSummaryToMap(obj oci_ai_document.ModelSummary) map[string]interface{} result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) } + if obj.TenancyId != nil { + result["tenancy_id"] = string(*obj.TenancyId) + } + if obj.TestingDataset != nil { testingDatasetArray := []interface{}{} if testingDatasetMap := DatasetToMap(&obj.TestingDataset); testingDatasetMap != nil { diff --git a/internal/service/ai_document/ai_document_processor_job_resource.go b/internal/service/ai_document/ai_document_processor_job_resource.go index 4fb485fa0c5..fb055b3323a 100644 --- a/internal/service/ai_document/ai_document_processor_job_resource.go +++ b/internal/service/ai_document/ai_document_processor_job_resource.go @@ -179,6 +179,12 @@ func AiDocumentProcessorJobResource() *schema.Resource { Computed: true, ForceNew: true, }, + "tenancy_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, // Computed }, @@ -460,6 +466,10 @@ func (s *AiDocumentProcessorJobResourceCrud) mapToDocumentFeature(fieldKeyFormat tmp := modelId.(string) details.ModelId = &tmp } + if tenancyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "tenancy_id")); ok { + tmp := tenancyId.(string) + details.TenancyId = &tmp + } baseObject = details case strings.ToLower("KEY_VALUE_EXTRACTION"): details := oci_ai_document.DocumentKeyValueExtractionFeature{} @@ -467,6 +477,10 @@ func (s *AiDocumentProcessorJobResourceCrud) mapToDocumentFeature(fieldKeyFormat tmp := modelId.(string) details.ModelId = &tmp } + if tenancyId, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "tenancy_id")); ok { + tmp := tenancyId.(string) + details.TenancyId = &tmp + } baseObject = details case strings.ToLower("LANGUAGE_CLASSIFICATION"): details := oci_ai_document.DocumentLanguageClassificationFeature{} @@ -504,12 +518,20 @@ func DocumentFeatureToMap(obj oci_ai_document.DocumentFeature) map[string]interf if v.ModelId != nil { result["model_id"] = string(*v.ModelId) } + + if v.TenancyId != nil { + result["tenancy_id"] = string(*v.TenancyId) + } case oci_ai_document.DocumentKeyValueExtractionFeature: result["feature_type"] = "KEY_VALUE_EXTRACTION" if v.ModelId != nil { result["model_id"] = string(*v.ModelId) } + + if v.TenancyId != nil { + result["tenancy_id"] = string(*v.TenancyId) + } case oci_ai_document.DocumentLanguageClassificationFeature: result["feature_type"] = "LANGUAGE_CLASSIFICATION" diff --git a/internal/service/budget/budget_budget_data_source.go b/internal/service/budget/budget_budget_data_source.go index 9201300cbb3..e9e298e9561 100644 --- a/internal/service/budget/budget_budget_data_source.go +++ b/internal/service/budget/budget_budget_data_source.go @@ -5,6 +5,7 @@ package budget import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_budget "github.com/oracle/oci-go-sdk/v65/budget" @@ -98,6 +99,10 @@ func (s *BudgetBudgetDataSourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.EndDate != nil { + s.D.Set("end_date", s.Res.EndDate.Format(time.RFC3339Nano)) + } + if s.Res.ForecastedSpend != nil { s.D.Set("forecasted_spend", int(*s.Res.ForecastedSpend)) } @@ -108,6 +113,10 @@ func (s *BudgetBudgetDataSourceCrud) SetData() error { s.D.Set("reset_period", s.Res.ResetPeriod) + if s.Res.StartDate != nil { + s.D.Set("start_date", s.Res.StartDate.Format(time.RFC3339Nano)) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TargetCompartmentId != nil { diff --git a/internal/service/budget/budget_budget_resource.go b/internal/service/budget/budget_budget_resource.go index c3c2a162131..3d7a93c570f 100644 --- a/internal/service/budget/budget_budget_resource.go +++ b/internal/service/budget/budget_budget_resource.go @@ -5,9 +5,11 @@ package budget import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_budget "github.com/oracle/oci-go-sdk/v65/budget" + 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" @@ -62,6 +64,12 @@ func BudgetBudgetResource() *schema.Resource { Optional: true, Computed: true, }, + "end_date": { + Type: schema.TypeString, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.TimeDiffSuppressFunction, + }, "freeform_tags": { Type: schema.TypeMap, Optional: true, @@ -73,20 +81,26 @@ func BudgetBudgetResource() *schema.Resource { Optional: true, Computed: true, }, + "start_date": { + Type: schema.TypeString, + Optional: true, + Computed: true, + DiffSuppressFunc: tfresource.TimeDiffSuppressFunction, + }, + // target_compartment_id conflicts with targets "target_compartment_id": { Type: schema.TypeString, Optional: true, Computed: true, ForceNew: true, - ConflictsWith: []string{"target_type"}, - Deprecated: tfresource.FieldDeprecatedForAnother("target_compartment_id", "target_type"), + ConflictsWith: []string{"targets"}, + Deprecated: tfresource.FieldDeprecatedForAnother("target_compartment_id", "targets"), }, "target_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ConflictsWith: []string{"target_compartment_id"}, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, }, "targets": { Type: schema.TypeList, @@ -96,6 +110,7 @@ func BudgetBudgetResource() *schema.Resource { Elem: &schema.Schema{ Type: schema.TypeString, }, + ConflictsWith: []string{"target_compartment_id"}, }, // Computed @@ -233,6 +248,14 @@ func (s *BudgetBudgetResourceCrud) Create() error { request.DisplayName = &tmp } + if endDate, ok := s.D.GetOkExists("end_date"); ok { + tmp, err := time.Parse(time.RFC3339, endDate.(string)) + if err != nil { + return err + } + request.EndDate = &oci_common.SDKTime{Time: tmp} + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } @@ -245,6 +268,14 @@ func (s *BudgetBudgetResourceCrud) Create() error { request.ResetPeriod = oci_budget.ResetPeriodEnum(resetPeriod.(string)) } + if startDate, ok := s.D.GetOkExists("start_date"); ok { + tmp, err := time.Parse(time.RFC3339, startDate.(string)) + if err != nil { + return err + } + request.StartDate = &oci_common.SDKTime{Time: tmp} + } + if targetCompartmentId, ok := s.D.GetOkExists("target_compartment_id"); ok { tmp := targetCompartmentId.(string) request.TargetCompartmentId = &tmp @@ -329,6 +360,14 @@ func (s *BudgetBudgetResourceCrud) Update() error { request.DisplayName = &tmp } + if endDate, ok := s.D.GetOkExists("end_date"); ok { + tmp, err := time.Parse(time.RFC3339, endDate.(string)) + if err != nil { + return err + } + request.EndDate = &oci_common.SDKTime{Time: tmp} + } + if freeformTags, ok := s.D.GetOkExists("freeform_tags"); ok { request.FreeformTags = tfresource.ObjectMapToStringMap(freeformTags.(map[string]interface{})) } @@ -341,6 +380,14 @@ func (s *BudgetBudgetResourceCrud) Update() error { request.ResetPeriod = oci_budget.ResetPeriodEnum(resetPeriod.(string)) } + if startDate, ok := s.D.GetOkExists("start_date"); ok { + tmp, err := time.Parse(time.RFC3339, startDate.(string)) + if err != nil { + return err + } + request.StartDate = &oci_common.SDKTime{Time: tmp} + } + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "budget") response, err := s.Client.UpdateBudget(context.Background(), request) @@ -397,6 +444,10 @@ func (s *BudgetBudgetResourceCrud) SetData() error { s.D.Set("display_name", *s.Res.DisplayName) } + if s.Res.EndDate != nil { + s.D.Set("end_date", s.Res.EndDate.Format(time.RFC3339Nano)) + } + if s.Res.ForecastedSpend != nil { s.D.Set("forecasted_spend", *s.Res.ForecastedSpend) } @@ -407,6 +458,10 @@ func (s *BudgetBudgetResourceCrud) SetData() error { s.D.Set("reset_period", s.Res.ResetPeriod) + if s.Res.StartDate != nil { + s.D.Set("start_date", s.Res.StartDate.Format(time.RFC3339Nano)) + } + s.D.Set("state", s.Res.LifecycleState) if s.Res.TargetCompartmentId != nil { diff --git a/internal/service/budget/budget_budgets_data_source.go b/internal/service/budget/budget_budgets_data_source.go index 4999504f36c..0a46697ee85 100644 --- a/internal/service/budget/budget_budgets_data_source.go +++ b/internal/service/budget/budget_budgets_data_source.go @@ -5,6 +5,7 @@ package budget import ( "context" + "time" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" oci_budget "github.com/oracle/oci-go-sdk/v65/budget" @@ -146,6 +147,10 @@ func (s *BudgetBudgetsDataSourceCrud) SetData() error { budget["display_name"] = *r.DisplayName } + if r.EndDate != nil { + budget["end_date"] = r.EndDate.Format(time.RFC3339Nano) + } + if r.ForecastedSpend != nil { budget["forecasted_spend"] = *r.ForecastedSpend } @@ -160,6 +165,10 @@ func (s *BudgetBudgetsDataSourceCrud) SetData() error { budget["reset_period"] = r.ResetPeriod + if r.StartDate != nil { + budget["start_date"] = r.StartDate.Format(time.RFC3339Nano) + } + budget["state"] = r.LifecycleState if r.TargetCompartmentId != nil { diff --git a/internal/service/certificates/certificates_certificate_authority_bundle_data_source.go b/internal/service/certificates/certificates_certificate_authority_bundle_data_source.go new file mode 100644 index 00000000000..40e665b2268 --- /dev/null +++ b/internal/service/certificates/certificates_certificate_authority_bundle_data_source.go @@ -0,0 +1,224 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package certificates + +import ( + "context" + "fmt" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + oci_certificates "github.com/oracle/oci-go-sdk/v65/certificates" + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func CertificatesCertificateAuthorityBundleDataSource() *schema.Resource { + return &schema.Resource{ + Read: readCertificatesCertificateAuthorityBundle, + Schema: map[string]*schema.Schema{ + "cert_chain_pem": { + Type: schema.TypeString, + Computed: true, + }, + "certificate_authority_id": { + Type: schema.TypeString, + Required: true, + }, + "certificate_authority_name": { + Type: schema.TypeString, + Computed: true, + }, + "certificate_pem": { + Type: schema.TypeString, + Computed: true, + }, + "certificate_authority_version_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "revocation_status": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "time_revoked": { + Type: schema.TypeString, + Required: true, + }, + "revocation_reason": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "serial_number": { + Type: schema.TypeString, + Computed: true, + }, + "stage": { + Type: schema.TypeString, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "CURRENT", + "PENDING", + "LATEST", + "PREVIOUS", + "DEPRECATED", + }, true), + Optional: true, + }, + "stages": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "validity": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "time_of_validity_not_before": { + Type: schema.TypeString, + Required: true, + }, + "time_of_validity_not_after": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "version_name": { + Type: schema.TypeString, + Computed: true, + }, + "version_number": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + }, + } +} + +func readCertificatesCertificateAuthorityBundle(d *schema.ResourceData, m interface{}) error { + sync := &CertificatesCertificateAuthorityBundleDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).CertificatesClient() + + return tfresource.ReadResource(sync) +} + +type CertificatesCertificateAuthorityBundleDataSourceCrud struct { + D *schema.ResourceData + Client *oci_certificates.CertificatesClient + Res *oci_certificates.GetCertificateAuthorityBundleResponse +} + +func (s *CertificatesCertificateAuthorityBundleDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *CertificatesCertificateAuthorityBundleDataSourceCrud) Get() error { + request := oci_certificates.GetCertificateAuthorityBundleRequest{} + + if certificateAuthorityId, ok := s.D.GetOkExists("certificate_authority_id"); ok { + tmp := certificateAuthorityId.(string) + request.CertificateAuthorityId = &tmp + } + + if versionNumber, ok := s.D.GetOkExists("version_number"); ok { + tmp := versionNumber.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return fmt.Errorf("unable to convert versionNumber string: %s to an int64 and encountered error: %v", tmp, err) + } + request.VersionNumber = &tmpInt64 + } + + if certificateAuthorityVersionName, ok := s.D.GetOkExists("certificate_authority_version_name"); ok { + tmp := certificateAuthorityVersionName.(string) + request.CertificateAuthorityVersionName = &tmp + } + + if stage, ok := s.D.GetOkExists("stage"); ok { + request.Stage = oci_certificates.GetCertificateAuthorityBundleStageEnum(stage.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "certificates") + + response, err := s.Client.GetCertificateAuthorityBundle(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *CertificatesCertificateAuthorityBundleDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.CertificateAuthorityId) + + if s.Res.CertChainPem != nil { + s.D.Set("cert_chain_pem", *s.Res.CertChainPem) + } + + if s.Res.CertificateAuthorityName != nil { + s.D.Set("certificate_authority_name", *s.Res.CertificateAuthorityName) + } + + if s.Res.CertificatePem != nil { + s.D.Set("certificate_pem", *s.Res.CertificatePem) + } + + if s.Res.RevocationStatus != nil { + s.D.Set("revocation_status", []interface{}{revocationStatusToMap(s.Res.RevocationStatus)}) + } else { + s.D.Set("revocation_status", nil) + } + + if s.Res.SerialNumber != nil { + s.D.Set("serial_number", *s.Res.SerialNumber) + } + + stages := []interface{}{} + for _, item := range s.Res.Stages { + stages = append(stages, item) + } + s.D.Set("stages", stages) + + if s.Res.TimeCreated != nil { + s.D.Set("time_created", s.Res.TimeCreated.String()) + } + + if s.Res.Validity != nil { + s.D.Set("validity", []interface{}{validityToMap(s.Res.Validity)}) + } else { + s.D.Set("validity", nil) + } + + if s.Res.VersionName != nil { + s.D.Set("version_name", *s.Res.VersionName) + } + + if s.Res.VersionNumber != nil { + s.D.Set("version_number", strconv.FormatInt(*s.Res.VersionNumber, 10)) + } + + return nil +} diff --git a/internal/service/certificates/certificates_certificate_bundle_data_source.go b/internal/service/certificates/certificates_certificate_bundle_data_source.go new file mode 100644 index 00000000000..bca920315fe --- /dev/null +++ b/internal/service/certificates/certificates_certificate_bundle_data_source.go @@ -0,0 +1,272 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package certificates + +import ( + "context" + "fmt" + "strconv" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + oci_certificates "github.com/oracle/oci-go-sdk/v65/certificates" + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func CertificatesCertificateBundleDataSource() *schema.Resource { + return &schema.Resource{ + Read: readCertificatesCertificateBundle, + Schema: map[string]*schema.Schema{ + "cert_chain_pem": { + Type: schema.TypeString, + Computed: true, + }, + "certificate_bundle_type": { + Type: schema.TypeString, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "CERTIFICATE_CONTENT_PUBLIC_ONLY", + "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY", + }, true), + Optional: true, + Computed: true, + }, + "certificate_id": { + Type: schema.TypeString, + Required: true, + }, + "certificate_name": { + Type: schema.TypeString, + Computed: true, + }, + "certificate_pem": { + Type: schema.TypeString, + Computed: true, + }, + "certificate_version_name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "private_key_pem": { + Type: schema.TypeString, + Computed: true, + }, + "private_key_pem_passphrase": { + Type: schema.TypeString, + Computed: true, + }, + "revocation_status": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "time_revoked": { + Type: schema.TypeString, + Required: true, + }, + "revocation_reason": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "serial_number": { + Type: schema.TypeString, + Computed: true, + }, + "stage": { + Type: schema.TypeString, + DiffSuppressFunc: tfresource.EqualIgnoreCaseSuppressDiff, + ValidateFunc: validation.StringInSlice([]string{ + "CURRENT", + "PENDING", + "LATEST", + "PREVIOUS", + "DEPRECATED", + }, true), + Optional: true, + }, + "stages": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "validity": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "time_of_validity_not_before": { + Type: schema.TypeString, + Required: true, + }, + "time_of_validity_not_after": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "version_number": { + Type: schema.TypeString, + Computed: true, + Optional: true, + }, + }, + } +} + +func readCertificatesCertificateBundle(d *schema.ResourceData, m interface{}) error { + sync := &CertificatesCertificateBundleDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).CertificatesClient() + + return tfresource.ReadResource(sync) +} + +type CertificatesCertificateBundleDataSourceCrud struct { + D *schema.ResourceData + Client *oci_certificates.CertificatesClient + Res *oci_certificates.GetCertificateBundleResponse +} + +func (s *CertificatesCertificateBundleDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *CertificatesCertificateBundleDataSourceCrud) Get() error { + request := oci_certificates.GetCertificateBundleRequest{} + + if certificateId, ok := s.D.GetOkExists("certificate_id"); ok { + tmp := certificateId.(string) + request.CertificateId = &tmp + } + + if versionNumber, ok := s.D.GetOkExists("version_number"); ok { + tmp := versionNumber.(string) + tmpInt64, err := strconv.ParseInt(tmp, 10, 64) + if err != nil { + return fmt.Errorf("unable to convert versionNumber string: %s to an int64 and encountered error: %v", tmp, err) + } + request.VersionNumber = &tmpInt64 + } + + if certificateVersionName, ok := s.D.GetOkExists("certificate_version_name"); ok { + tmp := certificateVersionName.(string) + request.CertificateVersionName = &tmp + } + + if stage, ok := s.D.GetOkExists("stage"); ok { + request.Stage = oci_certificates.GetCertificateBundleStageEnum(stage.(string)) + } + + if certificateBundleType, ok := s.D.GetOkExists("certificate_bundle_type"); ok { + request.CertificateBundleType = oci_certificates.GetCertificateBundleCertificateBundleTypeEnum(certificateBundleType.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "certificates") + + response, err := s.Client.GetCertificateBundle(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *CertificatesCertificateBundleDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(*s.Res.GetCertificateId()) + + if s.Res.GetCertificateName() != nil { + s.D.Set("certificate_name", *s.Res.GetCertificateName()) + } + + if s.Res.GetVersionNumber() != nil { + s.D.Set("version_number", strconv.FormatInt(*s.Res.GetVersionNumber(), 10)) + } + + if s.Res.GetSerialNumber() != nil { + s.D.Set("serial_number", *s.Res.GetSerialNumber()) + } + + if s.Res.GetTimeCreated() != nil { + s.D.Set("time_created", s.Res.GetTimeCreated().String()) + } + + if s.Res.GetValidity() != nil { + s.D.Set("validity", []interface{}{validityToMap(s.Res.GetValidity())}) + } else { + s.D.Set("validity", nil) + } + + stages := []interface{}{} + for _, item := range s.Res.GetStages() { + stages = append(stages, item) + } + s.D.Set("stages", stages) + + if s.Res.GetCertificatePem() != nil { + s.D.Set("certificate_pem", *s.Res.GetCertificatePem()) + } + + if s.Res.GetCertChainPem() != nil { + s.D.Set("cert_chain_pem", *s.Res.GetCertChainPem()) + } + + if s.Res.GetVersionName() != nil { + s.D.Set("version_name", *s.Res.GetVersionName()) + } + + if s.Res.GetRevocationStatus() != nil { + s.D.Set("revocation_status", []interface{}{revocationStatusToMap(s.Res.GetRevocationStatus())}) + } else { + s.D.Set("revocation_status", nil) + } + + if bundle, ok := s.Res.CertificateBundle.(oci_certificates.CertificateBundleWithPrivateKey); ok { + if bundle.PrivateKeyPem != nil { + s.D.Set("private_key_pem", *bundle.PrivateKeyPem) + } + if bundle.PrivateKeyPemPassphrase != nil { + s.D.Set("private_key_passphrase", *bundle.PrivateKeyPemPassphrase) + } + s.D.Set("certificate_bundle_type", "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY") + } else { + s.D.Set("certificate_bundle_type", "CERTIFICATE_CONTENT_PUBLIC_ONLY") + } + + return nil +} + +func validityToMap(obj *oci_certificates.Validity) map[string]interface{} { + result := map[string]interface{}{ + "time_of_validity_not_before": obj.TimeOfValidityNotBefore.String(), + "time_of_validity_not_after": obj.TimeOfValidityNotAfter.String(), + } + + return result +} + +func revocationStatusToMap(obj *oci_certificates.RevocationStatus) map[string]interface{} { + result := map[string]interface{}{ + "time_revoked": obj.TimeRevoked.String(), + "revocation_reason": obj.RevocationReason, + } + + return result +} diff --git a/internal/service/certificates/register_datasource.go b/internal/service/certificates/register_datasource.go new file mode 100644 index 00000000000..cde593914c8 --- /dev/null +++ b/internal/service/certificates/register_datasource.go @@ -0,0 +1,11 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package certificates + +import "github.com/oracle/terraform-provider-oci/internal/tfresource" + +func RegisterDatasource() { + tfresource.RegisterDatasource("oci_certificates_certificate_bundle", CertificatesCertificateBundleDataSource()) + tfresource.RegisterDatasource("oci_certificates_certificate_authority_bundle", CertificatesCertificateAuthorityBundleDataSource()) +} diff --git a/internal/service/containerengine/containerengine_cluster_complete_credential_rotation_management_resource.go b/internal/service/containerengine/containerengine_cluster_complete_credential_rotation_management_resource.go new file mode 100644 index 00000000000..06e9c83432f --- /dev/null +++ b/internal/service/containerengine/containerengine_cluster_complete_credential_rotation_management_resource.go @@ -0,0 +1,208 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package containerengine + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_containerengine "github.com/oracle/oci-go-sdk/v65/containerengine" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ContainerengineClusterCompleteCredentialRotationManagementResource() *schema.Resource { + return &schema.Resource{ + Timeouts: tfresource.DefaultTimeout, + Create: createContainerengineClusterCompleteCredentialRotationManagement, + Read: readContainerengineClusterCompleteCredentialRotationManagement, + Delete: deleteContainerengineClusterCompleteCredentialRotationManagement, + Schema: map[string]*schema.Schema{ + // Required + "cluster_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + + // Computed + }, + } +} + +func createContainerengineClusterCompleteCredentialRotationManagement(d *schema.ResourceData, m interface{}) error { + sync := &ContainerengineClusterCompleteCredentialRotationManagementResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ContainerEngineClient() + + return tfresource.CreateResource(d, sync) +} + +func readContainerengineClusterCompleteCredentialRotationManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +func deleteContainerengineClusterCompleteCredentialRotationManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +type ContainerengineClusterCompleteCredentialRotationManagementResourceCrud struct { + tfresource.BaseCrud + Client *oci_containerengine.ContainerEngineClient + Res *oci_containerengine.Cluster + DisableNotFoundRetries bool +} + +func (s *ContainerengineClusterCompleteCredentialRotationManagementResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ContainerengineClusterCompleteCredentialRotationManagementResourceCrud) Create() error { + request := oci_containerengine.CompleteCredentialRotationRequest{} + + if clusterId, ok := s.D.GetOkExists("cluster_id"); ok { + tmp := clusterId.(string) + request.ClusterId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "containerengine") + + response, err := s.Client.CompleteCredentialRotation(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + + // Wait until it finishes + clusterId, waitErr := clusterCompleteCredentialRotationManagementWaitForWorkRequest(workId, "cluster", + oci_containerengine.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries, s.Client) + if waitErr != nil { + return waitErr + } + + requestGet := oci_containerengine.GetClusterRequest{} + requestGet.ClusterId = clusterId + requestGet.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "containerengine") + responseGet, getClusterErr := s.Client.GetCluster(context.Background(), requestGet) + if getClusterErr != nil { + return getClusterErr + } + s.Res = &responseGet.Cluster + + return nil +} + +func clusterCompleteCredentialRotationManagementWorkRequestShouldRetryFunc(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, "containerengine", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_containerengine.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func clusterCompleteCredentialRotationManagementWaitForWorkRequest(wId *string, entityType string, action oci_containerengine.WorkRequestResourceActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_containerengine.ContainerEngineClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "containerengine") + retryPolicy.ShouldRetryOperation = clusterCompleteCredentialRotationManagementWorkRequestShouldRetryFunc(timeout) + + response := oci_containerengine.GetWorkRequestResponse{} + stateConf := &resource.StateChangeConf{ + Pending: []string{ + string(oci_containerengine.WorkRequestStatusInProgress), + string(oci_containerengine.WorkRequestStatusAccepted), + string(oci_containerengine.WorkRequestStatusCanceling), + }, + Target: []string{ + string(oci_containerengine.WorkRequestStatusSucceeded), + string(oci_containerengine.WorkRequestStatusFailed), + string(oci_containerengine.WorkRequestStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_containerengine.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_containerengine.WorkRequestStatusFailed || response.Status == oci_containerengine.WorkRequestStatusCanceled { + return nil, getErrorFromContainerengineClusterCompleteCredentialRotationManagementWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromContainerengineClusterCompleteCredentialRotationManagementWorkRequest(client *oci_containerengine.ContainerEngineClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_containerengine.WorkRequestResourceActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_containerengine.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 *ContainerengineClusterCompleteCredentialRotationManagementResourceCrud) SetData() error { + return nil +} diff --git a/internal/service/containerengine/containerengine_cluster_credential_rotation_status_data_source.go b/internal/service/containerengine/containerengine_cluster_credential_rotation_status_data_source.go new file mode 100644 index 00000000000..44257c579be --- /dev/null +++ b/internal/service/containerengine/containerengine_cluster_credential_rotation_status_data_source.go @@ -0,0 +1,94 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package containerengine + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + oci_containerengine "github.com/oracle/oci-go-sdk/v65/containerengine" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ContainerengineClusterCredentialRotationStatusDataSource() *schema.Resource { + return &schema.Resource{ + Read: readSingularContainerengineClusterCredentialRotationStatus, + Schema: map[string]*schema.Schema{ + "cluster_id": { + Type: schema.TypeString, + Required: true, + }, + // Computed + "status": { + Type: schema.TypeString, + Computed: true, + }, + "status_details": { + Type: schema.TypeString, + Computed: true, + }, + "time_auto_completion_scheduled": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func readSingularContainerengineClusterCredentialRotationStatus(d *schema.ResourceData, m interface{}) error { + sync := &ContainerengineClusterCredentialRotationStatusDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ContainerEngineClient() + + return tfresource.ReadResource(sync) +} + +type ContainerengineClusterCredentialRotationStatusDataSourceCrud struct { + D *schema.ResourceData + Client *oci_containerengine.ContainerEngineClient + Res *oci_containerengine.GetCredentialRotationStatusResponse +} + +func (s *ContainerengineClusterCredentialRotationStatusDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *ContainerengineClusterCredentialRotationStatusDataSourceCrud) Get() error { + request := oci_containerengine.GetCredentialRotationStatusRequest{} + + if clusterId, ok := s.D.GetOkExists("cluster_id"); ok { + tmp := clusterId.(string) + request.ClusterId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "containerengine") + + response, err := s.Client.GetCredentialRotationStatus(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *ContainerengineClusterCredentialRotationStatusDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("ContainerengineClusterCredentialRotationStatusDataSource-", ContainerengineClusterCredentialRotationStatusDataSource(), s.D)) + + s.D.Set("status", s.Res.Status) + + s.D.Set("status_details", s.Res.StatusDetails) + + if s.Res.TimeAutoCompletionScheduled != nil { + s.D.Set("time_auto_completion_scheduled", s.Res.TimeAutoCompletionScheduled.String()) + } + + return nil +} diff --git a/internal/service/containerengine/containerengine_cluster_resource.go b/internal/service/containerengine/containerengine_cluster_resource.go index 5ac6e11b09b..867444733a3 100644 --- a/internal/service/containerengine/containerengine_cluster_resource.go +++ b/internal/service/containerengine/containerengine_cluster_resource.go @@ -409,6 +409,10 @@ func ContainerengineClusterResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "time_credential_expiration": { + Type: schema.TypeString, + Computed: true, + }, "time_deleted": { Type: schema.TypeString, Computed: true, @@ -1247,6 +1251,10 @@ func ClusterMetadataToMap(obj *oci_containerengine.ClusterMetadata) map[string]i result["time_created"] = obj.TimeCreated.String() } + if obj.TimeCredentialExpiration != nil { + result["time_credential_expiration"] = obj.TimeCredentialExpiration.String() + } + if obj.TimeDeleted != nil { result["time_deleted"] = obj.TimeDeleted.String() } diff --git a/internal/service/containerengine/containerengine_cluster_start_credential_rotation_management_resource.go b/internal/service/containerengine/containerengine_cluster_start_credential_rotation_management_resource.go new file mode 100644 index 00000000000..551611da592 --- /dev/null +++ b/internal/service/containerengine/containerengine_cluster_start_credential_rotation_management_resource.go @@ -0,0 +1,224 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package containerengine + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_containerengine "github.com/oracle/oci-go-sdk/v65/containerengine" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func ContainerengineClusterStartCredentialRotationManagementResource() *schema.Resource { + return &schema.Resource{ + Timeouts: &schema.ResourceTimeout{ + Create: tfresource.GetTimeoutDuration("1h"), + Update: tfresource.GetTimeoutDuration("1h"), + Delete: tfresource.GetTimeoutDuration("1h"), + }, + Create: createContainerengineClusterStartCredentialRotationManagement, + Read: readContainerengineClusterStartCredentialRotationManagement, + Delete: deleteContainerengineClusterStartCredentialRotationManagement, + Schema: map[string]*schema.Schema{ + // Required + "auto_completion_delay_duration": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "cluster_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + + // Computed + }, + } +} + +func createContainerengineClusterStartCredentialRotationManagement(d *schema.ResourceData, m interface{}) error { + sync := &ContainerengineClusterStartCredentialRotationManagementResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).ContainerEngineClient() + + return tfresource.CreateResource(d, sync) +} + +func readContainerengineClusterStartCredentialRotationManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +func deleteContainerengineClusterStartCredentialRotationManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +type ContainerengineClusterStartCredentialRotationManagementResourceCrud struct { + tfresource.BaseCrud + Client *oci_containerengine.ContainerEngineClient + Res *oci_containerengine.Cluster + DisableNotFoundRetries bool +} + +func (s *ContainerengineClusterStartCredentialRotationManagementResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *ContainerengineClusterStartCredentialRotationManagementResourceCrud) Create() error { + request := oci_containerengine.StartCredentialRotationRequest{} + + if autoCompletionDelayDuration, ok := s.D.GetOkExists("auto_completion_delay_duration"); ok { + tmp := autoCompletionDelayDuration.(string) + request.AutoCompletionDelayDuration = &tmp + } + + if clusterId, ok := s.D.GetOkExists("cluster_id"); ok { + tmp := clusterId.(string) + request.ClusterId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "containerengine") + + response, err := s.Client.StartCredentialRotation(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + + // Wait until it finishes + _, waitErr := clusterStartCredentialRotationManagementWaitForWorkRequest(workId, "cluster", + oci_containerengine.WorkRequestResourceActionTypeCreated, s.D.Timeout(schema.TimeoutCreate), s.DisableNotFoundRetries, s.Client) + if waitErr != nil { + return waitErr + } + + requestGet := oci_containerengine.GetClusterRequest{} + clusterId, _ := s.D.GetOkExists("cluster_id") + tmpClusterId := clusterId.(string) + requestGet.ClusterId = &tmpClusterId + requestGet.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "containerengine") + responseGet, getClusterErr := s.Client.GetCluster(context.Background(), requestGet) + if getClusterErr != nil { + return getClusterErr + } + s.Res = &responseGet.Cluster + + return nil +} + +func clusterStartCredentialRotationManagementWorkRequestShouldRetryFunc(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, "containerengine", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_containerengine.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func clusterStartCredentialRotationManagementWaitForWorkRequest(wId *string, entityType string, action oci_containerengine.WorkRequestResourceActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_containerengine.ContainerEngineClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "containerengine") + retryPolicy.ShouldRetryOperation = clusterStartCredentialRotationManagementWorkRequestShouldRetryFunc(timeout) + + response := oci_containerengine.GetWorkRequestResponse{} + stateConf := &resource.StateChangeConf{ + Pending: []string{ + string(oci_containerengine.WorkRequestStatusInProgress), + string(oci_containerengine.WorkRequestStatusAccepted), + string(oci_containerengine.WorkRequestStatusCanceling), + }, + Target: []string{ + string(oci_containerengine.WorkRequestStatusSucceeded), + string(oci_containerengine.WorkRequestStatusFailed), + string(oci_containerengine.WorkRequestStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_containerengine.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_containerengine.WorkRequestStatusFailed || response.Status == oci_containerengine.WorkRequestStatusCanceled { + return nil, getErrorFromContainerengineClusterStartCredentialRotationManagementWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromContainerengineClusterStartCredentialRotationManagementWorkRequest(client *oci_containerengine.ContainerEngineClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_containerengine.WorkRequestResourceActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_containerengine.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 *ContainerengineClusterStartCredentialRotationManagementResourceCrud) SetData() error { + return nil +} diff --git a/internal/service/containerengine/register_datasource.go b/internal/service/containerengine/register_datasource.go index c9d481cd7fe..a12287cfff8 100644 --- a/internal/service/containerengine/register_datasource.go +++ b/internal/service/containerengine/register_datasource.go @@ -9,6 +9,7 @@ func RegisterDatasource() { tfresource.RegisterDatasource("oci_containerengine_addon", ContainerengineAddonDataSource()) tfresource.RegisterDatasource("oci_containerengine_addon_options", ContainerengineAddonOptionsDataSource()) tfresource.RegisterDatasource("oci_containerengine_addons", ContainerengineAddonsDataSource()) + tfresource.RegisterDatasource("oci_containerengine_cluster_credential_rotation_status", ContainerengineClusterCredentialRotationStatusDataSource()) tfresource.RegisterDatasource("oci_containerengine_cluster_kube_config", ContainerengineClusterKubeConfigDataSource()) tfresource.RegisterDatasource("oci_containerengine_cluster_option", ContainerengineClusterOptionDataSource()) tfresource.RegisterDatasource("oci_containerengine_cluster_workload_mapping", ContainerengineClusterWorkloadMappingDataSource()) diff --git a/internal/service/containerengine/register_resource.go b/internal/service/containerengine/register_resource.go index 8a8386a523b..74d0e6a8b2e 100644 --- a/internal/service/containerengine/register_resource.go +++ b/internal/service/containerengine/register_resource.go @@ -9,6 +9,8 @@ func RegisterResource() { tfresource.RegisterResource("oci_containerengine_addon", ContainerengineAddonResource()) tfresource.RegisterResource("oci_containerengine_cluster", ContainerengineClusterResource()) tfresource.RegisterResource("oci_containerengine_cluster_workload_mapping", ContainerengineClusterWorkloadMappingResource()) + tfresource.RegisterResource("oci_containerengine_cluster_complete_credential_rotation_management", ContainerengineClusterCompleteCredentialRotationManagementResource()) + tfresource.RegisterResource("oci_containerengine_cluster_start_credential_rotation_management", ContainerengineClusterStartCredentialRotationManagementResource()) tfresource.RegisterResource("oci_containerengine_node_pool", ContainerengineNodePoolResource()) tfresource.RegisterResource("oci_containerengine_virtual_node_pool", ContainerengineVirtualNodePoolResource()) } diff --git a/internal/service/core/core_cluster_network_resource.go b/internal/service/core/core_cluster_network_resource.go index 2cf95cba032..aad4c219acf 100644 --- a/internal/service/core/core_cluster_network_resource.go +++ b/internal/service/core/core_cluster_network_resource.go @@ -67,12 +67,19 @@ func CoreClusterNetworkResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, - // Computed "id": { Type: schema.TypeString, Computed: true, }, + "instance_display_name_formatter": { + Type: schema.TypeString, + Computed: true, + }, + "instance_hostname_formatter": { + Type: schema.TypeString, + Computed: true, + }, "compartment_id": { Type: schema.TypeString, Computed: true, @@ -704,6 +711,14 @@ func InstancePoolToMap(obj oci_core.InstancePool) map[string]interface{} { result["instance_configuration_id"] = string(*obj.InstanceConfigurationId) } + if obj.InstanceDisplayNameFormatter != nil { + result["instance_display_name_formatter"] = string(*obj.InstanceDisplayNameFormatter) + } + + if obj.InstanceHostnameFormatter != nil { + result["instance_hostname_formatter"] = string(*obj.InstanceHostnameFormatter) + } + loadBalancers := []interface{}{} for _, item := range obj.LoadBalancers { loadBalancers = append(loadBalancers, InstancePoolLoadBalancerAttachmentToMap(item)) diff --git a/internal/service/core/core_instance_pool_data_source.go b/internal/service/core/core_instance_pool_data_source.go index 38084976930..4cdaf27478c 100644 --- a/internal/service/core/core_instance_pool_data_source.go +++ b/internal/service/core/core_instance_pool_data_source.go @@ -84,6 +84,14 @@ func (s *CoreInstancePoolDataSourceCrud) SetData() error { s.D.Set("instance_configuration_id", *s.Res.InstanceConfigurationId) } + if s.Res.InstanceDisplayNameFormatter != nil { + s.D.Set("instance_display_name_formatter", *s.Res.InstanceDisplayNameFormatter) + } + + if s.Res.InstanceHostnameFormatter != nil { + s.D.Set("instance_hostname_formatter", *s.Res.InstanceHostnameFormatter) + } + loadBalancers := []interface{}{} for _, item := range s.Res.LoadBalancers { if item.LifecycleState != oci_core.InstancePoolLoadBalancerAttachmentLifecycleStateDetached { diff --git a/internal/service/core/core_instance_pool_resource.go b/internal/service/core/core_instance_pool_resource.go index a57c421f526..61278584f52 100644 --- a/internal/service/core/core_instance_pool_resource.go +++ b/internal/service/core/core_instance_pool_resource.go @@ -127,6 +127,16 @@ func CoreInstancePoolResource() *schema.Resource { Computed: true, Elem: schema.TypeString, }, + "instance_display_name_formatter": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "instance_hostname_formatter": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "load_balancers": { Type: schema.TypeList, Optional: true, @@ -312,6 +322,16 @@ func (s *CoreInstancePoolResourceCrud) Create() error { request.InstanceConfigurationId = &tmp } + if instanceDisplayNameFormatter, ok := s.D.GetOkExists("instance_display_name_formatter"); ok { + tmp := instanceDisplayNameFormatter.(string) + request.InstanceDisplayNameFormatter = &tmp + } + + if instanceHostnameFormatter, ok := s.D.GetOkExists("instance_hostname_formatter"); ok { + tmp := instanceHostnameFormatter.(string) + request.InstanceHostnameFormatter = &tmp + } + if loadBalancers, ok := s.D.GetOkExists("load_balancers"); ok { interfaces := loadBalancers.([]interface{}) tmp := make([]oci_core.AttachLoadBalancerDetails, len(interfaces)) @@ -450,6 +470,16 @@ func (s *CoreInstancePoolResourceCrud) Update() error { request.InstanceConfigurationId = &tmp } + if instanceDisplayNameFormatter, ok := s.D.GetOkExists("instance_display_name_formatter"); ok { + tmp := instanceDisplayNameFormatter.(string) + request.InstanceDisplayNameFormatter = &tmp + } + + if instanceHostnameFormatter, ok := s.D.GetOkExists("instance_hostname_formatter"); ok { + tmp := instanceHostnameFormatter.(string) + request.InstanceHostnameFormatter = &tmp + } + tmp := s.D.Id() request.InstancePoolId = &tmp @@ -540,6 +570,14 @@ func (s *CoreInstancePoolResourceCrud) SetData() error { s.D.Set("instance_configuration_id", *s.Res.InstanceConfigurationId) } + if s.Res.InstanceDisplayNameFormatter != nil { + s.D.Set("instance_display_name_formatter", *s.Res.InstanceDisplayNameFormatter) + } + + if s.Res.InstanceHostnameFormatter != nil { + s.D.Set("instance_hostname_formatter", *s.Res.InstanceHostnameFormatter) + } + loadBalancers := []interface{}{} for _, item := range s.Res.LoadBalancers { if item.LifecycleState != oci_core.InstancePoolLoadBalancerAttachmentLifecycleStateDetached { diff --git a/internal/service/database/database_autonomous_vm_cluster_data_source.go b/internal/service/database/database_autonomous_vm_cluster_data_source.go index 3b66a2a5af1..f18398c19b7 100644 --- a/internal/service/database/database_autonomous_vm_cluster_data_source.go +++ b/internal/service/database/database_autonomous_vm_cluster_data_source.go @@ -190,6 +190,14 @@ func (s *DatabaseAutonomousVmClusterDataSourceCrud) SetData() error { s.D.Set("time_created", s.Res.TimeCreated.String()) } + if s.Res.TimeDatabaseSslCertificateExpires != nil { + s.D.Set("time_database_ssl_certificate_expires", s.Res.TimeDatabaseSslCertificateExpires.String()) + } + + if s.Res.TimeOrdsCertificateExpires != nil { + s.D.Set("time_ords_certificate_expires", s.Res.TimeOrdsCertificateExpires.String()) + } + if s.Res.TimeZone != nil { s.D.Set("time_zone", *s.Res.TimeZone) } diff --git a/internal/service/database/database_autonomous_vm_cluster_ords_certificate_management_resource.go b/internal/service/database/database_autonomous_vm_cluster_ords_certificate_management_resource.go new file mode 100644 index 00000000000..6ff356df6d6 --- /dev/null +++ b/internal/service/database/database_autonomous_vm_cluster_ords_certificate_management_resource.go @@ -0,0 +1,144 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package database + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_database "github.com/oracle/oci-go-sdk/v65/database" + oci_work_requests "github.com/oracle/oci-go-sdk/v65/workrequests" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DatabaseAutonomousVmClusterOrdsCertificateManagementResource() *schema.Resource { + return &schema.Resource{ + Timeouts: tfresource.DefaultTimeout, + Create: createDatabaseAutonomousVmClusterOrdsCertificateManagement, + Read: readDatabaseAutonomousVmClusterOrdsCertificateManagement, + Delete: deleteDatabaseAutonomousVmClusterOrdsCertificateManagement, + Schema: map[string]*schema.Schema{ + // Required + "autonomous_vm_cluster_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "certificate_generation_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "ca_bundle_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "certificate_authority_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "certificate_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + } +} + +func createDatabaseAutonomousVmClusterOrdsCertificateManagement(d *schema.ResourceData, m interface{}) error { + sync := &DatabaseAutonomousVmClusterOrdsCertificateManagementResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatabaseClient() + sync.WorkRequestClient = m.(*client.OracleClients).WorkRequestClient + + return tfresource.CreateResource(d, sync) +} + +func readDatabaseAutonomousVmClusterOrdsCertificateManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +func deleteDatabaseAutonomousVmClusterOrdsCertificateManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +type DatabaseAutonomousVmClusterOrdsCertificateManagementResourceCrud struct { + tfresource.BaseCrud + Client *oci_database.DatabaseClient + Res *oci_database.RotateAutonomousVmClusterOrdsCertsResponse + DisableNotFoundRetries bool + WorkRequestClient *oci_work_requests.WorkRequestClient +} + +func (s *DatabaseAutonomousVmClusterOrdsCertificateManagementResourceCrud) ID() string { + return tfresource.GenerateDataSourceHashID("DatabaseAutonomousVmClusterOrdsCertificateManagementResource-", DatabaseAutonomousVmClusterOrdsCertificateManagementResource(), s.D) +} + +func (s *DatabaseAutonomousVmClusterOrdsCertificateManagementResourceCrud) Create() error { + request := oci_database.RotateAutonomousVmClusterOrdsCertsRequest{} + + if autonomousVmClusterId, ok := s.D.GetOkExists("autonomous_vm_cluster_id"); ok { + tmp := autonomousVmClusterId.(string) + request.AutonomousVmClusterId = &tmp + } + + if caBundleId, ok := s.D.GetOkExists("ca_bundle_id"); ok { + tmp := caBundleId.(string) + request.CaBundleId = &tmp + } + + if certificateAuthorityId, ok := s.D.GetOkExists("certificate_authority_id"); ok { + tmp := certificateAuthorityId.(string) + request.CertificateAuthorityId = &tmp + } + + if certificateGenerationType, ok := s.D.GetOkExists("certificate_generation_type"); ok { + request.CertificateGenerationType = oci_database.RotateAutonomousVmClusterOrdsCertsDetailsCertificateGenerationTypeEnum(certificateGenerationType.(string)) + } + + if certificateId, ok := s.D.GetOkExists("certificate_id"); ok { + tmp := certificateId.(string) + request.CertificateId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database") + + response, err := s.Client.RotateAutonomousVmClusterOrdsCerts(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + s.Res = &response + + if workId != nil { + var identifier *string + var err error + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "autonomousvmcluster", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries) + if identifier != nil { + s.D.SetId(*identifier) + } + if err != nil { + return err + } + } + return nil +} + +func (s *DatabaseAutonomousVmClusterOrdsCertificateManagementResourceCrud) SetData() error { + return nil +} diff --git a/internal/service/database/database_autonomous_vm_cluster_resource.go b/internal/service/database/database_autonomous_vm_cluster_resource.go index 8d5efe11ec3..78a27ae524f 100644 --- a/internal/service/database/database_autonomous_vm_cluster_resource.go +++ b/internal/service/database/database_autonomous_vm_cluster_resource.go @@ -389,6 +389,14 @@ func DatabaseAutonomousVmClusterResource() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "time_database_ssl_certificate_expires": { + Type: schema.TypeString, + Computed: true, + }, + "time_ords_certificate_expires": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -805,6 +813,14 @@ func (s *DatabaseAutonomousVmClusterResourceCrud) SetData() error { s.D.Set("time_created", s.Res.TimeCreated.String()) } + if s.Res.TimeDatabaseSslCertificateExpires != nil { + s.D.Set("time_database_ssl_certificate_expires", s.Res.TimeDatabaseSslCertificateExpires.String()) + } + + if s.Res.TimeOrdsCertificateExpires != nil { + s.D.Set("time_ords_certificate_expires", s.Res.TimeOrdsCertificateExpires.String()) + } + if s.Res.TimeZone != nil { s.D.Set("time_zone", *s.Res.TimeZone) } diff --git a/internal/service/database/database_autonomous_vm_cluster_ssl_certificate_management_resource.go b/internal/service/database/database_autonomous_vm_cluster_ssl_certificate_management_resource.go new file mode 100644 index 00000000000..c67580eba2a --- /dev/null +++ b/internal/service/database/database_autonomous_vm_cluster_ssl_certificate_management_resource.go @@ -0,0 +1,144 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package database + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_database "github.com/oracle/oci-go-sdk/v65/database" + oci_work_requests "github.com/oracle/oci-go-sdk/v65/workrequests" + + "github.com/oracle/terraform-provider-oci/internal/client" + "github.com/oracle/terraform-provider-oci/internal/tfresource" +) + +func DatabaseAutonomousVmClusterSslCertificateManagementResource() *schema.Resource { + return &schema.Resource{ + Timeouts: tfresource.DefaultTimeout, + Create: createDatabaseAutonomousVmClusterSslCertificateManagement, + Read: readDatabaseAutonomousVmClusterSslCertificateManagement, + Delete: deleteDatabaseAutonomousVmClusterSslCertificateManagement, + Schema: map[string]*schema.Schema{ + // Required + "autonomous_vm_cluster_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "certificate_generation_type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + // Optional + "ca_bundle_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "certificate_authority_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "certificate_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + // Computed + }, + } +} + +func createDatabaseAutonomousVmClusterSslCertificateManagement(d *schema.ResourceData, m interface{}) error { + sync := &DatabaseAutonomousVmClusterSslCertificateManagementResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).DatabaseClient() + sync.WorkRequestClient = m.(*client.OracleClients).WorkRequestClient + + return tfresource.CreateResource(d, sync) +} + +func readDatabaseAutonomousVmClusterSslCertificateManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +func deleteDatabaseAutonomousVmClusterSslCertificateManagement(d *schema.ResourceData, m interface{}) error { + return nil +} + +type DatabaseAutonomousVmClusterSslCertificateManagementResourceCrud struct { + tfresource.BaseCrud + Client *oci_database.DatabaseClient + Res *oci_database.RotateAutonomousVmClusterSslCertsResponse + DisableNotFoundRetries bool + WorkRequestClient *oci_work_requests.WorkRequestClient +} + +func (s *DatabaseAutonomousVmClusterSslCertificateManagementResourceCrud) ID() string { + return tfresource.GenerateDataSourceHashID("DatabaseAutonomousVmClusterSslCertificateManagementResource-", DatabaseAutonomousVmClusterSslCertificateManagementResource(), s.D) +} + +func (s *DatabaseAutonomousVmClusterSslCertificateManagementResourceCrud) Create() error { + request := oci_database.RotateAutonomousVmClusterSslCertsRequest{} + + if autonomousVmClusterId, ok := s.D.GetOkExists("autonomous_vm_cluster_id"); ok { + tmp := autonomousVmClusterId.(string) + request.AutonomousVmClusterId = &tmp + } + + if caBundleId, ok := s.D.GetOkExists("ca_bundle_id"); ok { + tmp := caBundleId.(string) + request.CaBundleId = &tmp + } + + if certificateAuthorityId, ok := s.D.GetOkExists("certificate_authority_id"); ok { + tmp := certificateAuthorityId.(string) + request.CertificateAuthorityId = &tmp + } + + if certificateGenerationType, ok := s.D.GetOkExists("certificate_generation_type"); ok { + request.CertificateGenerationType = oci_database.RotateAutonomousVmClusterSslCertsDetailsCertificateGenerationTypeEnum(certificateGenerationType.(string)) + } + + if certificateId, ok := s.D.GetOkExists("certificate_id"); ok { + tmp := certificateId.(string) + request.CertificateId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "database") + + response, err := s.Client.RotateAutonomousVmClusterSslCerts(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + s.Res = &response + + if workId != nil { + var identifier *string + var err error + identifier, err = tfresource.WaitForWorkRequestWithErrorHandling(s.WorkRequestClient, workId, "autonomousvmcluster", oci_work_requests.WorkRequestResourceActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate), s.DisableNotFoundRetries) + if identifier != nil { + s.D.SetId(*identifier) + } + if err != nil { + return err + } + } + return nil +} + +func (s *DatabaseAutonomousVmClusterSslCertificateManagementResourceCrud) SetData() error { + return nil +} diff --git a/internal/service/database/database_autonomous_vm_clusters_data_source.go b/internal/service/database/database_autonomous_vm_clusters_data_source.go index 64c3db3ca2d..d2e6addc35f 100644 --- a/internal/service/database/database_autonomous_vm_clusters_data_source.go +++ b/internal/service/database/database_autonomous_vm_clusters_data_source.go @@ -243,6 +243,14 @@ func (s *DatabaseAutonomousVmClustersDataSourceCrud) SetData() error { autonomousVmCluster["time_created"] = r.TimeCreated.String() } + if r.TimeDatabaseSslCertificateExpires != nil { + autonomousVmCluster["time_database_ssl_certificate_expires"] = r.TimeDatabaseSslCertificateExpires.String() + } + + if r.TimeOrdsCertificateExpires != nil { + autonomousVmCluster["time_ords_certificate_expires"] = r.TimeOrdsCertificateExpires.String() + } + if r.TimeZone != nil { autonomousVmCluster["time_zone"] = *r.TimeZone } diff --git a/internal/service/database/register_resource.go b/internal/service/database/register_resource.go index 7779466abe7..9aff31645a2 100644 --- a/internal/service/database/register_resource.go +++ b/internal/service/database/register_resource.go @@ -16,6 +16,8 @@ func RegisterResource() { tfresource.RegisterResource("oci_database_autonomous_database_wallet", DatabaseAutonomousDatabaseWalletResource()) tfresource.RegisterResource("oci_database_autonomous_exadata_infrastructure", DatabaseAutonomousExadataInfrastructureResource()) tfresource.RegisterResource("oci_database_autonomous_vm_cluster", DatabaseAutonomousVmClusterResource()) + tfresource.RegisterResource("oci_database_autonomous_vm_cluster_ords_certificate_management", DatabaseAutonomousVmClusterOrdsCertificateManagementResource()) + tfresource.RegisterResource("oci_database_autonomous_vm_cluster_ssl_certificate_management", DatabaseAutonomousVmClusterSslCertificateManagementResource()) tfresource.RegisterResource("oci_database_backup", DatabaseBackupResource()) tfresource.RegisterResource("oci_database_backup_cancel_management", DatabaseBackupCancelManagementResource()) tfresource.RegisterResource("oci_database_backup_destination", DatabaseBackupDestinationResource()) diff --git a/internal/service/golden_gate/golden_gate_deployment_backup_resource.go b/internal/service/golden_gate/golden_gate_deployment_backup_resource.go index 06221a16eb7..8125293b8e3 100644 --- a/internal/service/golden_gate/golden_gate_deployment_backup_resource.go +++ b/internal/service/golden_gate/golden_gate_deployment_backup_resource.go @@ -95,7 +95,7 @@ func GoldenGateDeploymentBackupResource() *schema.Resource { Computed: true, }, "size_in_bytes": { - Type: schema.TypeFloat, + Type: schema.TypeFloat, // keep TypeFloat instead of the computed TypeString Computed: true, }, "state": { diff --git a/internal/service/golden_gate/golden_gate_trail_files_data_source.go b/internal/service/golden_gate/golden_gate_trail_files_data_source.go index afd453dd78c..6cce387f5e2 100644 --- a/internal/service/golden_gate/golden_gate_trail_files_data_source.go +++ b/internal/service/golden_gate/golden_gate_trail_files_data_source.go @@ -73,7 +73,7 @@ func GoldenGateTrailFilesDataSource() *schema.Resource { Computed: true, }, "size_in_bytes": { - Type: schema.TypeFloat, + Type: schema.TypeFloat, // keep TypeFloat instead of the computed TypeString Computed: true, }, "time_last_updated": { diff --git a/internal/service/opsi/opsi_export.go b/internal/service/opsi/opsi_export.go index 388288dade1..5df4a4d26a3 100644 --- a/internal/service/opsi/opsi_export.go +++ b/internal/service/opsi/opsi_export.go @@ -133,6 +133,19 @@ var exportOpsiOpsiConfigurationHints = &tf_export.TerraformResourceHints{ }, } +var exportOpsiNewsReportHints = &tf_export.TerraformResourceHints{ + ResourceClass: "oci_opsi_news_report", + DatasourceClass: "oci_opsi_news_reports", + DatasourceItemsAttr: "news_report_collection", + IsDatasourceCollection: true, + ResourceAbbreviation: "news_report", + RequireResourceRefresh: true, + DiscoverableLifecycleStates: []string{ + string(oci_opsi.LifecycleStateActive), + string(oci_opsi.LifecycleStateNeedsAttention), + }, +} + var opsiResourceGraph = tf_export.TerraformResourceGraph{ "oci_identity_compartment": { {TerraformResourceHints: exportOpsiEnterpriseManagerBridgeHints}, @@ -142,6 +155,7 @@ var opsiResourceGraph = tf_export.TerraformResourceGraph{ {TerraformResourceHints: exportOpsiOperationsInsightsWarehouseHints}, {TerraformResourceHints: exportOpsiOperationsInsightsPrivateEndpointHints}, {TerraformResourceHints: exportOpsiOpsiConfigurationHints}, + {TerraformResourceHints: exportOpsiNewsReportHints}, }, "oci_opsi_operations_insights_warehouse": { { diff --git a/internal/service/opsi/opsi_news_report_data_source.go b/internal/service/opsi/opsi_news_report_data_source.go new file mode 100644 index 00000000000..00cb096fe73 --- /dev/null +++ b/internal/service/opsi/opsi_news_report_data_source.go @@ -0,0 +1,123 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package opsi + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + 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 OpsiNewsReportDataSource() *schema.Resource { + fieldMap := make(map[string]*schema.Schema) + fieldMap["news_report_id"] = &schema.Schema{ + Type: schema.TypeString, + Required: true, + } + return tfresource.GetSingularDataSourceItemSchema(OpsiNewsReportResource(), fieldMap, readSingularOpsiNewsReport) +} + +func readSingularOpsiNewsReport(d *schema.ResourceData, m interface{}) error { + sync := &OpsiNewsReportDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OperationsInsightsClient() + + return tfresource.ReadResource(sync) +} + +type OpsiNewsReportDataSourceCrud struct { + D *schema.ResourceData + Client *oci_opsi.OperationsInsightsClient + Res *oci_opsi.GetNewsReportResponse +} + +func (s *OpsiNewsReportDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *OpsiNewsReportDataSourceCrud) Get() error { + request := oci_opsi.GetNewsReportRequest{} + + if newsReportId, ok := s.D.GetOkExists("news_report_id"); ok { + tmp := newsReportId.(string) + request.NewsReportId = &tmp + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "opsi") + + response, err := s.Client.GetNewsReport(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + return nil +} + +func (s *OpsiNewsReportDataSourceCrud) 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.ContentTypes != nil { + s.D.Set("content_types", []interface{}{NewsContentTypesToMap(s.Res.ContentTypes)}) + } else { + s.D.Set("content_types", nil) + } + + 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) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + s.D.Set("locale", s.Res.Locale) + + if s.Res.Name != nil { + s.D.Set("name", *s.Res.Name) + } + + s.D.Set("news_frequency", s.Res.NewsFrequency) + + if s.Res.OnsTopicId != nil { + s.D.Set("ons_topic_id", *s.Res.OnsTopicId) + } + + s.D.Set("state", s.Res.LifecycleState) + + s.D.Set("status", s.Res.Status) + + 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/opsi/opsi_news_report_resource.go b/internal/service/opsi/opsi_news_report_resource.go new file mode 100644 index 00000000000..a4c49bec33b --- /dev/null +++ b/internal/service/opsi/opsi_news_report_resource.go @@ -0,0 +1,669 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package opsi + +import ( + "context" + "fmt" + "strings" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + + oci_common "github.com/oracle/oci-go-sdk/v65/common" + oci_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 OpsiNewsReportResource() *schema.Resource { + return &schema.Resource{ + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Timeouts: tfresource.DefaultTimeout, + Create: createOpsiNewsReport, + Read: readOpsiNewsReport, + Update: updateOpsiNewsReport, + Delete: deleteOpsiNewsReport, + Schema: map[string]*schema.Schema{ + // Required + "compartment_id": { + Type: schema.TypeString, + Required: true, + }, + "content_types": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // Required + "capacity_planning_resources": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + // Optional + // Computed + }, + }, + }, + "description": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "locale": { + Type: schema.TypeString, + Required: true, + }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "news_frequency": { + Type: schema.TypeString, + Required: true, + }, + "ons_topic_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, + }, + "status": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + // Computed + "lifecycle_details": { + Type: schema.TypeString, + Computed: true, + }, + "state": { + Type: schema.TypeString, + Computed: true, + }, + "system_tags": { + Type: schema.TypeMap, + Computed: true, + Elem: schema.TypeString, + }, + "time_created": { + Type: schema.TypeString, + Computed: true, + }, + "time_updated": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func createOpsiNewsReport(d *schema.ResourceData, m interface{}) error { + sync := &OpsiNewsReportResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OperationsInsightsClient() + + return tfresource.CreateResource(d, sync) +} + +func readOpsiNewsReport(d *schema.ResourceData, m interface{}) error { + sync := &OpsiNewsReportResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OperationsInsightsClient() + + return tfresource.ReadResource(sync) +} + +func updateOpsiNewsReport(d *schema.ResourceData, m interface{}) error { + sync := &OpsiNewsReportResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OperationsInsightsClient() + + return tfresource.UpdateResource(d, sync) +} + +func deleteOpsiNewsReport(d *schema.ResourceData, m interface{}) error { + sync := &OpsiNewsReportResourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OperationsInsightsClient() + sync.DisableNotFoundRetries = true + + return tfresource.DeleteResource(d, sync) +} + +type OpsiNewsReportResourceCrud struct { + tfresource.BaseCrud + Client *oci_opsi.OperationsInsightsClient + Res *oci_opsi.NewsReport + DisableNotFoundRetries bool +} + +func (s *OpsiNewsReportResourceCrud) ID() string { + return *s.Res.Id +} + +func (s *OpsiNewsReportResourceCrud) CreatedPending() []string { + return []string{ + string(oci_opsi.LifecycleStateCreating), + } +} + +func (s *OpsiNewsReportResourceCrud) CreatedTarget() []string { + return []string{ + string(oci_opsi.LifecycleStateActive), + string(oci_opsi.LifecycleStateNeedsAttention), + } +} + +func (s *OpsiNewsReportResourceCrud) DeletedPending() []string { + return []string{ + string(oci_opsi.LifecycleStateDeleting), + } +} + +func (s *OpsiNewsReportResourceCrud) DeletedTarget() []string { + return []string{ + string(oci_opsi.LifecycleStateDeleted), + } +} + +func (s *OpsiNewsReportResourceCrud) Create() error { + request := oci_opsi.CreateNewsReportRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if contentTypes, ok := s.D.GetOkExists("content_types"); ok { + if tmpList := contentTypes.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "content_types", 0) + tmp, err := s.mapToNewsContentTypes(fieldKeyFormat) + if err != nil { + return err + } + request.ContentTypes = &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 locale, ok := s.D.GetOkExists("locale"); ok { + request.Locale = oci_opsi.NewsLocaleEnum(locale.(string)) + } + + if name, ok := s.D.GetOkExists("name"); ok { + tmp := name.(string) + request.Name = &tmp + } + + if newsFrequency, ok := s.D.GetOkExists("news_frequency"); ok { + request.NewsFrequency = oci_opsi.NewsFrequencyEnum(newsFrequency.(string)) + } + + if onsTopicId, ok := s.D.GetOkExists("ons_topic_id"); ok { + tmp := onsTopicId.(string) + request.OnsTopicId = &tmp + } + + if status, ok := s.D.GetOkExists("status"); ok { + request.Status = oci_opsi.ResourceStatusEnum(status.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") + + response, err := s.Client.CreateNewsReport(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getNewsReportFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeCreated, s.D.Timeout(schema.TimeoutCreate)) +} + +func (s *OpsiNewsReportResourceCrud) getNewsReportFromWorkRequest(workId *string, retryPolicy *oci_common.RetryPolicy, + actionTypeEnum oci_opsi.ActionTypeEnum, timeout time.Duration) error { + + // Wait until it finishes + newsReportId, err := newsReportWaitForWorkRequest(workId, "opsi", + actionTypeEnum, timeout, s.DisableNotFoundRetries, s.Client) + + if err != nil { + return err + } + s.D.SetId(*newsReportId) + + return s.Get() +} + +func newsReportWorkRequestShouldRetryFunc(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, "opsi", startTime) { + return true + } + + // Only stop if the time Finished is set + if workRequestResponse, ok := response.Response.(oci_opsi.GetWorkRequestResponse); ok { + return workRequestResponse.TimeFinished == nil + } + return false + } +} + +func newsReportWaitForWorkRequest(wId *string, entityType string, action oci_opsi.ActionTypeEnum, + timeout time.Duration, disableFoundRetries bool, client *oci_opsi.OperationsInsightsClient) (*string, error) { + retryPolicy := tfresource.GetRetryPolicy(disableFoundRetries, "opsi") + retryPolicy.ShouldRetryOperation = newsReportWorkRequestShouldRetryFunc(timeout) + + response := oci_opsi.GetWorkRequestResponse{} + stateConf := &resource.StateChangeConf{ + Pending: []string{ + string(oci_opsi.OperationStatusInProgress), + string(oci_opsi.OperationStatusAccepted), + string(oci_opsi.OperationStatusCanceling), + }, + Target: []string{ + string(oci_opsi.OperationStatusSucceeded), + string(oci_opsi.OperationStatusFailed), + string(oci_opsi.OperationStatusCanceled), + }, + Refresh: func() (interface{}, string, error) { + var err error + response, err = client.GetWorkRequest(context.Background(), + oci_opsi.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_opsi.OperationStatusFailed || response.Status == oci_opsi.OperationStatusCanceled { + return nil, getErrorFromOpsiNewsReportWorkRequest(client, wId, retryPolicy, entityType, action) + } + + return identifier, nil +} + +func getErrorFromOpsiNewsReportWorkRequest(client *oci_opsi.OperationsInsightsClient, workId *string, retryPolicy *oci_common.RetryPolicy, entityType string, action oci_opsi.ActionTypeEnum) error { + response, err := client.ListWorkRequestErrors(context.Background(), + oci_opsi.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 *OpsiNewsReportResourceCrud) Get() error { + request := oci_opsi.GetNewsReportRequest{} + + tmp := s.D.Id() + request.NewsReportId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") + + response, err := s.Client.GetNewsReport(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response.NewsReport + return nil +} + +func (s *OpsiNewsReportResourceCrud) 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_opsi.UpdateNewsReportRequest{} + + if contentTypes, ok := s.D.GetOkExists("content_types"); ok { + if tmpList := contentTypes.([]interface{}); len(tmpList) > 0 { + fieldKeyFormat := fmt.Sprintf("%s.%d.%%s", "content_types", 0) + tmp, err := s.mapToNewsContentTypes(fieldKeyFormat) + if err != nil { + return err + } + request.ContentTypes = &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 locale, ok := s.D.GetOkExists("locale"); ok { + request.Locale = oci_opsi.NewsLocaleEnum(locale.(string)) + } + + if newsFrequency, ok := s.D.GetOkExists("news_frequency"); ok { + request.NewsFrequency = oci_opsi.NewsFrequencyEnum(newsFrequency.(string)) + } + + tmp := s.D.Id() + request.NewsReportId = &tmp + + if onsTopicId, ok := s.D.GetOkExists("ons_topic_id"); ok { + tmp := onsTopicId.(string) + request.OnsTopicId = &tmp + } + + if status, ok := s.D.GetOkExists("status"); ok { + request.Status = oci_opsi.ResourceStatusEnum(status.(string)) + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") + + response, err := s.Client.UpdateNewsReport(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getNewsReportFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} + +func (s *OpsiNewsReportResourceCrud) Delete() error { + request := oci_opsi.DeleteNewsReportRequest{} + + tmp := s.D.Id() + request.NewsReportId = &tmp + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") + + response, err := s.Client.DeleteNewsReport(context.Background(), request) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + // Wait until it finishes + _, delWorkRequestErr := newsReportWaitForWorkRequest(workId, "opsi", + oci_opsi.ActionTypeDeleted, s.D.Timeout(schema.TimeoutDelete), s.DisableNotFoundRetries, s.Client) + return delWorkRequestErr +} + +func (s *OpsiNewsReportResourceCrud) SetData() error { + if s.Res.CompartmentId != nil { + s.D.Set("compartment_id", *s.Res.CompartmentId) + } + + if s.Res.ContentTypes != nil { + s.D.Set("content_types", []interface{}{NewsContentTypesToMap(s.Res.ContentTypes)}) + } else { + s.D.Set("content_types", nil) + } + + 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) + s.D.Set("freeform_tags", s.Res.FreeformTags) + + if s.Res.LifecycleDetails != nil { + s.D.Set("lifecycle_details", *s.Res.LifecycleDetails) + } + + s.D.Set("locale", s.Res.Locale) + + if s.Res.Name != nil { + s.D.Set("name", *s.Res.Name) + } + + s.D.Set("news_frequency", s.Res.NewsFrequency) + + if s.Res.OnsTopicId != nil { + s.D.Set("ons_topic_id", *s.Res.OnsTopicId) + } + + s.D.Set("state", s.Res.LifecycleState) + + s.D.Set("status", s.Res.Status) + + 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 *OpsiNewsReportResourceCrud) mapToNewsContentTypes(fieldKeyFormat string) (oci_opsi.NewsContentTypes, error) { + result := oci_opsi.NewsContentTypes{} + + if capacityPlanningResources, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "capacity_planning_resources")); ok { + strArray := capacityPlanningResources.([]interface{}) + tmp := make([]oci_opsi.NewsContentTypesResourceEnum, len(strArray)) + for i := range strArray { + switch strArray[i].(string) { + case "HOST": + tmp[i] = oci_opsi.NewsContentTypesResourceHost + case "DATABASE": + tmp[i] = oci_opsi.NewsContentTypesResourceDatabase + case "EXADATA": + tmp[i] = oci_opsi.NewsContentTypesResourceExadata + default: + return result, fmt.Errorf("Not a valid capacity planning resource was provided") + } + } + result.CapacityPlanningResources = tmp + } + return result, nil +} + +func NewsContentTypesToMap(obj *oci_opsi.NewsContentTypes) map[string]interface{} { + result := map[string]interface{}{} + capacityPlanningResources := []interface{}{} + + for _, item := range obj.CapacityPlanningResources { + capacityPlanningResources = append(capacityPlanningResources, NewsContentTypesResourceToMap(item)) + } + result["capacity_planning_resources"] = capacityPlanningResources + return result +} + +func NewsContentTypesResourceToMap(obj oci_opsi.NewsContentTypesResourceEnum) string { + var result string + + switch obj { + case oci_opsi.NewsContentTypesResourceHost: + result = "HOST" + case oci_opsi.NewsContentTypesResourceDatabase: + result = "DATABASE" + case oci_opsi.NewsContentTypesResourceExadata: + result = "EXADATA" + default: + fmt.Println("ERROR, Nota a valid resource") + } + return result +} + +func NewsReportSummaryToMap(obj oci_opsi.NewsReportSummary) map[string]interface{} { + result := map[string]interface{}{} + + if obj.CompartmentId != nil { + result["compartment_id"] = string(*obj.CompartmentId) + } + + if obj.ContentTypes != nil { + result["content_types"] = []interface{}{NewsContentTypesToMap(obj.ContentTypes)} + } + + if obj.DefinedTags != nil { + result["defined_tags"] = tfresource.DefinedTagsToMap(obj.DefinedTags) + } + + if obj.Description != nil { + result["description"] = string(*obj.Description) + } + + result["freeform_tags"] = obj.FreeformTags + result["freeform_tags"] = obj.FreeformTags + + if obj.Id != nil { + result["id"] = string(*obj.Id) + } + + if obj.LifecycleDetails != nil { + result["lifecycle_details"] = string(*obj.LifecycleDetails) + } + + result["locale"] = string(obj.Locale) + + if obj.Name != nil { + result["name"] = string(*obj.Name) + } + + result["news_frequency"] = string(obj.NewsFrequency) + + if obj.OnsTopicId != nil { + result["ons_topic_id"] = string(*obj.OnsTopicId) + } + + result["state"] = string(obj.LifecycleState) + + result["status"] = string(obj.Status) + + if obj.SystemTags != nil { + result["system_tags"] = tfresource.SystemTagsToMap(obj.SystemTags) + } + + if obj.TimeCreated != nil { + result["time_created"] = obj.TimeCreated.String() + } + + if obj.TimeUpdated != nil { + result["time_updated"] = obj.TimeUpdated.String() + } + + return result +} + +func (s *OpsiNewsReportResourceCrud) updateCompartment(compartment interface{}) error { + changeCompartmentRequest := oci_opsi.ChangeNewsReportCompartmentRequest{} + + compartmentTmp := compartment.(string) + changeCompartmentRequest.CompartmentId = &compartmentTmp + + idTmp := s.D.Id() + changeCompartmentRequest.NewsReportId = &idTmp + + changeCompartmentRequest.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi") + + response, err := s.Client.ChangeNewsReportCompartment(context.Background(), changeCompartmentRequest) + if err != nil { + return err + } + + workId := response.OpcWorkRequestId + return s.getNewsReportFromWorkRequest(workId, tfresource.GetRetryPolicy(s.DisableNotFoundRetries, "opsi"), oci_opsi.ActionTypeUpdated, s.D.Timeout(schema.TimeoutUpdate)) +} diff --git a/internal/service/opsi/opsi_news_reports_data_source.go b/internal/service/opsi/opsi_news_reports_data_source.go new file mode 100644 index 00000000000..5e6903063ac --- /dev/null +++ b/internal/service/opsi/opsi_news_reports_data_source.go @@ -0,0 +1,176 @@ +// Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +// Licensed under the Mozilla Public License v2.0 + +package opsi + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + 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 OpsiNewsReportsDataSource() *schema.Resource { + return &schema.Resource{ + Read: readOpsiNewsReports, + Schema: map[string]*schema.Schema{ + "filter": tfresource.DataSourceFiltersSchema(), + "compartment_id": { + Type: schema.TypeString, + Optional: true, + }, + "compartment_id_in_subtree": { + Type: schema.TypeBool, + Optional: true, + }, + "news_report_id": { + Type: schema.TypeString, + Optional: true, + }, + "state": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "status": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "news_report_collection": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + + "items": { + Type: schema.TypeList, + Computed: true, + Elem: tfresource.GetDataSourceItemSchema(OpsiNewsReportResource()), + }, + }, + }, + }, + }, + } +} + +func readOpsiNewsReports(d *schema.ResourceData, m interface{}) error { + sync := &OpsiNewsReportsDataSourceCrud{} + sync.D = d + sync.Client = m.(*client.OracleClients).OperationsInsightsClient() + + return tfresource.ReadResource(sync) +} + +type OpsiNewsReportsDataSourceCrud struct { + D *schema.ResourceData + Client *oci_opsi.OperationsInsightsClient + Res *oci_opsi.ListNewsReportsResponse +} + +func (s *OpsiNewsReportsDataSourceCrud) VoidState() { + s.D.SetId("") +} + +func (s *OpsiNewsReportsDataSourceCrud) Get() error { + request := oci_opsi.ListNewsReportsRequest{} + + if compartmentId, ok := s.D.GetOkExists("compartment_id"); ok { + tmp := compartmentId.(string) + request.CompartmentId = &tmp + } + + if compartmentIdInSubtree, ok := s.D.GetOkExists("compartment_id_in_subtree"); ok { + tmp := compartmentIdInSubtree.(bool) + request.CompartmentIdInSubtree = &tmp + } + + if newsReportId, ok := s.D.GetOkExists("id"); ok { + tmp := newsReportId.(string) + request.NewsReportId = &tmp + } + + if state, ok := s.D.GetOkExists("state"); ok { + interfaces := state.([]interface{}) + tmp := make([]oci_opsi.LifecycleStateEnum, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = oci_opsi.LifecycleStateEnum(interfaces[i].(string)) + } + } + if len(tmp) != 0 || s.D.HasChange("state") { + request.LifecycleState = tmp + } + } + + if status, ok := s.D.GetOkExists("status"); ok { + interfaces := status.([]interface{}) + tmp := make([]oci_opsi.ResourceStatusEnum, len(interfaces)) + for i := range interfaces { + if interfaces[i] != nil { + tmp[i] = oci_opsi.ResourceStatusEnum(interfaces[i].(string)) + } + } + if len(tmp) != 0 || s.D.HasChange("status") { + request.Status = tmp + } + } + + request.RequestMetadata.RetryPolicy = tfresource.GetRetryPolicy(false, "opsi") + + response, err := s.Client.ListNewsReports(context.Background(), request) + if err != nil { + return err + } + + s.Res = &response + request.Page = s.Res.OpcNextPage + + for request.Page != nil { + listResponse, err := s.Client.ListNewsReports(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 *OpsiNewsReportsDataSourceCrud) SetData() error { + if s.Res == nil { + return nil + } + + s.D.SetId(tfresource.GenerateDataSourceHashID("OpsiNewsReportsDataSource-", OpsiNewsReportsDataSource(), s.D)) + resources := []map[string]interface{}{} + newsReport := map[string]interface{}{} + + items := []interface{}{} + for _, item := range s.Res.Items { + items = append(items, NewsReportSummaryToMap(item)) + } + newsReport["items"] = items + + if f, fOk := s.D.GetOkExists("filter"); fOk { + items = tfresource.ApplyFiltersInCollection(f.(*schema.Set), items, OpsiNewsReportsDataSource().Schema["news_report_collection"].Elem.(*schema.Resource).Schema) + newsReport["items"] = items + } + + resources = append(resources, newsReport) + if err := s.D.Set("news_report_collection", resources); err != nil { + return err + } + + return nil +} diff --git a/internal/service/opsi/register_datasource.go b/internal/service/opsi/register_datasource.go index ad6fc4cf553..0b4281b0b4b 100644 --- a/internal/service/opsi/register_datasource.go +++ b/internal/service/opsi/register_datasource.go @@ -20,6 +20,8 @@ func RegisterDatasource() { tfresource.RegisterDatasource("oci_opsi_host_insight", OpsiHostInsightDataSource()) tfresource.RegisterDatasource("oci_opsi_host_insights", OpsiHostInsightsDataSource()) tfresource.RegisterDatasource("oci_opsi_importable_compute_entities", OpsiImportableComputeEntitiesDataSource()) + tfresource.RegisterDatasource("oci_opsi_news_report", OpsiNewsReportDataSource()) + tfresource.RegisterDatasource("oci_opsi_news_reports", OpsiNewsReportsDataSource()) tfresource.RegisterDatasource("oci_opsi_importable_compute_entity", OpsiImportableComputeEntityDataSource()) tfresource.RegisterDatasource("oci_opsi_operations_insights_private_endpoint", OpsiOperationsInsightsPrivateEndpointDataSource()) tfresource.RegisterDatasource("oci_opsi_operations_insights_private_endpoints", OpsiOperationsInsightsPrivateEndpointsDataSource()) diff --git a/internal/service/opsi/register_resource.go b/internal/service/opsi/register_resource.go index 90e68a8c5e5..9adf047c636 100644 --- a/internal/service/opsi/register_resource.go +++ b/internal/service/opsi/register_resource.go @@ -11,6 +11,7 @@ func RegisterResource() { tfresource.RegisterResource("oci_opsi_enterprise_manager_bridge", OpsiEnterpriseManagerBridgeResource()) tfresource.RegisterResource("oci_opsi_exadata_insight", OpsiExadataInsightResource()) tfresource.RegisterResource("oci_opsi_host_insight", OpsiHostInsightResource()) + tfresource.RegisterResource("oci_opsi_news_report", OpsiNewsReportResource()) tfresource.RegisterResource("oci_opsi_operations_insights_private_endpoint", OpsiOperationsInsightsPrivateEndpointResource()) tfresource.RegisterResource("oci_opsi_operations_insights_warehouse", OpsiOperationsInsightsWarehouseResource()) tfresource.RegisterResource("oci_opsi_operations_insights_warehouse_download_warehouse_wallet", OpsiOperationsInsightsWarehouseDownloadWarehouseWalletResource()) diff --git a/vendor/github.com/google/go-cmp/cmp/compare.go b/vendor/github.com/google/go-cmp/cmp/compare.go index 86d0903b8b5..087320da7f0 100644 --- a/vendor/github.com/google/go-cmp/cmp/compare.go +++ b/vendor/github.com/google/go-cmp/cmp/compare.go @@ -13,21 +13,21 @@ // // The primary features of cmp are: // -// • When the default behavior of equality does not suit the needs of the test, -// custom equality functions can override the equality operation. -// For example, an equality function may report floats as equal so long as they -// are within some tolerance of each other. +// - When the default behavior of equality does not suit the test's needs, +// custom equality functions can override the equality operation. +// For example, an equality function may report floats as equal so long as +// they are within some tolerance of each other. // -// • Types that have an Equal method may use that method to determine equality. -// This allows package authors to determine the equality operation for the types -// that they define. +// - Types with an Equal method may use that method to determine equality. +// This allows package authors to determine the equality operation +// for the types that they define. // -// • If no custom equality functions are used and no Equal method is defined, -// equality is determined by recursively comparing the primitive kinds on both -// values, much like reflect.DeepEqual. Unlike reflect.DeepEqual, unexported -// fields are not compared by default; they result in panics unless suppressed -// by using an Ignore option (see cmpopts.IgnoreUnexported) or explicitly -// compared using the Exporter option. +// - If no custom equality functions are used and no Equal method is defined, +// equality is determined by recursively comparing the primitive kinds on +// both values, much like reflect.DeepEqual. Unlike reflect.DeepEqual, +// unexported fields are not compared by default; they result in panics +// unless suppressed by using an Ignore option (see cmpopts.IgnoreUnexported) +// or explicitly compared using the Exporter option. package cmp import ( @@ -36,33 +36,34 @@ import ( "strings" "github.com/google/go-cmp/cmp/internal/diff" - "github.com/google/go-cmp/cmp/internal/flags" "github.com/google/go-cmp/cmp/internal/function" "github.com/google/go-cmp/cmp/internal/value" ) +// TODO(≥go1.18): Use any instead of interface{}. + // Equal reports whether x and y are equal by recursively applying the // following rules in the given order to x and y and all of their sub-values: // -// • Let S be the set of all Ignore, Transformer, and Comparer options that -// remain after applying all path filters, value filters, and type filters. -// If at least one Ignore exists in S, then the comparison is ignored. -// If the number of Transformer and Comparer options in S is greater than one, -// then Equal panics because it is ambiguous which option to use. -// If S contains a single Transformer, then use that to transform the current -// values and recursively call Equal on the output values. -// If S contains a single Comparer, then use that to compare the current values. -// Otherwise, evaluation proceeds to the next rule. +// - Let S be the set of all Ignore, Transformer, and Comparer options that +// remain after applying all path filters, value filters, and type filters. +// If at least one Ignore exists in S, then the comparison is ignored. +// If the number of Transformer and Comparer options in S is non-zero, +// then Equal panics because it is ambiguous which option to use. +// If S contains a single Transformer, then use that to transform +// the current values and recursively call Equal on the output values. +// If S contains a single Comparer, then use that to compare the current values. +// Otherwise, evaluation proceeds to the next rule. // -// • If the values have an Equal method of the form "(T) Equal(T) bool" or -// "(T) Equal(I) bool" where T is assignable to I, then use the result of -// x.Equal(y) even if x or y is nil. Otherwise, no such method exists and -// evaluation proceeds to the next rule. +// - If the values have an Equal method of the form "(T) Equal(T) bool" or +// "(T) Equal(I) bool" where T is assignable to I, then use the result of +// x.Equal(y) even if x or y is nil. Otherwise, no such method exists and +// evaluation proceeds to the next rule. // -// • Lastly, try to compare x and y based on their basic kinds. -// Simple kinds like booleans, integers, floats, complex numbers, strings, and -// channels are compared using the equivalent of the == operator in Go. -// Functions are only equal if they are both nil, otherwise they are unequal. +// - Lastly, try to compare x and y based on their basic kinds. +// Simple kinds like booleans, integers, floats, complex numbers, strings, +// and channels are compared using the equivalent of the == operator in Go. +// Functions are only equal if they are both nil, otherwise they are unequal. // // Structs are equal if recursively calling Equal on all fields report equal. // If a struct contains unexported fields, Equal panics unless an Ignore option @@ -143,7 +144,7 @@ func rootStep(x, y interface{}) PathStep { // so that they have the same parent type. var t reflect.Type if !vx.IsValid() || !vy.IsValid() || vx.Type() != vy.Type() { - t = reflect.TypeOf((*interface{})(nil)).Elem() + t = anyType if vx.IsValid() { vvx := reflect.New(t).Elem() vvx.Set(vx) @@ -319,7 +320,6 @@ func (s *state) tryMethod(t reflect.Type, vx, vy reflect.Value) bool { } func (s *state) callTRFunc(f, v reflect.Value, step Transform) reflect.Value { - v = sanitizeValue(v, f.Type().In(0)) if !s.dynChecker.Next() { return f.Call([]reflect.Value{v})[0] } @@ -343,8 +343,6 @@ func (s *state) callTRFunc(f, v reflect.Value, step Transform) reflect.Value { } func (s *state) callTTBFunc(f, x, y reflect.Value) bool { - x = sanitizeValue(x, f.Type().In(0)) - y = sanitizeValue(y, f.Type().In(1)) if !s.dynChecker.Next() { return f.Call([]reflect.Value{x, y})[0].Bool() } @@ -372,19 +370,6 @@ func detectRaces(c chan<- reflect.Value, f reflect.Value, vs ...reflect.Value) { ret = f.Call(vs)[0] } -// sanitizeValue converts nil interfaces of type T to those of type R, -// assuming that T is assignable to R. -// Otherwise, it returns the input value as is. -func sanitizeValue(v reflect.Value, t reflect.Type) reflect.Value { - // TODO(≥go1.10): Workaround for reflect bug (https://golang.org/issue/22143). - if !flags.AtLeastGo110 { - if v.Kind() == reflect.Interface && v.IsNil() && v.Type() != t { - return reflect.New(t).Elem() - } - } - return v -} - func (s *state) compareStruct(t reflect.Type, vx, vy reflect.Value) { var addr bool var vax, vay reflect.Value // Addressable versions of vx and vy @@ -654,7 +639,9 @@ type dynChecker struct{ curr, next int } // Next increments the state and reports whether a check should be performed. // // Checks occur every Nth function call, where N is a triangular number: +// // 0 1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171 190 ... +// // See https://en.wikipedia.org/wiki/Triangular_number // // This sequence ensures that the cost of checks drops significantly as diff --git a/vendor/github.com/google/go-cmp/cmp/export_panic.go b/vendor/github.com/google/go-cmp/cmp/export_panic.go index 5ff0b4218c6..ae851fe53f2 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_panic.go +++ b/vendor/github.com/google/go-cmp/cmp/export_panic.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego // +build purego package cmp diff --git a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go index 21eb54858e0..e2c0f74e839 100644 --- a/vendor/github.com/google/go-cmp/cmp/export_unsafe.go +++ b/vendor/github.com/google/go-cmp/cmp/export_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego // +build !purego package cmp diff --git a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go index 1daaaacc5ee..36062a604ca 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !cmp_debug // +build !cmp_debug package diff diff --git a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go index 4b91dbcacae..a3b97a1ad57 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/diff/debug_enable.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build cmp_debug // +build cmp_debug package diff diff --git a/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go b/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go index bc196b16cfa..a248e5436d9 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/diff/diff.go @@ -127,9 +127,9 @@ var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 // This function returns an edit-script, which is a sequence of operations // needed to convert one list into the other. The following invariants for // the edit-script are maintained: -// • eq == (es.Dist()==0) -// • nx == es.LenX() -// • ny == es.LenY() +// - eq == (es.Dist()==0) +// - nx == es.LenX() +// - ny == es.LenY() // // This algorithm is not guaranteed to be an optimal solution (i.e., one that // produces an edit-script with a minimal Levenshtein distance). This algorithm @@ -169,12 +169,13 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { // A diagonal edge is equivalent to a matching symbol between both X and Y. // Invariants: - // • 0 ≤ fwdPath.X ≤ (fwdFrontier.X, revFrontier.X) ≤ revPath.X ≤ nx - // • 0 ≤ fwdPath.Y ≤ (fwdFrontier.Y, revFrontier.Y) ≤ revPath.Y ≤ ny + // - 0 ≤ fwdPath.X ≤ (fwdFrontier.X, revFrontier.X) ≤ revPath.X ≤ nx + // - 0 ≤ fwdPath.Y ≤ (fwdFrontier.Y, revFrontier.Y) ≤ revPath.Y ≤ ny // // In general: - // • fwdFrontier.X < revFrontier.X - // • fwdFrontier.Y < revFrontier.Y + // - fwdFrontier.X < revFrontier.X + // - fwdFrontier.Y < revFrontier.Y + // // Unless, it is time for the algorithm to terminate. fwdPath := path{+1, point{0, 0}, make(EditScript, 0, (nx+ny)/2)} revPath := path{-1, point{nx, ny}, make(EditScript, 0)} @@ -195,19 +196,21 @@ func Difference(nx, ny int, f EqualFunc) (es EditScript) { // computing sub-optimal edit-scripts between two lists. // // The algorithm is approximately as follows: - // • Searching for differences switches back-and-forth between - // a search that starts at the beginning (the top-left corner), and - // a search that starts at the end (the bottom-right corner). The goal of - // the search is connect with the search from the opposite corner. - // • As we search, we build a path in a greedy manner, where the first - // match seen is added to the path (this is sub-optimal, but provides a - // decent result in practice). When matches are found, we try the next pair - // of symbols in the lists and follow all matches as far as possible. - // • When searching for matches, we search along a diagonal going through - // through the "frontier" point. If no matches are found, we advance the - // frontier towards the opposite corner. - // • This algorithm terminates when either the X coordinates or the - // Y coordinates of the forward and reverse frontier points ever intersect. + // - Searching for differences switches back-and-forth between + // a search that starts at the beginning (the top-left corner), and + // a search that starts at the end (the bottom-right corner). + // The goal of the search is connect with the search + // from the opposite corner. + // - As we search, we build a path in a greedy manner, + // where the first match seen is added to the path (this is sub-optimal, + // but provides a decent result in practice). When matches are found, + // we try the next pair of symbols in the lists and follow all matches + // as far as possible. + // - When searching for matches, we search along a diagonal going through + // through the "frontier" point. If no matches are found, + // we advance the frontier towards the opposite corner. + // - This algorithm terminates when either the X coordinates or the + // Y coordinates of the forward and reverse frontier points ever intersect. // This algorithm is correct even if searching only in the forward direction // or in the reverse direction. We do both because it is commonly observed @@ -389,6 +392,7 @@ type point struct{ X, Y int } func (p *point) add(dx, dy int) { p.X += dx; p.Y += dy } // zigzag maps a consecutive sequence of integers to a zig-zag sequence. +// // [0 1 2 3 4 5 ...] => [0 -1 +1 -2 +2 ...] func zigzag(x int) int { if x&1 != 0 { diff --git a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go b/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go deleted file mode 100644 index 82d1d7fbf8a..00000000000 --- a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_legacy.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019, The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !go1.10 - -package flags - -// AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. -const AtLeastGo110 = false diff --git a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go b/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go deleted file mode 100644 index 8646f052934..00000000000 --- a/vendor/github.com/google/go-cmp/cmp/internal/flags/toolchain_recent.go +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019, The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build go1.10 - -package flags - -// AtLeastGo110 reports whether the Go toolchain is at least Go 1.10. -const AtLeastGo110 = true diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/name.go b/vendor/github.com/google/go-cmp/cmp/internal/value/name.go index b6c12cefb47..7b498bb2cb9 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/name.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/name.go @@ -9,6 +9,8 @@ import ( "strconv" ) +var anyType = reflect.TypeOf((*interface{})(nil)).Elem() + // TypeString is nearly identical to reflect.Type.String, // but has an additional option to specify that full type names be used. func TypeString(t reflect.Type, qualified bool) string { @@ -20,6 +22,11 @@ func appendTypeName(b []byte, t reflect.Type, qualified, elideFunc bool) []byte // of the same name and within the same package, // but declared within the namespace of different functions. + // Use the "any" alias instead of "interface{}" for better readability. + if t == anyType { + return append(b, "any"...) + } + // Named type. if t.Name() != "" { if qualified && t.PkgPath() != "" { diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go index 44f4a5afddc..1a71bfcbd39 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_purego.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build purego // +build purego package value diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go index a605953d466..16e6860af6e 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/pointer_unsafe.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !purego // +build !purego package value diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go b/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go deleted file mode 100644 index 9147a299731..00000000000 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2017, The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package value - -import ( - "math" - "reflect" -) - -// IsZero reports whether v is the zero value. -// This does not rely on Interface and so can be used on unexported fields. -func IsZero(v reflect.Value) bool { - switch v.Kind() { - case reflect.Bool: - return v.Bool() == false - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return math.Float64bits(v.Float()) == 0 - case reflect.Complex64, reflect.Complex128: - return math.Float64bits(real(v.Complex())) == 0 && math.Float64bits(imag(v.Complex())) == 0 - case reflect.String: - return v.String() == "" - case reflect.UnsafePointer: - return v.Pointer() == 0 - case reflect.Chan, reflect.Func, reflect.Interface, reflect.Ptr, reflect.Map, reflect.Slice: - return v.IsNil() - case reflect.Array: - for i := 0; i < v.Len(); i++ { - if !IsZero(v.Index(i)) { - return false - } - } - return true - case reflect.Struct: - for i := 0; i < v.NumField(); i++ { - if !IsZero(v.Field(i)) { - return false - } - } - return true - } - return false -} diff --git a/vendor/github.com/google/go-cmp/cmp/options.go b/vendor/github.com/google/go-cmp/cmp/options.go index e57b9eb5392..1f9ca9c4892 100644 --- a/vendor/github.com/google/go-cmp/cmp/options.go +++ b/vendor/github.com/google/go-cmp/cmp/options.go @@ -33,6 +33,7 @@ type Option interface { } // applicableOption represents the following types: +// // Fundamental: ignore | validator | *comparer | *transformer // Grouping: Options type applicableOption interface { @@ -43,6 +44,7 @@ type applicableOption interface { } // coreOption represents the following types: +// // Fundamental: ignore | validator | *comparer | *transformer // Filters: *pathFilter | *valuesFilter type coreOption interface { @@ -336,9 +338,9 @@ func (tr transformer) String() string { // both implement T. // // The equality function must be: -// • Symmetric: equal(x, y) == equal(y, x) -// • Deterministic: equal(x, y) == equal(x, y) -// • Pure: equal(x, y) does not modify x or y +// - Symmetric: equal(x, y) == equal(y, x) +// - Deterministic: equal(x, y) == equal(x, y) +// - Pure: equal(x, y) does not modify x or y func Comparer(f interface{}) Option { v := reflect.ValueOf(f) if !function.IsType(v.Type(), function.Equal) || v.IsNil() { @@ -430,7 +432,7 @@ func AllowUnexported(types ...interface{}) Option { } // Result represents the comparison result for a single node and -// is provided by cmp when calling Result (see Reporter). +// is provided by cmp when calling Report (see Reporter). type Result struct { _ [0]func() // Make Result incomparable flags resultFlags diff --git a/vendor/github.com/google/go-cmp/cmp/path.go b/vendor/github.com/google/go-cmp/cmp/path.go index f01eff318c5..a0a588502ed 100644 --- a/vendor/github.com/google/go-cmp/cmp/path.go +++ b/vendor/github.com/google/go-cmp/cmp/path.go @@ -41,13 +41,13 @@ type PathStep interface { // The type of each valid value is guaranteed to be identical to Type. // // In some cases, one or both may be invalid or have restrictions: - // • For StructField, both are not interface-able if the current field - // is unexported and the struct type is not explicitly permitted by - // an Exporter to traverse unexported fields. - // • For SliceIndex, one may be invalid if an element is missing from - // either the x or y slice. - // • For MapIndex, one may be invalid if an entry is missing from - // either the x or y map. + // - For StructField, both are not interface-able if the current field + // is unexported and the struct type is not explicitly permitted by + // an Exporter to traverse unexported fields. + // - For SliceIndex, one may be invalid if an element is missing from + // either the x or y slice. + // - For MapIndex, one may be invalid if an entry is missing from + // either the x or y map. // // The provided values must not be mutated. Values() (vx, vy reflect.Value) @@ -94,6 +94,7 @@ func (pa Path) Index(i int) PathStep { // The simplified path only contains struct field accesses. // // For example: +// // MyMap.MySlices.MyField func (pa Path) String() string { var ss []string @@ -108,6 +109,7 @@ func (pa Path) String() string { // GoString returns the path to a specific node using Go syntax. // // For example: +// // (*root.MyMap["key"].(*mypkg.MyStruct).MySlices)[2][3].MyField func (pa Path) GoString() string { var ssPre, ssPost []string @@ -159,7 +161,7 @@ func (ps pathStep) String() string { if ps.typ == nil { return "" } - s := ps.typ.String() + s := value.TypeString(ps.typ, false) if s == "" || strings.ContainsAny(s, "{}\n") { return "root" // Type too simple or complex to print } @@ -178,7 +180,7 @@ type structField struct { unexported bool mayForce bool // Forcibly allow visibility paddr bool // Was parent addressable? - pvx, pvy reflect.Value // Parent values (always addressible) + pvx, pvy reflect.Value // Parent values (always addressable) field reflect.StructField // Field information } @@ -282,7 +284,7 @@ type typeAssertion struct { func (ta TypeAssertion) Type() reflect.Type { return ta.typ } func (ta TypeAssertion) Values() (vx, vy reflect.Value) { return ta.vx, ta.vy } -func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", ta.typ) } +func (ta TypeAssertion) String() string { return fmt.Sprintf(".(%v)", value.TypeString(ta.typ, false)) } // Transform is a transformation from the parent type to the current type. type Transform struct{ *transform } diff --git a/vendor/github.com/google/go-cmp/cmp/report_compare.go b/vendor/github.com/google/go-cmp/cmp/report_compare.go index 104bb30538b..2050bf6b46b 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -7,8 +7,6 @@ package cmp import ( "fmt" "reflect" - - "github.com/google/go-cmp/cmp/internal/value" ) // numContextRecords is the number of surrounding equal records to print. @@ -116,7 +114,10 @@ func (opts formatOptions) FormatDiff(v *valueNode, ptrs *pointerReferences) (out } // For leaf nodes, format the value based on the reflect.Values alone. - if v.MaxDepth == 0 { + // As a special case, treat equal []byte as a leaf nodes. + isBytes := v.Type.Kind() == reflect.Slice && v.Type.Elem() == byteType + isEqualBytes := isBytes && v.NumDiff+v.NumIgnored+v.NumTransformed == 0 + if v.MaxDepth == 0 || isEqualBytes { switch opts.DiffMode { case diffUnknown, diffIdentical: // Format Equal. @@ -245,11 +246,11 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind, pt var isZero bool switch opts.DiffMode { case diffIdentical: - isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueY) + isZero = r.Value.ValueX.IsZero() || r.Value.ValueY.IsZero() case diffRemoved: - isZero = value.IsZero(r.Value.ValueX) + isZero = r.Value.ValueX.IsZero() case diffInserted: - isZero = value.IsZero(r.Value.ValueY) + isZero = r.Value.ValueY.IsZero() } if isZero { continue diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 33f03577f98..2ab41fad3fb 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -16,6 +16,13 @@ import ( "github.com/google/go-cmp/cmp/internal/value" ) +var ( + anyType = reflect.TypeOf((*interface{})(nil)).Elem() + stringType = reflect.TypeOf((*string)(nil)).Elem() + bytesType = reflect.TypeOf((*[]byte)(nil)).Elem() + byteType = reflect.TypeOf((*byte)(nil)).Elem() +) + type formatValueOptions struct { // AvoidStringer controls whether to avoid calling custom stringer // methods like error.Error or fmt.Stringer.String. @@ -184,7 +191,7 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } for i := 0; i < v.NumField(); i++ { vv := v.Field(i) - if value.IsZero(vv) { + if vv.IsZero() { continue // Elide fields with zero values } if len(list) == maxLen { @@ -205,12 +212,13 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } // Check whether this is a []byte of text data. - if t.Elem() == reflect.TypeOf(byte(0)) { + if t.Elem() == byteType { b := v.Bytes() - isPrintSpace := func(r rune) bool { return unicode.IsPrint(r) && unicode.IsSpace(r) } + isPrintSpace := func(r rune) bool { return unicode.IsPrint(r) || unicode.IsSpace(r) } if len(b) > 0 && utf8.Valid(b) && len(bytes.TrimFunc(b, isPrintSpace)) == 0 { out = opts.formatString("", string(b)) - return opts.WithTypeMode(emitType).FormatType(t, out) + skipType = true + return opts.FormatType(t, out) } } @@ -281,7 +289,12 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } defer ptrs.Pop() - skipType = true // Let the underlying value print the type instead + // Skip the name only if this is an unnamed pointer type. + // Otherwise taking the address of a value does not reproduce + // the named pointer type. + if v.Type().Name() == "" { + skipType = true // Let the underlying value print the type instead + } out = opts.FormatValue(v.Elem(), t.Kind(), ptrs) out = wrapTrunkReference(ptrRef, opts.PrintAddresses, out) out = &textWrap{Prefix: "&", Value: out} @@ -292,7 +305,6 @@ func (opts formatOptions) FormatValue(v reflect.Value, parentKind reflect.Kind, } // Interfaces accept different concrete types, // so configure the underlying value to explicitly print the type. - skipType = true // Print the concrete type instead return opts.WithTypeMode(emitType).FormatValue(v.Elem(), t.Kind(), ptrs) default: panic(fmt.Sprintf("%v kind not handled", v.Kind())) diff --git a/vendor/github.com/google/go-cmp/cmp/report_slices.go b/vendor/github.com/google/go-cmp/cmp/report_slices.go index 2ad3bc85ba8..23e444f62f3 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_slices.go +++ b/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -80,7 +80,7 @@ func (opts formatOptions) CanFormatDiffSlice(v *valueNode) bool { } // Use specialized string diffing for longer slices or strings. - const minLength = 64 + const minLength = 32 return vx.Len() >= minLength && vy.Len() >= minLength } @@ -104,7 +104,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { case t.Kind() == reflect.String: sx, sy = vx.String(), vy.String() isString = true - case t.Kind() == reflect.Slice && t.Elem() == reflect.TypeOf(byte(0)): + case t.Kind() == reflect.Slice && t.Elem() == byteType: sx, sy = string(vx.Bytes()), string(vy.Bytes()) isString = true case t.Kind() == reflect.Array: @@ -147,7 +147,10 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { }) efficiencyLines := float64(esLines.Dist()) / float64(len(esLines)) efficiencyBytes := float64(esBytes.Dist()) / float64(len(esBytes)) - isPureLinedText = efficiencyLines < 4*efficiencyBytes + quotedLength := len(strconv.Quote(sx + sy)) + unquotedLength := len(sx) + len(sy) + escapeExpansionRatio := float64(quotedLength) / float64(unquotedLength) + isPureLinedText = efficiencyLines < 4*efficiencyBytes || escapeExpansionRatio > 1.1 } } @@ -171,12 +174,13 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { // differences in a string literal. This format is more readable, // but has edge-cases where differences are visually indistinguishable. // This format is avoided under the following conditions: - // • A line starts with `"""` - // • A line starts with "..." - // • A line contains non-printable characters - // • Adjacent different lines differ only by whitespace + // - A line starts with `"""` + // - A line starts with "..." + // - A line contains non-printable characters + // - Adjacent different lines differ only by whitespace // // For example: + // // """ // ... // 3 identical lines // foo @@ -231,7 +235,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { var out textNode = &textWrap{Prefix: "(", Value: list2, Suffix: ")"} switch t.Kind() { case reflect.String: - if t != reflect.TypeOf(string("")) { + if t != stringType { out = opts.FormatType(t, out) } case reflect.Slice: @@ -326,12 +330,12 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { switch t.Kind() { case reflect.String: out = &textWrap{Prefix: "strings.Join(", Value: out, Suffix: fmt.Sprintf(", %q)", delim)} - if t != reflect.TypeOf(string("")) { + if t != stringType { out = opts.FormatType(t, out) } case reflect.Slice: out = &textWrap{Prefix: "bytes.Join(", Value: out, Suffix: fmt.Sprintf(", %q)", delim)} - if t != reflect.TypeOf([]byte(nil)) { + if t != bytesType { out = opts.FormatType(t, out) } } @@ -446,7 +450,6 @@ func (opts formatOptions) formatDiffSlice( // {NumIdentical: 3}, // {NumInserted: 1}, // ] -// func coalesceAdjacentEdits(name string, es diff.EditScript) (groups []diffStats) { var prevMode byte lastStats := func(mode byte) *diffStats { @@ -503,7 +506,6 @@ func coalesceAdjacentEdits(name string, es diff.EditScript) (groups []diffStats) // {NumIdentical: 8, NumRemoved: 12, NumInserted: 3}, // {NumIdentical: 63}, // ] -// func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStats { groups, groupsOrig := groups[:0], groups for i, ds := range groupsOrig { @@ -548,7 +550,6 @@ func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStat // {NumRemoved: 9}, // {NumIdentical: 64}, // incremented by 10 // ] -// func cleanupSurroundingIdentical(groups []diffStats, eq func(i, j int) bool) []diffStats { var ix, iy int // indexes into sequence x and y for i, ds := range groups { @@ -563,10 +564,10 @@ func cleanupSurroundingIdentical(groups []diffStats, eq func(i, j int) bool) []d nx := ds.NumIdentical + ds.NumRemoved + ds.NumModified ny := ds.NumIdentical + ds.NumInserted + ds.NumModified var numLeadingIdentical, numTrailingIdentical int - for i := 0; i < nx && i < ny && eq(ix+i, iy+i); i++ { + for j := 0; j < nx && j < ny && eq(ix+j, iy+j); j++ { numLeadingIdentical++ } - for i := 0; i < nx && i < ny && eq(ix+nx-1-i, iy+ny-1-i); i++ { + for j := 0; j < nx && j < ny && eq(ix+nx-1-j, iy+ny-1-j); j++ { numTrailingIdentical++ } if numIdentical := numLeadingIdentical + numTrailingIdentical; numIdentical > 0 { diff --git a/vendor/github.com/google/go-cmp/cmp/report_text.go b/vendor/github.com/google/go-cmp/cmp/report_text.go index 0fd46d7ffb6..388fcf57120 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_text.go +++ b/vendor/github.com/google/go-cmp/cmp/report_text.go @@ -393,6 +393,7 @@ func (s diffStats) Append(ds diffStats) diffStats { // String prints a humanly-readable summary of coalesced records. // // Example: +// // diffStats{Name: "Field", NumIgnored: 5}.String() => "5 ignored fields" func (s diffStats) String() string { var ss []string diff --git a/vendor/github.com/hashicorp/go-version/CHANGELOG.md b/vendor/github.com/hashicorp/go-version/CHANGELOG.md index dbae7f7be9c..5f16dd140c3 100644 --- a/vendor/github.com/hashicorp/go-version/CHANGELOG.md +++ b/vendor/github.com/hashicorp/go-version/CHANGELOG.md @@ -1,3 +1,23 @@ +# 1.6.0 (June 28, 2022) + +FEATURES: + +- Add `Prerelease` function to `Constraint` to return true if the version includes a prerelease field ([#100](https://github.com/hashicorp/go-version/pull/100)) + +# 1.5.0 (May 18, 2022) + +FEATURES: + +- Use `encoding` `TextMarshaler` & `TextUnmarshaler` instead of JSON equivalents ([#95](https://github.com/hashicorp/go-version/pull/95)) +- Add JSON handlers to allow parsing from/to JSON ([#93](https://github.com/hashicorp/go-version/pull/93)) + +# 1.4.0 (January 5, 2022) + +FEATURES: + + - Introduce `MustConstraints()` ([#87](https://github.com/hashicorp/go-version/pull/87)) + - `Constraints`: Introduce `Equals()` and `sort.Interface` methods ([#88](https://github.com/hashicorp/go-version/pull/88)) + # 1.3.0 (March 31, 2021) Please note that CHANGELOG.md does not exist in the source code prior to this release. diff --git a/vendor/github.com/hashicorp/go-version/README.md b/vendor/github.com/hashicorp/go-version/README.md index 851a337beb4..4d250509033 100644 --- a/vendor/github.com/hashicorp/go-version/README.md +++ b/vendor/github.com/hashicorp/go-version/README.md @@ -1,5 +1,5 @@ # Versioning Library for Go -[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/master.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/master) +[![Build Status](https://circleci.com/gh/hashicorp/go-version/tree/main.svg?style=svg)](https://circleci.com/gh/hashicorp/go-version/tree/main) [![GoDoc](https://godoc.org/github.com/hashicorp/go-version?status.svg)](https://godoc.org/github.com/hashicorp/go-version) go-version is a library for parsing versions and version constraints, diff --git a/vendor/github.com/hashicorp/go-version/constraint.go b/vendor/github.com/hashicorp/go-version/constraint.go index d055759611c..da5d1aca148 100644 --- a/vendor/github.com/hashicorp/go-version/constraint.go +++ b/vendor/github.com/hashicorp/go-version/constraint.go @@ -4,6 +4,7 @@ import ( "fmt" "reflect" "regexp" + "sort" "strings" ) @@ -11,30 +12,40 @@ import ( // ">= 1.0". type Constraint struct { f constraintFunc + op operator check *Version original string } +func (c *Constraint) Equals(con *Constraint) bool { + return c.op == con.op && c.check.Equal(con.check) +} + // Constraints is a slice of constraints. We make a custom type so that // we can add methods to it. type Constraints []*Constraint type constraintFunc func(v, c *Version) bool -var constraintOperators map[string]constraintFunc +var constraintOperators map[string]constraintOperation + +type constraintOperation struct { + op operator + f constraintFunc +} var constraintRegexp *regexp.Regexp func init() { - constraintOperators = map[string]constraintFunc{ - "": constraintEqual, - "=": constraintEqual, - "!=": constraintNotEqual, - ">": constraintGreaterThan, - "<": constraintLessThan, - ">=": constraintGreaterThanEqual, - "<=": constraintLessThanEqual, - "~>": constraintPessimistic, + constraintOperators = map[string]constraintOperation{ + "": {op: equal, f: constraintEqual}, + "=": {op: equal, f: constraintEqual}, + "!=": {op: notEqual, f: constraintNotEqual}, + ">": {op: greaterThan, f: constraintGreaterThan}, + "<": {op: lessThan, f: constraintLessThan}, + ">=": {op: greaterThanEqual, f: constraintGreaterThanEqual}, + "<=": {op: lessThanEqual, f: constraintLessThanEqual}, + "~>": {op: pessimistic, f: constraintPessimistic}, } ops := make([]string, 0, len(constraintOperators)) @@ -66,6 +77,16 @@ func NewConstraint(v string) (Constraints, error) { return Constraints(result), nil } +// MustConstraints is a helper that wraps a call to a function +// returning (Constraints, error) and panics if error is non-nil. +func MustConstraints(c Constraints, err error) Constraints { + if err != nil { + panic(err) + } + + return c +} + // Check tests if a version satisfies all the constraints. func (cs Constraints) Check(v *Version) bool { for _, c := range cs { @@ -77,6 +98,56 @@ func (cs Constraints) Check(v *Version) bool { return true } +// Equals compares Constraints with other Constraints +// for equality. This may not represent logical equivalence +// of compared constraints. +// e.g. even though '>0.1,>0.2' is logically equivalent +// to '>0.2' it is *NOT* treated as equal. +// +// Missing operator is treated as equal to '=', whitespaces +// are ignored and constraints are sorted before comaparison. +func (cs Constraints) Equals(c Constraints) bool { + if len(cs) != len(c) { + return false + } + + // make copies to retain order of the original slices + left := make(Constraints, len(cs)) + copy(left, cs) + sort.Stable(left) + right := make(Constraints, len(c)) + copy(right, c) + sort.Stable(right) + + // compare sorted slices + for i, con := range left { + if !con.Equals(right[i]) { + return false + } + } + + return true +} + +func (cs Constraints) Len() int { + return len(cs) +} + +func (cs Constraints) Less(i, j int) bool { + if cs[i].op < cs[j].op { + return true + } + if cs[i].op > cs[j].op { + return false + } + + return cs[i].check.LessThan(cs[j].check) +} + +func (cs Constraints) Swap(i, j int) { + cs[i], cs[j] = cs[j], cs[i] +} + // Returns the string format of the constraints func (cs Constraints) String() string { csStr := make([]string, len(cs)) @@ -92,6 +163,12 @@ func (c *Constraint) Check(v *Version) bool { return c.f(v, c.check) } +// Prerelease returns true if the version underlying this constraint +// contains a prerelease field. +func (c *Constraint) Prerelease() bool { + return len(c.check.Prerelease()) > 0 +} + func (c *Constraint) String() string { return c.original } @@ -107,8 +184,11 @@ func parseSingle(v string) (*Constraint, error) { return nil, err } + cop := constraintOperators[matches[1]] + return &Constraint{ - f: constraintOperators[matches[1]], + f: cop.f, + op: cop.op, check: check, original: v, }, nil @@ -138,6 +218,18 @@ func prereleaseCheck(v, c *Version) bool { // Constraint functions //------------------------------------------------------------------- +type operator rune + +const ( + equal operator = '=' + notEqual operator = '≠' + greaterThan operator = '>' + lessThan operator = '<' + greaterThanEqual operator = '≥' + lessThanEqual operator = '≤' + pessimistic operator = '~' +) + func constraintEqual(v, c *Version) bool { return v.Equal(c) } diff --git a/vendor/github.com/hashicorp/go-version/version.go b/vendor/github.com/hashicorp/go-version/version.go index 8068834ec84..e87df69906d 100644 --- a/vendor/github.com/hashicorp/go-version/version.go +++ b/vendor/github.com/hashicorp/go-version/version.go @@ -64,7 +64,6 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { } segmentsStr := strings.Split(matches[1], ".") segments := make([]int64, len(segmentsStr)) - si := 0 for i, str := range segmentsStr { val, err := strconv.ParseInt(str, 10, 64) if err != nil { @@ -72,8 +71,7 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { "Error parsing version: %s", err) } - segments[i] = int64(val) - si++ + segments[i] = val } // Even though we could support more than three segments, if we @@ -92,7 +90,7 @@ func newVersion(v string, pattern *regexp.Regexp) (*Version, error) { metadata: matches[10], pre: pre, segments: segments, - si: si, + si: len(segmentsStr), original: v, }, nil } @@ -390,3 +388,20 @@ func (v *Version) String() string { func (v *Version) Original() string { return v.original } + +// UnmarshalText implements encoding.TextUnmarshaler interface. +func (v *Version) UnmarshalText(b []byte) error { + temp, err := NewVersion(string(b)) + if err != nil { + return err + } + + *v = *temp + + return nil +} + +// MarshalText implements encoding.TextMarshaler interface. +func (v *Version) MarshalText() ([]byte, error) { + return []byte(v.String()), nil +} diff --git a/vendor/github.com/hashicorp/terraform-json/LICENSE b/vendor/github.com/hashicorp/terraform-json/LICENSE index a612ad9813b..3b97eaf3c31 100644 --- a/vendor/github.com/hashicorp/terraform-json/LICENSE +++ b/vendor/github.com/hashicorp/terraform-json/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2019 HashiCorp, Inc. + Mozilla Public License Version 2.0 ================================== diff --git a/vendor/github.com/hashicorp/terraform-json/README.md b/vendor/github.com/hashicorp/terraform-json/README.md index fea0ba26092..4a9cd94a119 100644 --- a/vendor/github.com/hashicorp/terraform-json/README.md +++ b/vendor/github.com/hashicorp/terraform-json/README.md @@ -1,6 +1,5 @@ # terraform-json -[![CircleCI](https://circleci.com/gh/hashicorp/terraform-json/tree/main.svg?style=svg)](https://circleci.com/gh/hashicorp/terraform-json/tree/main) [![GoDoc](https://godoc.org/github.com/hashicorp/terraform-json?status.svg)](https://godoc.org/github.com/hashicorp/terraform-json) This repository houses data types designed to help parse the data produced by diff --git a/vendor/github.com/hashicorp/terraform-json/config.go b/vendor/github.com/hashicorp/terraform-json/config.go index e093cfa8bff..5ebe4bc840c 100644 --- a/vendor/github.com/hashicorp/terraform-json/config.go +++ b/vendor/github.com/hashicorp/terraform-json/config.go @@ -48,6 +48,9 @@ type ProviderConfig struct { // The name of the provider, ie: "aws". Name string `json:"name,omitempty"` + // The fully-specified name of the provider, ie: "registry.terraform.io/hashicorp/aws". + FullName string `json:"full_name,omitempty"` + // The alias of the provider, ie: "us-east-1". Alias string `json:"alias,omitempty"` diff --git a/vendor/github.com/hashicorp/terraform-json/metadata.go b/vendor/github.com/hashicorp/terraform-json/metadata.go new file mode 100644 index 00000000000..70d7ce4380a --- /dev/null +++ b/vendor/github.com/hashicorp/terraform-json/metadata.go @@ -0,0 +1,104 @@ +package tfjson + +import ( + "encoding/json" + "errors" + "fmt" + + "github.com/hashicorp/go-version" + "github.com/zclconf/go-cty/cty" +) + +// MetadataFunctionsFormatVersionConstraints defines the versions of the JSON +// metadata functions format that are supported by this package. +var MetadataFunctionsFormatVersionConstraints = "~> 1.0" + +// MetadataFunctions is the top-level object returned when exporting function +// signatures +type MetadataFunctions struct { + // The version of the format. This should always match the + // MetadataFunctionsFormatVersionConstraints in this package, else + // unmarshaling will fail. + FormatVersion string `json:"format_version"` + + // The signatures of the functions available in a Terraform version. + Signatures map[string]*FunctionSignature `json:"function_signatures,omitempty"` +} + +// Validate checks to ensure that MetadataFunctions is present, and the +// version matches the version supported by this library. +func (f *MetadataFunctions) Validate() error { + if f == nil { + return errors.New("metadata functions data is nil") + } + + if f.FormatVersion == "" { + return errors.New("unexpected metadata functions data, format version is missing") + } + + constraint, err := version.NewConstraint(MetadataFunctionsFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(f.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", f.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported metadata functions format version: %q does not satisfy %q", + version, constraint) + } + + return nil +} + +func (f *MetadataFunctions) UnmarshalJSON(b []byte) error { + type rawFunctions MetadataFunctions + var functions rawFunctions + + err := json.Unmarshal(b, &functions) + if err != nil { + return err + } + + *f = *(*MetadataFunctions)(&functions) + + return f.Validate() +} + +// FunctionSignature represents a function signature. +type FunctionSignature struct { + // Description is an optional human-readable description + // of the function + Description string `json:"description,omitempty"` + + // ReturnType is the ctyjson representation of the function's + // return types based on supplying all parameters using + // dynamic types. Functions can have dynamic return types. + ReturnType cty.Type `json:"return_type"` + + // Parameters describes the function's fixed positional parameters. + Parameters []*FunctionParameter `json:"parameters,omitempty"` + + // VariadicParameter describes the function's variadic + // parameter if it is supported. + VariadicParameter *FunctionParameter `json:"variadic_parameter,omitempty"` +} + +// FunctionParameter represents a parameter to a function. +type FunctionParameter struct { + // Name is an optional name for the argument. + Name string `json:"name,omitempty"` + + // Description is an optional human-readable description + // of the argument + Description string `json:"description,omitempty"` + + // IsNullable is true if null is acceptable value for the argument + IsNullable bool `json:"is_nullable,omitempty"` + + // A type that any argument for this parameter must conform to. + Type cty.Type `json:"type"` +} diff --git a/vendor/github.com/hashicorp/terraform-json/plan.go b/vendor/github.com/hashicorp/terraform-json/plan.go index 97635bd4733..274006a0180 100644 --- a/vendor/github.com/hashicorp/terraform-json/plan.go +++ b/vendor/github.com/hashicorp/terraform-json/plan.go @@ -4,11 +4,13 @@ import ( "encoding/json" "errors" "fmt" + + "github.com/hashicorp/go-version" ) -// PlanFormatVersions represents versions of the JSON plan format that -// are supported by this package. -var PlanFormatVersions = []string{"0.1", "0.2"} +// PlanFormatVersionConstraints defines the versions of the JSON plan format +// that are supported by this package. +var PlanFormatVersionConstraints = ">= 0.1, < 2.0" // ResourceMode is a string representation of the resource type found // in certain fields in the plan. @@ -53,6 +55,19 @@ type Plan struct { // The Terraform configuration used to make the plan. Config *Config `json:"configuration,omitempty"` + + // RelevantAttributes represents any resource instances and their + // attributes which may have contributed to the planned changes + RelevantAttributes []ResourceAttribute `json:"relevant_attributes,omitempty"` +} + +// ResourceAttribute describes a full path to a resource attribute +type ResourceAttribute struct { + // Resource describes resource instance address (e.g. null_resource.foo) + Resource string `json:"resource"` + // Attribute describes the attribute path using a lossy representation + // of cty.Path. (e.g. ["id"] or ["objects", 0, "val"]). + Attribute []json.RawMessage `json:"attribute"` } // Validate checks to ensure that the plan is present, and the @@ -66,9 +81,19 @@ func (p *Plan) Validate() error { return errors.New("unexpected plan input, format version is missing") } - if !isStringInSlice(PlanFormatVersions, p.FormatVersion) { - return fmt.Errorf("unsupported plan format version: expected %q, got %q", - PlanFormatVersions, p.FormatVersion) + constraint, err := version.NewConstraint(PlanFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(p.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", p.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported plan format version: %q does not satisfy %q", + version, constraint) } return nil diff --git a/vendor/github.com/hashicorp/terraform-json/schemas.go b/vendor/github.com/hashicorp/terraform-json/schemas.go index 88c2c94bb43..f7c8abd50f6 100644 --- a/vendor/github.com/hashicorp/terraform-json/schemas.go +++ b/vendor/github.com/hashicorp/terraform-json/schemas.go @@ -5,12 +5,13 @@ import ( "errors" "fmt" + "github.com/hashicorp/go-version" "github.com/zclconf/go-cty/cty" ) -// ProviderSchemasFormatVersions represents the versions of -// the JSON provider schema format that are supported by this package. -var ProviderSchemasFormatVersions = []string{"0.1", "0.2"} +// ProviderSchemasFormatVersionConstraints defines the versions of the JSON +// provider schema format that are supported by this package. +var ProviderSchemasFormatVersionConstraints = ">= 0.1, < 2.0" // ProviderSchemas represents the schemas of all providers and // resources in use by the configuration. @@ -38,9 +39,19 @@ func (p *ProviderSchemas) Validate() error { return errors.New("unexpected provider schema data, format version is missing") } - if !isStringInSlice(ProviderSchemasFormatVersions, p.FormatVersion) { - return fmt.Errorf("unsupported provider schema data format version: expected %q, got %q", - ProviderSchemasFormatVersions, p.FormatVersion) + constraint, err := version.NewConstraint(ProviderSchemasFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(p.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", p.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported provider schema format version: %q does not satisfy %q", + version, constraint) } return nil @@ -212,6 +223,43 @@ type SchemaAttribute struct { Sensitive bool `json:"sensitive,omitempty"` } +// jsonSchemaAttribute describes an attribute within a schema block +// in a middle-step internal representation before marshalled into +// a more useful SchemaAttribute with cty.Type. +// +// This avoid panic on marshalling cty.NilType (from cty upstream) +// which the default Go marshaller cannot ignore because it's a +// not nil-able struct. +type jsonSchemaAttribute struct { + AttributeType json.RawMessage `json:"type,omitempty"` + AttributeNestedType *SchemaNestedAttributeType `json:"nested_type,omitempty"` + Description string `json:"description,omitempty"` + DescriptionKind SchemaDescriptionKind `json:"description_kind,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` + Required bool `json:"required,omitempty"` + Optional bool `json:"optional,omitempty"` + Computed bool `json:"computed,omitempty"` + Sensitive bool `json:"sensitive,omitempty"` +} + +func (as *SchemaAttribute) MarshalJSON() ([]byte, error) { + jsonSa := &jsonSchemaAttribute{ + AttributeNestedType: as.AttributeNestedType, + Description: as.Description, + DescriptionKind: as.DescriptionKind, + Deprecated: as.Deprecated, + Required: as.Required, + Optional: as.Optional, + Computed: as.Computed, + Sensitive: as.Sensitive, + } + if as.AttributeType != cty.NilType { + attrTy, _ := as.AttributeType.MarshalJSON() + jsonSa.AttributeType = attrTy + } + return json.Marshal(jsonSa) +} + // SchemaNestedAttributeType describes a nested attribute // which could also be just expressed simply as cty.Object(...), // cty.List(cty.Object(...)) etc. but this allows tracking additional diff --git a/vendor/github.com/hashicorp/terraform-json/state.go b/vendor/github.com/hashicorp/terraform-json/state.go index ad632e49d5c..3c3f6a4b0aa 100644 --- a/vendor/github.com/hashicorp/terraform-json/state.go +++ b/vendor/github.com/hashicorp/terraform-json/state.go @@ -5,11 +5,14 @@ import ( "encoding/json" "errors" "fmt" + + "github.com/hashicorp/go-version" + "github.com/zclconf/go-cty/cty" ) -// StateFormatVersions represents the versions of the JSON state format +// StateFormatVersionConstraints defines the versions of the JSON state format // that are supported by this package. -var StateFormatVersions = []string{"0.1", "0.2"} +var StateFormatVersionConstraints = ">= 0.1, < 2.0" // State is the top-level representation of a Terraform state. type State struct { @@ -50,9 +53,19 @@ func (s *State) Validate() error { return errors.New("unexpected state input, format version is missing") } - if !isStringInSlice(StateFormatVersions, s.FormatVersion) { - return fmt.Errorf("unsupported state format version: expected %q, got %q", - StateFormatVersions, s.FormatVersion) + constraint, err := version.NewConstraint(StateFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(s.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", s.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported state format version: %q does not satisfy %q", + version, constraint) } return nil @@ -163,4 +176,31 @@ type StateOutput struct { // The value of the output. Value interface{} `json:"value,omitempty"` + + // The type of the output. + Type cty.Type `json:"type,omitempty"` +} + +// jsonStateOutput describes an output value in a middle-step internal +// representation before marshalled into a more useful StateOutput with cty.Type. +// +// This avoid panic on marshalling cty.NilType (from cty upstream) +// which the default Go marshaller cannot ignore because it's a +// not nil-able struct. +type jsonStateOutput struct { + Sensitive bool `json:"sensitive"` + Value interface{} `json:"value,omitempty"` + Type json.RawMessage `json:"type,omitempty"` +} + +func (so *StateOutput) MarshalJSON() ([]byte, error) { + jsonSa := &jsonStateOutput{ + Sensitive: so.Sensitive, + Value: so.Value, + } + if so.Type != cty.NilType { + outputType, _ := so.Type.MarshalJSON() + jsonSa.Type = outputType + } + return json.Marshal(jsonSa) } diff --git a/vendor/github.com/hashicorp/terraform-json/validate.go b/vendor/github.com/hashicorp/terraform-json/validate.go index db9db1919ce..97b82d0a979 100644 --- a/vendor/github.com/hashicorp/terraform-json/validate.go +++ b/vendor/github.com/hashicorp/terraform-json/validate.go @@ -4,8 +4,14 @@ import ( "encoding/json" "errors" "fmt" + + "github.com/hashicorp/go-version" ) +// ValidateFormatVersionConstraints defines the versions of the JSON +// validate format that are supported by this package. +var ValidateFormatVersionConstraints = ">= 0.1, < 2.0" + // Pos represents a position in a config file type Pos struct { Line int `json:"line"` @@ -110,10 +116,19 @@ func (vo *ValidateOutput) Validate() error { return nil } - supportedVersion := "0.1" - if vo.FormatVersion != supportedVersion { - return fmt.Errorf("unsupported validation output format version: expected %q, got %q", - supportedVersion, vo.FormatVersion) + constraint, err := version.NewConstraint(ValidateFormatVersionConstraints) + if err != nil { + return fmt.Errorf("invalid version constraint: %w", err) + } + + version, err := version.NewVersion(vo.FormatVersion) + if err != nil { + return fmt.Errorf("invalid format version %q: %w", vo.FormatVersion, err) + } + + if !constraint.Check(version) { + return fmt.Errorf("unsupported validation output format version: %q does not satisfy %q", + version, constraint) } return nil diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/component_model.go b/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/component_model.go index ae006ba87c3..24ac35d932a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/component_model.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/component_model.go @@ -19,7 +19,7 @@ import ( type ComponentModel struct { // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of active custom Key Value model that need to be composed. - ModelId *string `mandatory:"true" json:"modelId"` + ModelId *string `mandatory:"false" json:"modelId"` } func (m ComponentModel) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/create_model_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/create_model_details.go index db5b613da5d..14d2b998a8f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/create_model_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/aidocument/create_model_details.go @@ -25,8 +25,6 @@ type CreateModelDetails struct { // The compartment identifier. CompartmentId *string `mandatory:"true" json:"compartmentId"` - TrainingDataset Dataset `mandatory:"true" json:"trainingDataset"` - // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project that contains the model. ProjectId *string `mandatory:"true" json:"projectId"` @@ -45,6 +43,8 @@ type CreateModelDetails struct { // The maximum model training time in hours, expressed as a decimal fraction. MaxTrainingTimeInHours *float64 `mandatory:"false" json:"maxTrainingTimeInHours"` + TrainingDataset Dataset `mandatory:"false" json:"trainingDataset"` + TestingDataset Dataset `mandatory:"false" json:"testingDataset"` ValidationDataset Dataset `mandatory:"false" json:"validationDataset"` @@ -91,6 +91,7 @@ func (m *CreateModelDetails) UnmarshalJSON(data []byte) (e error) { ModelVersion *string `json:"modelVersion"` IsQuickMode *bool `json:"isQuickMode"` MaxTrainingTimeInHours *float64 `json:"maxTrainingTimeInHours"` + TrainingDataset dataset `json:"trainingDataset"` TestingDataset dataset `json:"testingDataset"` ValidationDataset dataset `json:"validationDataset"` ComponentModels []ComponentModel `json:"componentModels"` @@ -99,7 +100,6 @@ func (m *CreateModelDetails) UnmarshalJSON(data []byte) (e error) { DefinedTags map[string]map[string]interface{} `json:"definedTags"` ModelType ModelModelTypeEnum `json:"modelType"` CompartmentId *string `json:"compartmentId"` - TrainingDataset dataset `json:"trainingDataset"` ProjectId *string `json:"projectId"` }{} @@ -118,6 +118,16 @@ func (m *CreateModelDetails) UnmarshalJSON(data []byte) (e error) { m.MaxTrainingTimeInHours = model.MaxTrainingTimeInHours + nn, e = model.TrainingDataset.UnmarshalPolymorphicJSON(model.TrainingDataset.JsonData) + if e != nil { + return + } + if nn != nil { + m.TrainingDataset = nn.(Dataset) + } else { + m.TrainingDataset = nil + } + nn, e = model.TestingDataset.UnmarshalPolymorphicJSON(model.TestingDataset.JsonData) if e != nil { return @@ -153,16 +163,6 @@ func (m *CreateModelDetails) UnmarshalJSON(data []byte) (e error) { m.CompartmentId = model.CompartmentId - nn, e = model.TrainingDataset.UnmarshalPolymorphicJSON(model.TrainingDataset.JsonData) - if e != nil { - return - } - if nn != nil { - m.TrainingDataset = nn.(Dataset) - } else { - m.TrainingDataset = nil - } - m.ProjectId = model.ProjectId return diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule.go index 32a214fad57..a1cea9ea4f8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule_summary.go index 9385982e711..65249fc0038 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_rule_summary.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_type.go index 6f49a580300..6a969960ae2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/alert_type.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget.go index 1e0874c67a7..136b54dfbfb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget @@ -56,9 +56,15 @@ type Budget struct { // The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight. BudgetProcessingPeriodStartOffset *int `mandatory:"false" json:"budgetProcessingPeriodStartOffset"` - // The type of the budget processing period. Valid values are INVOICE and MONTH. + // The budget processing period type. Valid values are INVOICE, MONTH, and SINGLE_USE. ProcessingPeriodType ProcessingPeriodTypeEnum `mandatory:"false" json:"processingPeriodType,omitempty"` + // The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + StartDate *common.SDKTime `mandatory:"false" json:"startDate"` + + // The time when the one-time budget concludes. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + EndDate *common.SDKTime `mandatory:"false" json:"endDate"` + // The type of target on which the budget is applied. TargetType TargetTypeEnum `mandatory:"false" json:"targetType,omitempty"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_client.go index f62d717af15..29a8fcf62a6 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_client.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget @@ -93,9 +93,10 @@ func (client *BudgetClient) ConfigurationProvider() *common.ConfigurationProvide // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/CreateAlertRule.go.html to see an example of how to use CreateAlertRule API. +// A default retry strategy applies to this operation CreateAlertRule() func (client BudgetClient) CreateAlertRule(ctx context.Context, request CreateAlertRuleRequest) (response CreateAlertRuleResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -155,9 +156,10 @@ func (client BudgetClient) createAlertRule(ctx context.Context, request common.O // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/CreateBudget.go.html to see an example of how to use CreateBudget API. +// A default retry strategy applies to this operation CreateBudget() func (client BudgetClient) CreateBudget(ctx context.Context, request CreateBudgetRequest) (response CreateBudgetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -217,9 +219,10 @@ func (client BudgetClient) createBudget(ctx context.Context, request common.OCIR // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/DeleteAlertRule.go.html to see an example of how to use DeleteAlertRule API. +// A default retry strategy applies to this operation DeleteAlertRule() func (client BudgetClient) DeleteAlertRule(ctx context.Context, request DeleteAlertRuleRequest) (response DeleteAlertRuleResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -274,9 +277,10 @@ func (client BudgetClient) deleteAlertRule(ctx context.Context, request common.O // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/DeleteBudget.go.html to see an example of how to use DeleteBudget API. +// A default retry strategy applies to this operation DeleteBudget() func (client BudgetClient) DeleteBudget(ctx context.Context, request DeleteBudgetRequest) (response DeleteBudgetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -331,9 +335,10 @@ func (client BudgetClient) deleteBudget(ctx context.Context, request common.OCIR // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/GetAlertRule.go.html to see an example of how to use GetAlertRule API. +// A default retry strategy applies to this operation GetAlertRule() func (client BudgetClient) GetAlertRule(ctx context.Context, request GetAlertRuleRequest) (response GetAlertRuleResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -388,9 +393,10 @@ func (client BudgetClient) getAlertRule(ctx context.Context, request common.OCIR // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/GetBudget.go.html to see an example of how to use GetBudget API. +// A default retry strategy applies to this operation GetBudget() func (client BudgetClient) GetBudget(ctx context.Context, request GetBudgetRequest) (response GetBudgetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -445,9 +451,10 @@ func (client BudgetClient) getBudget(ctx context.Context, request common.OCIRequ // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/ListAlertRules.go.html to see an example of how to use ListAlertRules API. +// A default retry strategy applies to this operation ListAlertRules() func (client BudgetClient) ListAlertRules(ctx context.Context, request ListAlertRulesRequest) (response ListAlertRulesResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -500,15 +507,15 @@ func (client BudgetClient) listAlertRules(ctx context.Context, request common.OC // ListBudgets Gets a list of budgets in a compartment. // By default, ListBudgets returns budgets of the 'COMPARTMENT' target type, and the budget records with only one target compartment OCID. // To list all budgets, set the targetType query parameter to ALL (for example: 'targetType=ALL'). -// Additional targetTypes would be available in future releases. Clients should ignore new targetTypes, -// or upgrade to the latest version of the client SDK to handle new targetTypes. +// Clients should ignore new targetTypes, or upgrade to the latest version of the client SDK to handle new targetTypes. // // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/ListBudgets.go.html to see an example of how to use ListBudgets API. +// A default retry strategy applies to this operation ListBudgets() func (client BudgetClient) ListBudgets(ctx context.Context, request ListBudgetsRequest) (response ListBudgetsResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -563,9 +570,10 @@ func (client BudgetClient) listBudgets(ctx context.Context, request common.OCIRe // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/UpdateAlertRule.go.html to see an example of how to use UpdateAlertRule API. +// A default retry strategy applies to this operation UpdateAlertRule() func (client BudgetClient) UpdateAlertRule(ctx context.Context, request UpdateAlertRuleRequest) (response UpdateAlertRuleResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } @@ -620,9 +628,10 @@ func (client BudgetClient) updateAlertRule(ctx context.Context, request common.O // See also // // Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/budget/UpdateBudget.go.html to see an example of how to use UpdateBudget API. +// A default retry strategy applies to this operation UpdateBudget() func (client BudgetClient) UpdateBudget(ctx context.Context, request UpdateBudgetRequest) (response UpdateBudgetResponse, err error) { var ociResponse common.OCIResponse - policy := common.NoRetryPolicy() + policy := common.DefaultRetryPolicy() if client.RetryPolicy() != nil { policy = *client.RetryPolicy() } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_summary.go index 91b6ff3f6d2..73fda50113a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/budget_summary.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget @@ -56,9 +56,15 @@ type BudgetSummary struct { // The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight. BudgetProcessingPeriodStartOffset *int `mandatory:"false" json:"budgetProcessingPeriodStartOffset"` - // The type of the budget processing period. Valid values are INVOICE and MONTH. + // The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE. ProcessingPeriodType ProcessingPeriodTypeEnum `mandatory:"false" json:"processingPeriodType,omitempty"` + // The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + StartDate *common.SDKTime `mandatory:"false" json:"startDate"` + + // The time when the one-time budget concludes. For example, - `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + EndDate *common.SDKTime `mandatory:"false" json:"endDate"` + // The type of target on which the budget is applied. TargetType TargetTypeEnum `mandatory:"false" json:"targetType,omitempty"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_alert_rule_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_alert_rule_details.go index 5f1c028728b..6aadbf08f10 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_alert_rule_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_alert_rule_details.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_budget_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_budget_details.go index c489629120b..e15ae71a82d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_budget_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/create_budget_details.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget @@ -43,9 +43,15 @@ type CreateBudgetDetails struct { // The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight. BudgetProcessingPeriodStartOffset *int `mandatory:"false" json:"budgetProcessingPeriodStartOffset"` - // The type of the budget processing period. Valid values are INVOICE and MONTH. + // The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE. ProcessingPeriodType ProcessingPeriodTypeEnum `mandatory:"false" json:"processingPeriodType,omitempty"` + // The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + StartDate *common.SDKTime `mandatory:"false" json:"startDate"` + + // The date when the one-time budget concludes. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + EndDate *common.SDKTime `mandatory:"false" json:"endDate"` + // The type of target on which the budget is applied. TargetType TargetTypeEnum `mandatory:"false" json:"targetType,omitempty"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/lifecycle_state.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/lifecycle_state.go index 986b0c48681..794caf7f280 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/lifecycle_state.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/lifecycle_state.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/processing_period_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/processing_period_type.go index 630c2b1b987..ceff12a06cd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/processing_period_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/processing_period_type.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget @@ -18,18 +18,21 @@ type ProcessingPeriodTypeEnum string // Set of constants representing the allowable values for ProcessingPeriodTypeEnum const ( - ProcessingPeriodTypeInvoice ProcessingPeriodTypeEnum = "INVOICE" - ProcessingPeriodTypeMonth ProcessingPeriodTypeEnum = "MONTH" + ProcessingPeriodTypeInvoice ProcessingPeriodTypeEnum = "INVOICE" + ProcessingPeriodTypeMonth ProcessingPeriodTypeEnum = "MONTH" + ProcessingPeriodTypeSingleUse ProcessingPeriodTypeEnum = "SINGLE_USE" ) var mappingProcessingPeriodTypeEnum = map[string]ProcessingPeriodTypeEnum{ - "INVOICE": ProcessingPeriodTypeInvoice, - "MONTH": ProcessingPeriodTypeMonth, + "INVOICE": ProcessingPeriodTypeInvoice, + "MONTH": ProcessingPeriodTypeMonth, + "SINGLE_USE": ProcessingPeriodTypeSingleUse, } var mappingProcessingPeriodTypeEnumLowerCase = map[string]ProcessingPeriodTypeEnum{ - "invoice": ProcessingPeriodTypeInvoice, - "month": ProcessingPeriodTypeMonth, + "invoice": ProcessingPeriodTypeInvoice, + "month": ProcessingPeriodTypeMonth, + "single_use": ProcessingPeriodTypeSingleUse, } // GetProcessingPeriodTypeEnumValues Enumerates the set of values for ProcessingPeriodTypeEnum @@ -46,6 +49,7 @@ func GetProcessingPeriodTypeEnumStringValues() []string { return []string{ "INVOICE", "MONTH", + "SINGLE_USE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/reset_period.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/reset_period.go index b4bdbbda90d..546f1201d96 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/reset_period.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/reset_period.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_by.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_by.go index cbbdc50b951..2c8832ef15b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_by.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_by.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_order.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_order.go index 0b01bc01a61..6a8effce6a2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_order.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/sort_order.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/target_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/target_type.go index 3d80cbce979..4b471f99d07 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/target_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/target_type.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/threshold_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/threshold_type.go index 0e173dfdbd2..d8ef4806855 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/threshold_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/threshold_type.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_alert_rule_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_alert_rule_details.go index 7833a7b9f6b..40a52972462 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_alert_rule_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_alert_rule_details.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_budget_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_budget_details.go index f4b53856124..9bd97d93737 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_budget_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/budget/update_budget_details.go @@ -4,7 +4,7 @@ // Budgets API // -// Use the Budgets API to manage budgets and budget alerts. +// Use the Budgets API to manage budgets and budget alerts. For more information, see Budgets Overview (https://docs.cloud.oracle.com/iaas/Content/Billing/Concepts/budgetsoverview.htm). // package budget @@ -30,9 +30,15 @@ type UpdateBudgetDetails struct { // The number of days offset from the first day of the month, at which the budget processing period starts. In months that have fewer days than this value, processing will begin on the last day of that month. For example, for a value of 12, processing starts every month on the 12th at midnight. BudgetProcessingPeriodStartOffset *int `mandatory:"false" json:"budgetProcessingPeriodStartOffset"` - // The type of the budget processing period. Valid values are INVOICE and MONTH. + // The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE. ProcessingPeriodType ProcessingPeriodTypeEnum `mandatory:"false" json:"processingPeriodType,omitempty"` + // The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + StartDate *common.SDKTime `mandatory:"false" json:"startDate"` + + // The time when the one-time budget concludes. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. + EndDate *common.SDKTime `mandatory:"false" json:"endDate"` + // The reset period for the budget. ResetPeriod ResetPeriodEnum `mandatory:"false" json:"resetPeriod,omitempty"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/ca_bundle.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/ca_bundle.go new file mode 100644 index 00000000000..8f9bf795641 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/ca_bundle.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CaBundle The contents of the CA bundle (root and intermediate certificates), properties of the CA bundle, and user-provided contextual metadata for the CA bundle. +type CaBundle struct { + + // The OCID of the CA bundle. + Id *string `mandatory:"true" json:"id"` + + // A user-friendly name for the CA bundle. Names are unique within a compartment. Valid characters include uppercase or lowercase letters, numbers, hyphens, underscores, and periods. + Name *string `mandatory:"true" json:"name"` + + // Certificates (in PEM format) in the CA bundle. Can be of arbitrary length. + CaBundlePem *string `mandatory:"true" json:"caBundlePem"` +} + +func (m CaBundle) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CaBundle) 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/certificates/certificate_authority_bundle.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_authority_bundle.go new file mode 100644 index 00000000000..d5baf83e096 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_authority_bundle.go @@ -0,0 +1,74 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateAuthorityBundle The contents of the certificate, properties of the certificate (and certificate version), and user-provided contextual metadata for the certificate. +type CertificateAuthorityBundle struct { + + // The OCID of the certificate authority (CA). + CertificateAuthorityId *string `mandatory:"true" json:"certificateAuthorityId"` + + // The name of the CA. + CertificateAuthorityName *string `mandatory:"true" json:"certificateAuthorityName"` + + // A unique certificate identifier used in certificate revocation tracking, formatted as octets. + // Example: `03 AC FC FA CC B3 CB 02 B8 F8 DE F5 85 E7 7B FF` + SerialNumber *string `mandatory:"true" json:"serialNumber"` + + // The certificate (in PEM format) for this CA version. + CertificatePem *string `mandatory:"true" json:"certificatePem"` + + // A property indicating when the CA was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The version number of the CA. + VersionNumber *int64 `mandatory:"true" json:"versionNumber"` + + Validity *Validity `mandatory:"true" json:"validity"` + + // A list of rotation states for this CA. + Stages []VersionStageEnum `mandatory:"true" json:"stages"` + + // The certificate chain (in PEM format) for this CA version. + CertChainPem *string `mandatory:"false" json:"certChainPem"` + + // The name of the CA. + VersionName *string `mandatory:"false" json:"versionName"` + + RevocationStatus *RevocationStatus `mandatory:"false" json:"revocationStatus"` +} + +func (m CertificateAuthorityBundle) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CertificateAuthorityBundle) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range m.Stages { + if _, ok := GetMappingVersionStageEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stages: %s. Supported values are: %s.", val, strings.Join(GetVersionStageEnumStringValues(), ","))) + } + } + + 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/certificates/certificate_authority_bundle_version_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_authority_bundle_version_collection.go new file mode 100644 index 00000000000..fad700a4655 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_authority_bundle_version_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateAuthorityBundleVersionCollection The results of a certificate authority (CA) version search. Results contain CA version summary objects and other data. +type CertificateAuthorityBundleVersionCollection struct { + + // A list of CA version summary objects. + Items []CertificateAuthorityBundleVersionSummary `mandatory:"true" json:"items"` +} + +func (m CertificateAuthorityBundleVersionCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CertificateAuthorityBundleVersionCollection) 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/certificates/certificate_authority_bundle_version_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_authority_bundle_version_summary.go new file mode 100644 index 00000000000..e866c4858d7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_authority_bundle_version_summary.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateAuthorityBundleVersionSummary The properties of a version of a bundle for a certificate authority (CA). Certificate authority bundle version summary objects do not include the actual contents of the certificate. +type CertificateAuthorityBundleVersionSummary struct { + + // The OCID of the certificate authority (CA). + CertificateAuthorityId *string `mandatory:"true" json:"certificateAuthorityId"` + + // An optional property indicating when the CA version was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // The version number of the CA. + VersionNumber *int64 `mandatory:"true" json:"versionNumber"` + + // The name of the CA. + CertificateAuthorityName *string `mandatory:"true" json:"certificateAuthorityName"` + + // A list of rotation states for this CA version. + Stages []VersionStageEnum `mandatory:"true" json:"stages"` + + // A unique certificate identifier used in certificate revocation tracking, formatted as octets. + // Example: `03 AC FC FA CC B3 CB 02 B8 F8 DE F5 85 E7 7B FF` + SerialNumber *string `mandatory:"false" json:"serialNumber"` + + // The name of the CA version. When this value is not null, the name is unique across CA versions for a given CA. + VersionName *string `mandatory:"false" json:"versionName"` + + // An optional property indicating when to delete the CA version, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` + + Validity *Validity `mandatory:"false" json:"validity"` + + RevocationStatus *RevocationStatus `mandatory:"false" json:"revocationStatus"` +} + +func (m CertificateAuthorityBundleVersionSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CertificateAuthorityBundleVersionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range m.Stages { + if _, ok := GetMappingVersionStageEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stages: %s. Supported values are: %s.", val, strings.Join(GetVersionStageEnumStringValues(), ","))) + } + } + + 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/certificates/certificate_bundle.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle.go new file mode 100644 index 00000000000..6aa7b7aff92 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle.go @@ -0,0 +1,237 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateBundle The contents of the certificate, properties of the certificate (and certificate version), and user-provided contextual metadata for the certificate. +type CertificateBundle interface { + + // The OCID of the certificate. + GetCertificateId() *string + + // The name of the certificate. + GetCertificateName() *string + + // The version number of the certificate. + GetVersionNumber() *int64 + + // A unique certificate identifier used in certificate revocation tracking, formatted as octets. + // Example: `03 AC FC FA CC B3 CB 02 B8 F8 DE F5 85 E7 7B FF` + GetSerialNumber() *string + + // An optional property indicating when the certificate version was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + GetTimeCreated() *common.SDKTime + + GetValidity() *Validity + + // A list of rotation states for the certificate bundle. + GetStages() []VersionStageEnum + + // The certificate in PEM format. + GetCertificatePem() *string + + // The certificate chain (in PEM format) for the certificate bundle. + GetCertChainPem() *string + + // The name of the certificate version. + GetVersionName() *string + + GetRevocationStatus() *RevocationStatus +} + +type certificatebundle struct { + JsonData []byte + CertificateId *string `mandatory:"true" json:"certificateId"` + CertificateName *string `mandatory:"true" json:"certificateName"` + VersionNumber *int64 `mandatory:"true" json:"versionNumber"` + SerialNumber *string `mandatory:"true" json:"serialNumber"` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + Validity *Validity `mandatory:"true" json:"validity"` + Stages []VersionStageEnum `mandatory:"true" json:"stages"` + CertificatePem *string `mandatory:"false" json:"certificatePem"` + CertChainPem *string `mandatory:"false" json:"certChainPem"` + VersionName *string `mandatory:"false" json:"versionName"` + RevocationStatus *RevocationStatus `mandatory:"false" json:"revocationStatus"` + CertificateBundleType string `json:"certificateBundleType"` +} + +// UnmarshalJSON unmarshals json +func (m *certificatebundle) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalercertificatebundle certificatebundle + s := struct { + Model Unmarshalercertificatebundle + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.CertificateId = s.Model.CertificateId + m.CertificateName = s.Model.CertificateName + m.VersionNumber = s.Model.VersionNumber + m.SerialNumber = s.Model.SerialNumber + m.TimeCreated = s.Model.TimeCreated + m.Validity = s.Model.Validity + m.Stages = s.Model.Stages + m.CertificatePem = s.Model.CertificatePem + m.CertChainPem = s.Model.CertChainPem + m.VersionName = s.Model.VersionName + m.RevocationStatus = s.Model.RevocationStatus + m.CertificateBundleType = s.Model.CertificateBundleType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *certificatebundle) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.CertificateBundleType { + case "CERTIFICATE_CONTENT_PUBLIC_ONLY": + mm := CertificateBundlePublicOnly{} + err = json.Unmarshal(data, &mm) + return mm, err + case "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY": + mm := CertificateBundleWithPrivateKey{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + return *m, nil + } +} + +//GetCertificateId returns CertificateId +func (m certificatebundle) GetCertificateId() *string { + return m.CertificateId +} + +//GetCertificateName returns CertificateName +func (m certificatebundle) GetCertificateName() *string { + return m.CertificateName +} + +//GetVersionNumber returns VersionNumber +func (m certificatebundle) GetVersionNumber() *int64 { + return m.VersionNumber +} + +//GetSerialNumber returns SerialNumber +func (m certificatebundle) GetSerialNumber() *string { + return m.SerialNumber +} + +//GetTimeCreated returns TimeCreated +func (m certificatebundle) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetValidity returns Validity +func (m certificatebundle) GetValidity() *Validity { + return m.Validity +} + +//GetStages returns Stages +func (m certificatebundle) GetStages() []VersionStageEnum { + return m.Stages +} + +//GetCertificatePem returns CertificatePem +func (m certificatebundle) GetCertificatePem() *string { + return m.CertificatePem +} + +//GetCertChainPem returns CertChainPem +func (m certificatebundle) GetCertChainPem() *string { + return m.CertChainPem +} + +//GetVersionName returns VersionName +func (m certificatebundle) GetVersionName() *string { + return m.VersionName +} + +//GetRevocationStatus returns RevocationStatus +func (m certificatebundle) GetRevocationStatus() *RevocationStatus { + return m.RevocationStatus +} + +func (m certificatebundle) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m certificatebundle) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range m.Stages { + if _, ok := GetMappingVersionStageEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stages: %s. Supported values are: %s.", val, strings.Join(GetVersionStageEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CertificateBundleCertificateBundleTypeEnum Enum with underlying type: string +type CertificateBundleCertificateBundleTypeEnum string + +// Set of constants representing the allowable values for CertificateBundleCertificateBundleTypeEnum +const ( + CertificateBundleCertificateBundleTypePublicOnly CertificateBundleCertificateBundleTypeEnum = "CERTIFICATE_CONTENT_PUBLIC_ONLY" + CertificateBundleCertificateBundleTypeWithPrivateKey CertificateBundleCertificateBundleTypeEnum = "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY" +) + +var mappingCertificateBundleCertificateBundleTypeEnum = map[string]CertificateBundleCertificateBundleTypeEnum{ + "CERTIFICATE_CONTENT_PUBLIC_ONLY": CertificateBundleCertificateBundleTypePublicOnly, + "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY": CertificateBundleCertificateBundleTypeWithPrivateKey, +} + +var mappingCertificateBundleCertificateBundleTypeEnumLowerCase = map[string]CertificateBundleCertificateBundleTypeEnum{ + "certificate_content_public_only": CertificateBundleCertificateBundleTypePublicOnly, + "certificate_content_with_private_key": CertificateBundleCertificateBundleTypeWithPrivateKey, +} + +// GetCertificateBundleCertificateBundleTypeEnumValues Enumerates the set of values for CertificateBundleCertificateBundleTypeEnum +func GetCertificateBundleCertificateBundleTypeEnumValues() []CertificateBundleCertificateBundleTypeEnum { + values := make([]CertificateBundleCertificateBundleTypeEnum, 0) + for _, v := range mappingCertificateBundleCertificateBundleTypeEnum { + values = append(values, v) + } + return values +} + +// GetCertificateBundleCertificateBundleTypeEnumStringValues Enumerates the set of values in String for CertificateBundleCertificateBundleTypeEnum +func GetCertificateBundleCertificateBundleTypeEnumStringValues() []string { + return []string{ + "CERTIFICATE_CONTENT_PUBLIC_ONLY", + "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY", + } +} + +// GetMappingCertificateBundleCertificateBundleTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCertificateBundleCertificateBundleTypeEnum(val string) (CertificateBundleCertificateBundleTypeEnum, bool) { + enum, ok := mappingCertificateBundleCertificateBundleTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_public_only.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_public_only.go new file mode 100644 index 00000000000..f3d5699bebe --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_public_only.go @@ -0,0 +1,145 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateBundlePublicOnly A certificate bundle, not including the private key. +type CertificateBundlePublicOnly struct { + + // The OCID of the certificate. + CertificateId *string `mandatory:"true" json:"certificateId"` + + // The name of the certificate. + CertificateName *string `mandatory:"true" json:"certificateName"` + + // The version number of the certificate. + VersionNumber *int64 `mandatory:"true" json:"versionNumber"` + + // A unique certificate identifier used in certificate revocation tracking, formatted as octets. + // Example: `03 AC FC FA CC B3 CB 02 B8 F8 DE F5 85 E7 7B FF` + SerialNumber *string `mandatory:"true" json:"serialNumber"` + + // An optional property indicating when the certificate version was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + Validity *Validity `mandatory:"true" json:"validity"` + + // The certificate in PEM format. + CertificatePem *string `mandatory:"false" json:"certificatePem"` + + // The certificate chain (in PEM format) for the certificate bundle. + CertChainPem *string `mandatory:"false" json:"certChainPem"` + + // The name of the certificate version. + VersionName *string `mandatory:"false" json:"versionName"` + + RevocationStatus *RevocationStatus `mandatory:"false" json:"revocationStatus"` + + // A list of rotation states for the certificate bundle. + Stages []VersionStageEnum `mandatory:"true" json:"stages"` +} + +//GetCertificateId returns CertificateId +func (m CertificateBundlePublicOnly) GetCertificateId() *string { + return m.CertificateId +} + +//GetCertificateName returns CertificateName +func (m CertificateBundlePublicOnly) GetCertificateName() *string { + return m.CertificateName +} + +//GetVersionNumber returns VersionNumber +func (m CertificateBundlePublicOnly) GetVersionNumber() *int64 { + return m.VersionNumber +} + +//GetSerialNumber returns SerialNumber +func (m CertificateBundlePublicOnly) GetSerialNumber() *string { + return m.SerialNumber +} + +//GetCertificatePem returns CertificatePem +func (m CertificateBundlePublicOnly) GetCertificatePem() *string { + return m.CertificatePem +} + +//GetCertChainPem returns CertChainPem +func (m CertificateBundlePublicOnly) GetCertChainPem() *string { + return m.CertChainPem +} + +//GetTimeCreated returns TimeCreated +func (m CertificateBundlePublicOnly) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetValidity returns Validity +func (m CertificateBundlePublicOnly) GetValidity() *Validity { + return m.Validity +} + +//GetVersionName returns VersionName +func (m CertificateBundlePublicOnly) GetVersionName() *string { + return m.VersionName +} + +//GetStages returns Stages +func (m CertificateBundlePublicOnly) GetStages() []VersionStageEnum { + return m.Stages +} + +//GetRevocationStatus returns RevocationStatus +func (m CertificateBundlePublicOnly) GetRevocationStatus() *RevocationStatus { + return m.RevocationStatus +} + +func (m CertificateBundlePublicOnly) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CertificateBundlePublicOnly) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.Stages { + if _, ok := GetMappingVersionStageEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stages: %s. Supported values are: %s.", val, strings.Join(GetVersionStageEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CertificateBundlePublicOnly) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCertificateBundlePublicOnly CertificateBundlePublicOnly + s := struct { + DiscriminatorParam string `json:"certificateBundleType"` + MarshalTypeCertificateBundlePublicOnly + }{ + "CERTIFICATE_CONTENT_PUBLIC_ONLY", + (MarshalTypeCertificateBundlePublicOnly)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_version_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_version_collection.go new file mode 100644 index 00000000000..30f6dae7806 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_version_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateBundleVersionCollection The results of a certificate bundle versions search. Results contain certificate bundle version summary objects. +type CertificateBundleVersionCollection struct { + + // A list of certificate bundle version summary objects. + Items []CertificateBundleVersionSummary `mandatory:"true" json:"items"` +} + +func (m CertificateBundleVersionCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CertificateBundleVersionCollection) 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/certificates/certificate_bundle_version_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_version_summary.go new file mode 100644 index 00000000000..16eed0432ef --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_version_summary.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateBundleVersionSummary The properties of the certificate bundle. Certificate bundle version summary objects do not include the actual contents of the certificate. +type CertificateBundleVersionSummary struct { + + // The OCID of the certificate. + CertificateId *string `mandatory:"true" json:"certificateId"` + + // The name of the certificate. + CertificateName *string `mandatory:"true" json:"certificateName"` + + // The version number of the certificate. + VersionNumber *int64 `mandatory:"true" json:"versionNumber"` + + // An optional property indicating when the certificate version was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + // A list of rotation states for this certificate bundle version. + Stages []VersionStageEnum `mandatory:"true" json:"stages"` + + // A unique certificate identifier used in certificate revocation tracking, formatted as octets. + // Example: `03 AC FC FA CC B3 CB 02 B8 F8 DE F5 85 E7 7B FF` + SerialNumber *string `mandatory:"false" json:"serialNumber"` + + // The name of the certificate version. + VersionName *string `mandatory:"false" json:"versionName"` + + Validity *Validity `mandatory:"false" json:"validity"` + + // An optional property indicating when to delete the certificate version, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfDeletion *common.SDKTime `mandatory:"false" json:"timeOfDeletion"` + + RevocationStatus *RevocationStatus `mandatory:"false" json:"revocationStatus"` +} + +func (m CertificateBundleVersionSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CertificateBundleVersionSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range m.Stages { + if _, ok := GetMappingVersionStageEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stages: %s. Supported values are: %s.", val, strings.Join(GetVersionStageEnumStringValues(), ","))) + } + } + + 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/certificates/certificate_bundle_with_private_key.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_with_private_key.go new file mode 100644 index 00000000000..dec96e902ce --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificate_bundle_with_private_key.go @@ -0,0 +1,151 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CertificateBundleWithPrivateKey A certificate bundle, including the private key. +type CertificateBundleWithPrivateKey struct { + + // The OCID of the certificate. + CertificateId *string `mandatory:"true" json:"certificateId"` + + // The name of the certificate. + CertificateName *string `mandatory:"true" json:"certificateName"` + + // The version number of the certificate. + VersionNumber *int64 `mandatory:"true" json:"versionNumber"` + + // A unique certificate identifier used in certificate revocation tracking, formatted as octets. + // Example: `03 AC FC FA CC B3 CB 02 B8 F8 DE F5 85 E7 7B FF` + SerialNumber *string `mandatory:"true" json:"serialNumber"` + + // An optional property indicating when the certificate version was created, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"` + + Validity *Validity `mandatory:"true" json:"validity"` + + // The private key (in PEM format) for the certificate. + PrivateKeyPem *string `mandatory:"true" json:"privateKeyPem"` + + // The certificate in PEM format. + CertificatePem *string `mandatory:"false" json:"certificatePem"` + + // The certificate chain (in PEM format) for the certificate bundle. + CertChainPem *string `mandatory:"false" json:"certChainPem"` + + // The name of the certificate version. + VersionName *string `mandatory:"false" json:"versionName"` + + RevocationStatus *RevocationStatus `mandatory:"false" json:"revocationStatus"` + + // An optional passphrase for the private key. + PrivateKeyPemPassphrase *string `mandatory:"false" json:"privateKeyPemPassphrase"` + + // A list of rotation states for the certificate bundle. + Stages []VersionStageEnum `mandatory:"true" json:"stages"` +} + +//GetCertificateId returns CertificateId +func (m CertificateBundleWithPrivateKey) GetCertificateId() *string { + return m.CertificateId +} + +//GetCertificateName returns CertificateName +func (m CertificateBundleWithPrivateKey) GetCertificateName() *string { + return m.CertificateName +} + +//GetVersionNumber returns VersionNumber +func (m CertificateBundleWithPrivateKey) GetVersionNumber() *int64 { + return m.VersionNumber +} + +//GetSerialNumber returns SerialNumber +func (m CertificateBundleWithPrivateKey) GetSerialNumber() *string { + return m.SerialNumber +} + +//GetCertificatePem returns CertificatePem +func (m CertificateBundleWithPrivateKey) GetCertificatePem() *string { + return m.CertificatePem +} + +//GetCertChainPem returns CertChainPem +func (m CertificateBundleWithPrivateKey) GetCertChainPem() *string { + return m.CertChainPem +} + +//GetTimeCreated returns TimeCreated +func (m CertificateBundleWithPrivateKey) GetTimeCreated() *common.SDKTime { + return m.TimeCreated +} + +//GetValidity returns Validity +func (m CertificateBundleWithPrivateKey) GetValidity() *Validity { + return m.Validity +} + +//GetVersionName returns VersionName +func (m CertificateBundleWithPrivateKey) GetVersionName() *string { + return m.VersionName +} + +//GetStages returns Stages +func (m CertificateBundleWithPrivateKey) GetStages() []VersionStageEnum { + return m.Stages +} + +//GetRevocationStatus returns RevocationStatus +func (m CertificateBundleWithPrivateKey) GetRevocationStatus() *RevocationStatus { + return m.RevocationStatus +} + +func (m CertificateBundleWithPrivateKey) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CertificateBundleWithPrivateKey) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + for _, val := range m.Stages { + if _, ok := GetMappingVersionStageEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stages: %s. Supported values are: %s.", val, strings.Join(GetVersionStageEnumStringValues(), ","))) + } + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m CertificateBundleWithPrivateKey) MarshalJSON() (buff []byte, e error) { + type MarshalTypeCertificateBundleWithPrivateKey CertificateBundleWithPrivateKey + s := struct { + DiscriminatorParam string `json:"certificateBundleType"` + MarshalTypeCertificateBundleWithPrivateKey + }{ + "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY", + (MarshalTypeCertificateBundleWithPrivateKey)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificates_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificates_client.go new file mode 100644 index 00000000000..91f98272a76 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/certificates_client.go @@ -0,0 +1,377 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "context" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "github.com/oracle/oci-go-sdk/v65/common/auth" + "net/http" +) + +//CertificatesClient a client for Certificates +type CertificatesClient struct { + common.BaseClient + config *common.ConfigurationProvider +} + +// NewCertificatesClientWithConfigurationProvider Creates a new default Certificates client with the given configuration provider. +// the configuration provider will be used for the default signer as well as reading the region +func NewCertificatesClientWithConfigurationProvider(configProvider common.ConfigurationProvider) (client CertificatesClient, err error) { + provider, err := auth.GetGenericConfigurationProvider(configProvider) + if err != nil { + return client, err + } + baseClient, e := common.NewClientWithConfig(provider) + if e != nil { + return client, e + } + return newCertificatesClientFromBaseClient(baseClient, provider) +} + +// NewCertificatesClientWithOboToken Creates a new default Certificates 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 NewCertificatesClientWithOboToken(configProvider common.ConfigurationProvider, oboToken string) (client CertificatesClient, err error) { + baseClient, err := common.NewClientWithOboToken(configProvider, oboToken) + if err != nil { + return client, err + } + + return newCertificatesClientFromBaseClient(baseClient, configProvider) +} + +func newCertificatesClientFromBaseClient(baseClient common.BaseClient, configProvider common.ConfigurationProvider) (client CertificatesClient, err error) { + // Certificates service default circuit breaker is enabled + baseClient.Configuration.CircuitBreaker = common.NewCircuitBreaker(common.DefaultCircuitBreakerSettingWithServiceName("Certificates")) + common.ConfigCircuitBreakerFromEnvVar(&baseClient) + common.ConfigCircuitBreakerFromGlobalVar(&baseClient) + + client = CertificatesClient{BaseClient: baseClient} + client.BasePath = "20210224" + err = client.setConfigurationProvider(configProvider) + return +} + +// SetRegion overrides the region of this client. +func (client *CertificatesClient) SetRegion(region string) { + client.Host = common.StringToRegion(region).EndpointForTemplate("certificates", "https://certificates.{region}.oci.{secondLevelDomain}") +} + +// SetConfigurationProvider sets the configuration provider including the region, returns an error if is not valid +func (client *CertificatesClient) 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 *CertificatesClient) ConfigurationProvider() *common.ConfigurationProvider { + return client.config +} + +// GetCaBundle Gets a ca-bundle bundle. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/GetCaBundle.go.html to see an example of how to use GetCaBundle API. +func (client CertificatesClient) GetCaBundle(ctx context.Context, request GetCaBundleRequest) (response GetCaBundleResponse, 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.getCaBundle, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCaBundleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCaBundleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCaBundleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCaBundleResponse") + } + return +} + +// getCaBundle implements the OCIOperation interface (enables retrying operations) +func (client CertificatesClient) getCaBundle(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/caBundles/{caBundleId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCaBundleResponse + 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/certificates/20210224/CaBundle/GetCaBundle" + err = common.PostProcessServiceError(err, "Certificates", "GetCaBundle", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCertificateAuthorityBundle Gets a certificate authority bundle that matches either the specified `stage`, `name`, or `versionNumber` parameter. +// If none of these parameters are provided, the bundle for the certificate authority version marked as `CURRENT` will be returned. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/GetCertificateAuthorityBundle.go.html to see an example of how to use GetCertificateAuthorityBundle API. +func (client CertificatesClient) GetCertificateAuthorityBundle(ctx context.Context, request GetCertificateAuthorityBundleRequest) (response GetCertificateAuthorityBundleResponse, 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.getCertificateAuthorityBundle, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCertificateAuthorityBundleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCertificateAuthorityBundleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCertificateAuthorityBundleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCertificateAuthorityBundleResponse") + } + return +} + +// getCertificateAuthorityBundle implements the OCIOperation interface (enables retrying operations) +func (client CertificatesClient) getCertificateAuthorityBundle(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/certificateAuthorityBundles/{certificateAuthorityId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCertificateAuthorityBundleResponse + 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/certificates/20210224/CertificateAuthorityBundle/GetCertificateAuthorityBundle" + err = common.PostProcessServiceError(err, "Certificates", "GetCertificateAuthorityBundle", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetCertificateBundle Gets a certificate bundle that matches either the specified `stage`, `versionName`, or `versionNumber` parameter. +// If none of these parameters are provided, the bundle for the certificate version marked as `CURRENT` will be returned. +// By default, the private key is not included in the query result, and a CertificateBundlePublicOnly is returned. +// If the private key is needed, use the CertificateBundleTypeQueryParam parameter to get a CertificateBundleWithPrivateKey response. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/GetCertificateBundle.go.html to see an example of how to use GetCertificateBundle API. +func (client CertificatesClient) GetCertificateBundle(ctx context.Context, request GetCertificateBundleRequest) (response GetCertificateBundleResponse, 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.getCertificateBundle, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCertificateBundleResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCertificateBundleResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCertificateBundleResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCertificateBundleResponse") + } + return +} + +// getCertificateBundle implements the OCIOperation interface (enables retrying operations) +func (client CertificatesClient) getCertificateBundle(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/certificateBundles/{certificateId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCertificateBundleResponse + 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/certificates/20210224/CertificateBundle/GetCertificateBundle" + err = common.PostProcessServiceError(err, "Certificates", "GetCertificateBundle", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponseWithPolymorphicBody(httpResponse, &response, &certificatebundle{}) + return response, err +} + +// ListCertificateAuthorityBundleVersions Lists all certificate authority bundle versions for the specified certificate authority. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/ListCertificateAuthorityBundleVersions.go.html to see an example of how to use ListCertificateAuthorityBundleVersions API. +func (client CertificatesClient) ListCertificateAuthorityBundleVersions(ctx context.Context, request ListCertificateAuthorityBundleVersionsRequest) (response ListCertificateAuthorityBundleVersionsResponse, 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.listCertificateAuthorityBundleVersions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCertificateAuthorityBundleVersionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCertificateAuthorityBundleVersionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCertificateAuthorityBundleVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCertificateAuthorityBundleVersionsResponse") + } + return +} + +// listCertificateAuthorityBundleVersions implements the OCIOperation interface (enables retrying operations) +func (client CertificatesClient) listCertificateAuthorityBundleVersions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/certificateAuthorityBundles/{certificateAuthorityId}/versions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCertificateAuthorityBundleVersionsResponse + 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/certificates/20210224/CertificateAuthorityBundleVersionSummary/ListCertificateAuthorityBundleVersions" + err = common.PostProcessServiceError(err, "Certificates", "ListCertificateAuthorityBundleVersions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// ListCertificateBundleVersions Lists all certificate bundle versions for the specified certificate. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/ListCertificateBundleVersions.go.html to see an example of how to use ListCertificateBundleVersions API. +func (client CertificatesClient) ListCertificateBundleVersions(ctx context.Context, request ListCertificateBundleVersionsRequest) (response ListCertificateBundleVersionsResponse, 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.listCertificateBundleVersions, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListCertificateBundleVersionsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListCertificateBundleVersionsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListCertificateBundleVersionsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListCertificateBundleVersionsResponse") + } + return +} + +// listCertificateBundleVersions implements the OCIOperation interface (enables retrying operations) +func (client CertificatesClient) listCertificateBundleVersions(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/certificateBundles/{certificateId}/versions", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListCertificateBundleVersionsResponse + 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/certificates/20210224/CertificateBundleVersionSummary/ListCertificateBundleVersions" + err = common.PostProcessServiceError(err, "Certificates", "ListCertificateBundleVersions", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_ca_bundle_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_ca_bundle_request_response.go new file mode 100644 index 00000000000..9f1959031b8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_ca_bundle_request_response.go @@ -0,0 +1,93 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCaBundleRequest wrapper for the GetCaBundle operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/GetCaBundle.go.html to see an example of how to use GetCaBundleRequest. +type GetCaBundleRequest struct { + + // The OCID of the CA bundle. + CaBundleId *string `mandatory:"true" contributesTo:"path" name:"caBundleId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetCaBundleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCaBundleRequest) 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 GetCaBundleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCaBundleRequest) 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 GetCaBundleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCaBundleResponse wrapper for the GetCaBundle operation +type GetCaBundleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CaBundle instance + CaBundle `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 GetCaBundleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCaBundleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_certificate_authority_bundle_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_certificate_authority_bundle_request_response.go new file mode 100644 index 00000000000..c166667cc8e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_certificate_authority_bundle_request_response.go @@ -0,0 +1,159 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCertificateAuthorityBundleRequest wrapper for the GetCertificateAuthorityBundle operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/GetCertificateAuthorityBundle.go.html to see an example of how to use GetCertificateAuthorityBundleRequest. +type GetCertificateAuthorityBundleRequest struct { + + // The OCID of the certificate authority (CA). + CertificateAuthorityId *string `mandatory:"true" contributesTo:"path" name:"certificateAuthorityId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The version number of the certificate authority (CA). + VersionNumber *int64 `mandatory:"false" contributesTo:"query" name:"versionNumber"` + + // The name of the certificate authority (CA). (This might be referred to as the name of the CA version, as every CA consists of at least one version.) Names are unique across versions of a given CA. + CertificateAuthorityVersionName *string `mandatory:"false" contributesTo:"query" name:"certificateAuthorityVersionName"` + + // The rotation state of the certificate version. + Stage GetCertificateAuthorityBundleStageEnum `mandatory:"false" contributesTo:"query" name:"stage" 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 GetCertificateAuthorityBundleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCertificateAuthorityBundleRequest) 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 GetCertificateAuthorityBundleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCertificateAuthorityBundleRequest) 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 GetCertificateAuthorityBundleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGetCertificateAuthorityBundleStageEnum(string(request.Stage)); !ok && request.Stage != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stage: %s. Supported values are: %s.", request.Stage, strings.Join(GetGetCertificateAuthorityBundleStageEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCertificateAuthorityBundleResponse wrapper for the GetCertificateAuthorityBundle operation +type GetCertificateAuthorityBundleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CertificateAuthorityBundle instance + CertificateAuthorityBundle `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 GetCertificateAuthorityBundleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCertificateAuthorityBundleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetCertificateAuthorityBundleStageEnum Enum with underlying type: string +type GetCertificateAuthorityBundleStageEnum string + +// Set of constants representing the allowable values for GetCertificateAuthorityBundleStageEnum +const ( + GetCertificateAuthorityBundleStageCurrent GetCertificateAuthorityBundleStageEnum = "CURRENT" + GetCertificateAuthorityBundleStagePending GetCertificateAuthorityBundleStageEnum = "PENDING" + GetCertificateAuthorityBundleStageLatest GetCertificateAuthorityBundleStageEnum = "LATEST" + GetCertificateAuthorityBundleStagePrevious GetCertificateAuthorityBundleStageEnum = "PREVIOUS" + GetCertificateAuthorityBundleStageDeprecated GetCertificateAuthorityBundleStageEnum = "DEPRECATED" +) + +var mappingGetCertificateAuthorityBundleStageEnum = map[string]GetCertificateAuthorityBundleStageEnum{ + "CURRENT": GetCertificateAuthorityBundleStageCurrent, + "PENDING": GetCertificateAuthorityBundleStagePending, + "LATEST": GetCertificateAuthorityBundleStageLatest, + "PREVIOUS": GetCertificateAuthorityBundleStagePrevious, + "DEPRECATED": GetCertificateAuthorityBundleStageDeprecated, +} + +var mappingGetCertificateAuthorityBundleStageEnumLowerCase = map[string]GetCertificateAuthorityBundleStageEnum{ + "current": GetCertificateAuthorityBundleStageCurrent, + "pending": GetCertificateAuthorityBundleStagePending, + "latest": GetCertificateAuthorityBundleStageLatest, + "previous": GetCertificateAuthorityBundleStagePrevious, + "deprecated": GetCertificateAuthorityBundleStageDeprecated, +} + +// GetGetCertificateAuthorityBundleStageEnumValues Enumerates the set of values for GetCertificateAuthorityBundleStageEnum +func GetGetCertificateAuthorityBundleStageEnumValues() []GetCertificateAuthorityBundleStageEnum { + values := make([]GetCertificateAuthorityBundleStageEnum, 0) + for _, v := range mappingGetCertificateAuthorityBundleStageEnum { + values = append(values, v) + } + return values +} + +// GetGetCertificateAuthorityBundleStageEnumStringValues Enumerates the set of values in String for GetCertificateAuthorityBundleStageEnum +func GetGetCertificateAuthorityBundleStageEnumStringValues() []string { + return []string{ + "CURRENT", + "PENDING", + "LATEST", + "PREVIOUS", + "DEPRECATED", + } +} + +// GetMappingGetCertificateAuthorityBundleStageEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetCertificateAuthorityBundleStageEnum(val string) (GetCertificateAuthorityBundleStageEnum, bool) { + enum, ok := mappingGetCertificateAuthorityBundleStageEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_certificate_bundle_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_certificate_bundle_request_response.go new file mode 100644 index 00000000000..3bd35c42f04 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/get_certificate_bundle_request_response.go @@ -0,0 +1,207 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCertificateBundleRequest wrapper for the GetCertificateBundle operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/GetCertificateBundle.go.html to see an example of how to use GetCertificateBundleRequest. +type GetCertificateBundleRequest struct { + + // The OCID of the certificate. + CertificateId *string `mandatory:"true" contributesTo:"path" name:"certificateId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The version number of the certificate. The default value is 0, which means that this query parameter is ignored. + VersionNumber *int64 `mandatory:"false" contributesTo:"query" name:"versionNumber"` + + // The name of the certificate. (This might be referred to as the name of the certificate version, as every certificate consists of at least one version.) Names are unique across versions of a given certificate. + CertificateVersionName *string `mandatory:"false" contributesTo:"query" name:"certificateVersionName"` + + // The rotation state of the certificate version. + Stage GetCertificateBundleStageEnum `mandatory:"false" contributesTo:"query" name:"stage" omitEmpty:"true"` + + // The type of certificate bundle. By default, the private key fields are not returned. When querying for certificate bundles, to return results with certificate contents, the private key in PEM format, and the private key passphrase, specify the value of this parameter as `CERTIFICATE_CONTENT_WITH_PRIVATE_KEY`. + CertificateBundleType GetCertificateBundleCertificateBundleTypeEnum `mandatory:"false" contributesTo:"query" name:"certificateBundleType" 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 GetCertificateBundleRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCertificateBundleRequest) 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 GetCertificateBundleRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCertificateBundleRequest) 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 GetCertificateBundleRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingGetCertificateBundleStageEnum(string(request.Stage)); !ok && request.Stage != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Stage: %s. Supported values are: %s.", request.Stage, strings.Join(GetGetCertificateBundleStageEnumStringValues(), ","))) + } + if _, ok := GetMappingGetCertificateBundleCertificateBundleTypeEnum(string(request.CertificateBundleType)); !ok && request.CertificateBundleType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CertificateBundleType: %s. Supported values are: %s.", request.CertificateBundleType, strings.Join(GetGetCertificateBundleCertificateBundleTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCertificateBundleResponse wrapper for the GetCertificateBundle operation +type GetCertificateBundleResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CertificateBundle instance + CertificateBundle `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 GetCertificateBundleResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCertificateBundleResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// GetCertificateBundleStageEnum Enum with underlying type: string +type GetCertificateBundleStageEnum string + +// Set of constants representing the allowable values for GetCertificateBundleStageEnum +const ( + GetCertificateBundleStageCurrent GetCertificateBundleStageEnum = "CURRENT" + GetCertificateBundleStagePending GetCertificateBundleStageEnum = "PENDING" + GetCertificateBundleStageLatest GetCertificateBundleStageEnum = "LATEST" + GetCertificateBundleStagePrevious GetCertificateBundleStageEnum = "PREVIOUS" + GetCertificateBundleStageDeprecated GetCertificateBundleStageEnum = "DEPRECATED" +) + +var mappingGetCertificateBundleStageEnum = map[string]GetCertificateBundleStageEnum{ + "CURRENT": GetCertificateBundleStageCurrent, + "PENDING": GetCertificateBundleStagePending, + "LATEST": GetCertificateBundleStageLatest, + "PREVIOUS": GetCertificateBundleStagePrevious, + "DEPRECATED": GetCertificateBundleStageDeprecated, +} + +var mappingGetCertificateBundleStageEnumLowerCase = map[string]GetCertificateBundleStageEnum{ + "current": GetCertificateBundleStageCurrent, + "pending": GetCertificateBundleStagePending, + "latest": GetCertificateBundleStageLatest, + "previous": GetCertificateBundleStagePrevious, + "deprecated": GetCertificateBundleStageDeprecated, +} + +// GetGetCertificateBundleStageEnumValues Enumerates the set of values for GetCertificateBundleStageEnum +func GetGetCertificateBundleStageEnumValues() []GetCertificateBundleStageEnum { + values := make([]GetCertificateBundleStageEnum, 0) + for _, v := range mappingGetCertificateBundleStageEnum { + values = append(values, v) + } + return values +} + +// GetGetCertificateBundleStageEnumStringValues Enumerates the set of values in String for GetCertificateBundleStageEnum +func GetGetCertificateBundleStageEnumStringValues() []string { + return []string{ + "CURRENT", + "PENDING", + "LATEST", + "PREVIOUS", + "DEPRECATED", + } +} + +// GetMappingGetCertificateBundleStageEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetCertificateBundleStageEnum(val string) (GetCertificateBundleStageEnum, bool) { + enum, ok := mappingGetCertificateBundleStageEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// GetCertificateBundleCertificateBundleTypeEnum Enum with underlying type: string +type GetCertificateBundleCertificateBundleTypeEnum string + +// Set of constants representing the allowable values for GetCertificateBundleCertificateBundleTypeEnum +const ( + GetCertificateBundleCertificateBundleTypePublicOnly GetCertificateBundleCertificateBundleTypeEnum = "CERTIFICATE_CONTENT_PUBLIC_ONLY" + GetCertificateBundleCertificateBundleTypeWithPrivateKey GetCertificateBundleCertificateBundleTypeEnum = "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY" +) + +var mappingGetCertificateBundleCertificateBundleTypeEnum = map[string]GetCertificateBundleCertificateBundleTypeEnum{ + "CERTIFICATE_CONTENT_PUBLIC_ONLY": GetCertificateBundleCertificateBundleTypePublicOnly, + "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY": GetCertificateBundleCertificateBundleTypeWithPrivateKey, +} + +var mappingGetCertificateBundleCertificateBundleTypeEnumLowerCase = map[string]GetCertificateBundleCertificateBundleTypeEnum{ + "certificate_content_public_only": GetCertificateBundleCertificateBundleTypePublicOnly, + "certificate_content_with_private_key": GetCertificateBundleCertificateBundleTypeWithPrivateKey, +} + +// GetGetCertificateBundleCertificateBundleTypeEnumValues Enumerates the set of values for GetCertificateBundleCertificateBundleTypeEnum +func GetGetCertificateBundleCertificateBundleTypeEnumValues() []GetCertificateBundleCertificateBundleTypeEnum { + values := make([]GetCertificateBundleCertificateBundleTypeEnum, 0) + for _, v := range mappingGetCertificateBundleCertificateBundleTypeEnum { + values = append(values, v) + } + return values +} + +// GetGetCertificateBundleCertificateBundleTypeEnumStringValues Enumerates the set of values in String for GetCertificateBundleCertificateBundleTypeEnum +func GetGetCertificateBundleCertificateBundleTypeEnumStringValues() []string { + return []string{ + "CERTIFICATE_CONTENT_PUBLIC_ONLY", + "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY", + } +} + +// GetMappingGetCertificateBundleCertificateBundleTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingGetCertificateBundleCertificateBundleTypeEnum(val string) (GetCertificateBundleCertificateBundleTypeEnum, bool) { + enum, ok := mappingGetCertificateBundleCertificateBundleTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/list_certificate_authority_bundle_versions_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/list_certificate_authority_bundle_versions_request_response.go new file mode 100644 index 00000000000..16cb070ce1f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/list_certificate_authority_bundle_versions_request_response.go @@ -0,0 +1,183 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCertificateAuthorityBundleVersionsRequest wrapper for the ListCertificateAuthorityBundleVersions operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/ListCertificateAuthorityBundleVersions.go.html to see an example of how to use ListCertificateAuthorityBundleVersionsRequest. +type ListCertificateAuthorityBundleVersionsRequest struct { + + // The OCID of the certificate authority (CA). + CertificateAuthorityId *string `mandatory:"true" contributesTo:"path" name:"certificateAuthorityId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for `VERSION_NUMBER` is ascending. + SortBy ListCertificateAuthorityBundleVersionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListCertificateAuthorityBundleVersionsSortOrderEnum `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 ListCertificateAuthorityBundleVersionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCertificateAuthorityBundleVersionsRequest) 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 ListCertificateAuthorityBundleVersionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCertificateAuthorityBundleVersionsRequest) 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 ListCertificateAuthorityBundleVersionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCertificateAuthorityBundleVersionsSortByEnum(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(GetListCertificateAuthorityBundleVersionsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListCertificateAuthorityBundleVersionsSortOrderEnum(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(GetListCertificateAuthorityBundleVersionsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCertificateAuthorityBundleVersionsResponse wrapper for the ListCertificateAuthorityBundleVersions operation +type ListCertificateAuthorityBundleVersionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CertificateAuthorityBundleVersionCollection instance + CertificateAuthorityBundleVersionCollection `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"` +} + +func (response ListCertificateAuthorityBundleVersionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCertificateAuthorityBundleVersionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCertificateAuthorityBundleVersionsSortByEnum Enum with underlying type: string +type ListCertificateAuthorityBundleVersionsSortByEnum string + +// Set of constants representing the allowable values for ListCertificateAuthorityBundleVersionsSortByEnum +const ( + ListCertificateAuthorityBundleVersionsSortByVersionNumber ListCertificateAuthorityBundleVersionsSortByEnum = "VERSION_NUMBER" +) + +var mappingListCertificateAuthorityBundleVersionsSortByEnum = map[string]ListCertificateAuthorityBundleVersionsSortByEnum{ + "VERSION_NUMBER": ListCertificateAuthorityBundleVersionsSortByVersionNumber, +} + +var mappingListCertificateAuthorityBundleVersionsSortByEnumLowerCase = map[string]ListCertificateAuthorityBundleVersionsSortByEnum{ + "version_number": ListCertificateAuthorityBundleVersionsSortByVersionNumber, +} + +// GetListCertificateAuthorityBundleVersionsSortByEnumValues Enumerates the set of values for ListCertificateAuthorityBundleVersionsSortByEnum +func GetListCertificateAuthorityBundleVersionsSortByEnumValues() []ListCertificateAuthorityBundleVersionsSortByEnum { + values := make([]ListCertificateAuthorityBundleVersionsSortByEnum, 0) + for _, v := range mappingListCertificateAuthorityBundleVersionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCertificateAuthorityBundleVersionsSortByEnumStringValues Enumerates the set of values in String for ListCertificateAuthorityBundleVersionsSortByEnum +func GetListCertificateAuthorityBundleVersionsSortByEnumStringValues() []string { + return []string{ + "VERSION_NUMBER", + } +} + +// GetMappingListCertificateAuthorityBundleVersionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCertificateAuthorityBundleVersionsSortByEnum(val string) (ListCertificateAuthorityBundleVersionsSortByEnum, bool) { + enum, ok := mappingListCertificateAuthorityBundleVersionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCertificateAuthorityBundleVersionsSortOrderEnum Enum with underlying type: string +type ListCertificateAuthorityBundleVersionsSortOrderEnum string + +// Set of constants representing the allowable values for ListCertificateAuthorityBundleVersionsSortOrderEnum +const ( + ListCertificateAuthorityBundleVersionsSortOrderAsc ListCertificateAuthorityBundleVersionsSortOrderEnum = "ASC" + ListCertificateAuthorityBundleVersionsSortOrderDesc ListCertificateAuthorityBundleVersionsSortOrderEnum = "DESC" +) + +var mappingListCertificateAuthorityBundleVersionsSortOrderEnum = map[string]ListCertificateAuthorityBundleVersionsSortOrderEnum{ + "ASC": ListCertificateAuthorityBundleVersionsSortOrderAsc, + "DESC": ListCertificateAuthorityBundleVersionsSortOrderDesc, +} + +var mappingListCertificateAuthorityBundleVersionsSortOrderEnumLowerCase = map[string]ListCertificateAuthorityBundleVersionsSortOrderEnum{ + "asc": ListCertificateAuthorityBundleVersionsSortOrderAsc, + "desc": ListCertificateAuthorityBundleVersionsSortOrderDesc, +} + +// GetListCertificateAuthorityBundleVersionsSortOrderEnumValues Enumerates the set of values for ListCertificateAuthorityBundleVersionsSortOrderEnum +func GetListCertificateAuthorityBundleVersionsSortOrderEnumValues() []ListCertificateAuthorityBundleVersionsSortOrderEnum { + values := make([]ListCertificateAuthorityBundleVersionsSortOrderEnum, 0) + for _, v := range mappingListCertificateAuthorityBundleVersionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCertificateAuthorityBundleVersionsSortOrderEnumStringValues Enumerates the set of values in String for ListCertificateAuthorityBundleVersionsSortOrderEnum +func GetListCertificateAuthorityBundleVersionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCertificateAuthorityBundleVersionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCertificateAuthorityBundleVersionsSortOrderEnum(val string) (ListCertificateAuthorityBundleVersionsSortOrderEnum, bool) { + enum, ok := mappingListCertificateAuthorityBundleVersionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/list_certificate_bundle_versions_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/list_certificate_bundle_versions_request_response.go new file mode 100644 index 00000000000..dd4fa3614e7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/list_certificate_bundle_versions_request_response.go @@ -0,0 +1,183 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListCertificateBundleVersionsRequest wrapper for the ListCertificateBundleVersions operation +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/certificates/ListCertificateBundleVersions.go.html to see an example of how to use ListCertificateBundleVersionsRequest. +type ListCertificateBundleVersionsRequest struct { + + // The OCID of the certificate. + CertificateId *string `mandatory:"true" contributesTo:"path" name:"certificateId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, + // please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The field to sort by. You can specify only one sort order. The default + // order for `VERSION_NUMBER` is ascending. + SortBy ListCertificateBundleVersionsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListCertificateBundleVersionsSortOrderEnum `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 ListCertificateBundleVersionsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListCertificateBundleVersionsRequest) 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 ListCertificateBundleVersionsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListCertificateBundleVersionsRequest) 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 ListCertificateBundleVersionsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListCertificateBundleVersionsSortByEnum(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(GetListCertificateBundleVersionsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListCertificateBundleVersionsSortOrderEnum(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(GetListCertificateBundleVersionsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListCertificateBundleVersionsResponse wrapper for the ListCertificateBundleVersions operation +type ListCertificateBundleVersionsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CertificateBundleVersionCollection instance + CertificateBundleVersionCollection `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"` +} + +func (response ListCertificateBundleVersionsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListCertificateBundleVersionsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListCertificateBundleVersionsSortByEnum Enum with underlying type: string +type ListCertificateBundleVersionsSortByEnum string + +// Set of constants representing the allowable values for ListCertificateBundleVersionsSortByEnum +const ( + ListCertificateBundleVersionsSortByVersionNumber ListCertificateBundleVersionsSortByEnum = "VERSION_NUMBER" +) + +var mappingListCertificateBundleVersionsSortByEnum = map[string]ListCertificateBundleVersionsSortByEnum{ + "VERSION_NUMBER": ListCertificateBundleVersionsSortByVersionNumber, +} + +var mappingListCertificateBundleVersionsSortByEnumLowerCase = map[string]ListCertificateBundleVersionsSortByEnum{ + "version_number": ListCertificateBundleVersionsSortByVersionNumber, +} + +// GetListCertificateBundleVersionsSortByEnumValues Enumerates the set of values for ListCertificateBundleVersionsSortByEnum +func GetListCertificateBundleVersionsSortByEnumValues() []ListCertificateBundleVersionsSortByEnum { + values := make([]ListCertificateBundleVersionsSortByEnum, 0) + for _, v := range mappingListCertificateBundleVersionsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListCertificateBundleVersionsSortByEnumStringValues Enumerates the set of values in String for ListCertificateBundleVersionsSortByEnum +func GetListCertificateBundleVersionsSortByEnumStringValues() []string { + return []string{ + "VERSION_NUMBER", + } +} + +// GetMappingListCertificateBundleVersionsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCertificateBundleVersionsSortByEnum(val string) (ListCertificateBundleVersionsSortByEnum, bool) { + enum, ok := mappingListCertificateBundleVersionsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListCertificateBundleVersionsSortOrderEnum Enum with underlying type: string +type ListCertificateBundleVersionsSortOrderEnum string + +// Set of constants representing the allowable values for ListCertificateBundleVersionsSortOrderEnum +const ( + ListCertificateBundleVersionsSortOrderAsc ListCertificateBundleVersionsSortOrderEnum = "ASC" + ListCertificateBundleVersionsSortOrderDesc ListCertificateBundleVersionsSortOrderEnum = "DESC" +) + +var mappingListCertificateBundleVersionsSortOrderEnum = map[string]ListCertificateBundleVersionsSortOrderEnum{ + "ASC": ListCertificateBundleVersionsSortOrderAsc, + "DESC": ListCertificateBundleVersionsSortOrderDesc, +} + +var mappingListCertificateBundleVersionsSortOrderEnumLowerCase = map[string]ListCertificateBundleVersionsSortOrderEnum{ + "asc": ListCertificateBundleVersionsSortOrderAsc, + "desc": ListCertificateBundleVersionsSortOrderDesc, +} + +// GetListCertificateBundleVersionsSortOrderEnumValues Enumerates the set of values for ListCertificateBundleVersionsSortOrderEnum +func GetListCertificateBundleVersionsSortOrderEnumValues() []ListCertificateBundleVersionsSortOrderEnum { + values := make([]ListCertificateBundleVersionsSortOrderEnum, 0) + for _, v := range mappingListCertificateBundleVersionsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListCertificateBundleVersionsSortOrderEnumStringValues Enumerates the set of values in String for ListCertificateBundleVersionsSortOrderEnum +func GetListCertificateBundleVersionsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListCertificateBundleVersionsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListCertificateBundleVersionsSortOrderEnum(val string) (ListCertificateBundleVersionsSortOrderEnum, bool) { + enum, ok := mappingListCertificateBundleVersionsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/revocation_reason.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/revocation_reason.go new file mode 100644 index 00000000000..cf1da2df2ce --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/revocation_reason.go @@ -0,0 +1,80 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "strings" +) + +// RevocationReasonEnum Enum with underlying type: string +type RevocationReasonEnum string + +// Set of constants representing the allowable values for RevocationReasonEnum +const ( + RevocationReasonUnspecified RevocationReasonEnum = "UNSPECIFIED" + RevocationReasonKeyCompromise RevocationReasonEnum = "KEY_COMPROMISE" + RevocationReasonCaCompromise RevocationReasonEnum = "CA_COMPROMISE" + RevocationReasonAffiliationChanged RevocationReasonEnum = "AFFILIATION_CHANGED" + RevocationReasonSuperseded RevocationReasonEnum = "SUPERSEDED" + RevocationReasonCessationOfOperation RevocationReasonEnum = "CESSATION_OF_OPERATION" + RevocationReasonPrivilegeWithdrawn RevocationReasonEnum = "PRIVILEGE_WITHDRAWN" + RevocationReasonAaCompromise RevocationReasonEnum = "AA_COMPROMISE" +) + +var mappingRevocationReasonEnum = map[string]RevocationReasonEnum{ + "UNSPECIFIED": RevocationReasonUnspecified, + "KEY_COMPROMISE": RevocationReasonKeyCompromise, + "CA_COMPROMISE": RevocationReasonCaCompromise, + "AFFILIATION_CHANGED": RevocationReasonAffiliationChanged, + "SUPERSEDED": RevocationReasonSuperseded, + "CESSATION_OF_OPERATION": RevocationReasonCessationOfOperation, + "PRIVILEGE_WITHDRAWN": RevocationReasonPrivilegeWithdrawn, + "AA_COMPROMISE": RevocationReasonAaCompromise, +} + +var mappingRevocationReasonEnumLowerCase = map[string]RevocationReasonEnum{ + "unspecified": RevocationReasonUnspecified, + "key_compromise": RevocationReasonKeyCompromise, + "ca_compromise": RevocationReasonCaCompromise, + "affiliation_changed": RevocationReasonAffiliationChanged, + "superseded": RevocationReasonSuperseded, + "cessation_of_operation": RevocationReasonCessationOfOperation, + "privilege_withdrawn": RevocationReasonPrivilegeWithdrawn, + "aa_compromise": RevocationReasonAaCompromise, +} + +// GetRevocationReasonEnumValues Enumerates the set of values for RevocationReasonEnum +func GetRevocationReasonEnumValues() []RevocationReasonEnum { + values := make([]RevocationReasonEnum, 0) + for _, v := range mappingRevocationReasonEnum { + values = append(values, v) + } + return values +} + +// GetRevocationReasonEnumStringValues Enumerates the set of values in String for RevocationReasonEnum +func GetRevocationReasonEnumStringValues() []string { + return []string{ + "UNSPECIFIED", + "KEY_COMPROMISE", + "CA_COMPROMISE", + "AFFILIATION_CHANGED", + "SUPERSEDED", + "CESSATION_OF_OPERATION", + "PRIVILEGE_WITHDRAWN", + "AA_COMPROMISE", + } +} + +// GetMappingRevocationReasonEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRevocationReasonEnum(val string) (RevocationReasonEnum, bool) { + enum, ok := mappingRevocationReasonEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/certificates/revocation_status.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/revocation_status.go new file mode 100644 index 00000000000..17e0d2f6e72 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/revocation_status.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RevocationStatus The current revocation status of the certificate or certificate authority (CA). +type RevocationStatus struct { + + // The time when the certificate or CA was revoked. + TimeRevoked *common.SDKTime `mandatory:"true" json:"timeRevoked"` + + // The reason that the certificate or CA was revoked. + RevocationReason RevocationReasonEnum `mandatory:"true" json:"revocationReason"` +} + +func (m RevocationStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RevocationStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRevocationReasonEnum(string(m.RevocationReason)); !ok && m.RevocationReason != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for RevocationReason: %s. Supported values are: %s.", m.RevocationReason, strings.Join(GetRevocationReasonEnumStringValues(), ","))) + } + + 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/certificates/validity.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/validity.go new file mode 100644 index 00000000000..3eef35e7dec --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/validity.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Validity An object that describes a period of time during which an entity is valid. +type Validity struct { + + // The date on which the certificate validity period begins, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfValidityNotBefore *common.SDKTime `mandatory:"true" json:"timeOfValidityNotBefore"` + + // The date on which the certificate validity period ends, expressed in RFC 3339 (https://tools.ietf.org/html/rfc3339) timestamp format. + // Example: `2019-04-03T21:10:29.600Z` + TimeOfValidityNotAfter *common.SDKTime `mandatory:"true" json:"timeOfValidityNotAfter"` +} + +func (m Validity) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Validity) 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/certificates/version_stage.go b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/version_stage.go new file mode 100644 index 00000000000..82ac5eb07b2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/certificates/version_stage.go @@ -0,0 +1,72 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Certificates Service Retrieval API +// +// API for retrieving certificates. +// + +package certificates + +import ( + "strings" +) + +// VersionStageEnum Enum with underlying type: string +type VersionStageEnum string + +// Set of constants representing the allowable values for VersionStageEnum +const ( + VersionStageCurrent VersionStageEnum = "CURRENT" + VersionStagePending VersionStageEnum = "PENDING" + VersionStageLatest VersionStageEnum = "LATEST" + VersionStagePrevious VersionStageEnum = "PREVIOUS" + VersionStageDeprecated VersionStageEnum = "DEPRECATED" + VersionStageFailed VersionStageEnum = "FAILED" +) + +var mappingVersionStageEnum = map[string]VersionStageEnum{ + "CURRENT": VersionStageCurrent, + "PENDING": VersionStagePending, + "LATEST": VersionStageLatest, + "PREVIOUS": VersionStagePrevious, + "DEPRECATED": VersionStageDeprecated, + "FAILED": VersionStageFailed, +} + +var mappingVersionStageEnumLowerCase = map[string]VersionStageEnum{ + "current": VersionStageCurrent, + "pending": VersionStagePending, + "latest": VersionStageLatest, + "previous": VersionStagePrevious, + "deprecated": VersionStageDeprecated, + "failed": VersionStageFailed, +} + +// GetVersionStageEnumValues Enumerates the set of values for VersionStageEnum +func GetVersionStageEnumValues() []VersionStageEnum { + values := make([]VersionStageEnum, 0) + for _, v := range mappingVersionStageEnum { + values = append(values, v) + } + return values +} + +// GetVersionStageEnumStringValues Enumerates the set of values in String for VersionStageEnum +func GetVersionStageEnumStringValues() []string { + return []string{ + "CURRENT", + "PENDING", + "LATEST", + "PREVIOUS", + "DEPRECATED", + "FAILED", + } +} + +// GetMappingVersionStageEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingVersionStageEnum(val string) (VersionStageEnum, bool) { + enum, ok := mappingVersionStageEnumLowerCase[strings.ToLower(val)] + return enum, ok +} 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 90df5fb7d5e..72214352d28 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,7 +12,7 @@ import ( const ( major = "65" - minor = "44" + minor = "46" patch = "0" tag = "" ) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/cluster_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/cluster_metadata.go index 52f40640bef..c6fd02a06ce 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/cluster_metadata.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/cluster_metadata.go @@ -46,6 +46,9 @@ type ClusterMetadata struct { // The OCID of the work request which updated the cluster. UpdatedByWorkRequestId *string `mandatory:"false" json:"updatedByWorkRequestId"` + + // The time until which the cluster credential is valid. + TimeCredentialExpiration *common.SDKTime `mandatory:"false" json:"timeCredentialExpiration"` } func (m ClusterMetadata) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/complete_credential_rotation_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/complete_credential_rotation_request_response.go new file mode 100644 index 00000000000..a6ccdf73c1c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/complete_credential_rotation_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CompleteCredentialRotationRequest wrapper for the CompleteCredentialRotation operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerengine/CompleteCredentialRotation.go.html to see an example of how to use CompleteCredentialRotationRequest. +type CompleteCredentialRotationRequest struct { + + // The OCID of the cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // A token you supply to uniquely identify the request and provide idempotency if + // the request is retried. Idempotency tokens expire after 24 hours. + 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. + 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 CompleteCredentialRotationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CompleteCredentialRotationRequest) 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 CompleteCredentialRotationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CompleteCredentialRotationRequest) 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 CompleteCredentialRotationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CompleteCredentialRotationResponse wrapper for the CompleteCredentialRotation operation +type CompleteCredentialRotationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CompleteCredentialRotationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CompleteCredentialRotationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/containerengine_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/containerengine_client.go index 21823560065..7b37b393b4f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/containerengine_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/containerengine_client.go @@ -148,6 +148,69 @@ func (client ContainerEngineClient) clusterMigrateToNativeVcn(ctx context.Contex return response, err } +// CompleteCredentialRotation Complete cluster credential rotation. Retire old credentials from kubernetes components. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerengine/CompleteCredentialRotation.go.html to see an example of how to use CompleteCredentialRotation API. +// A default retry strategy applies to this operation CompleteCredentialRotation() +func (client ContainerEngineClient) CompleteCredentialRotation(ctx context.Context, request CompleteCredentialRotationRequest) (response CompleteCredentialRotationResponse, 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.completeCredentialRotation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CompleteCredentialRotationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CompleteCredentialRotationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CompleteCredentialRotationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CompleteCredentialRotationResponse") + } + return +} + +// completeCredentialRotation implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) completeCredentialRotation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/clusters/{clusterId}/actions/completeCredentialRotation", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CompleteCredentialRotationResponse + 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/containerengine/20180222/Cluster/CompleteCredentialRotation" + err = common.PostProcessServiceError(err, "ContainerEngine", "CompleteCredentialRotation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateCluster Create a new cluster. // // See also @@ -1095,6 +1158,64 @@ func (client ContainerEngineClient) getClusterOptions(ctx context.Context, reque return response, err } +// GetCredentialRotationStatus Get cluster credential rotation status. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerengine/GetCredentialRotationStatus.go.html to see an example of how to use GetCredentialRotationStatus API. +// A default retry strategy applies to this operation GetCredentialRotationStatus() +func (client ContainerEngineClient) GetCredentialRotationStatus(ctx context.Context, request GetCredentialRotationStatusRequest) (response GetCredentialRotationStatusResponse, 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.getCredentialRotationStatus, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetCredentialRotationStatusResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetCredentialRotationStatusResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetCredentialRotationStatusResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetCredentialRotationStatusResponse") + } + return +} + +// getCredentialRotationStatus implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) getCredentialRotationStatus(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/clusters/{clusterId}/credentialRotationStatus", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetCredentialRotationStatusResponse + 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/containerengine/20180222/CredentialRotationStatus/GetCredentialRotationStatus" + err = common.PostProcessServiceError(err, "ContainerEngine", "GetCredentialRotationStatus", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetNodePool Get the details of a node pool. // // See also @@ -2144,6 +2265,69 @@ func (client ContainerEngineClient) listWorkloadMappings(ctx context.Context, re return response, err } +// StartCredentialRotation Start cluster credential rotation by adding new credentials, old credentials will still work after this operation. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerengine/StartCredentialRotation.go.html to see an example of how to use StartCredentialRotation API. +// A default retry strategy applies to this operation StartCredentialRotation() +func (client ContainerEngineClient) StartCredentialRotation(ctx context.Context, request StartCredentialRotationRequest) (response StartCredentialRotationResponse, 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.startCredentialRotation, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = StartCredentialRotationResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = StartCredentialRotationResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(StartCredentialRotationResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into StartCredentialRotationResponse") + } + return +} + +// startCredentialRotation implements the OCIOperation interface (enables retrying operations) +func (client ContainerEngineClient) startCredentialRotation(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/clusters/{clusterId}/actions/startCredentialRotation", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response StartCredentialRotationResponse + 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/containerengine/20180222/Cluster/StartCredentialRotation" + err = common.PostProcessServiceError(err, "ContainerEngine", "StartCredentialRotation", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateAddon Update addon details for a cluster. // // See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/credential_rotation_status.go b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/credential_rotation_status.go new file mode 100644 index 00000000000..eeb9cacc1e8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/credential_rotation_status.go @@ -0,0 +1,156 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CredentialRotationStatus Information regarding cluster's credential rotation. +type CredentialRotationStatus struct { + + // Credential rotation status of a kubernetes cluster + // IN_PROGRESS: Issuing new credentials to kubernetes cluster control plane and worker nodes or retiring old credentials from kubernetes cluster control plane and worker nodes. + // WAITING: Waiting for customer to invoke the complete rotation action or the automcatic complete rotation action. + // COMPLETED: New credentials are functional on kuberentes cluster. + Status CredentialRotationStatusStatusEnum `mandatory:"true" json:"status"` + + // Details of a kuberenetes cluster credential rotation status: + // ISSUING_NEW_CREDENTIALS: Credential rotation is in progress. Starting to issue new credentials to kubernetes cluster control plane and worker nodes. + // NEW_CREDENTIALS_ISSUED: New credentials are added. At this stage cluster has both old and new credentials and is awaiting old credentials retirement. + // RETIRING_OLD_CREDENTIALS: Retirement of old credentials is in progress. Starting to remove old credentials from kubernetes cluster control plane and worker nodes. + // COMPLETED: Credential rotation is complete. Old credentials are retired. + StatusDetails CredentialRotationStatusStatusDetailsEnum `mandatory:"true" json:"statusDetails"` + + // The time by which retirement of old credentials should start. + TimeAutoCompletionScheduled *common.SDKTime `mandatory:"false" json:"timeAutoCompletionScheduled"` +} + +func (m CredentialRotationStatus) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CredentialRotationStatus) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingCredentialRotationStatusStatusEnum(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(GetCredentialRotationStatusStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingCredentialRotationStatusStatusDetailsEnum(string(m.StatusDetails)); !ok && m.StatusDetails != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for StatusDetails: %s. Supported values are: %s.", m.StatusDetails, strings.Join(GetCredentialRotationStatusStatusDetailsEnumStringValues(), ","))) + } + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CredentialRotationStatusStatusEnum Enum with underlying type: string +type CredentialRotationStatusStatusEnum string + +// Set of constants representing the allowable values for CredentialRotationStatusStatusEnum +const ( + CredentialRotationStatusStatusInProgress CredentialRotationStatusStatusEnum = "IN_PROGRESS" + CredentialRotationStatusStatusWaiting CredentialRotationStatusStatusEnum = "WAITING" + CredentialRotationStatusStatusCompleted CredentialRotationStatusStatusEnum = "COMPLETED" +) + +var mappingCredentialRotationStatusStatusEnum = map[string]CredentialRotationStatusStatusEnum{ + "IN_PROGRESS": CredentialRotationStatusStatusInProgress, + "WAITING": CredentialRotationStatusStatusWaiting, + "COMPLETED": CredentialRotationStatusStatusCompleted, +} + +var mappingCredentialRotationStatusStatusEnumLowerCase = map[string]CredentialRotationStatusStatusEnum{ + "in_progress": CredentialRotationStatusStatusInProgress, + "waiting": CredentialRotationStatusStatusWaiting, + "completed": CredentialRotationStatusStatusCompleted, +} + +// GetCredentialRotationStatusStatusEnumValues Enumerates the set of values for CredentialRotationStatusStatusEnum +func GetCredentialRotationStatusStatusEnumValues() []CredentialRotationStatusStatusEnum { + values := make([]CredentialRotationStatusStatusEnum, 0) + for _, v := range mappingCredentialRotationStatusStatusEnum { + values = append(values, v) + } + return values +} + +// GetCredentialRotationStatusStatusEnumStringValues Enumerates the set of values in String for CredentialRotationStatusStatusEnum +func GetCredentialRotationStatusStatusEnumStringValues() []string { + return []string{ + "IN_PROGRESS", + "WAITING", + "COMPLETED", + } +} + +// GetMappingCredentialRotationStatusStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCredentialRotationStatusStatusEnum(val string) (CredentialRotationStatusStatusEnum, bool) { + enum, ok := mappingCredentialRotationStatusStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// CredentialRotationStatusStatusDetailsEnum Enum with underlying type: string +type CredentialRotationStatusStatusDetailsEnum string + +// Set of constants representing the allowable values for CredentialRotationStatusStatusDetailsEnum +const ( + CredentialRotationStatusStatusDetailsIssuingNewCredentials CredentialRotationStatusStatusDetailsEnum = "ISSUING_NEW_CREDENTIALS" + CredentialRotationStatusStatusDetailsNewCredentialsIssued CredentialRotationStatusStatusDetailsEnum = "NEW_CREDENTIALS_ISSUED" + CredentialRotationStatusStatusDetailsRetiringOldCredentials CredentialRotationStatusStatusDetailsEnum = "RETIRING_OLD_CREDENTIALS" + CredentialRotationStatusStatusDetailsCompleted CredentialRotationStatusStatusDetailsEnum = "COMPLETED" +) + +var mappingCredentialRotationStatusStatusDetailsEnum = map[string]CredentialRotationStatusStatusDetailsEnum{ + "ISSUING_NEW_CREDENTIALS": CredentialRotationStatusStatusDetailsIssuingNewCredentials, + "NEW_CREDENTIALS_ISSUED": CredentialRotationStatusStatusDetailsNewCredentialsIssued, + "RETIRING_OLD_CREDENTIALS": CredentialRotationStatusStatusDetailsRetiringOldCredentials, + "COMPLETED": CredentialRotationStatusStatusDetailsCompleted, +} + +var mappingCredentialRotationStatusStatusDetailsEnumLowerCase = map[string]CredentialRotationStatusStatusDetailsEnum{ + "issuing_new_credentials": CredentialRotationStatusStatusDetailsIssuingNewCredentials, + "new_credentials_issued": CredentialRotationStatusStatusDetailsNewCredentialsIssued, + "retiring_old_credentials": CredentialRotationStatusStatusDetailsRetiringOldCredentials, + "completed": CredentialRotationStatusStatusDetailsCompleted, +} + +// GetCredentialRotationStatusStatusDetailsEnumValues Enumerates the set of values for CredentialRotationStatusStatusDetailsEnum +func GetCredentialRotationStatusStatusDetailsEnumValues() []CredentialRotationStatusStatusDetailsEnum { + values := make([]CredentialRotationStatusStatusDetailsEnum, 0) + for _, v := range mappingCredentialRotationStatusStatusDetailsEnum { + values = append(values, v) + } + return values +} + +// GetCredentialRotationStatusStatusDetailsEnumStringValues Enumerates the set of values in String for CredentialRotationStatusStatusDetailsEnum +func GetCredentialRotationStatusStatusDetailsEnumStringValues() []string { + return []string{ + "ISSUING_NEW_CREDENTIALS", + "NEW_CREDENTIALS_ISSUED", + "RETIRING_OLD_CREDENTIALS", + "COMPLETED", + } +} + +// GetMappingCredentialRotationStatusStatusDetailsEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingCredentialRotationStatusStatusDetailsEnum(val string) (CredentialRotationStatusStatusDetailsEnum, bool) { + enum, ok := mappingCredentialRotationStatusStatusDetailsEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/get_credential_rotation_status_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/get_credential_rotation_status_request_response.go new file mode 100644 index 00000000000..5abcc731664 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/get_credential_rotation_status_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetCredentialRotationStatusRequest wrapper for the GetCredentialRotationStatus operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerengine/GetCredentialRotationStatus.go.html to see an example of how to use GetCredentialRotationStatusRequest. +type GetCredentialRotationStatusRequest struct { + + // The OCID of the cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetCredentialRotationStatusRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetCredentialRotationStatusRequest) 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 GetCredentialRotationStatusRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetCredentialRotationStatusRequest) 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 GetCredentialRotationStatusRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetCredentialRotationStatusResponse wrapper for the GetCredentialRotationStatus operation +type GetCredentialRotationStatusResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The CredentialRotationStatus instance + CredentialRotationStatus `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 GetCredentialRotationStatusResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetCredentialRotationStatusResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/start_credential_rotation_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/start_credential_rotation_details.go new file mode 100644 index 00000000000..dbb4f2b549c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/start_credential_rotation_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Container Engine for Kubernetes API +// +// API for the Container Engine for Kubernetes service. Use this API to build, deploy, +// and manage cloud-native applications. For more information, see +// Overview of Container Engine for Kubernetes (https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengoverview.htm). +// + +package containerengine + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// StartCredentialRotationDetails Properties that define a request to start credential rotation on a kubernetes cluster. +type StartCredentialRotationDetails struct { + + // The duration in days(in ISO 8601 notation eg. P5D) after which the old credentials should be retired. Maximum delay duration is 14 days. + AutoCompletionDelayDuration *string `mandatory:"true" json:"autoCompletionDelayDuration"` +} + +func (m StartCredentialRotationDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m StartCredentialRotationDetails) 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/containerengine/start_credential_rotation_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/start_credential_rotation_request_response.go new file mode 100644 index 00000000000..11e1ff95d21 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/containerengine/start_credential_rotation_request_response.go @@ -0,0 +1,102 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package containerengine + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// StartCredentialRotationRequest wrapper for the StartCredentialRotation operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/containerengine/StartCredentialRotation.go.html to see an example of how to use StartCredentialRotationRequest. +type StartCredentialRotationRequest struct { + + // The OCID of the cluster. + ClusterId *string `mandatory:"true" contributesTo:"path" name:"clusterId"` + + // The details for a kubernetes cluster to start credential rotation. + StartCredentialRotationDetails `contributesTo:"body"` + + // A token you supply to uniquely identify the request and provide idempotency if + // the request is retried. Idempotency tokens expire after 24 hours. + 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. + 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 StartCredentialRotationRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request StartCredentialRotationRequest) 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 StartCredentialRotationRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request StartCredentialRotationRequest) 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 StartCredentialRotationRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// StartCredentialRotationResponse wrapper for the StartCredentialRotation operation +type StartCredentialRotationResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The OCID of the work request handling the operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response StartCredentialRotationResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response StartCredentialRotationResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/create_instance_pool_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/create_instance_pool_details.go index 8032d0b9000..3db2af6d63a 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/create_instance_pool_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/create_instance_pool_details.go @@ -57,6 +57,14 @@ type CreateInstancePoolDetails struct { // The load balancers to attach to the instance pool. LoadBalancers []AttachLoadBalancerDetails `mandatory:"false" json:"loadBalancers"` + + // A user-friendly formatter for the instance pool's instances. Instance displaynames follow the format. + // The formatter does not retroactively change instance's displaynames, only instance displaynames in the future follow the format + InstanceDisplayNameFormatter *string `mandatory:"false" json:"instanceDisplayNameFormatter"` + + // A user-friendly formatter for the instance pool's instances. Instance hostnames follow the format. + // The formatter does not retroactively change instance's hostnames, only instance hostnames in the future follow the format + InstanceHostnameFormatter *string `mandatory:"false" json:"instanceHostnameFormatter"` } func (m CreateInstancePoolDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_pool.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_pool.go index 4fea0a086ad..a9271f29e07 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_pool.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/instance_pool.go @@ -66,6 +66,14 @@ type InstancePool struct { // The load balancers attached to the instance pool. LoadBalancers []InstancePoolLoadBalancerAttachment `mandatory:"false" json:"loadBalancers"` + + // A user-friendly formatter for the instance pool's instances. Instance displaynames follow the format. + // The formatter does not retroactively change instance's displaynames, only instance displaynames in the future follow the format + InstanceDisplayNameFormatter *string `mandatory:"false" json:"instanceDisplayNameFormatter"` + + // A user-friendly formatter for the instance pool's instances. Instance hostnames follow the format. + // The formatter does not retroactively change instance's hostnames, only instance hostnames in the future follow the format + InstanceHostnameFormatter *string `mandatory:"false" json:"instanceHostnameFormatter"` } func (m InstancePool) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_pool_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_pool_details.go index e693420517f..11188f51728 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_pool_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/core/update_instance_pool_details.go @@ -54,6 +54,14 @@ type UpdateInstancePoolDetails struct { // use the CreateComputeCapacityReport // operation. Size *int `mandatory:"false" json:"size"` + + // A user-friendly formatter for the instance pool's instances. Instance displaynames follow the format. + // The formatter does not retroactively change instance's displaynames, only instance displaynames in the future follow the format + InstanceDisplayNameFormatter *string `mandatory:"false" json:"instanceDisplayNameFormatter"` + + // A user-friendly formatter for the instance pool's instances. Instance hostnames follow the format. + // The formatter does not retroactively change instance's hostnames, only instance hostnames in the future follow the format + InstanceHostnameFormatter *string `mandatory:"false" json:"instanceHostnameFormatter"` } func (m UpdateInstancePoolDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/list_scheduled_activities_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/list_scheduled_activities_request_response.go index 3d0e4c7935c..fdb06f8263f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/list_scheduled_activities_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/list_scheduled_activities_request_response.go @@ -36,6 +36,12 @@ type ListScheduledActivitiesRequest struct { // A filter that returns all resources that match the specified status LifecycleState ScheduledActivityLifecycleStateEnum `mandatory:"false" contributesTo:"query" name:"lifecycleState" omitEmpty:"true"` + // A filter that returns all resources that match the specified scheduledActivityAssociationId. + ScheduledActivityAssociationId *string `mandatory:"false" contributesTo:"query" name:"scheduledActivityAssociationId"` + + // A filter that returns all resources that match the specified scheduledActivityPhase. + ScheduledActivityPhase ScheduledActivityScheduledActivityPhaseEnum `mandatory:"false" contributesTo:"query" name:"scheduledActivityPhase" omitEmpty:"true"` + // The maximum number of items to return. Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` @@ -93,6 +99,9 @@ func (request ListScheduledActivitiesRequest) ValidateEnumValue() (bool, error) if _, ok := GetMappingScheduledActivityLifecycleStateEnum(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(GetScheduledActivityLifecycleStateEnumStringValues(), ","))) } + if _, ok := GetMappingScheduledActivityScheduledActivityPhaseEnum(string(request.ScheduledActivityPhase)); !ok && request.ScheduledActivityPhase != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduledActivityPhase: %s. Supported values are: %s.", request.ScheduledActivityPhase, strings.Join(GetScheduledActivityScheduledActivityPhaseEnumStringValues(), ","))) + } if _, ok := GetMappingListScheduledActivitiesSortOrderEnum(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(GetListScheduledActivitiesSortOrderEnumStringValues(), ","))) } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity.go index c494935fe94..3c858ee9863 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity.go @@ -43,6 +43,12 @@ type ScheduledActivity struct { // Current time the scheduled activity is scheduled to end. An RFC3339 formatted datetime string. TimeExpectedFinish *common.SDKTime `mandatory:"true" json:"timeExpectedFinish"` + // A property describing the phase of the scheduled activity. + ScheduledActivityPhase ScheduledActivityScheduledActivityPhaseEnum `mandatory:"true" json:"scheduledActivityPhase"` + + // The unique identifier that associates a scheduled activity with others in one complete maintenance. For example, with ZDT, a complete upgrade maintenance includes 5 scheduled activities - PREPARE, EXECUTE, POST, PRE_MAINTENANCE, and POST_MAINTENANCE. All of them share the same unique identifier - scheduledActivityAssociationId. + ScheduledActivityAssociationId *string `mandatory:"true" json:"scheduledActivityAssociationId"` + // List of actions Actions []Action `mandatory:"false" json:"actions"` @@ -80,6 +86,9 @@ func (m ScheduledActivity) ValidateEnumValue() (bool, error) { if _, ok := GetMappingScheduledActivityServiceAvailabilityEnum(string(m.ServiceAvailability)); !ok && m.ServiceAvailability != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceAvailability: %s. Supported values are: %s.", m.ServiceAvailability, strings.Join(GetScheduledActivityServiceAvailabilityEnumStringValues(), ","))) } + if _, ok := GetMappingScheduledActivityScheduledActivityPhaseEnum(string(m.ScheduledActivityPhase)); !ok && m.ScheduledActivityPhase != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduledActivityPhase: %s. Supported values are: %s.", m.ScheduledActivityPhase, strings.Join(GetScheduledActivityScheduledActivityPhaseEnumStringValues(), ","))) + } if _, ok := GetMappingScheduledActivityLifecycleDetailsEnum(string(m.LifecycleDetails)); !ok && m.LifecycleDetails != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleDetails: %s. Supported values are: %s.", m.LifecycleDetails, strings.Join(GetScheduledActivityLifecycleDetailsEnumStringValues(), ","))) @@ -93,20 +102,22 @@ func (m ScheduledActivity) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *ScheduledActivity) UnmarshalJSON(data []byte) (e error) { model := struct { - Actions []action `json:"actions"` - TimeFinished *common.SDKTime `json:"timeFinished"` - DelayInHours *int `json:"delayInHours"` - TimeCreated *common.SDKTime `json:"timeCreated"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - LifecycleDetails ScheduledActivityLifecycleDetailsEnum `json:"lifecycleDetails"` - Id *string `json:"id"` - DisplayName *string `json:"displayName"` - RunCycle ScheduledActivityRunCycleEnum `json:"runCycle"` - FusionEnvironmentId *string `json:"fusionEnvironmentId"` - LifecycleState ScheduledActivityLifecycleStateEnum `json:"lifecycleState"` - ServiceAvailability ScheduledActivityServiceAvailabilityEnum `json:"serviceAvailability"` - TimeScheduledStart *common.SDKTime `json:"timeScheduledStart"` - TimeExpectedFinish *common.SDKTime `json:"timeExpectedFinish"` + Actions []action `json:"actions"` + TimeFinished *common.SDKTime `json:"timeFinished"` + DelayInHours *int `json:"delayInHours"` + TimeCreated *common.SDKTime `json:"timeCreated"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleDetails ScheduledActivityLifecycleDetailsEnum `json:"lifecycleDetails"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + RunCycle ScheduledActivityRunCycleEnum `json:"runCycle"` + FusionEnvironmentId *string `json:"fusionEnvironmentId"` + LifecycleState ScheduledActivityLifecycleStateEnum `json:"lifecycleState"` + ServiceAvailability ScheduledActivityServiceAvailabilityEnum `json:"serviceAvailability"` + TimeScheduledStart *common.SDKTime `json:"timeScheduledStart"` + TimeExpectedFinish *common.SDKTime `json:"timeExpectedFinish"` + ScheduledActivityPhase ScheduledActivityScheduledActivityPhaseEnum `json:"scheduledActivityPhase"` + ScheduledActivityAssociationId *string `json:"scheduledActivityAssociationId"` }{} e = json.Unmarshal(data, &model) @@ -153,6 +164,10 @@ func (m *ScheduledActivity) UnmarshalJSON(data []byte) (e error) { m.TimeExpectedFinish = model.TimeExpectedFinish + m.ScheduledActivityPhase = model.ScheduledActivityPhase + + m.ScheduledActivityAssociationId = model.ScheduledActivityAssociationId + return } @@ -355,3 +370,49 @@ func GetMappingScheduledActivityLifecycleDetailsEnum(val string) (ScheduledActiv enum, ok := mappingScheduledActivityLifecycleDetailsEnumLowerCase[strings.ToLower(val)] return enum, ok } + +// ScheduledActivityScheduledActivityPhaseEnum Enum with underlying type: string +type ScheduledActivityScheduledActivityPhaseEnum string + +// Set of constants representing the allowable values for ScheduledActivityScheduledActivityPhaseEnum +const ( + ScheduledActivityScheduledActivityPhasePreMaintenance ScheduledActivityScheduledActivityPhaseEnum = "PRE_MAINTENANCE" + ScheduledActivityScheduledActivityPhaseMaintenance ScheduledActivityScheduledActivityPhaseEnum = "MAINTENANCE" + ScheduledActivityScheduledActivityPhasePostMaintenance ScheduledActivityScheduledActivityPhaseEnum = "POST_MAINTENANCE" +) + +var mappingScheduledActivityScheduledActivityPhaseEnum = map[string]ScheduledActivityScheduledActivityPhaseEnum{ + "PRE_MAINTENANCE": ScheduledActivityScheduledActivityPhasePreMaintenance, + "MAINTENANCE": ScheduledActivityScheduledActivityPhaseMaintenance, + "POST_MAINTENANCE": ScheduledActivityScheduledActivityPhasePostMaintenance, +} + +var mappingScheduledActivityScheduledActivityPhaseEnumLowerCase = map[string]ScheduledActivityScheduledActivityPhaseEnum{ + "pre_maintenance": ScheduledActivityScheduledActivityPhasePreMaintenance, + "maintenance": ScheduledActivityScheduledActivityPhaseMaintenance, + "post_maintenance": ScheduledActivityScheduledActivityPhasePostMaintenance, +} + +// GetScheduledActivityScheduledActivityPhaseEnumValues Enumerates the set of values for ScheduledActivityScheduledActivityPhaseEnum +func GetScheduledActivityScheduledActivityPhaseEnumValues() []ScheduledActivityScheduledActivityPhaseEnum { + values := make([]ScheduledActivityScheduledActivityPhaseEnum, 0) + for _, v := range mappingScheduledActivityScheduledActivityPhaseEnum { + values = append(values, v) + } + return values +} + +// GetScheduledActivityScheduledActivityPhaseEnumStringValues Enumerates the set of values in String for ScheduledActivityScheduledActivityPhaseEnum +func GetScheduledActivityScheduledActivityPhaseEnumStringValues() []string { + return []string{ + "PRE_MAINTENANCE", + "MAINTENANCE", + "POST_MAINTENANCE", + } +} + +// GetMappingScheduledActivityScheduledActivityPhaseEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingScheduledActivityScheduledActivityPhaseEnum(val string) (ScheduledActivityScheduledActivityPhaseEnum, bool) { + enum, ok := mappingScheduledActivityScheduledActivityPhaseEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity_summary.go index 8663e6870df..900d98f9aef 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/fusionapps/scheduled_activity_summary.go @@ -43,6 +43,12 @@ type ScheduledActivitySummary struct { // Service availability / impact during scheduled activity execution, up down ServiceAvailability ScheduledActivityServiceAvailabilityEnum `mandatory:"true" json:"serviceAvailability"` + // A property describing the phase of the scheduled activity. + ScheduledActivityPhase ScheduledActivityScheduledActivityPhaseEnum `mandatory:"true" json:"scheduledActivityPhase"` + + // The unique identifier that associates a scheduled activity with others in one complete maintenance. For example, with ZDT, a complete upgrade maintenance includes 5 scheduled activities - PREPARE, EXECUTE, POST, PRE_MAINTENANCE, and POST_MAINTENANCE. All of them share the same unique identifier - scheduledActivityAssociationId. + ScheduledActivityAssociationId *string `mandatory:"true" json:"scheduledActivityAssociationId"` + // List of actions Actions []Action `mandatory:"false" json:"actions"` @@ -88,6 +94,9 @@ func (m ScheduledActivitySummary) ValidateEnumValue() (bool, error) { if _, ok := GetMappingScheduledActivityServiceAvailabilityEnum(string(m.ServiceAvailability)); !ok && m.ServiceAvailability != "" { errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ServiceAvailability: %s. Supported values are: %s.", m.ServiceAvailability, strings.Join(GetScheduledActivityServiceAvailabilityEnumStringValues(), ","))) } + if _, ok := GetMappingScheduledActivityScheduledActivityPhaseEnum(string(m.ScheduledActivityPhase)); !ok && m.ScheduledActivityPhase != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ScheduledActivityPhase: %s. Supported values are: %s.", m.ScheduledActivityPhase, strings.Join(GetScheduledActivityScheduledActivityPhaseEnumStringValues(), ","))) + } if len(errMessage) > 0 { return true, fmt.Errorf(strings.Join(errMessage, "\n")) @@ -98,22 +107,24 @@ func (m ScheduledActivitySummary) ValidateEnumValue() (bool, error) { // UnmarshalJSON unmarshals from json func (m *ScheduledActivitySummary) UnmarshalJSON(data []byte) (e error) { model := struct { - Actions []action `json:"actions"` - TimeFinished *common.SDKTime `json:"timeFinished"` - DelayInHours *int `json:"delayInHours"` - TimeAccepted *common.SDKTime `json:"timeAccepted"` - TimeUpdated *common.SDKTime `json:"timeUpdated"` - LifecycleDetails *string `json:"lifecycleDetails"` - FreeformTags map[string]string `json:"freeformTags"` - DefinedTags map[string]map[string]interface{} `json:"definedTags"` - Id *string `json:"id"` - DisplayName *string `json:"displayName"` - RunCycle ScheduledActivityRunCycleEnum `json:"runCycle"` - FusionEnvironmentId *string `json:"fusionEnvironmentId"` - LifecycleState ScheduledActivityLifecycleStateEnum `json:"lifecycleState"` - TimeScheduledStart *common.SDKTime `json:"timeScheduledStart"` - TimeExpectedFinish *common.SDKTime `json:"timeExpectedFinish"` - ServiceAvailability ScheduledActivityServiceAvailabilityEnum `json:"serviceAvailability"` + Actions []action `json:"actions"` + TimeFinished *common.SDKTime `json:"timeFinished"` + DelayInHours *int `json:"delayInHours"` + TimeAccepted *common.SDKTime `json:"timeAccepted"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + LifecycleDetails *string `json:"lifecycleDetails"` + FreeformTags map[string]string `json:"freeformTags"` + DefinedTags map[string]map[string]interface{} `json:"definedTags"` + Id *string `json:"id"` + DisplayName *string `json:"displayName"` + RunCycle ScheduledActivityRunCycleEnum `json:"runCycle"` + FusionEnvironmentId *string `json:"fusionEnvironmentId"` + LifecycleState ScheduledActivityLifecycleStateEnum `json:"lifecycleState"` + TimeScheduledStart *common.SDKTime `json:"timeScheduledStart"` + TimeExpectedFinish *common.SDKTime `json:"timeExpectedFinish"` + ServiceAvailability ScheduledActivityServiceAvailabilityEnum `json:"serviceAvailability"` + ScheduledActivityPhase ScheduledActivityScheduledActivityPhaseEnum `json:"scheduledActivityPhase"` + ScheduledActivityAssociationId *string `json:"scheduledActivityAssociationId"` }{} e = json.Unmarshal(data, &model) @@ -164,5 +175,9 @@ func (m *ScheduledActivitySummary) UnmarshalJSON(data []byte) (e error) { m.ServiceAvailability = model.ServiceAvailability + m.ScheduledActivityPhase = model.ScheduledActivityPhase + + m.ScheduledActivityAssociationId = model.ScheduledActivityAssociationId + return } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/copy_deployment_backup_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/copy_deployment_backup_details.go new file mode 100644 index 00000000000..51d21a69a7e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/copy_deployment_backup_details.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// GoldenGate API +// +// Use the Oracle Cloud Infrastructure GoldenGate APIs to perform data replication operations. +// + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CopyDeploymentBackupDetails The information about the copy for a Deployment Backup. +type CopyDeploymentBackupDetails struct { + + // Name of namespace that serves as a container for all of your buckets + NamespaceName *string `mandatory:"true" json:"namespaceName"` + + // Name of the bucket where the object is to be uploaded in the object storage + BucketName *string `mandatory:"true" json:"bucketName"` + + // A 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"` + + // Tags defined 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 CopyDeploymentBackupDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CopyDeploymentBackupDetails) 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/goldengate/copy_deployment_backup_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/copy_deployment_backup_request_response.go new file mode 100644 index 00000000000..9f7f1d63ca7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/copy_deployment_backup_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package goldengate + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CopyDeploymentBackupRequest wrapper for the CopyDeploymentBackup operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/CopyDeploymentBackup.go.html to see an example of how to use CopyDeploymentBackupRequest. +type CopyDeploymentBackupRequest struct { + + // A unique DeploymentBackup identifier. + DeploymentBackupId *string `mandatory:"true" contributesTo:"path" name:"deploymentBackupId"` + + // A placeholder for any additional metadata to describe the copy of a Deployment Backup. + CopyDeploymentBackupDetails `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"` + + // A token that uniquely identifies a request so it can be retried, in case of a timeout or server error, + // without the 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 was deleted and purged + // from the system, then a retry of the original creation request is rejected. + OpcRetryToken *string `mandatory:"false" contributesTo:"header" name:"opc-retry-token"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request CopyDeploymentBackupRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CopyDeploymentBackupRequest) 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 CopyDeploymentBackupRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CopyDeploymentBackupRequest) 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 CopyDeploymentBackupRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CopyDeploymentBackupResponse wrapper for the CopyDeploymentBackup operation +type CopyDeploymentBackupResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A unique Oracle-assigned identifier for an asynchronous request. You can use this to query + // status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // A unique Oracle-assigned identifier for the request. If you need to contact Oracle about a + // particular request, please include the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response CopyDeploymentBackupResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CopyDeploymentBackupResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/goldengate_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/goldengate_client.go index 7fd9f1ddefa..9c30f3dd787 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/goldengate_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/goldengate_client.go @@ -537,6 +537,69 @@ func (client GoldenGateClient) collectDeploymentDiagnostic(ctx context.Context, return response, err } +// CopyDeploymentBackup Creates a copy of a Deployment Backup. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/goldengate/CopyDeploymentBackup.go.html to see an example of how to use CopyDeploymentBackup API. +// A default retry strategy applies to this operation CopyDeploymentBackup() +func (client GoldenGateClient) CopyDeploymentBackup(ctx context.Context, request CopyDeploymentBackupRequest) (response CopyDeploymentBackupResponse, 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.copyDeploymentBackup, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CopyDeploymentBackupResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CopyDeploymentBackupResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CopyDeploymentBackupResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CopyDeploymentBackupResponse") + } + return +} + +// copyDeploymentBackup implements the OCIOperation interface (enables retrying operations) +func (client GoldenGateClient) copyDeploymentBackup(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/deploymentBackups/{deploymentBackupId}/actions/copyToBucket", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CopyDeploymentBackupResponse + 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/goldengate/20200407/DeploymentBackup/CopyDeploymentBackup" + err = common.PostProcessServiceError(err, "GoldenGate", "CopyDeploymentBackup", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateConnection Creates a new Connection. // // See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/operation_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/operation_type.go index 52c3fd52aba..e146421af9e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/operation_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/goldengate/operation_type.go @@ -33,6 +33,7 @@ const ( OperationTypeGoldengateDeploymentBackupCreate OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_BACKUP_CREATE" OperationTypeGoldengateDeploymentBackupDelete OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_BACKUP_DELETE" OperationTypeGoldengateDeploymentBackupCancel OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_BACKUP_CANCEL" + OperationTypeGoldengateDeploymentBackupCopy OperationTypeEnum = "GOLDENGATE_DEPLOYMENT_BACKUP_COPY" OperationTypeGoldengateConnectionCreate OperationTypeEnum = "GOLDENGATE_CONNECTION_CREATE" OperationTypeGoldengateConnectionUpdate OperationTypeEnum = "GOLDENGATE_CONNECTION_UPDATE" OperationTypeGoldengateConnectionDelete OperationTypeEnum = "GOLDENGATE_CONNECTION_DELETE" @@ -63,6 +64,7 @@ var mappingOperationTypeEnum = map[string]OperationTypeEnum{ "GOLDENGATE_DEPLOYMENT_BACKUP_CREATE": OperationTypeGoldengateDeploymentBackupCreate, "GOLDENGATE_DEPLOYMENT_BACKUP_DELETE": OperationTypeGoldengateDeploymentBackupDelete, "GOLDENGATE_DEPLOYMENT_BACKUP_CANCEL": OperationTypeGoldengateDeploymentBackupCancel, + "GOLDENGATE_DEPLOYMENT_BACKUP_COPY": OperationTypeGoldengateDeploymentBackupCopy, "GOLDENGATE_CONNECTION_CREATE": OperationTypeGoldengateConnectionCreate, "GOLDENGATE_CONNECTION_UPDATE": OperationTypeGoldengateConnectionUpdate, "GOLDENGATE_CONNECTION_DELETE": OperationTypeGoldengateConnectionDelete, @@ -93,6 +95,7 @@ var mappingOperationTypeEnumLowerCase = map[string]OperationTypeEnum{ "goldengate_deployment_backup_create": OperationTypeGoldengateDeploymentBackupCreate, "goldengate_deployment_backup_delete": OperationTypeGoldengateDeploymentBackupDelete, "goldengate_deployment_backup_cancel": OperationTypeGoldengateDeploymentBackupCancel, + "goldengate_deployment_backup_copy": OperationTypeGoldengateDeploymentBackupCopy, "goldengate_connection_create": OperationTypeGoldengateConnectionCreate, "goldengate_connection_update": OperationTypeGoldengateConnectionUpdate, "goldengate_connection_delete": OperationTypeGoldengateConnectionDelete, @@ -134,6 +137,7 @@ func GetOperationTypeEnumStringValues() []string { "GOLDENGATE_DEPLOYMENT_BACKUP_CREATE", "GOLDENGATE_DEPLOYMENT_BACKUP_DELETE", "GOLDENGATE_DEPLOYMENT_BACKUP_CANCEL", + "GOLDENGATE_DEPLOYMENT_BACKUP_COPY", "GOLDENGATE_CONNECTION_CREATE", "GOLDENGATE_CONNECTION_UPDATE", "GOLDENGATE_CONNECTION_DELETE", diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_column.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_column.go index b1905a3df92..abb1e87fdfe 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_column.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_column.go @@ -137,6 +137,10 @@ func (m *abstractcolumn) UnmarshalPolymorphicJSON(data []byte) (interface{}, err mm := TimeStatsDataColumn{} err = json.Unmarshal(data, &mm) return mm, err + case "TABLE_COLUMN": + mm := TableColumn{} + err = json.Unmarshal(data, &mm) + return mm, err case "CHART_COLUMN": mm := ChartColumn{} err = json.Unmarshal(data, &mm) @@ -240,6 +244,7 @@ const ( AbstractColumnTypeTimeStatsDataColumn AbstractColumnTypeEnum = "TIME_STATS_DATA_COLUMN" AbstractColumnTypeTimeClusterColumn AbstractColumnTypeEnum = "TIME_CLUSTER_COLUMN" AbstractColumnTypeTimeClusterDataColumn AbstractColumnTypeEnum = "TIME_CLUSTER_DATA_COLUMN" + AbstractColumnTypeTableColumn AbstractColumnTypeEnum = "TABLE_COLUMN" AbstractColumnTypeTimeColumn AbstractColumnTypeEnum = "TIME_COLUMN" AbstractColumnTypeTrendColumn AbstractColumnTypeEnum = "TREND_COLUMN" AbstractColumnTypeClassifyColumn AbstractColumnTypeEnum = "CLASSIFY_COLUMN" @@ -253,6 +258,7 @@ var mappingAbstractColumnTypeEnum = map[string]AbstractColumnTypeEnum{ "TIME_STATS_DATA_COLUMN": AbstractColumnTypeTimeStatsDataColumn, "TIME_CLUSTER_COLUMN": AbstractColumnTypeTimeClusterColumn, "TIME_CLUSTER_DATA_COLUMN": AbstractColumnTypeTimeClusterDataColumn, + "TABLE_COLUMN": AbstractColumnTypeTableColumn, "TIME_COLUMN": AbstractColumnTypeTimeColumn, "TREND_COLUMN": AbstractColumnTypeTrendColumn, "CLASSIFY_COLUMN": AbstractColumnTypeClassifyColumn, @@ -266,6 +272,7 @@ var mappingAbstractColumnTypeEnumLowerCase = map[string]AbstractColumnTypeEnum{ "time_stats_data_column": AbstractColumnTypeTimeStatsDataColumn, "time_cluster_column": AbstractColumnTypeTimeClusterColumn, "time_cluster_data_column": AbstractColumnTypeTimeClusterDataColumn, + "table_column": AbstractColumnTypeTableColumn, "time_column": AbstractColumnTypeTimeColumn, "trend_column": AbstractColumnTypeTrendColumn, "classify_column": AbstractColumnTypeClassifyColumn, @@ -290,6 +297,7 @@ func GetAbstractColumnTypeEnumStringValues() []string { "TIME_STATS_DATA_COLUMN", "TIME_CLUSTER_COLUMN", "TIME_CLUSTER_DATA_COLUMN", + "TABLE_COLUMN", "TIME_COLUMN", "TREND_COLUMN", "CLASSIFY_COLUMN", diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_command_descriptor.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_command_descriptor.go index 39950c1a2d7..342a2556aa5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_command_descriptor.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/abstract_command_descriptor.go @@ -96,6 +96,10 @@ func (m *abstractcommanddescriptor) UnmarshalPolymorphicJSON(data []byte) (inter mm := TailCommandDescriptor{} err = json.Unmarshal(data, &mm) return mm, err + case "OUTLIER": + mm := OutlierCommandDescriptor{} + err = json.Unmarshal(data, &mm) + return mm, err case "DEMO_MODE": mm := DemoModeCommandDescriptor{} err = json.Unmarshal(data, &mm) @@ -140,6 +144,10 @@ func (m *abstractcommanddescriptor) UnmarshalPolymorphicJSON(data []byte) (inter mm := BucketCommandDescriptor{} err = json.Unmarshal(data, &mm) return mm, err + case "RARE": + mm := RareCommandDescriptor{} + err = json.Unmarshal(data, &mm) + return mm, err case "ADD_INSIGHTS": mm := AddInsightsCommandDescriptor{} err = json.Unmarshal(data, &mm) @@ -216,6 +224,10 @@ func (m *abstractcommanddescriptor) UnmarshalPolymorphicJSON(data []byte) (inter mm := ClusterSplitCommandDescriptor{} err = json.Unmarshal(data, &mm) return mm, err + case "FREQUENT": + mm := FrequentCommandDescriptor{} + err = json.Unmarshal(data, &mm) + return mm, err case "CLUSTER_DETAILS": mm := ClusterDetailsCommandDescriptor{} err = json.Unmarshal(data, &mm) @@ -387,6 +399,9 @@ const ( AbstractCommandDescriptorNameAnomaly AbstractCommandDescriptorNameEnum = "ANOMALY" AbstractCommandDescriptorNameDedup AbstractCommandDescriptorNameEnum = "DEDUP" AbstractCommandDescriptorNameTimeCluster AbstractCommandDescriptorNameEnum = "TIME_CLUSTER" + AbstractCommandDescriptorNameFrequent AbstractCommandDescriptorNameEnum = "FREQUENT" + AbstractCommandDescriptorNameRare AbstractCommandDescriptorNameEnum = "RARE" + AbstractCommandDescriptorNameOutlier AbstractCommandDescriptorNameEnum = "OUTLIER" ) var mappingAbstractCommandDescriptorNameEnum = map[string]AbstractCommandDescriptorNameEnum{ @@ -440,6 +455,9 @@ var mappingAbstractCommandDescriptorNameEnum = map[string]AbstractCommandDescrip "ANOMALY": AbstractCommandDescriptorNameAnomaly, "DEDUP": AbstractCommandDescriptorNameDedup, "TIME_CLUSTER": AbstractCommandDescriptorNameTimeCluster, + "FREQUENT": AbstractCommandDescriptorNameFrequent, + "RARE": AbstractCommandDescriptorNameRare, + "OUTLIER": AbstractCommandDescriptorNameOutlier, } var mappingAbstractCommandDescriptorNameEnumLowerCase = map[string]AbstractCommandDescriptorNameEnum{ @@ -493,6 +511,9 @@ var mappingAbstractCommandDescriptorNameEnumLowerCase = map[string]AbstractComma "anomaly": AbstractCommandDescriptorNameAnomaly, "dedup": AbstractCommandDescriptorNameDedup, "time_cluster": AbstractCommandDescriptorNameTimeCluster, + "frequent": AbstractCommandDescriptorNameFrequent, + "rare": AbstractCommandDescriptorNameRare, + "outlier": AbstractCommandDescriptorNameOutlier, } // GetAbstractCommandDescriptorNameEnumValues Enumerates the set of values for AbstractCommandDescriptorNameEnum @@ -557,6 +578,9 @@ func GetAbstractCommandDescriptorNameEnumStringValues() []string { "ANOMALY", "DEDUP", "TIME_CLUSTER", + "FREQUENT", + "RARE", + "OUTLIER", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/association_property.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/association_property.go new file mode 100644 index 00000000000..264c3ff0e44 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/association_property.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// AssociationProperty A property represented as a name-value pair. +type AssociationProperty struct { + + // The name of the association property. + Name *string `mandatory:"true" json:"name"` + + // The value of the association property. + Value *string `mandatory:"false" json:"value"` + + // A list of pattern level overrides for this property. + Patterns []PatternOverride `mandatory:"false" json:"patterns"` +} + +func (m AssociationProperty) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m AssociationProperty) 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/loganalytics/condition_block.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/condition_block.go new file mode 100644 index 00000000000..41df142d3ae --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/condition_block.go @@ -0,0 +1,109 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ConditionBlock A condition block. This could represent a single condition, or have nested condition blocks under it. +// To form a single condition, specify the fieldName, labelConditionOperator and labelConditionValue(s). +// To form nested conditions, specify the conditions in conditionBlocks, and how to join them in conditionBlocksOperator. +type ConditionBlock struct { + + // Operator using which the conditionBlocks should be joined. Specify this for nested conditions. + ConditionBlocksOperator ConditionBlockConditionBlocksOperatorEnum `mandatory:"false" json:"conditionBlocksOperator,omitempty"` + + // The name of the field the condition is based on. Specify this if this condition block represents a single condition. + FieldName *string `mandatory:"false" json:"fieldName"` + + // The condition operator. Specify this if this condition block represents a single condition. + LabelConditionOperator *string `mandatory:"false" json:"labelConditionOperator"` + + // The condition value. Specify this if this condition block represents a single condition. + LabelConditionValue *string `mandatory:"false" json:"labelConditionValue"` + + // A list of condition values. Specify this if this condition block represents a single condition. + LabelConditionValues []string `mandatory:"false" json:"labelConditionValues"` + + // Condition blocks to evaluate within this condition block. Specify this for nested conditions. + ConditionBlocks []ConditionBlock `mandatory:"false" json:"conditionBlocks"` +} + +func (m ConditionBlock) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ConditionBlock) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingConditionBlockConditionBlocksOperatorEnum(string(m.ConditionBlocksOperator)); !ok && m.ConditionBlocksOperator != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ConditionBlocksOperator: %s. Supported values are: %s.", m.ConditionBlocksOperator, strings.Join(GetConditionBlockConditionBlocksOperatorEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ConditionBlockConditionBlocksOperatorEnum Enum with underlying type: string +type ConditionBlockConditionBlocksOperatorEnum string + +// Set of constants representing the allowable values for ConditionBlockConditionBlocksOperatorEnum +const ( + ConditionBlockConditionBlocksOperatorAnd ConditionBlockConditionBlocksOperatorEnum = "AND" + ConditionBlockConditionBlocksOperatorOr ConditionBlockConditionBlocksOperatorEnum = "OR" + ConditionBlockConditionBlocksOperatorNotAnd ConditionBlockConditionBlocksOperatorEnum = "NOT_AND" + ConditionBlockConditionBlocksOperatorNotOr ConditionBlockConditionBlocksOperatorEnum = "NOT_OR" +) + +var mappingConditionBlockConditionBlocksOperatorEnum = map[string]ConditionBlockConditionBlocksOperatorEnum{ + "AND": ConditionBlockConditionBlocksOperatorAnd, + "OR": ConditionBlockConditionBlocksOperatorOr, + "NOT_AND": ConditionBlockConditionBlocksOperatorNotAnd, + "NOT_OR": ConditionBlockConditionBlocksOperatorNotOr, +} + +var mappingConditionBlockConditionBlocksOperatorEnumLowerCase = map[string]ConditionBlockConditionBlocksOperatorEnum{ + "and": ConditionBlockConditionBlocksOperatorAnd, + "or": ConditionBlockConditionBlocksOperatorOr, + "not_and": ConditionBlockConditionBlocksOperatorNotAnd, + "not_or": ConditionBlockConditionBlocksOperatorNotOr, +} + +// GetConditionBlockConditionBlocksOperatorEnumValues Enumerates the set of values for ConditionBlockConditionBlocksOperatorEnum +func GetConditionBlockConditionBlocksOperatorEnumValues() []ConditionBlockConditionBlocksOperatorEnum { + values := make([]ConditionBlockConditionBlocksOperatorEnum, 0) + for _, v := range mappingConditionBlockConditionBlocksOperatorEnum { + values = append(values, v) + } + return values +} + +// GetConditionBlockConditionBlocksOperatorEnumStringValues Enumerates the set of values in String for ConditionBlockConditionBlocksOperatorEnum +func GetConditionBlockConditionBlocksOperatorEnumStringValues() []string { + return []string{ + "AND", + "OR", + "NOT_AND", + "NOT_OR", + } +} + +// GetMappingConditionBlockConditionBlocksOperatorEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingConditionBlockConditionBlocksOperatorEnum(val string) (ConditionBlockConditionBlocksOperatorEnum, bool) { + enum, ok := mappingConditionBlockConditionBlocksOperatorEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/creation_source_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/creation_source_type.go index 2e9512345b5..971c67fb506 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/creation_source_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/creation_source_type.go @@ -19,6 +19,7 @@ type CreationSourceTypeEnum string // Set of constants representing the allowable values for CreationSourceTypeEnum const ( CreationSourceTypeEmBridge CreationSourceTypeEnum = "EM_BRIDGE" + CreationSourceTypeBulkDiscovery CreationSourceTypeEnum = "BULK_DISCOVERY" CreationSourceTypeServiceConnectorHub CreationSourceTypeEnum = "SERVICE_CONNECTOR_HUB" CreationSourceTypeDiscovery CreationSourceTypeEnum = "DISCOVERY" CreationSourceTypeNone CreationSourceTypeEnum = "NONE" @@ -26,6 +27,7 @@ const ( var mappingCreationSourceTypeEnum = map[string]CreationSourceTypeEnum{ "EM_BRIDGE": CreationSourceTypeEmBridge, + "BULK_DISCOVERY": CreationSourceTypeBulkDiscovery, "SERVICE_CONNECTOR_HUB": CreationSourceTypeServiceConnectorHub, "DISCOVERY": CreationSourceTypeDiscovery, "NONE": CreationSourceTypeNone, @@ -33,6 +35,7 @@ var mappingCreationSourceTypeEnum = map[string]CreationSourceTypeEnum{ var mappingCreationSourceTypeEnumLowerCase = map[string]CreationSourceTypeEnum{ "em_bridge": CreationSourceTypeEmBridge, + "bulk_discovery": CreationSourceTypeBulkDiscovery, "service_connector_hub": CreationSourceTypeServiceConnectorHub, "discovery": CreationSourceTypeDiscovery, "none": CreationSourceTypeNone, @@ -51,6 +54,7 @@ func GetCreationSourceTypeEnumValues() []CreationSourceTypeEnum { func GetCreationSourceTypeEnumStringValues() []string { return []string{ "EM_BRIDGE", + "BULK_DISCOVERY", "SERVICE_CONNECTOR_HUB", "DISCOVERY", "NONE", diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/credential_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/credential_endpoint.go new file mode 100644 index 00000000000..32a9eb16d9c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/credential_endpoint.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CredentialEndpoint The endpoint from where to fetch a credential, for example, the OAuth 2.0 token. +type CredentialEndpoint struct { + + // The credential endpoint name. + Name *string `mandatory:"true" json:"name"` + + Request *EndpointRequest `mandatory:"true" json:"request"` + + // The credential endpoint description. + Description *string `mandatory:"false" json:"description"` + + // The credential endpoint model. + Model *string `mandatory:"false" json:"model"` + + // The endpoint unique identifier. + EndpointId *int64 `mandatory:"false" json:"endpointId"` + + Response *EndpointResponse `mandatory:"false" json:"response"` + + Proxy *EndpointProxy `mandatory:"false" json:"proxy"` +} + +func (m CredentialEndpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CredentialEndpoint) 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/loganalytics/delete_log_analytics_em_bridge_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/delete_log_analytics_em_bridge_request_response.go index d6e99cb18b1..fd6fecdf744 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/delete_log_analytics_em_bridge_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/delete_log_analytics_em_bridge_request_response.go @@ -34,6 +34,9 @@ type DeleteLogAnalyticsEmBridgeRequest struct { // The client request ID for tracing. OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + // If true, delete entities created by this bridge + IsDeleteEntities *bool `mandatory:"false" contributesTo:"query" name:"isDeleteEntities"` + // 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/loganalytics/effective_property_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/effective_property_collection.go new file mode 100644 index 00000000000..a6a6c0a8570 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/effective_property_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EffectivePropertyCollection A collection of effective properties. +type EffectivePropertyCollection struct { + + // A list of properties and their effective values. + Items []EffectivePropertySummary `mandatory:"false" json:"items"` +} + +func (m EffectivePropertyCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EffectivePropertyCollection) 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/loganalytics/effective_property_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/effective_property_summary.go new file mode 100644 index 00000000000..7cf73ed0101 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/effective_property_summary.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EffectivePropertySummary A property and its effective value details. +type EffectivePropertySummary struct { + + // The property name. + Name *string `mandatory:"true" json:"name"` + + // The effective value of the property. This is determined by considering the value set at the most effective level. + Value *string `mandatory:"false" json:"value"` + + // The level from which the effective value was determined. + EffectiveLevel *string `mandatory:"false" json:"effectiveLevel"` + + // A list of pattern level override values for the property. + Patterns []PatternOverride `mandatory:"false" json:"patterns"` +} + +func (m EffectivePropertySummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EffectivePropertySummary) 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/loganalytics/endpoint_credentials.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_credentials.go new file mode 100644 index 00000000000..4ae5523abc6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_credentials.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EndpointCredentials An object containing credential details to authenticate/authorize a REST request. +type EndpointCredentials struct { + + // The credential type. NONE indicates credentials are not needed to access the endpoint. + // BASIC_AUTH represents a username and password based model. TOKEN could be static or dynamic. + // In case of dynamic tokens, also specify the endpoint from which the token must be fetched. + CredentialType EndpointCredentialsCredentialTypeEnum `mandatory:"false" json:"credentialType,omitempty"` + + // The named credential name on the management agent. + CredentialName *string `mandatory:"false" json:"credentialName"` + + CredentialEndpoint *CredentialEndpoint `mandatory:"false" json:"credentialEndpoint"` +} + +func (m EndpointCredentials) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EndpointCredentials) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingEndpointCredentialsCredentialTypeEnum(string(m.CredentialType)); !ok && m.CredentialType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CredentialType: %s. Supported values are: %s.", m.CredentialType, strings.Join(GetEndpointCredentialsCredentialTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EndpointCredentialsCredentialTypeEnum Enum with underlying type: string +type EndpointCredentialsCredentialTypeEnum string + +// Set of constants representing the allowable values for EndpointCredentialsCredentialTypeEnum +const ( + EndpointCredentialsCredentialTypeNone EndpointCredentialsCredentialTypeEnum = "NONE" + EndpointCredentialsCredentialTypeBasicAuth EndpointCredentialsCredentialTypeEnum = "BASIC_AUTH" + EndpointCredentialsCredentialTypeStaticToken EndpointCredentialsCredentialTypeEnum = "STATIC_TOKEN" + EndpointCredentialsCredentialTypeDynamicToken EndpointCredentialsCredentialTypeEnum = "DYNAMIC_TOKEN" +) + +var mappingEndpointCredentialsCredentialTypeEnum = map[string]EndpointCredentialsCredentialTypeEnum{ + "NONE": EndpointCredentialsCredentialTypeNone, + "BASIC_AUTH": EndpointCredentialsCredentialTypeBasicAuth, + "STATIC_TOKEN": EndpointCredentialsCredentialTypeStaticToken, + "DYNAMIC_TOKEN": EndpointCredentialsCredentialTypeDynamicToken, +} + +var mappingEndpointCredentialsCredentialTypeEnumLowerCase = map[string]EndpointCredentialsCredentialTypeEnum{ + "none": EndpointCredentialsCredentialTypeNone, + "basic_auth": EndpointCredentialsCredentialTypeBasicAuth, + "static_token": EndpointCredentialsCredentialTypeStaticToken, + "dynamic_token": EndpointCredentialsCredentialTypeDynamicToken, +} + +// GetEndpointCredentialsCredentialTypeEnumValues Enumerates the set of values for EndpointCredentialsCredentialTypeEnum +func GetEndpointCredentialsCredentialTypeEnumValues() []EndpointCredentialsCredentialTypeEnum { + values := make([]EndpointCredentialsCredentialTypeEnum, 0) + for _, v := range mappingEndpointCredentialsCredentialTypeEnum { + values = append(values, v) + } + return values +} + +// GetEndpointCredentialsCredentialTypeEnumStringValues Enumerates the set of values in String for EndpointCredentialsCredentialTypeEnum +func GetEndpointCredentialsCredentialTypeEnumStringValues() []string { + return []string{ + "NONE", + "BASIC_AUTH", + "STATIC_TOKEN", + "DYNAMIC_TOKEN", + } +} + +// GetMappingEndpointCredentialsCredentialTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingEndpointCredentialsCredentialTypeEnum(val string) (EndpointCredentialsCredentialTypeEnum, bool) { + enum, ok := mappingEndpointCredentialsCredentialTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_proxy.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_proxy.go new file mode 100644 index 00000000000..21054dc841a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_proxy.go @@ -0,0 +1,95 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EndpointProxy An object containing the endpoint proxy details. +type EndpointProxy struct { + + // The proxy URL. + Url *string `mandatory:"true" json:"url"` + + // The named credential name on the management agent, containing the proxy credentials. + CredentialName *string `mandatory:"false" json:"credentialName"` + + // The credential type. NONE indicates credentials are not needed to access the proxy. + // BASIC_AUTH represents a username and password based model. TOKEN represents a token based model. + CredentialType EndpointProxyCredentialTypeEnum `mandatory:"false" json:"credentialType,omitempty"` +} + +func (m EndpointProxy) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EndpointProxy) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingEndpointProxyCredentialTypeEnum(string(m.CredentialType)); !ok && m.CredentialType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for CredentialType: %s. Supported values are: %s.", m.CredentialType, strings.Join(GetEndpointProxyCredentialTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EndpointProxyCredentialTypeEnum Enum with underlying type: string +type EndpointProxyCredentialTypeEnum string + +// Set of constants representing the allowable values for EndpointProxyCredentialTypeEnum +const ( + EndpointProxyCredentialTypeNone EndpointProxyCredentialTypeEnum = "NONE" + EndpointProxyCredentialTypeBasicAuth EndpointProxyCredentialTypeEnum = "BASIC_AUTH" + EndpointProxyCredentialTypeToken EndpointProxyCredentialTypeEnum = "TOKEN" +) + +var mappingEndpointProxyCredentialTypeEnum = map[string]EndpointProxyCredentialTypeEnum{ + "NONE": EndpointProxyCredentialTypeNone, + "BASIC_AUTH": EndpointProxyCredentialTypeBasicAuth, + "TOKEN": EndpointProxyCredentialTypeToken, +} + +var mappingEndpointProxyCredentialTypeEnumLowerCase = map[string]EndpointProxyCredentialTypeEnum{ + "none": EndpointProxyCredentialTypeNone, + "basic_auth": EndpointProxyCredentialTypeBasicAuth, + "token": EndpointProxyCredentialTypeToken, +} + +// GetEndpointProxyCredentialTypeEnumValues Enumerates the set of values for EndpointProxyCredentialTypeEnum +func GetEndpointProxyCredentialTypeEnumValues() []EndpointProxyCredentialTypeEnum { + values := make([]EndpointProxyCredentialTypeEnum, 0) + for _, v := range mappingEndpointProxyCredentialTypeEnum { + values = append(values, v) + } + return values +} + +// GetEndpointProxyCredentialTypeEnumStringValues Enumerates the set of values in String for EndpointProxyCredentialTypeEnum +func GetEndpointProxyCredentialTypeEnumStringValues() []string { + return []string{ + "NONE", + "BASIC_AUTH", + "TOKEN", + } +} + +// GetMappingEndpointProxyCredentialTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingEndpointProxyCredentialTypeEnum(val string) (EndpointProxyCredentialTypeEnum, bool) { + enum, ok := mappingEndpointProxyCredentialTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_request.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_request.go new file mode 100644 index 00000000000..74c0b7e89e0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_request.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EndpointRequest An object containing details to make a REST request. +type EndpointRequest struct { + + // The request URL. + Url *string `mandatory:"true" json:"url"` + + // The endpoint method - GET or POST. + Method EndpointRequestMethodEnum `mandatory:"false" json:"method,omitempty"` + + // The request content type. + ContentType *string `mandatory:"false" json:"contentType"` + + // The request payload, applicable for POST requests. + Payload *string `mandatory:"false" json:"payload"` + + // The request headers represented as a list of name-value pairs. + Headers []NameValuePair `mandatory:"false" json:"headers"` + + // The request form parameters represented as a list of name-value pairs. + FormParameters []NameValuePair `mandatory:"false" json:"formParameters"` +} + +func (m EndpointRequest) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingEndpointRequestMethodEnum(string(m.Method)); !ok && m.Method != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Method: %s. Supported values are: %s.", m.Method, strings.Join(GetEndpointRequestMethodEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// EndpointRequestMethodEnum Enum with underlying type: string +type EndpointRequestMethodEnum string + +// Set of constants representing the allowable values for EndpointRequestMethodEnum +const ( + EndpointRequestMethodGet EndpointRequestMethodEnum = "GET" + EndpointRequestMethodPost EndpointRequestMethodEnum = "POST" +) + +var mappingEndpointRequestMethodEnum = map[string]EndpointRequestMethodEnum{ + "GET": EndpointRequestMethodGet, + "POST": EndpointRequestMethodPost, +} + +var mappingEndpointRequestMethodEnumLowerCase = map[string]EndpointRequestMethodEnum{ + "get": EndpointRequestMethodGet, + "post": EndpointRequestMethodPost, +} + +// GetEndpointRequestMethodEnumValues Enumerates the set of values for EndpointRequestMethodEnum +func GetEndpointRequestMethodEnumValues() []EndpointRequestMethodEnum { + values := make([]EndpointRequestMethodEnum, 0) + for _, v := range mappingEndpointRequestMethodEnum { + values = append(values, v) + } + return values +} + +// GetEndpointRequestMethodEnumStringValues Enumerates the set of values in String for EndpointRequestMethodEnum +func GetEndpointRequestMethodEnumStringValues() []string { + return []string{ + "GET", + "POST", + } +} + +// GetMappingEndpointRequestMethodEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingEndpointRequestMethodEnum(val string) (EndpointRequestMethodEnum, bool) { + enum, ok := mappingEndpointRequestMethodEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_response.go new file mode 100644 index 00000000000..94985a50bfe --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_response.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EndpointResponse An object containing details of a REST response. +type EndpointResponse struct { + + // The response content type. + ContentType *string `mandatory:"false" json:"contentType"` + + // A sample response. + Example *string `mandatory:"false" json:"example"` +} + +func (m EndpointResponse) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EndpointResponse) 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/loganalytics/endpoint_result.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_result.go new file mode 100644 index 00000000000..f55258d29a3 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/endpoint_result.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// EndpointResult The validation status of a specified endpoint. +type EndpointResult struct { + + // The endpoint name. + EndpointName *string `mandatory:"false" json:"endpointName"` + + // The endpoint URL. + Url *string `mandatory:"false" json:"url"` + + // The endpoint validation status. + Status *string `mandatory:"false" json:"status"` + + // The list of violations (if any). + Violations []Violation `mandatory:"false" json:"violations"` + + // The resolved log endpoints based on the specified list endpoint response. + LogEndpoints []string `mandatory:"false" json:"logEndpoints"` +} + +func (m EndpointResult) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m EndpointResult) 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/loganalytics/estimate_recall_data_size_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/estimate_recall_data_size_details.go index d215871962e..bb6d14667ac 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/estimate_recall_data_size_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/estimate_recall_data_size_details.go @@ -23,6 +23,12 @@ type EstimateRecallDataSizeDetails struct { // This is the end of the time range for the data to be recalled TimeDataEnded *common.SDKTime `mandatory:"true" json:"timeDataEnded"` + + // This is the list of logsets to be accounted for in the recalled data + LogSets *string `mandatory:"false" json:"logSets"` + + // This indicates if only new data has to be recalled in the timeframe + IsRecallNewDataOnly *bool `mandatory:"false" json:"isRecallNewDataOnly"` } func (m EstimateRecallDataSizeDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/estimate_recall_data_size_result.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/estimate_recall_data_size_result.go index 30097ac3635..869a859295f 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/estimate_recall_data_size_result.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/estimate_recall_data_size_result.go @@ -31,6 +31,15 @@ type EstimateRecallDataSizeResult struct { // This indicates if the time range of data to be recalled overlaps with existing recalled data IsOverlappingWithExistingRecalls *bool `mandatory:"false" json:"isOverlappingWithExistingRecalls"` + + // This is the number of core groups estimated for this recall + CoreGroupCount *int `mandatory:"false" json:"coreGroupCount"` + + // This is the max number of core groups that is available for any recall + CoreGroupCountLimit *int `mandatory:"false" json:"coreGroupCountLimit"` + + // This is the size limit in bytes + SizeLimitInBytes *int64 `mandatory:"false" json:"sizeLimitInBytes"` } func (m EstimateRecallDataSizeResult) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/frequent_command_descriptor.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/frequent_command_descriptor.go new file mode 100644 index 00000000000..deb5b052b2e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/frequent_command_descriptor.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// FrequentCommandDescriptor Command descriptor for querylanguage FREQUENT command. +type FrequentCommandDescriptor struct { + + // Command fragment display string from user specified query string formatted by query builder. + DisplayQueryString *string `mandatory:"true" json:"displayQueryString"` + + // Command fragment internal string from user specified query string formatted by query builder. + InternalQueryString *string `mandatory:"true" json:"internalQueryString"` + + // querylanguage command designation for example; reporting vs filtering + Category *string `mandatory:"false" json:"category"` + + // Fields referenced in command fragment from user specified query string. + ReferencedFields []AbstractField `mandatory:"false" json:"referencedFields"` + + // Fields declared in command fragment from user specified query string. + DeclaredFields []AbstractField `mandatory:"false" json:"declaredFields"` + + // Field denoting if this is a hidden command that is not shown in the query string. + IsHidden *bool `mandatory:"false" json:"isHidden"` +} + +//GetDisplayQueryString returns DisplayQueryString +func (m FrequentCommandDescriptor) GetDisplayQueryString() *string { + return m.DisplayQueryString +} + +//GetInternalQueryString returns InternalQueryString +func (m FrequentCommandDescriptor) GetInternalQueryString() *string { + return m.InternalQueryString +} + +//GetCategory returns Category +func (m FrequentCommandDescriptor) GetCategory() *string { + return m.Category +} + +//GetReferencedFields returns ReferencedFields +func (m FrequentCommandDescriptor) GetReferencedFields() []AbstractField { + return m.ReferencedFields +} + +//GetDeclaredFields returns DeclaredFields +func (m FrequentCommandDescriptor) GetDeclaredFields() []AbstractField { + return m.DeclaredFields +} + +//GetIsHidden returns IsHidden +func (m FrequentCommandDescriptor) GetIsHidden() *bool { + return m.IsHidden +} + +func (m FrequentCommandDescriptor) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m FrequentCommandDescriptor) 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 FrequentCommandDescriptor) MarshalJSON() (buff []byte, e error) { + type MarshalTypeFrequentCommandDescriptor FrequentCommandDescriptor + s := struct { + DiscriminatorParam string `json:"name"` + MarshalTypeFrequentCommandDescriptor + }{ + "FREQUENT", + (MarshalTypeFrequentCommandDescriptor)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *FrequentCommandDescriptor) UnmarshalJSON(data []byte) (e error) { + model := struct { + Category *string `json:"category"` + ReferencedFields []abstractfield `json:"referencedFields"` + DeclaredFields []abstractfield `json:"declaredFields"` + IsHidden *bool `json:"isHidden"` + DisplayQueryString *string `json:"displayQueryString"` + InternalQueryString *string `json:"internalQueryString"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Category = model.Category + + m.ReferencedFields = make([]AbstractField, len(model.ReferencedFields)) + for i, n := range model.ReferencedFields { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ReferencedFields[i] = nn.(AbstractField) + } else { + m.ReferencedFields[i] = nil + } + } + + m.DeclaredFields = make([]AbstractField, len(model.DeclaredFields)) + for i, n := range model.DeclaredFields { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.DeclaredFields[i] = nn.(AbstractField) + } else { + m.DeclaredFields[i] = nil + } + } + + m.IsHidden = model.IsHidden + + m.DisplayQueryString = model.DisplayQueryString + + m.InternalQueryString = model.InternalQueryString + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_recall_count_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_recall_count_request_response.go new file mode 100644 index 00000000000..abbf7c5e576 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_recall_count_request_response.go @@ -0,0 +1,89 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetRecallCountRequest wrapper for the GetRecallCount operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/GetRecallCount.go.html to see an example of how to use GetRecallCountRequest. +type GetRecallCountRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetRecallCountRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetRecallCountRequest) 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 GetRecallCountRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRecallCountRequest) 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 GetRecallCountRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetRecallCountResponse wrapper for the GetRecallCount operation +type GetRecallCountResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The RecallCount instance + RecallCount `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetRecallCountResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetRecallCountResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_recalled_data_size_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_recalled_data_size_request_response.go new file mode 100644 index 00000000000..881b3013feb --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_recalled_data_size_request_response.go @@ -0,0 +1,105 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetRecalledDataSizeRequest wrapper for the GetRecalledDataSize operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/GetRecalledDataSize.go.html to see an example of how to use GetRecalledDataSizeRequest. +type GetRecalledDataSizeRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // This is the start of the time range for recalled data + TimeDataStarted *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeDataStarted"` + + // This is the end of the time range for recalled data + TimeDataEnded *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeDataEnded"` + + // 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 GetRecalledDataSizeRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetRecalledDataSizeRequest) 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 GetRecalledDataSizeRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRecalledDataSizeRequest) 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 GetRecalledDataSizeRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetRecalledDataSizeResponse wrapper for the GetRecalledDataSize operation +type GetRecalledDataSizeResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The RecalledDataSize instance + RecalledDataSize `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the next page of the list. Include this value as the `page` parameter for the + // subsequent request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the previous page of the list. Include this value as the `page` parameter for the + // subsequent request to get the previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` +} + +func (response GetRecalledDataSizeResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetRecalledDataSizeResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_rules_summary_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_rules_summary_request_response.go new file mode 100644 index 00000000000..837163113c0 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/get_rules_summary_request_response.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetRulesSummaryRequest wrapper for the GetRulesSummary operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/GetRulesSummary.go.html to see an example of how to use GetRulesSummaryRequest. +type GetRulesSummaryRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The ID of the compartment in which to list resources. + CompartmentId *string `mandatory:"true" contributesTo:"query" name:"compartmentId"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetRulesSummaryRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetRulesSummaryRequest) 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 GetRulesSummaryRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetRulesSummaryRequest) 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 GetRulesSummaryRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetRulesSummaryResponse wrapper for the GetRulesSummary operation +type GetRulesSummaryResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The RuleSummaryReport instance + RuleSummaryReport `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response GetRulesSummaryResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetRulesSummaryResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/level.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/level.go new file mode 100644 index 00000000000..af9b70ca9c2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/level.go @@ -0,0 +1,43 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// Level An object used to represent a level at which a property or resource or constraint is defined. +type Level struct { + + // The level name. + Name *string `mandatory:"true" json:"name"` + + // A string representation of constraints that apply at this level. + // For example, a property defined at SOURCE level could further be applicable only for SOURCE_TYPE:database_sql. + Constraints *string `mandatory:"false" json:"constraints"` +} + +func (m Level) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m Level) 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/loganalytics/list_effective_properties_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_effective_properties_request_response.go new file mode 100644 index 00000000000..870bd325094 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_effective_properties_request_response.go @@ -0,0 +1,219 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListEffectivePropertiesRequest wrapper for the ListEffectiveProperties operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ListEffectiveProperties.go.html to see an example of how to use ListEffectivePropertiesRequest. +type ListEffectivePropertiesRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The agent ocid. + AgentId *string `mandatory:"false" contributesTo:"query" name:"agentId"` + + // The source name. + SourceName *string `mandatory:"false" contributesTo:"query" name:"sourceName"` + + // The include pattern flag. + IsIncludePatterns *bool `mandatory:"false" contributesTo:"query" name:"isIncludePatterns"` + + // The entity ocid. + EntityId *string `mandatory:"false" contributesTo:"query" name:"entityId"` + + // The pattern id. + PatternId *int `mandatory:"false" contributesTo:"query" name:"patternId"` + + // The property name used for filtering. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListEffectivePropertiesSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The attribute used to sort the returned properties + SortBy ListEffectivePropertiesSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListEffectivePropertiesRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListEffectivePropertiesRequest) 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 ListEffectivePropertiesRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListEffectivePropertiesRequest) 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 ListEffectivePropertiesRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListEffectivePropertiesSortOrderEnum(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(GetListEffectivePropertiesSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListEffectivePropertiesSortByEnum(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(GetListEffectivePropertiesSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListEffectivePropertiesResponse wrapper for the ListEffectiveProperties operation +type ListEffectivePropertiesResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of EffectivePropertyCollection instances + EffectivePropertyCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the previous page of the list. Include this value as the `page` parameter for the + // subsequent request to get the previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the next page of the list. Include this value as the `page` parameter for the + // subsequent request to get the next batch of items. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListEffectivePropertiesResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListEffectivePropertiesResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListEffectivePropertiesSortOrderEnum Enum with underlying type: string +type ListEffectivePropertiesSortOrderEnum string + +// Set of constants representing the allowable values for ListEffectivePropertiesSortOrderEnum +const ( + ListEffectivePropertiesSortOrderAsc ListEffectivePropertiesSortOrderEnum = "ASC" + ListEffectivePropertiesSortOrderDesc ListEffectivePropertiesSortOrderEnum = "DESC" +) + +var mappingListEffectivePropertiesSortOrderEnum = map[string]ListEffectivePropertiesSortOrderEnum{ + "ASC": ListEffectivePropertiesSortOrderAsc, + "DESC": ListEffectivePropertiesSortOrderDesc, +} + +var mappingListEffectivePropertiesSortOrderEnumLowerCase = map[string]ListEffectivePropertiesSortOrderEnum{ + "asc": ListEffectivePropertiesSortOrderAsc, + "desc": ListEffectivePropertiesSortOrderDesc, +} + +// GetListEffectivePropertiesSortOrderEnumValues Enumerates the set of values for ListEffectivePropertiesSortOrderEnum +func GetListEffectivePropertiesSortOrderEnumValues() []ListEffectivePropertiesSortOrderEnum { + values := make([]ListEffectivePropertiesSortOrderEnum, 0) + for _, v := range mappingListEffectivePropertiesSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListEffectivePropertiesSortOrderEnumStringValues Enumerates the set of values in String for ListEffectivePropertiesSortOrderEnum +func GetListEffectivePropertiesSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListEffectivePropertiesSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListEffectivePropertiesSortOrderEnum(val string) (ListEffectivePropertiesSortOrderEnum, bool) { + enum, ok := mappingListEffectivePropertiesSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListEffectivePropertiesSortByEnum Enum with underlying type: string +type ListEffectivePropertiesSortByEnum string + +// Set of constants representing the allowable values for ListEffectivePropertiesSortByEnum +const ( + ListEffectivePropertiesSortByName ListEffectivePropertiesSortByEnum = "name" + ListEffectivePropertiesSortByDisplayname ListEffectivePropertiesSortByEnum = "displayName" +) + +var mappingListEffectivePropertiesSortByEnum = map[string]ListEffectivePropertiesSortByEnum{ + "name": ListEffectivePropertiesSortByName, + "displayName": ListEffectivePropertiesSortByDisplayname, +} + +var mappingListEffectivePropertiesSortByEnumLowerCase = map[string]ListEffectivePropertiesSortByEnum{ + "name": ListEffectivePropertiesSortByName, + "displayname": ListEffectivePropertiesSortByDisplayname, +} + +// GetListEffectivePropertiesSortByEnumValues Enumerates the set of values for ListEffectivePropertiesSortByEnum +func GetListEffectivePropertiesSortByEnumValues() []ListEffectivePropertiesSortByEnum { + values := make([]ListEffectivePropertiesSortByEnum, 0) + for _, v := range mappingListEffectivePropertiesSortByEnum { + values = append(values, v) + } + return values +} + +// GetListEffectivePropertiesSortByEnumStringValues Enumerates the set of values in String for ListEffectivePropertiesSortByEnum +func GetListEffectivePropertiesSortByEnumStringValues() []string { + return []string{ + "name", + "displayName", + } +} + +// GetMappingListEffectivePropertiesSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListEffectivePropertiesSortByEnum(val string) (ListEffectivePropertiesSortByEnum, bool) { + enum, ok := mappingListEffectivePropertiesSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_overlapping_recalls_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_overlapping_recalls_request_response.go new file mode 100644 index 00000000000..74b990bd76e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_overlapping_recalls_request_response.go @@ -0,0 +1,208 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListOverlappingRecallsRequest wrapper for the ListOverlappingRecalls operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ListOverlappingRecalls.go.html to see an example of how to use ListOverlappingRecallsRequest. +type ListOverlappingRecallsRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // This is the query parameter of which field to sort by. Only one sort order may be provided. Default order for timeDataStarted + // is descending. If no value is specified timeDataStarted is default. + SortBy ListOverlappingRecallsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListOverlappingRecallsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // This is the start of the time range for recalled data + TimeDataStarted *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeDataStarted"` + + // This is the end of the time range for recalled data + TimeDataEnded *common.SDKTime `mandatory:"false" contributesTo:"query" name:"timeDataEnded"` + + // 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 ListOverlappingRecallsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListOverlappingRecallsRequest) 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 ListOverlappingRecallsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListOverlappingRecallsRequest) 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 ListOverlappingRecallsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListOverlappingRecallsSortByEnum(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(GetListOverlappingRecallsSortByEnumStringValues(), ","))) + } + if _, ok := GetMappingListOverlappingRecallsSortOrderEnum(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(GetListOverlappingRecallsSortOrderEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListOverlappingRecallsResponse wrapper for the ListOverlappingRecalls operation +type ListOverlappingRecallsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of OverlappingRecallCollection instances + OverlappingRecallCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the next page of the list. Include this value as the `page` parameter for the + // subsequent request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the previous page of the list. Include this value as the `page` parameter for the + // subsequent request to get the previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` +} + +func (response ListOverlappingRecallsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListOverlappingRecallsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListOverlappingRecallsSortByEnum Enum with underlying type: string +type ListOverlappingRecallsSortByEnum string + +// Set of constants representing the allowable values for ListOverlappingRecallsSortByEnum +const ( + ListOverlappingRecallsSortByTimestarted ListOverlappingRecallsSortByEnum = "timeStarted" + ListOverlappingRecallsSortByTimedatastarted ListOverlappingRecallsSortByEnum = "timeDataStarted" +) + +var mappingListOverlappingRecallsSortByEnum = map[string]ListOverlappingRecallsSortByEnum{ + "timeStarted": ListOverlappingRecallsSortByTimestarted, + "timeDataStarted": ListOverlappingRecallsSortByTimedatastarted, +} + +var mappingListOverlappingRecallsSortByEnumLowerCase = map[string]ListOverlappingRecallsSortByEnum{ + "timestarted": ListOverlappingRecallsSortByTimestarted, + "timedatastarted": ListOverlappingRecallsSortByTimedatastarted, +} + +// GetListOverlappingRecallsSortByEnumValues Enumerates the set of values for ListOverlappingRecallsSortByEnum +func GetListOverlappingRecallsSortByEnumValues() []ListOverlappingRecallsSortByEnum { + values := make([]ListOverlappingRecallsSortByEnum, 0) + for _, v := range mappingListOverlappingRecallsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListOverlappingRecallsSortByEnumStringValues Enumerates the set of values in String for ListOverlappingRecallsSortByEnum +func GetListOverlappingRecallsSortByEnumStringValues() []string { + return []string{ + "timeStarted", + "timeDataStarted", + } +} + +// GetMappingListOverlappingRecallsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOverlappingRecallsSortByEnum(val string) (ListOverlappingRecallsSortByEnum, bool) { + enum, ok := mappingListOverlappingRecallsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListOverlappingRecallsSortOrderEnum Enum with underlying type: string +type ListOverlappingRecallsSortOrderEnum string + +// Set of constants representing the allowable values for ListOverlappingRecallsSortOrderEnum +const ( + ListOverlappingRecallsSortOrderAsc ListOverlappingRecallsSortOrderEnum = "ASC" + ListOverlappingRecallsSortOrderDesc ListOverlappingRecallsSortOrderEnum = "DESC" +) + +var mappingListOverlappingRecallsSortOrderEnum = map[string]ListOverlappingRecallsSortOrderEnum{ + "ASC": ListOverlappingRecallsSortOrderAsc, + "DESC": ListOverlappingRecallsSortOrderDesc, +} + +var mappingListOverlappingRecallsSortOrderEnumLowerCase = map[string]ListOverlappingRecallsSortOrderEnum{ + "asc": ListOverlappingRecallsSortOrderAsc, + "desc": ListOverlappingRecallsSortOrderDesc, +} + +// GetListOverlappingRecallsSortOrderEnumValues Enumerates the set of values for ListOverlappingRecallsSortOrderEnum +func GetListOverlappingRecallsSortOrderEnumValues() []ListOverlappingRecallsSortOrderEnum { + values := make([]ListOverlappingRecallsSortOrderEnum, 0) + for _, v := range mappingListOverlappingRecallsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListOverlappingRecallsSortOrderEnumStringValues Enumerates the set of values in String for ListOverlappingRecallsSortOrderEnum +func GetListOverlappingRecallsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListOverlappingRecallsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListOverlappingRecallsSortOrderEnum(val string) (ListOverlappingRecallsSortOrderEnum, bool) { + enum, ok := mappingListOverlappingRecallsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_properties_metadata_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_properties_metadata_request_response.go new file mode 100644 index 00000000000..4ae6f6ea0d6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_properties_metadata_request_response.go @@ -0,0 +1,214 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListPropertiesMetadataRequest wrapper for the ListPropertiesMetadata operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ListPropertiesMetadata.go.html to see an example of how to use ListPropertiesMetadataRequest. +type ListPropertiesMetadataRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // The property name used for filtering. + Name *string `mandatory:"false" contributesTo:"query" name:"name"` + + // The property display text used for filtering. Only properties matching the specified display + // name or description will be returned. + DisplayText *string `mandatory:"false" contributesTo:"query" name:"displayText"` + + // The level for which applicable properties are to be listed. + Level *string `mandatory:"false" contributesTo:"query" name:"level"` + + // The constraints that apply to the properties at a certain level. + Constraints *string `mandatory:"false" contributesTo:"query" name:"constraints"` + + // The maximum number of items to return. + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call. + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListPropertiesMetadataSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // The attribute used to sort the returned properties + SortBy ListPropertiesMetadataSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListPropertiesMetadataRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListPropertiesMetadataRequest) 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 ListPropertiesMetadataRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListPropertiesMetadataRequest) 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 ListPropertiesMetadataRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingListPropertiesMetadataSortOrderEnum(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(GetListPropertiesMetadataSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListPropertiesMetadataSortByEnum(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(GetListPropertiesMetadataSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListPropertiesMetadataResponse wrapper for the ListPropertiesMetadata operation +type ListPropertiesMetadataResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of PropertyMetadataSummaryCollection instances + PropertyMetadataSummaryCollection `presentIn:"body"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the previous page of the list. Include this value as the `page` parameter for the + // subsequent request to get the previous batch of items. + OpcPrevPage *string `presentIn:"header" name:"opc-prev-page"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then additional items may be available on the next page of the list. Include this value as the `page` parameter for the + // subsequent request to get the next batch of items. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListPropertiesMetadataResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListPropertiesMetadataResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListPropertiesMetadataSortOrderEnum Enum with underlying type: string +type ListPropertiesMetadataSortOrderEnum string + +// Set of constants representing the allowable values for ListPropertiesMetadataSortOrderEnum +const ( + ListPropertiesMetadataSortOrderAsc ListPropertiesMetadataSortOrderEnum = "ASC" + ListPropertiesMetadataSortOrderDesc ListPropertiesMetadataSortOrderEnum = "DESC" +) + +var mappingListPropertiesMetadataSortOrderEnum = map[string]ListPropertiesMetadataSortOrderEnum{ + "ASC": ListPropertiesMetadataSortOrderAsc, + "DESC": ListPropertiesMetadataSortOrderDesc, +} + +var mappingListPropertiesMetadataSortOrderEnumLowerCase = map[string]ListPropertiesMetadataSortOrderEnum{ + "asc": ListPropertiesMetadataSortOrderAsc, + "desc": ListPropertiesMetadataSortOrderDesc, +} + +// GetListPropertiesMetadataSortOrderEnumValues Enumerates the set of values for ListPropertiesMetadataSortOrderEnum +func GetListPropertiesMetadataSortOrderEnumValues() []ListPropertiesMetadataSortOrderEnum { + values := make([]ListPropertiesMetadataSortOrderEnum, 0) + for _, v := range mappingListPropertiesMetadataSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListPropertiesMetadataSortOrderEnumStringValues Enumerates the set of values in String for ListPropertiesMetadataSortOrderEnum +func GetListPropertiesMetadataSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListPropertiesMetadataSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPropertiesMetadataSortOrderEnum(val string) (ListPropertiesMetadataSortOrderEnum, bool) { + enum, ok := mappingListPropertiesMetadataSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListPropertiesMetadataSortByEnum Enum with underlying type: string +type ListPropertiesMetadataSortByEnum string + +// Set of constants representing the allowable values for ListPropertiesMetadataSortByEnum +const ( + ListPropertiesMetadataSortByName ListPropertiesMetadataSortByEnum = "name" + ListPropertiesMetadataSortByDisplayname ListPropertiesMetadataSortByEnum = "displayName" +) + +var mappingListPropertiesMetadataSortByEnum = map[string]ListPropertiesMetadataSortByEnum{ + "name": ListPropertiesMetadataSortByName, + "displayName": ListPropertiesMetadataSortByDisplayname, +} + +var mappingListPropertiesMetadataSortByEnumLowerCase = map[string]ListPropertiesMetadataSortByEnum{ + "name": ListPropertiesMetadataSortByName, + "displayname": ListPropertiesMetadataSortByDisplayname, +} + +// GetListPropertiesMetadataSortByEnumValues Enumerates the set of values for ListPropertiesMetadataSortByEnum +func GetListPropertiesMetadataSortByEnumValues() []ListPropertiesMetadataSortByEnum { + values := make([]ListPropertiesMetadataSortByEnum, 0) + for _, v := range mappingListPropertiesMetadataSortByEnum { + values = append(values, v) + } + return values +} + +// GetListPropertiesMetadataSortByEnumStringValues Enumerates the set of values in String for ListPropertiesMetadataSortByEnum +func GetListPropertiesMetadataSortByEnumStringValues() []string { + return []string{ + "name", + "displayName", + } +} + +// GetMappingListPropertiesMetadataSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListPropertiesMetadataSortByEnum(val string) (ListPropertiesMetadataSortByEnum, bool) { + enum, ok := mappingListPropertiesMetadataSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_scheduled_tasks_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_scheduled_tasks_request_response.go index 6f1d68e6bec..a90d4a39ccd 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_scheduled_tasks_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_scheduled_tasks_request_response.go @@ -140,24 +140,21 @@ type ListScheduledTasksTaskTypeEnum string // Set of constants representing the allowable values for ListScheduledTasksTaskTypeEnum const ( - ListScheduledTasksTaskTypeSavedSearch ListScheduledTasksTaskTypeEnum = "SAVED_SEARCH" - ListScheduledTasksTaskTypeAcceleration ListScheduledTasksTaskTypeEnum = "ACCELERATION" - ListScheduledTasksTaskTypePurge ListScheduledTasksTaskTypeEnum = "PURGE" - ListScheduledTasksTaskTypeAccelerationMaintenance ListScheduledTasksTaskTypeEnum = "ACCELERATION_MAINTENANCE" + ListScheduledTasksTaskTypeSavedSearch ListScheduledTasksTaskTypeEnum = "SAVED_SEARCH" + ListScheduledTasksTaskTypeAcceleration ListScheduledTasksTaskTypeEnum = "ACCELERATION" + ListScheduledTasksTaskTypePurge ListScheduledTasksTaskTypeEnum = "PURGE" ) var mappingListScheduledTasksTaskTypeEnum = map[string]ListScheduledTasksTaskTypeEnum{ - "SAVED_SEARCH": ListScheduledTasksTaskTypeSavedSearch, - "ACCELERATION": ListScheduledTasksTaskTypeAcceleration, - "PURGE": ListScheduledTasksTaskTypePurge, - "ACCELERATION_MAINTENANCE": ListScheduledTasksTaskTypeAccelerationMaintenance, + "SAVED_SEARCH": ListScheduledTasksTaskTypeSavedSearch, + "ACCELERATION": ListScheduledTasksTaskTypeAcceleration, + "PURGE": ListScheduledTasksTaskTypePurge, } var mappingListScheduledTasksTaskTypeEnumLowerCase = map[string]ListScheduledTasksTaskTypeEnum{ - "saved_search": ListScheduledTasksTaskTypeSavedSearch, - "acceleration": ListScheduledTasksTaskTypeAcceleration, - "purge": ListScheduledTasksTaskTypePurge, - "acceleration_maintenance": ListScheduledTasksTaskTypeAccelerationMaintenance, + "saved_search": ListScheduledTasksTaskTypeSavedSearch, + "acceleration": ListScheduledTasksTaskTypeAcceleration, + "purge": ListScheduledTasksTaskTypePurge, } // GetListScheduledTasksTaskTypeEnumValues Enumerates the set of values for ListScheduledTasksTaskTypeEnum @@ -175,7 +172,6 @@ func GetListScheduledTasksTaskTypeEnumStringValues() []string { "SAVED_SEARCH", "ACCELERATION", "PURGE", - "ACCELERATION_MAINTENANCE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_storage_work_requests_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_storage_work_requests_request_response.go index be28382f3e6..7cc354ce90d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_storage_work_requests_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/list_storage_work_requests_request_response.go @@ -241,6 +241,7 @@ const ( ListStorageWorkRequestsOperationTypePurgeStorageData ListStorageWorkRequestsOperationTypeEnum = "PURGE_STORAGE_DATA" ListStorageWorkRequestsOperationTypeRecallArchivedStorageData ListStorageWorkRequestsOperationTypeEnum = "RECALL_ARCHIVED_STORAGE_DATA" ListStorageWorkRequestsOperationTypeReleaseRecalledStorageData ListStorageWorkRequestsOperationTypeEnum = "RELEASE_RECALLED_STORAGE_DATA" + ListStorageWorkRequestsOperationTypePurgeArchivalData ListStorageWorkRequestsOperationTypeEnum = "PURGE_ARCHIVAL_DATA" ListStorageWorkRequestsOperationTypeArchiveStorageData ListStorageWorkRequestsOperationTypeEnum = "ARCHIVE_STORAGE_DATA" ListStorageWorkRequestsOperationTypeCleanupArchivalStorageData ListStorageWorkRequestsOperationTypeEnum = "CLEANUP_ARCHIVAL_STORAGE_DATA" ListStorageWorkRequestsOperationTypeEncryptActiveData ListStorageWorkRequestsOperationTypeEnum = "ENCRYPT_ACTIVE_DATA" @@ -252,6 +253,7 @@ var mappingListStorageWorkRequestsOperationTypeEnum = map[string]ListStorageWork "PURGE_STORAGE_DATA": ListStorageWorkRequestsOperationTypePurgeStorageData, "RECALL_ARCHIVED_STORAGE_DATA": ListStorageWorkRequestsOperationTypeRecallArchivedStorageData, "RELEASE_RECALLED_STORAGE_DATA": ListStorageWorkRequestsOperationTypeReleaseRecalledStorageData, + "PURGE_ARCHIVAL_DATA": ListStorageWorkRequestsOperationTypePurgeArchivalData, "ARCHIVE_STORAGE_DATA": ListStorageWorkRequestsOperationTypeArchiveStorageData, "CLEANUP_ARCHIVAL_STORAGE_DATA": ListStorageWorkRequestsOperationTypeCleanupArchivalStorageData, "ENCRYPT_ACTIVE_DATA": ListStorageWorkRequestsOperationTypeEncryptActiveData, @@ -263,6 +265,7 @@ var mappingListStorageWorkRequestsOperationTypeEnumLowerCase = map[string]ListSt "purge_storage_data": ListStorageWorkRequestsOperationTypePurgeStorageData, "recall_archived_storage_data": ListStorageWorkRequestsOperationTypeRecallArchivedStorageData, "release_recalled_storage_data": ListStorageWorkRequestsOperationTypeReleaseRecalledStorageData, + "purge_archival_data": ListStorageWorkRequestsOperationTypePurgeArchivalData, "archive_storage_data": ListStorageWorkRequestsOperationTypeArchiveStorageData, "cleanup_archival_storage_data": ListStorageWorkRequestsOperationTypeCleanupArchivalStorageData, "encrypt_active_data": ListStorageWorkRequestsOperationTypeEncryptActiveData, @@ -285,6 +288,7 @@ func GetListStorageWorkRequestsOperationTypeEnumStringValues() []string { "PURGE_STORAGE_DATA", "RECALL_ARCHIVED_STORAGE_DATA", "RELEASE_RECALLED_STORAGE_DATA", + "PURGE_ARCHIVAL_DATA", "ARCHIVE_STORAGE_DATA", "CLEANUP_ARCHIVAL_STORAGE_DATA", "ENCRYPT_ACTIVE_DATA", diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association.go index f6e9231b3ae..fb51c924dd1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association.go @@ -70,6 +70,9 @@ type LogAnalyticsAssociation struct { // The log group compartment. LogGroupCompartment *string `mandatory:"false" json:"logGroupCompartment"` + + // A list of association properties. + AssociationProperties []AssociationProperty `mandatory:"false" json:"associationProperties"` } func (m LogAnalyticsAssociation) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association_parameter.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association_parameter.go index f1c305d2314..beed9577581 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association_parameter.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_association_parameter.go @@ -39,6 +39,12 @@ type LogAnalyticsAssociationParameter struct { // The status. Either FAILED or SUCCEEDED. Status LogAnalyticsAssociationParameterStatusEnum `mandatory:"false" json:"status,omitempty"` + // The status description. + StatusDescription *string `mandatory:"false" json:"statusDescription"` + + // A list of association properties. + AssociationProperties []AssociationProperty `mandatory:"false" json:"associationProperties"` + // A list of missing properties. MissingProperties []string `mandatory:"false" json:"missingProperties"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_endpoint.go new file mode 100644 index 00000000000..1e03ef36e13 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_endpoint.go @@ -0,0 +1,123 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LogAnalyticsEndpoint Endpoint configuration for REST API based log collection. +type LogAnalyticsEndpoint interface { +} + +type loganalyticsendpoint struct { + JsonData []byte + EndpointType string `json:"endpointType"` +} + +// UnmarshalJSON unmarshals json +func (m *loganalyticsendpoint) UnmarshalJSON(data []byte) error { + m.JsonData = data + type Unmarshalerloganalyticsendpoint loganalyticsendpoint + s := struct { + Model Unmarshalerloganalyticsendpoint + }{} + err := json.Unmarshal(data, &s.Model) + if err != nil { + return err + } + m.EndpointType = s.Model.EndpointType + + return err +} + +// UnmarshalPolymorphicJSON unmarshals polymorphic json +func (m *loganalyticsendpoint) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) { + + if data == nil || string(data) == "null" { + return nil, nil + } + + var err error + switch m.EndpointType { + case "LOG_LIST": + mm := LogListTypeEndpoint{} + err = json.Unmarshal(data, &mm) + return mm, err + case "LOG": + mm := LogTypeEndpoint{} + err = json.Unmarshal(data, &mm) + return mm, err + default: + common.Logf("Recieved unsupported enum value for LogAnalyticsEndpoint: %s.", m.EndpointType) + return *m, nil + } +} + +func (m loganalyticsendpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m loganalyticsendpoint) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// LogAnalyticsEndpointEndpointTypeEnum Enum with underlying type: string +type LogAnalyticsEndpointEndpointTypeEnum string + +// Set of constants representing the allowable values for LogAnalyticsEndpointEndpointTypeEnum +const ( + LogAnalyticsEndpointEndpointTypeLogList LogAnalyticsEndpointEndpointTypeEnum = "LOG_LIST" + LogAnalyticsEndpointEndpointTypeLog LogAnalyticsEndpointEndpointTypeEnum = "LOG" +) + +var mappingLogAnalyticsEndpointEndpointTypeEnum = map[string]LogAnalyticsEndpointEndpointTypeEnum{ + "LOG_LIST": LogAnalyticsEndpointEndpointTypeLogList, + "LOG": LogAnalyticsEndpointEndpointTypeLog, +} + +var mappingLogAnalyticsEndpointEndpointTypeEnumLowerCase = map[string]LogAnalyticsEndpointEndpointTypeEnum{ + "log_list": LogAnalyticsEndpointEndpointTypeLogList, + "log": LogAnalyticsEndpointEndpointTypeLog, +} + +// GetLogAnalyticsEndpointEndpointTypeEnumValues Enumerates the set of values for LogAnalyticsEndpointEndpointTypeEnum +func GetLogAnalyticsEndpointEndpointTypeEnumValues() []LogAnalyticsEndpointEndpointTypeEnum { + values := make([]LogAnalyticsEndpointEndpointTypeEnum, 0) + for _, v := range mappingLogAnalyticsEndpointEndpointTypeEnum { + values = append(values, v) + } + return values +} + +// GetLogAnalyticsEndpointEndpointTypeEnumStringValues Enumerates the set of values in String for LogAnalyticsEndpointEndpointTypeEnum +func GetLogAnalyticsEndpointEndpointTypeEnumStringValues() []string { + return []string{ + "LOG_LIST", + "LOG", + } +} + +// GetMappingLogAnalyticsEndpointEndpointTypeEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingLogAnalyticsEndpointEndpointTypeEnum(val string) (LogAnalyticsEndpointEndpointTypeEnum, bool) { + enum, ok := mappingLogAnalyticsEndpointEndpointTypeEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_preference.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_preference.go index 8f75c50505c..cd827bfeec3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_preference.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_preference.go @@ -18,7 +18,7 @@ import ( // LogAnalyticsPreference The preference information type LogAnalyticsPreference struct { - // The preference name. Currently, only "DEFAULT_HOMEPAGE" is supported. + // The preference name. Name *string `mandatory:"false" json:"name"` // The preference value. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_property.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_property.go new file mode 100644 index 00000000000..c3db3f91083 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_property.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LogAnalyticsProperty A property represented as a name-value pair. +type LogAnalyticsProperty struct { + + // The property name. + Name *string `mandatory:"true" json:"name"` + + // The property value. + Value *string `mandatory:"false" json:"value"` +} + +func (m LogAnalyticsProperty) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LogAnalyticsProperty) 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/loganalytics/log_analytics_source.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source.go index eca91aac934..46bea2b5e84 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source.go @@ -10,6 +10,7 @@ package loganalytics import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -130,6 +131,12 @@ type LogAnalyticsSource struct { // An array of categories assigned to this source. // The isSystem flag denotes if each category assignment is user-created or Oracle-defined. Categories []LogAnalyticsCategory `mandatory:"false" json:"categories"` + + // An array of REST API endpoints for log collection. + Endpoints []LogAnalyticsEndpoint `mandatory:"false" json:"endpoints"` + + // A list of source properties. + SourceProperties []LogAnalyticsProperty `mandatory:"false" json:"sourceProperties"` } func (m LogAnalyticsSource) String() string { @@ -147,3 +154,201 @@ func (m LogAnalyticsSource) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *LogAnalyticsSource) UnmarshalJSON(data []byte) (e error) { + model := struct { + LabelConditions []LogAnalyticsSourceLabelCondition `json:"labelConditions"` + AssociationCount *int `json:"associationCount"` + AssociationEntity []LogAnalyticsAssociation `json:"associationEntity"` + DataFilterDefinitions []LogAnalyticsSourceDataFilter `json:"dataFilterDefinitions"` + DatabaseCredential *string `json:"databaseCredential"` + ExtendedFieldDefinitions []LogAnalyticsSourceExtendedFieldDefinition `json:"extendedFieldDefinitions"` + IsForCloud *bool `json:"isForCloud"` + Labels []LogAnalyticsLabelView `json:"labels"` + MetricDefinitions []LogAnalyticsMetric `json:"metricDefinitions"` + Metrics []LogAnalyticsSourceMetric `json:"metrics"` + OobParsers []LogAnalyticsParser `json:"oobParsers"` + Parameters []LogAnalyticsParameter `json:"parameters"` + PatternCount *int `json:"patternCount"` + Patterns []LogAnalyticsSourcePattern `json:"patterns"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + EditVersion *int64 `json:"editVersion"` + Functions []LogAnalyticsSourceFunction `json:"functions"` + SourceId *int64 `json:"sourceId"` + Name *string `json:"name"` + IsSecureContent *bool `json:"isSecureContent"` + IsSystem *bool `json:"isSystem"` + Parsers []LogAnalyticsParser `json:"parsers"` + IsAutoAssociationEnabled *bool `json:"isAutoAssociationEnabled"` + IsAutoAssociationOverride *bool `json:"isAutoAssociationOverride"` + RuleId *int64 `json:"ruleId"` + TypeName *string `json:"typeName"` + TypeDisplayName *string `json:"typeDisplayName"` + WarningConfig *int64 `json:"warningConfig"` + MetadataFields []LogAnalyticsSourceMetadataField `json:"metadataFields"` + LabelDefinitions []LogAnalyticsLabelDefinition `json:"labelDefinitions"` + EntityTypes []LogAnalyticsSourceEntityType `json:"entityTypes"` + IsTimezoneOverride *bool `json:"isTimezoneOverride"` + UserParsers []LogAnalyticsParser `json:"userParsers"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + EventTypes []EventType `json:"eventTypes"` + Categories []LogAnalyticsCategory `json:"categories"` + Endpoints []loganalyticsendpoint `json:"endpoints"` + SourceProperties []LogAnalyticsProperty `json:"sourceProperties"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.LabelConditions = make([]LogAnalyticsSourceLabelCondition, len(model.LabelConditions)) + for i, n := range model.LabelConditions { + m.LabelConditions[i] = n + } + + m.AssociationCount = model.AssociationCount + + m.AssociationEntity = make([]LogAnalyticsAssociation, len(model.AssociationEntity)) + for i, n := range model.AssociationEntity { + m.AssociationEntity[i] = n + } + + m.DataFilterDefinitions = make([]LogAnalyticsSourceDataFilter, len(model.DataFilterDefinitions)) + for i, n := range model.DataFilterDefinitions { + m.DataFilterDefinitions[i] = n + } + + m.DatabaseCredential = model.DatabaseCredential + + m.ExtendedFieldDefinitions = make([]LogAnalyticsSourceExtendedFieldDefinition, len(model.ExtendedFieldDefinitions)) + for i, n := range model.ExtendedFieldDefinitions { + m.ExtendedFieldDefinitions[i] = n + } + + m.IsForCloud = model.IsForCloud + + m.Labels = make([]LogAnalyticsLabelView, len(model.Labels)) + for i, n := range model.Labels { + m.Labels[i] = n + } + + m.MetricDefinitions = make([]LogAnalyticsMetric, len(model.MetricDefinitions)) + for i, n := range model.MetricDefinitions { + m.MetricDefinitions[i] = n + } + + m.Metrics = make([]LogAnalyticsSourceMetric, len(model.Metrics)) + for i, n := range model.Metrics { + m.Metrics[i] = n + } + + m.OobParsers = make([]LogAnalyticsParser, len(model.OobParsers)) + for i, n := range model.OobParsers { + m.OobParsers[i] = n + } + + m.Parameters = make([]LogAnalyticsParameter, len(model.Parameters)) + for i, n := range model.Parameters { + m.Parameters[i] = n + } + + m.PatternCount = model.PatternCount + + m.Patterns = make([]LogAnalyticsSourcePattern, len(model.Patterns)) + for i, n := range model.Patterns { + m.Patterns[i] = n + } + + m.Description = model.Description + + m.DisplayName = model.DisplayName + + m.EditVersion = model.EditVersion + + m.Functions = make([]LogAnalyticsSourceFunction, len(model.Functions)) + for i, n := range model.Functions { + m.Functions[i] = n + } + + m.SourceId = model.SourceId + + m.Name = model.Name + + m.IsSecureContent = model.IsSecureContent + + m.IsSystem = model.IsSystem + + m.Parsers = make([]LogAnalyticsParser, len(model.Parsers)) + for i, n := range model.Parsers { + m.Parsers[i] = n + } + + m.IsAutoAssociationEnabled = model.IsAutoAssociationEnabled + + m.IsAutoAssociationOverride = model.IsAutoAssociationOverride + + m.RuleId = model.RuleId + + m.TypeName = model.TypeName + + m.TypeDisplayName = model.TypeDisplayName + + m.WarningConfig = model.WarningConfig + + m.MetadataFields = make([]LogAnalyticsSourceMetadataField, len(model.MetadataFields)) + for i, n := range model.MetadataFields { + m.MetadataFields[i] = n + } + + m.LabelDefinitions = make([]LogAnalyticsLabelDefinition, len(model.LabelDefinitions)) + for i, n := range model.LabelDefinitions { + m.LabelDefinitions[i] = n + } + + m.EntityTypes = make([]LogAnalyticsSourceEntityType, len(model.EntityTypes)) + for i, n := range model.EntityTypes { + m.EntityTypes[i] = n + } + + m.IsTimezoneOverride = model.IsTimezoneOverride + + m.UserParsers = make([]LogAnalyticsParser, len(model.UserParsers)) + for i, n := range model.UserParsers { + m.UserParsers[i] = n + } + + m.TimeUpdated = model.TimeUpdated + + m.EventTypes = make([]EventType, len(model.EventTypes)) + for i, n := range model.EventTypes { + m.EventTypes[i] = n + } + + m.Categories = make([]LogAnalyticsCategory, len(model.Categories)) + for i, n := range model.Categories { + m.Categories[i] = n + } + + m.Endpoints = make([]LogAnalyticsEndpoint, len(model.Endpoints)) + for i, n := range model.Endpoints { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Endpoints[i] = nn.(LogAnalyticsEndpoint) + } else { + m.Endpoints[i] = nil + } + } + + m.SourceProperties = make([]LogAnalyticsProperty, len(model.SourceProperties)) + for i, n := range model.SourceProperties { + m.SourceProperties[i] = n + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_label_condition.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_label_condition.go index 7b2e1213dac..7ec9b314591 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_label_condition.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_label_condition.go @@ -18,6 +18,11 @@ import ( // LogAnalyticsSourceLabelCondition LogAnalyticsSourceLabelCondition type LogAnalyticsSourceLabelCondition struct { + // String representation of the label condition. This supports specifying multiple condition blocks at various nested levels. + ConditionString *string `mandatory:"false" json:"conditionString"` + + ConditionBlock *ConditionBlock `mandatory:"false" json:"conditionBlock"` + // The message. Message *string `mandatory:"false" json:"message"` diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_pattern.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_pattern.go index dad75a985bb..df744795968 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_pattern.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_pattern.go @@ -75,6 +75,9 @@ type LogAnalyticsSourcePattern struct { // The source entity type. EntityType []string `mandatory:"false" json:"entityType"` + + // A list of pattern properties. + PatternProperties []LogAnalyticsProperty `mandatory:"false" json:"patternProperties"` } func (m LogAnalyticsSourcePattern) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_summary.go index 473f7e51152..905fcd7c138 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_analytics_source_summary.go @@ -10,6 +10,7 @@ package loganalytics import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -123,6 +124,12 @@ type LogAnalyticsSourceSummary struct { // The last updated date. TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // An array of REST API endpoints for log collection. + Endpoints []LogAnalyticsEndpoint `mandatory:"false" json:"endpoints"` + + // A list of source properties. + SourceProperties []LogAnalyticsProperty `mandatory:"false" json:"sourceProperties"` } func (m LogAnalyticsSourceSummary) String() string { @@ -140,3 +147,189 @@ func (m LogAnalyticsSourceSummary) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *LogAnalyticsSourceSummary) UnmarshalJSON(data []byte) (e error) { + model := struct { + LabelConditions []LogAnalyticsSourceLabelCondition `json:"labelConditions"` + AssociationCount *int `json:"associationCount"` + AssociationEntity []LogAnalyticsAssociation `json:"associationEntity"` + DataFilterDefinitions []LogAnalyticsSourceDataFilter `json:"dataFilterDefinitions"` + DatabaseCredential *string `json:"databaseCredential"` + ExtendedFieldDefinitions []LogAnalyticsSourceExtendedFieldDefinition `json:"extendedFieldDefinitions"` + IsForCloud *bool `json:"isForCloud"` + Labels []LogAnalyticsLabelView `json:"labels"` + MetricDefinitions []LogAnalyticsMetric `json:"metricDefinitions"` + Metrics []LogAnalyticsSourceMetric `json:"metrics"` + OobParsers []LogAnalyticsParser `json:"oobParsers"` + Parameters []LogAnalyticsParameter `json:"parameters"` + PatternCount *int `json:"patternCount"` + Patterns []LogAnalyticsSourcePattern `json:"patterns"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + EditVersion *int64 `json:"editVersion"` + Functions []LogAnalyticsSourceFunction `json:"functions"` + SourceId *int64 `json:"sourceId"` + Name *string `json:"name"` + IsSecureContent *bool `json:"isSecureContent"` + IsSystem *bool `json:"isSystem"` + Parsers []LogAnalyticsParser `json:"parsers"` + IsAutoAssociationEnabled *bool `json:"isAutoAssociationEnabled"` + IsAutoAssociationOverride *bool `json:"isAutoAssociationOverride"` + RuleId *int64 `json:"ruleId"` + TypeName *string `json:"typeName"` + TypeDisplayName *string `json:"typeDisplayName"` + WarningConfig *int64 `json:"warningConfig"` + MetadataFields []LogAnalyticsSourceMetadataField `json:"metadataFields"` + LabelDefinitions []LogAnalyticsLabelDefinition `json:"labelDefinitions"` + EntityTypes []LogAnalyticsSourceEntityType `json:"entityTypes"` + IsTimezoneOverride *bool `json:"isTimezoneOverride"` + UserParsers []LogAnalyticsParser `json:"userParsers"` + TimeUpdated *common.SDKTime `json:"timeUpdated"` + Endpoints []loganalyticsendpoint `json:"endpoints"` + SourceProperties []LogAnalyticsProperty `json:"sourceProperties"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.LabelConditions = make([]LogAnalyticsSourceLabelCondition, len(model.LabelConditions)) + for i, n := range model.LabelConditions { + m.LabelConditions[i] = n + } + + m.AssociationCount = model.AssociationCount + + m.AssociationEntity = make([]LogAnalyticsAssociation, len(model.AssociationEntity)) + for i, n := range model.AssociationEntity { + m.AssociationEntity[i] = n + } + + m.DataFilterDefinitions = make([]LogAnalyticsSourceDataFilter, len(model.DataFilterDefinitions)) + for i, n := range model.DataFilterDefinitions { + m.DataFilterDefinitions[i] = n + } + + m.DatabaseCredential = model.DatabaseCredential + + m.ExtendedFieldDefinitions = make([]LogAnalyticsSourceExtendedFieldDefinition, len(model.ExtendedFieldDefinitions)) + for i, n := range model.ExtendedFieldDefinitions { + m.ExtendedFieldDefinitions[i] = n + } + + m.IsForCloud = model.IsForCloud + + m.Labels = make([]LogAnalyticsLabelView, len(model.Labels)) + for i, n := range model.Labels { + m.Labels[i] = n + } + + m.MetricDefinitions = make([]LogAnalyticsMetric, len(model.MetricDefinitions)) + for i, n := range model.MetricDefinitions { + m.MetricDefinitions[i] = n + } + + m.Metrics = make([]LogAnalyticsSourceMetric, len(model.Metrics)) + for i, n := range model.Metrics { + m.Metrics[i] = n + } + + m.OobParsers = make([]LogAnalyticsParser, len(model.OobParsers)) + for i, n := range model.OobParsers { + m.OobParsers[i] = n + } + + m.Parameters = make([]LogAnalyticsParameter, len(model.Parameters)) + for i, n := range model.Parameters { + m.Parameters[i] = n + } + + m.PatternCount = model.PatternCount + + m.Patterns = make([]LogAnalyticsSourcePattern, len(model.Patterns)) + for i, n := range model.Patterns { + m.Patterns[i] = n + } + + m.Description = model.Description + + m.DisplayName = model.DisplayName + + m.EditVersion = model.EditVersion + + m.Functions = make([]LogAnalyticsSourceFunction, len(model.Functions)) + for i, n := range model.Functions { + m.Functions[i] = n + } + + m.SourceId = model.SourceId + + m.Name = model.Name + + m.IsSecureContent = model.IsSecureContent + + m.IsSystem = model.IsSystem + + m.Parsers = make([]LogAnalyticsParser, len(model.Parsers)) + for i, n := range model.Parsers { + m.Parsers[i] = n + } + + m.IsAutoAssociationEnabled = model.IsAutoAssociationEnabled + + m.IsAutoAssociationOverride = model.IsAutoAssociationOverride + + m.RuleId = model.RuleId + + m.TypeName = model.TypeName + + m.TypeDisplayName = model.TypeDisplayName + + m.WarningConfig = model.WarningConfig + + m.MetadataFields = make([]LogAnalyticsSourceMetadataField, len(model.MetadataFields)) + for i, n := range model.MetadataFields { + m.MetadataFields[i] = n + } + + m.LabelDefinitions = make([]LogAnalyticsLabelDefinition, len(model.LabelDefinitions)) + for i, n := range model.LabelDefinitions { + m.LabelDefinitions[i] = n + } + + m.EntityTypes = make([]LogAnalyticsSourceEntityType, len(model.EntityTypes)) + for i, n := range model.EntityTypes { + m.EntityTypes[i] = n + } + + m.IsTimezoneOverride = model.IsTimezoneOverride + + m.UserParsers = make([]LogAnalyticsParser, len(model.UserParsers)) + for i, n := range model.UserParsers { + m.UserParsers[i] = n + } + + m.TimeUpdated = model.TimeUpdated + + m.Endpoints = make([]LogAnalyticsEndpoint, len(model.Endpoints)) + for i, n := range model.Endpoints { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Endpoints[i] = nn.(LogAnalyticsEndpoint) + } else { + m.Endpoints[i] = nil + } + } + + m.SourceProperties = make([]LogAnalyticsProperty, len(model.SourceProperties)) + for i, n := range model.SourceProperties { + m.SourceProperties[i] = n + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_endpoint.go new file mode 100644 index 00000000000..7ebcd727e59 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_endpoint.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LogEndpoint An endpoint used to fetch logs. +type LogEndpoint struct { + + // The endpoint name. + Name *string `mandatory:"true" json:"name"` + + Request *EndpointRequest `mandatory:"true" json:"request"` + + // The endpoint description. + Description *string `mandatory:"false" json:"description"` + + // The endpoint model. + Model *string `mandatory:"false" json:"model"` + + // The endpoint unique identifier. + EndpointId *int64 `mandatory:"false" json:"endpointId"` + + Response *EndpointResponse `mandatory:"false" json:"response"` + + Credentials *EndpointCredentials `mandatory:"false" json:"credentials"` + + Proxy *EndpointProxy `mandatory:"false" json:"proxy"` + + // A flag indicating whether or not the endpoint is enabled for log collection. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // The system flag. A value of false denotes a custom, or user + // defined endpoint. A value of true denotes an Oracle defined endpoint. + IsSystem *bool `mandatory:"false" json:"isSystem"` + + // A list of endpoint properties. + EndpointProperties []LogAnalyticsProperty `mandatory:"false" json:"endpointProperties"` +} + +func (m LogEndpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LogEndpoint) 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/loganalytics/log_list_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_list_endpoint.go new file mode 100644 index 00000000000..503ad991bd9 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_list_endpoint.go @@ -0,0 +1,66 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LogListEndpoint An endpoint used to fetch a list of log URLs. +type LogListEndpoint struct { + + // The endpoint name. + Name *string `mandatory:"true" json:"name"` + + Request *EndpointRequest `mandatory:"true" json:"request"` + + // The endpoint description. + Description *string `mandatory:"false" json:"description"` + + // The endpoint model. + Model *string `mandatory:"false" json:"model"` + + // The endpoint unique identifier. + EndpointId *int64 `mandatory:"false" json:"endpointId"` + + Response *EndpointResponse `mandatory:"false" json:"response"` + + Credentials *EndpointCredentials `mandatory:"false" json:"credentials"` + + Proxy *EndpointProxy `mandatory:"false" json:"proxy"` + + // A flag indicating whether or not the endpoint is enabled for log collection. + IsEnabled *bool `mandatory:"false" json:"isEnabled"` + + // The system flag. A value of false denotes a custom, or user + // defined endpoint. A value of true denotes an Oracle defined endpoint. + IsSystem *bool `mandatory:"false" json:"isSystem"` + + // A list of endpoint properties. + EndpointProperties []LogAnalyticsProperty `mandatory:"false" json:"endpointProperties"` +} + +func (m LogListEndpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LogListEndpoint) 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/loganalytics/log_list_type_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_list_type_endpoint.go new file mode 100644 index 00000000000..5d104116aa8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_list_type_endpoint.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LogListTypeEndpoint The LOG_LIST type endpoint configuration. The list of logs is first fetched using the listEndpoint configuration, +// and then the logs are subsequently fetched using the logEndpoints, which reference the list endpoint response. +// For time based incremental collection, specify the START_TIME macro with the desired time format, +// example: {START_TIME:yyMMddHHmmssZ}. +// For offset based incremental collection, specify the START_OFFSET macro with offset identifier in the API response, +// example: {START_OFFSET:$.offset} +type LogListTypeEndpoint struct { + ListEndpoint *LogListEndpoint `mandatory:"true" json:"listEndpoint"` + + // Log endpoints, which reference the listEndpoint response, to fetch log data. + LogEndpoints []LogEndpoint `mandatory:"true" json:"logEndpoints"` +} + +func (m LogListTypeEndpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LogListTypeEndpoint) 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 LogListTypeEndpoint) MarshalJSON() (buff []byte, e error) { + type MarshalTypeLogListTypeEndpoint LogListTypeEndpoint + s := struct { + DiscriminatorParam string `json:"endpointType"` + MarshalTypeLogListTypeEndpoint + }{ + "LOG_LIST", + (MarshalTypeLogListTypeEndpoint)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_type_endpoint.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_type_endpoint.go new file mode 100644 index 00000000000..a027d5687fb --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/log_type_endpoint.go @@ -0,0 +1,56 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// LogTypeEndpoint The LOG type endpoint configuration. Logs are fetched from the specified endpoint. +// For time based incremental collection, specify the START_TIME macro with the desired time format, +// example: {START_TIME:yyMMddHHmmssZ}. +// For offset based incremental collection, specify the START_OFFSET macro with offset identifier in the API response, +// example: {START_OFFSET:$.offset} +type LogTypeEndpoint struct { + LogEndpoint *LogEndpoint `mandatory:"true" json:"logEndpoint"` +} + +func (m LogTypeEndpoint) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m LogTypeEndpoint) 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 LogTypeEndpoint) MarshalJSON() (buff []byte, e error) { + type MarshalTypeLogTypeEndpoint LogTypeEndpoint + s := struct { + DiscriminatorParam string `json:"endpointType"` + MarshalTypeLogTypeEndpoint + }{ + "LOG", + (MarshalTypeLogTypeEndpoint)(m), + } + + return json.Marshal(&s) +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/loganalytics_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/loganalytics_client.go index b616e456f44..efa0e8555b8 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/loganalytics_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/loganalytics_client.go @@ -4704,7 +4704,7 @@ func (client LogAnalyticsClient) getParserSummary(ctx context.Context, request c return response, err } -// GetPreferences Lists the preferences of the tenant. Currently, only "DEFAULT_HOMEPAGE" is supported. +// GetPreferences Lists the tenant preferences such as DEFAULT_HOMEPAGE and collection properties. // // See also // @@ -4879,6 +4879,180 @@ func (client LogAnalyticsClient) getQueryWorkRequest(ctx context.Context, reques return response, err } +// GetRecallCount This API gets the number of recalls made and the maximum recalls that can be made +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/GetRecallCount.go.html to see an example of how to use GetRecallCount API. +// A default retry strategy applies to this operation GetRecallCount() +func (client LogAnalyticsClient) GetRecallCount(ctx context.Context, request GetRecallCountRequest) (response GetRecallCountResponse, 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.getRecallCount, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetRecallCountResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetRecallCountResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetRecallCountResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRecallCountResponse") + } + return +} + +// getRecallCount implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) getRecallCount(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/namespaces/{namespaceName}/storage/recallCount", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetRecallCountResponse + 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/logan-api-spec/20200601/Storage/GetRecallCount" + err = common.PostProcessServiceError(err, "LogAnalytics", "GetRecallCount", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetRecalledDataSize This API gets the datasize of recalls for a given timeframe +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/GetRecalledDataSize.go.html to see an example of how to use GetRecalledDataSize API. +// A default retry strategy applies to this operation GetRecalledDataSize() +func (client LogAnalyticsClient) GetRecalledDataSize(ctx context.Context, request GetRecalledDataSizeRequest) (response GetRecalledDataSizeResponse, 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.getRecalledDataSize, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetRecalledDataSizeResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetRecalledDataSizeResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetRecalledDataSizeResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRecalledDataSizeResponse") + } + return +} + +// getRecalledDataSize implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) getRecalledDataSize(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/namespaces/{namespaceName}/storage/recalledDataSize", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetRecalledDataSizeResponse + 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/logan-api-spec/20200601/Storage/GetRecalledDataSize" + err = common.PostProcessServiceError(err, "LogAnalytics", "GetRecalledDataSize", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + +// GetRulesSummary Returns the count of detection rules in a compartment. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/GetRulesSummary.go.html to see an example of how to use GetRulesSummary API. +// A default retry strategy applies to this operation GetRulesSummary() +func (client LogAnalyticsClient) GetRulesSummary(ctx context.Context, request GetRulesSummaryRequest) (response GetRulesSummaryResponse, 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.getRulesSummary, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetRulesSummaryResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetRulesSummaryResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetRulesSummaryResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetRulesSummaryResponse") + } + return +} + +// getRulesSummary implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) getRulesSummary(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/namespaces/{namespaceName}/rulesSummary", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetRulesSummaryResponse + 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/logan-api-spec/20200601/Rule/GetRulesSummary" + err = common.PostProcessServiceError(err, "LogAnalytics", "GetRulesSummary", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetScheduledTask Get the scheduled task for the specified task identifier. // // See also @@ -5757,6 +5931,64 @@ func (client LogAnalyticsClient) listConfigWorkRequests(ctx context.Context, req return response, err } +// ListEffectiveProperties Returns a list of effective properties for the specified resource. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ListEffectiveProperties.go.html to see an example of how to use ListEffectiveProperties API. +// A default retry strategy applies to this operation ListEffectiveProperties() +func (client LogAnalyticsClient) ListEffectiveProperties(ctx context.Context, request ListEffectivePropertiesRequest) (response ListEffectivePropertiesResponse, 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.listEffectiveProperties, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListEffectivePropertiesResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListEffectivePropertiesResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListEffectivePropertiesResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListEffectivePropertiesResponse") + } + return +} + +// listEffectiveProperties implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) listEffectiveProperties(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/namespaces/{namespaceName}/effectiveProperties", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListEffectivePropertiesResponse + 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/logan-api-spec/20200601/LogAnalyticsProperty/ListEffectiveProperties" + err = common.PostProcessServiceError(err, "LogAnalytics", "ListEffectiveProperties", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListEncryptionKeyInfo This API returns the list of customer owned encryption key info. // // See also @@ -6797,6 +7029,64 @@ func (client LogAnalyticsClient) listNamespaces(ctx context.Context, request com return response, err } +// ListOverlappingRecalls This API gets the list of overlapping recalls made in the given timeframe +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ListOverlappingRecalls.go.html to see an example of how to use ListOverlappingRecalls API. +// A default retry strategy applies to this operation ListOverlappingRecalls() +func (client LogAnalyticsClient) ListOverlappingRecalls(ctx context.Context, request ListOverlappingRecallsRequest) (response ListOverlappingRecallsResponse, 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.listOverlappingRecalls, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListOverlappingRecallsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListOverlappingRecallsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListOverlappingRecallsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListOverlappingRecallsResponse") + } + return +} + +// listOverlappingRecalls implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) listOverlappingRecalls(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/namespaces/{namespaceName}/storage/overlappingRecalls", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListOverlappingRecallsResponse + 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/logan-api-spec/20200601/Storage/ListOverlappingRecalls" + err = common.PostProcessServiceError(err, "LogAnalytics", "ListOverlappingRecalls", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListParserFunctions Lists the parser functions defined for the specified parser. // // See also @@ -6971,6 +7261,64 @@ func (client LogAnalyticsClient) listParsers(ctx context.Context, request common return response, err } +// ListPropertiesMetadata Returns a list of properties along with their metadata. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ListPropertiesMetadata.go.html to see an example of how to use ListPropertiesMetadata API. +// A default retry strategy applies to this operation ListPropertiesMetadata() +func (client LogAnalyticsClient) ListPropertiesMetadata(ctx context.Context, request ListPropertiesMetadataRequest) (response ListPropertiesMetadataResponse, 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.listPropertiesMetadata, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListPropertiesMetadataResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListPropertiesMetadataResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListPropertiesMetadataResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListPropertiesMetadataResponse") + } + return +} + +// listPropertiesMetadata implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) listPropertiesMetadata(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/namespaces/{namespaceName}/propertiesMetadata", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListPropertiesMetadataResponse + 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/logan-api-spec/20200601/LogAnalyticsProperty/ListPropertiesMetadata" + err = common.PostProcessServiceError(err, "LogAnalytics", "ListPropertiesMetadata", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListQueryWorkRequests List active asynchronous queries. // // See also @@ -8986,7 +9334,7 @@ func (client LogAnalyticsClient) removeEntityAssociations(ctx context.Context, r return response, err } -// RemovePreferences Removes the tenant preferences. Currently, only "DEFAULT_HOMEPAGE" is supported. +// RemovePreferences Removes the tenant preferences such as DEFAULT_HOMEPAGE and collection properties. // // See also // @@ -10098,7 +10446,7 @@ func (client LogAnalyticsClient) updateLookupData(ctx context.Context, request c return response, err } -// UpdatePreferences Updates the tenant preferences. Currently, only "DEFAULT_HOMEPAGE" is supported. +// UpdatePreferences Updates the tenant preferences such as DEFAULT_HOMEPAGE and collection properties. // // See also // @@ -10883,6 +11231,66 @@ func (client LogAnalyticsClient) validateAssociationParameters(ctx context.Conte return response, err } +// ValidateEndpoint Validates the REST endpoint configuration. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ValidateEndpoint.go.html to see an example of how to use ValidateEndpoint API. +// A default retry strategy applies to this operation ValidateEndpoint() +func (client LogAnalyticsClient) ValidateEndpoint(ctx context.Context, request ValidateEndpointRequest) (response ValidateEndpointResponse, 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.validateEndpoint, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ValidateEndpointResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ValidateEndpointResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ValidateEndpointResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ValidateEndpointResponse") + } + return +} + +// validateEndpoint implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) validateEndpoint(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + if !common.IsEnvVarFalse(common.UsingExpectHeaderEnvVar) { + extraHeaders["Expect"] = "100-continue" + } + httpRequest, err := request.HTTPRequest(http.MethodPost, "/namespaces/{namespaceName}/sources/actions/validateEndpoint", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ValidateEndpointResponse + 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/logan-api-spec/20200601/LogAnalyticsSource/ValidateEndpoint" + err = common.PostProcessServiceError(err, "LogAnalytics", "ValidateEndpoint", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ValidateFile Validates a log file to check whether it is eligible to be uploaded or not. // // See also @@ -10941,6 +11349,70 @@ func (client LogAnalyticsClient) validateFile(ctx context.Context, request commo return response, err } +// ValidateLabelCondition Validates specified condition for a source label. If both conditionString +// and conditionBlocks are specified, they would be validated to ensure they represent +// identical conditions. If one of them is input, the response would include the validated +// representation of the other structure too. Additionally, if field values +// are passed, the condition specification would be evaluated against them. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ValidateLabelCondition.go.html to see an example of how to use ValidateLabelCondition API. +// A default retry strategy applies to this operation ValidateLabelCondition() +func (client LogAnalyticsClient) ValidateLabelCondition(ctx context.Context, request ValidateLabelConditionRequest) (response ValidateLabelConditionResponse, 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.validateLabelCondition, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ValidateLabelConditionResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ValidateLabelConditionResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ValidateLabelConditionResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ValidateLabelConditionResponse") + } + return +} + +// validateLabelCondition implements the OCIOperation interface (enables retrying operations) +func (client LogAnalyticsClient) validateLabelCondition(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + if !common.IsEnvVarFalse(common.UsingExpectHeaderEnvVar) { + extraHeaders["Expect"] = "100-continue" + } + httpRequest, err := request.HTTPRequest(http.MethodPost, "/namespaces/{namespaceName}/sources/actions/validateLabelCondition", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ValidateLabelConditionResponse + 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/logan-api-spec/20200601/LogAnalyticsSource/ValidateLabelCondition" + err = common.PostProcessServiceError(err, "LogAnalytics", "ValidateLabelCondition", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ValidateSource Checks if the specified input is a valid log source definition. // // See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/name_value_pair.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/name_value_pair.go new file mode 100644 index 00000000000..52779346ca7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/name_value_pair.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NameValuePair An object representing a name-value pair. +type NameValuePair struct { + + // The name. + Name *string `mandatory:"true" json:"name"` + + // The value. + Value *string `mandatory:"false" json:"value"` +} + +func (m NameValuePair) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NameValuePair) 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/loganalytics/namespace.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/namespace.go index 89653dad288..c1e46a5128c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/namespace.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/namespace.go @@ -15,7 +15,7 @@ import ( "strings" ) -// Namespace This is the namespace details of a tenancy in Logan Analytics application +// Namespace This is the namespace details of a tenancy in Logging Analytics application type Namespace struct { // This is the namespace name of a tenancy diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/namespace_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/namespace_summary.go index 92f924481c7..8e4ab81fb5e 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/namespace_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/namespace_summary.go @@ -15,7 +15,7 @@ import ( "strings" ) -// NamespaceSummary The is the namespace summary of a tenancy in Logan Analytics application +// NamespaceSummary The is the namespace summary of a tenancy in Logging Analytics application type NamespaceSummary struct { // This is the namespace name of a tenancy diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/outlier_command_descriptor.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/outlier_command_descriptor.go new file mode 100644 index 00000000000..f294f9770a2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/outlier_command_descriptor.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OutlierCommandDescriptor Command descriptor for querylanguage OUTLIER command. +type OutlierCommandDescriptor struct { + + // Command fragment display string from user specified query string formatted by query builder. + DisplayQueryString *string `mandatory:"true" json:"displayQueryString"` + + // Command fragment internal string from user specified query string formatted by query builder. + InternalQueryString *string `mandatory:"true" json:"internalQueryString"` + + // querylanguage command designation for example; reporting vs filtering + Category *string `mandatory:"false" json:"category"` + + // Fields referenced in command fragment from user specified query string. + ReferencedFields []AbstractField `mandatory:"false" json:"referencedFields"` + + // Fields declared in command fragment from user specified query string. + DeclaredFields []AbstractField `mandatory:"false" json:"declaredFields"` + + // Field denoting if this is a hidden command that is not shown in the query string. + IsHidden *bool `mandatory:"false" json:"isHidden"` +} + +//GetDisplayQueryString returns DisplayQueryString +func (m OutlierCommandDescriptor) GetDisplayQueryString() *string { + return m.DisplayQueryString +} + +//GetInternalQueryString returns InternalQueryString +func (m OutlierCommandDescriptor) GetInternalQueryString() *string { + return m.InternalQueryString +} + +//GetCategory returns Category +func (m OutlierCommandDescriptor) GetCategory() *string { + return m.Category +} + +//GetReferencedFields returns ReferencedFields +func (m OutlierCommandDescriptor) GetReferencedFields() []AbstractField { + return m.ReferencedFields +} + +//GetDeclaredFields returns DeclaredFields +func (m OutlierCommandDescriptor) GetDeclaredFields() []AbstractField { + return m.DeclaredFields +} + +//GetIsHidden returns IsHidden +func (m OutlierCommandDescriptor) GetIsHidden() *bool { + return m.IsHidden +} + +func (m OutlierCommandDescriptor) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OutlierCommandDescriptor) 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 OutlierCommandDescriptor) MarshalJSON() (buff []byte, e error) { + type MarshalTypeOutlierCommandDescriptor OutlierCommandDescriptor + s := struct { + DiscriminatorParam string `json:"name"` + MarshalTypeOutlierCommandDescriptor + }{ + "OUTLIER", + (MarshalTypeOutlierCommandDescriptor)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *OutlierCommandDescriptor) UnmarshalJSON(data []byte) (e error) { + model := struct { + Category *string `json:"category"` + ReferencedFields []abstractfield `json:"referencedFields"` + DeclaredFields []abstractfield `json:"declaredFields"` + IsHidden *bool `json:"isHidden"` + DisplayQueryString *string `json:"displayQueryString"` + InternalQueryString *string `json:"internalQueryString"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Category = model.Category + + m.ReferencedFields = make([]AbstractField, len(model.ReferencedFields)) + for i, n := range model.ReferencedFields { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ReferencedFields[i] = nn.(AbstractField) + } else { + m.ReferencedFields[i] = nil + } + } + + m.DeclaredFields = make([]AbstractField, len(model.DeclaredFields)) + for i, n := range model.DeclaredFields { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.DeclaredFields[i] = nn.(AbstractField) + } else { + m.DeclaredFields[i] = nil + } + } + + m.IsHidden = model.IsHidden + + m.DisplayQueryString = model.DisplayQueryString + + m.InternalQueryString = model.InternalQueryString + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/overlapping_recall_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/overlapping_recall_collection.go new file mode 100644 index 00000000000..c73843bd131 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/overlapping_recall_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OverlappingRecallCollection This is the list of overlapping recall requests +type OverlappingRecallCollection struct { + + // This is the array of overlapping recall requests + Items []OverlappingRecallSummary `mandatory:"true" json:"items"` +} + +func (m OverlappingRecallCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OverlappingRecallCollection) 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/loganalytics/overlapping_recall_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/overlapping_recall_summary.go new file mode 100644 index 00000000000..a03ee863faa --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/overlapping_recall_summary.go @@ -0,0 +1,63 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// OverlappingRecallSummary This is the information about overlapping recall requests +type OverlappingRecallSummary struct { + + // This is the start of the time range of the archival data + TimeDataStarted *common.SDKTime `mandatory:"true" json:"timeDataStarted"` + + // This is the end of the time range of the archival data + TimeDataEnded *common.SDKTime `mandatory:"true" json:"timeDataEnded"` + + // This is the time when the recall operation was started for this recall request + TimeStarted *common.SDKTime `mandatory:"true" json:"timeStarted"` + + // This is the status of the recall + Status RecallStatusEnum `mandatory:"true" json:"status"` + + // This is the purpose of the recall + Purpose *string `mandatory:"true" json:"purpose"` + + // This is the query associated with the recall + QueryString *string `mandatory:"true" json:"queryString"` + + // This is the list of logsets associated with this recall + LogSets *string `mandatory:"true" json:"logSets"` + + // This is the user who initiated the recall request + CreatedBy *string `mandatory:"true" json:"createdBy"` +} + +func (m OverlappingRecallSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m OverlappingRecallSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingRecallStatusEnum(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(GetRecallStatusEnumStringValues(), ","))) + } + + 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/loganalytics/pattern_override.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/pattern_override.go new file mode 100644 index 00000000000..852e3d9cc87 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/pattern_override.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PatternOverride Details of pattern level override for a property. +type PatternOverride struct { + + // The pattern id. + Id *string `mandatory:"true" json:"id"` + + // The value of the property. + Value *string `mandatory:"true" json:"value"` + + // The effective level of the property value. + EffectiveLevel *string `mandatory:"false" json:"effectiveLevel"` +} + +func (m PatternOverride) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PatternOverride) 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/loganalytics/property_metadata_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/property_metadata_summary.go new file mode 100644 index 00000000000..cebda6f8a10 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/property_metadata_summary.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PropertyMetadataSummary Summary of property metadata details. +type PropertyMetadataSummary struct { + + // The property name. + Name *string `mandatory:"false" json:"name"` + + // The property display name. + DisplayName *string `mandatory:"false" json:"displayName"` + + // The property description. + Description *string `mandatory:"false" json:"description"` + + // The default property value. + DefaultValue *string `mandatory:"false" json:"defaultValue"` + + // A list of levels at which the property could be defined. + Levels []Level `mandatory:"false" json:"levels"` +} + +func (m PropertyMetadataSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PropertyMetadataSummary) 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/loganalytics/property_metadata_summary_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/property_metadata_summary_collection.go new file mode 100644 index 00000000000..2aa26cf5193 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/property_metadata_summary_collection.go @@ -0,0 +1,39 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// PropertyMetadataSummaryCollection A collection of property metadata objects. +type PropertyMetadataSummaryCollection struct { + + // An array of properties along with their metadata summary. + Items []PropertyMetadataSummary `mandatory:"false" json:"items"` +} + +func (m PropertyMetadataSummaryCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m PropertyMetadataSummaryCollection) 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/loganalytics/query_aggregation.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/query_aggregation.go index 3130c349d2c..a35ae7d1e01 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/query_aggregation.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/query_aggregation.go @@ -34,6 +34,9 @@ type QueryAggregation struct { // Explanation of why results may be partial. Only set if arePartialResults is true. PartialResultReason *string `mandatory:"false" json:"partialResultReason"` + // True if the data returned by query is hidden. + IsContentHidden *bool `mandatory:"false" json:"isContentHidden"` + // Query result columns Columns []AbstractColumn `mandatory:"false" json:"columns"` @@ -70,6 +73,7 @@ func (m *QueryAggregation) UnmarshalJSON(data []byte) (e error) { TotalMatchedCount *int64 `json:"totalMatchedCount"` ArePartialResults *bool `json:"arePartialResults"` PartialResultReason *string `json:"partialResultReason"` + IsContentHidden *bool `json:"isContentHidden"` Columns []abstractcolumn `json:"columns"` Fields []abstractcolumn `json:"fields"` Items []map[string]interface{} `json:"items"` @@ -90,6 +94,8 @@ func (m *QueryAggregation) UnmarshalJSON(data []byte) (e error) { m.PartialResultReason = model.PartialResultReason + m.IsContentHidden = model.IsContentHidden + m.Columns = make([]AbstractColumn, len(model.Columns)) for i, n := range model.Columns { nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/rare_command_descriptor.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/rare_command_descriptor.go new file mode 100644 index 00000000000..536267e0056 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/rare_command_descriptor.go @@ -0,0 +1,152 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RareCommandDescriptor Command descriptor for querylanguage RARE command. +type RareCommandDescriptor struct { + + // Command fragment display string from user specified query string formatted by query builder. + DisplayQueryString *string `mandatory:"true" json:"displayQueryString"` + + // Command fragment internal string from user specified query string formatted by query builder. + InternalQueryString *string `mandatory:"true" json:"internalQueryString"` + + // querylanguage command designation for example; reporting vs filtering + Category *string `mandatory:"false" json:"category"` + + // Fields referenced in command fragment from user specified query string. + ReferencedFields []AbstractField `mandatory:"false" json:"referencedFields"` + + // Fields declared in command fragment from user specified query string. + DeclaredFields []AbstractField `mandatory:"false" json:"declaredFields"` + + // Field denoting if this is a hidden command that is not shown in the query string. + IsHidden *bool `mandatory:"false" json:"isHidden"` +} + +//GetDisplayQueryString returns DisplayQueryString +func (m RareCommandDescriptor) GetDisplayQueryString() *string { + return m.DisplayQueryString +} + +//GetInternalQueryString returns InternalQueryString +func (m RareCommandDescriptor) GetInternalQueryString() *string { + return m.InternalQueryString +} + +//GetCategory returns Category +func (m RareCommandDescriptor) GetCategory() *string { + return m.Category +} + +//GetReferencedFields returns ReferencedFields +func (m RareCommandDescriptor) GetReferencedFields() []AbstractField { + return m.ReferencedFields +} + +//GetDeclaredFields returns DeclaredFields +func (m RareCommandDescriptor) GetDeclaredFields() []AbstractField { + return m.DeclaredFields +} + +//GetIsHidden returns IsHidden +func (m RareCommandDescriptor) GetIsHidden() *bool { + return m.IsHidden +} + +func (m RareCommandDescriptor) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RareCommandDescriptor) 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 RareCommandDescriptor) MarshalJSON() (buff []byte, e error) { + type MarshalTypeRareCommandDescriptor RareCommandDescriptor + s := struct { + DiscriminatorParam string `json:"name"` + MarshalTypeRareCommandDescriptor + }{ + "RARE", + (MarshalTypeRareCommandDescriptor)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *RareCommandDescriptor) UnmarshalJSON(data []byte) (e error) { + model := struct { + Category *string `json:"category"` + ReferencedFields []abstractfield `json:"referencedFields"` + DeclaredFields []abstractfield `json:"declaredFields"` + IsHidden *bool `json:"isHidden"` + DisplayQueryString *string `json:"displayQueryString"` + InternalQueryString *string `json:"internalQueryString"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.Category = model.Category + + m.ReferencedFields = make([]AbstractField, len(model.ReferencedFields)) + for i, n := range model.ReferencedFields { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.ReferencedFields[i] = nn.(AbstractField) + } else { + m.ReferencedFields[i] = nil + } + } + + m.DeclaredFields = make([]AbstractField, len(model.DeclaredFields)) + for i, n := range model.DeclaredFields { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.DeclaredFields[i] = nn.(AbstractField) + } else { + m.DeclaredFields[i] = nil + } + } + + m.IsHidden = model.IsHidden + + m.DisplayQueryString = model.DisplayQueryString + + m.InternalQueryString = model.InternalQueryString + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_details.go index a716f18232c..073f8cb5842 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_details.go @@ -35,6 +35,12 @@ type RecallArchivedDataDetails struct { // This is the query that identifies the recalled data. Query *string `mandatory:"false" json:"query"` + + // This is the purpose of the recall + Purpose *string `mandatory:"false" json:"purpose"` + + // This indicates if only new data has to be recalled in this recall request + IsRecallNewDataOnly *bool `mandatory:"false" json:"isRecallNewDataOnly"` } func (m RecallArchivedDataDetails) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_request_response.go index af11863ac33..21572dab222 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_request_response.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_archived_data_request_response.go @@ -89,6 +89,9 @@ type RecallArchivedDataResponse struct { // The underlying http response RawResponse *http.Response + // The RecalledDataInfo instance + RecalledDataInfo `presentIn:"body"` + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. OpcRequestId *string `presentIn:"header" name:"opc-request-id"` @@ -97,6 +100,9 @@ type RecallArchivedDataResponse struct { // URI to entity or work request created. Location *string `presentIn:"header" name:"location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` } func (response RecallArchivedDataResponse) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_count.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_count.go new file mode 100644 index 00000000000..970a2703f67 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_count.go @@ -0,0 +1,51 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RecallCount This is the recall count statistics for a given tenant +type RecallCount struct { + + // This is the total number of recalls made so far + RecallCount *int `mandatory:"true" json:"recallCount"` + + // This is the number of recalls that succeeded + RecallSucceeded *int `mandatory:"true" json:"recallSucceeded"` + + // This is the number of recalls that failed + RecallFailed *int `mandatory:"true" json:"recallFailed"` + + // This is the number of recalls in pending state + RecallPending *int `mandatory:"true" json:"recallPending"` + + // This is the maximum number of recalls (including successful and pending recalls) allowed + RecallLimit *int `mandatory:"true" json:"recallLimit"` +} + +func (m RecallCount) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RecallCount) 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/loganalytics/recall_status.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_status.go new file mode 100644 index 00000000000..f7c9e39850f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recall_status.go @@ -0,0 +1,60 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "strings" +) + +// RecallStatusEnum Enum with underlying type: string +type RecallStatusEnum string + +// Set of constants representing the allowable values for RecallStatusEnum +const ( + RecallStatusRecalled RecallStatusEnum = "RECALLED" + RecallStatusPending RecallStatusEnum = "PENDING" + RecallStatusFailed RecallStatusEnum = "FAILED" +) + +var mappingRecallStatusEnum = map[string]RecallStatusEnum{ + "RECALLED": RecallStatusRecalled, + "PENDING": RecallStatusPending, + "FAILED": RecallStatusFailed, +} + +var mappingRecallStatusEnumLowerCase = map[string]RecallStatusEnum{ + "recalled": RecallStatusRecalled, + "pending": RecallStatusPending, + "failed": RecallStatusFailed, +} + +// GetRecallStatusEnumValues Enumerates the set of values for RecallStatusEnum +func GetRecallStatusEnumValues() []RecallStatusEnum { + values := make([]RecallStatusEnum, 0) + for _, v := range mappingRecallStatusEnum { + values = append(values, v) + } + return values +} + +// GetRecallStatusEnumStringValues Enumerates the set of values in String for RecallStatusEnum +func GetRecallStatusEnumStringValues() []string { + return []string{ + "RECALLED", + "PENDING", + "FAILED", + } +} + +// GetMappingRecallStatusEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingRecallStatusEnum(val string) (RecallStatusEnum, bool) { + enum, ok := mappingRecallStatusEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data.go index b5b03024934..e152b79e75c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data.go @@ -36,6 +36,21 @@ type RecalledData struct { // This is the size in bytes StorageUsageInBytes *int64 `mandatory:"true" json:"storageUsageInBytes"` + + // This is the size of the archival data not recalled yet within the specified time range + NotRecalledDataInBytes *int64 `mandatory:"true" json:"notRecalledDataInBytes"` + + // This is the purpose of the recall + Purpose *string `mandatory:"true" json:"purpose"` + + // This is the query associated with the recall + QueryString *string `mandatory:"true" json:"queryString"` + + // This is the list of logsets associated with the recall + LogSets *string `mandatory:"true" json:"logSets"` + + // This is the user who initiated the recall request + CreatedBy *string `mandatory:"true" json:"createdBy"` } func (m RecalledData) String() string { @@ -64,16 +79,19 @@ type RecalledDataStatusEnum string const ( RecalledDataStatusRecalled RecalledDataStatusEnum = "RECALLED" RecalledDataStatusPending RecalledDataStatusEnum = "PENDING" + RecalledDataStatusFailed RecalledDataStatusEnum = "FAILED" ) var mappingRecalledDataStatusEnum = map[string]RecalledDataStatusEnum{ "RECALLED": RecalledDataStatusRecalled, "PENDING": RecalledDataStatusPending, + "FAILED": RecalledDataStatusFailed, } var mappingRecalledDataStatusEnumLowerCase = map[string]RecalledDataStatusEnum{ "recalled": RecalledDataStatusRecalled, "pending": RecalledDataStatusPending, + "failed": RecalledDataStatusFailed, } // GetRecalledDataStatusEnumValues Enumerates the set of values for RecalledDataStatusEnum @@ -90,6 +108,7 @@ func GetRecalledDataStatusEnumStringValues() []string { return []string{ "RECALLED", "PENDING", + "FAILED", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data_info.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data_info.go new file mode 100644 index 00000000000..01250b86a32 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data_info.go @@ -0,0 +1,42 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RecalledDataInfo This is the synchronous result of a recall of archived data +type RecalledDataInfo struct { + + // This is the parent name of the list of overlapping recalls + CollectionName *string `mandatory:"true" json:"collectionName"` + + // This is the recall name made for a specific purpose + Purpose *string `mandatory:"false" json:"purpose"` +} + +func (m RecalledDataInfo) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RecalledDataInfo) 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/loganalytics/recalled_data_size.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data_size.go new file mode 100644 index 00000000000..9f9f0e0bec5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/recalled_data_size.go @@ -0,0 +1,48 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RecalledDataSize This is the recall related data size for the given timeframe +type RecalledDataSize struct { + + // This is the start of the time range of the archival data + TimeDataStarted *common.SDKTime `mandatory:"true" json:"timeDataStarted"` + + // This is the end of the time range of the archival data + TimeDataEnded *common.SDKTime `mandatory:"true" json:"timeDataEnded"` + + // This is the size of the recalled data + RecalledDataInBytes *int64 `mandatory:"true" json:"recalledDataInBytes"` + + // This is the size of the archival data not recalled yet + NotRecalledDataInBytes *int64 `mandatory:"true" json:"notRecalledDataInBytes"` +} + +func (m RecalledDataSize) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RecalledDataSize) 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/loganalytics/rule_summary_report.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/rule_summary_report.go new file mode 100644 index 00000000000..40eb8dde0e2 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/rule_summary_report.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// RuleSummaryReport A summary count of detection rules. +type RuleSummaryReport struct { + + // The total count of detection rules. + TotalCount *int `mandatory:"true" json:"totalCount"` + + // The count of ingest time rules. + IngestTimeRulesCount *int `mandatory:"true" json:"ingestTimeRulesCount"` + + // The count of saved search rules. + SavedSearchRulesCount *int `mandatory:"true" json:"savedSearchRulesCount"` +} + +func (m RuleSummaryReport) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m RuleSummaryReport) 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/loganalytics/storage.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage.go index 503c5d4f3f7..2d6f09f7b2d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage.go @@ -15,7 +15,7 @@ import ( "strings" ) -// Storage This is the storage configuration and status of a tenancy in Logan Analytics application +// Storage This is the storage configuration and status of a tenancy in Logging Analytics application type Storage struct { // This indicates if old data can be archived for a tenancy diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_operation_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_operation_type.go index ddb6d5a3cb4..1326d1712d2 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_operation_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_operation_type.go @@ -22,6 +22,7 @@ const ( StorageOperationTypePurgeStorageData StorageOperationTypeEnum = "PURGE_STORAGE_DATA" StorageOperationTypeRecallArchivedStorageData StorageOperationTypeEnum = "RECALL_ARCHIVED_STORAGE_DATA" StorageOperationTypeReleaseRecalledStorageData StorageOperationTypeEnum = "RELEASE_RECALLED_STORAGE_DATA" + StorageOperationTypePurgeArchivalData StorageOperationTypeEnum = "PURGE_ARCHIVAL_DATA" StorageOperationTypeArchiveStorageData StorageOperationTypeEnum = "ARCHIVE_STORAGE_DATA" StorageOperationTypeCleanupArchivalStorageData StorageOperationTypeEnum = "CLEANUP_ARCHIVAL_STORAGE_DATA" StorageOperationTypeEncryptActiveData StorageOperationTypeEnum = "ENCRYPT_ACTIVE_DATA" @@ -33,6 +34,7 @@ var mappingStorageOperationTypeEnum = map[string]StorageOperationTypeEnum{ "PURGE_STORAGE_DATA": StorageOperationTypePurgeStorageData, "RECALL_ARCHIVED_STORAGE_DATA": StorageOperationTypeRecallArchivedStorageData, "RELEASE_RECALLED_STORAGE_DATA": StorageOperationTypeReleaseRecalledStorageData, + "PURGE_ARCHIVAL_DATA": StorageOperationTypePurgeArchivalData, "ARCHIVE_STORAGE_DATA": StorageOperationTypeArchiveStorageData, "CLEANUP_ARCHIVAL_STORAGE_DATA": StorageOperationTypeCleanupArchivalStorageData, "ENCRYPT_ACTIVE_DATA": StorageOperationTypeEncryptActiveData, @@ -44,6 +46,7 @@ var mappingStorageOperationTypeEnumLowerCase = map[string]StorageOperationTypeEn "purge_storage_data": StorageOperationTypePurgeStorageData, "recall_archived_storage_data": StorageOperationTypeRecallArchivedStorageData, "release_recalled_storage_data": StorageOperationTypeReleaseRecalledStorageData, + "purge_archival_data": StorageOperationTypePurgeArchivalData, "archive_storage_data": StorageOperationTypeArchiveStorageData, "cleanup_archival_storage_data": StorageOperationTypeCleanupArchivalStorageData, "encrypt_active_data": StorageOperationTypeEncryptActiveData, @@ -66,6 +69,7 @@ func GetStorageOperationTypeEnumStringValues() []string { "PURGE_STORAGE_DATA", "RECALL_ARCHIVED_STORAGE_DATA", "RELEASE_RECALLED_STORAGE_DATA", + "PURGE_ARCHIVAL_DATA", "ARCHIVE_STORAGE_DATA", "CLEANUP_ARCHIVAL_STORAGE_DATA", "ENCRYPT_ACTIVE_DATA", diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_usage.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_usage.go index c69f8cf53da..6efca088033 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_usage.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_usage.go @@ -15,7 +15,7 @@ import ( "strings" ) -// StorageUsage This is the storage usage information of a tenancy in Logan Analytics application +// StorageUsage This is the storage usage information of a tenancy in Logging Analytics application type StorageUsage struct { // This is the number of bytes of active data (non-archived) diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request.go index a6171bc1722..7490d53c02d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request.go @@ -80,6 +80,18 @@ type StorageWorkRequest struct { // The type of customer encryption key. It can be archival, active or all. KeyType EncryptionKeyTypeEnum `mandatory:"false" json:"keyType,omitempty"` + + // This is a list of logsets associated with this work request + LogSets *string `mandatory:"false" json:"logSets"` + + // This is the purpose of the operation associated with this work request + Purpose *string `mandatory:"false" json:"purpose"` + + // This is the query string applied on the operation associated with this work request + Query *string `mandatory:"false" json:"query"` + + // This is the flag to indicate if only new data has to be recalled in this work request + IsRecallNewDataOnly *bool `mandatory:"false" json:"isRecallNewDataOnly"` } func (m StorageWorkRequest) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request_summary.go index d14fefbbf9b..cd23dfb11d3 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/storage_work_request_summary.go @@ -80,6 +80,18 @@ type StorageWorkRequestSummary struct { // The type of customer encryption key. It can be archival, active or all. KeyType EncryptionKeyTypeEnum `mandatory:"false" json:"keyType,omitempty"` + + // This is a list of logsets associated with this work request + LogSets *string `mandatory:"false" json:"logSets"` + + // This is the purpose of the operation associated with this work request + Purpose *string `mandatory:"false" json:"purpose"` + + // This is the query string applied on the operation associated with this work request + Query *string `mandatory:"false" json:"query"` + + // This is the flag to indicate if only new data has to be recalled in this work request + IsRecallNewDataOnly *bool `mandatory:"false" json:"isRecallNewDataOnly"` } func (m StorageWorkRequestSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/table_column.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/table_column.go new file mode 100644 index 00000000000..0a4b7f82d5d --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/table_column.go @@ -0,0 +1,220 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "encoding/json" + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// TableColumn Result column that contains a table within each row. +type TableColumn struct { + + // Column display name - will be alias if column is renamed by queryStrng. + DisplayName *string `mandatory:"false" json:"displayName"` + + // If the column is a 'List of Values' column, this array contains the field values that are applicable to query results or all if no filters applied. + Values []FieldValue `mandatory:"false" json:"values"` + + // Identifies if all values in this column come from a pre-defined list of values. + IsListOfValues *bool `mandatory:"false" json:"isListOfValues"` + + // Identifies if this column allows multiple values to exist in a single row. + IsMultiValued *bool `mandatory:"false" json:"isMultiValued"` + + // A flag indicating whether or not the field is a case sensitive field. Only applies to string fields. + IsCaseSensitive *bool `mandatory:"false" json:"isCaseSensitive"` + + // Identifies if this column can be used as a grouping field in any grouping command. + IsGroupable *bool `mandatory:"false" json:"isGroupable"` + + // Identifies if this column can be used as an expression parameter in any command that accepts querylanguage expressions. + IsEvaluable *bool `mandatory:"false" json:"isEvaluable"` + + // Same as displayName unless column renamed in which case this will hold the original display name for the column. + OriginalDisplayName *string `mandatory:"false" json:"originalDisplayName"` + + // Internal identifier for the column. + InternalName *string `mandatory:"false" json:"internalName"` + + // Column descriptors for the table result. + Columns []AbstractColumn `mandatory:"false" json:"columns"` + + // Results data of the table. + Result []map[string]interface{} `mandatory:"false" json:"result"` + + // Subsystem column belongs to. + SubSystem SubSystemNameEnum `mandatory:"false" json:"subSystem,omitempty"` + + // Field denoting column data type. + ValueType ValueTypeEnum `mandatory:"false" json:"valueType,omitempty"` +} + +//GetDisplayName returns DisplayName +func (m TableColumn) GetDisplayName() *string { + return m.DisplayName +} + +//GetSubSystem returns SubSystem +func (m TableColumn) GetSubSystem() SubSystemNameEnum { + return m.SubSystem +} + +//GetValues returns Values +func (m TableColumn) GetValues() []FieldValue { + return m.Values +} + +//GetIsListOfValues returns IsListOfValues +func (m TableColumn) GetIsListOfValues() *bool { + return m.IsListOfValues +} + +//GetIsMultiValued returns IsMultiValued +func (m TableColumn) GetIsMultiValued() *bool { + return m.IsMultiValued +} + +//GetIsCaseSensitive returns IsCaseSensitive +func (m TableColumn) GetIsCaseSensitive() *bool { + return m.IsCaseSensitive +} + +//GetIsGroupable returns IsGroupable +func (m TableColumn) GetIsGroupable() *bool { + return m.IsGroupable +} + +//GetIsEvaluable returns IsEvaluable +func (m TableColumn) GetIsEvaluable() *bool { + return m.IsEvaluable +} + +//GetValueType returns ValueType +func (m TableColumn) GetValueType() ValueTypeEnum { + return m.ValueType +} + +//GetOriginalDisplayName returns OriginalDisplayName +func (m TableColumn) GetOriginalDisplayName() *string { + return m.OriginalDisplayName +} + +//GetInternalName returns InternalName +func (m TableColumn) GetInternalName() *string { + return m.InternalName +} + +func (m TableColumn) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m TableColumn) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingSubSystemNameEnum(string(m.SubSystem)); !ok && m.SubSystem != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for SubSystem: %s. Supported values are: %s.", m.SubSystem, strings.Join(GetSubSystemNameEnumStringValues(), ","))) + } + if _, ok := GetMappingValueTypeEnum(string(m.ValueType)); !ok && m.ValueType != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ValueType: %s. Supported values are: %s.", m.ValueType, strings.Join(GetValueTypeEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// MarshalJSON marshals to json representation +func (m TableColumn) MarshalJSON() (buff []byte, e error) { + type MarshalTypeTableColumn TableColumn + s := struct { + DiscriminatorParam string `json:"type"` + MarshalTypeTableColumn + }{ + "TABLE_COLUMN", + (MarshalTypeTableColumn)(m), + } + + return json.Marshal(&s) +} + +// UnmarshalJSON unmarshals from json +func (m *TableColumn) UnmarshalJSON(data []byte) (e error) { + model := struct { + DisplayName *string `json:"displayName"` + SubSystem SubSystemNameEnum `json:"subSystem"` + Values []FieldValue `json:"values"` + IsListOfValues *bool `json:"isListOfValues"` + IsMultiValued *bool `json:"isMultiValued"` + IsCaseSensitive *bool `json:"isCaseSensitive"` + IsGroupable *bool `json:"isGroupable"` + IsEvaluable *bool `json:"isEvaluable"` + ValueType ValueTypeEnum `json:"valueType"` + OriginalDisplayName *string `json:"originalDisplayName"` + InternalName *string `json:"internalName"` + Columns []abstractcolumn `json:"columns"` + Result []map[string]interface{} `json:"result"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.DisplayName = model.DisplayName + + m.SubSystem = model.SubSystem + + m.Values = make([]FieldValue, len(model.Values)) + for i, n := range model.Values { + m.Values[i] = n + } + + m.IsListOfValues = model.IsListOfValues + + m.IsMultiValued = model.IsMultiValued + + m.IsCaseSensitive = model.IsCaseSensitive + + m.IsGroupable = model.IsGroupable + + m.IsEvaluable = model.IsEvaluable + + m.ValueType = model.ValueType + + m.OriginalDisplayName = model.OriginalDisplayName + + m.InternalName = model.InternalName + + m.Columns = make([]AbstractColumn, len(model.Columns)) + for i, n := range model.Columns { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Columns[i] = nn.(AbstractColumn) + } else { + m.Columns[i] = nil + } + } + + m.Result = make([]map[string]interface{}, len(model.Result)) + for i, n := range model.Result { + m.Result[i] = n + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/task_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/task_type.go index 666d8fa1ea0..d53c6e6a6f5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/task_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/task_type.go @@ -18,24 +18,21 @@ type TaskTypeEnum string // Set of constants representing the allowable values for TaskTypeEnum const ( - TaskTypeSavedSearch TaskTypeEnum = "SAVED_SEARCH" - TaskTypeAcceleration TaskTypeEnum = "ACCELERATION" - TaskTypePurge TaskTypeEnum = "PURGE" - TaskTypeAccelerationMaintenance TaskTypeEnum = "ACCELERATION_MAINTENANCE" + TaskTypeSavedSearch TaskTypeEnum = "SAVED_SEARCH" + TaskTypeAcceleration TaskTypeEnum = "ACCELERATION" + TaskTypePurge TaskTypeEnum = "PURGE" ) var mappingTaskTypeEnum = map[string]TaskTypeEnum{ - "SAVED_SEARCH": TaskTypeSavedSearch, - "ACCELERATION": TaskTypeAcceleration, - "PURGE": TaskTypePurge, - "ACCELERATION_MAINTENANCE": TaskTypeAccelerationMaintenance, + "SAVED_SEARCH": TaskTypeSavedSearch, + "ACCELERATION": TaskTypeAcceleration, + "PURGE": TaskTypePurge, } var mappingTaskTypeEnumLowerCase = map[string]TaskTypeEnum{ - "saved_search": TaskTypeSavedSearch, - "acceleration": TaskTypeAcceleration, - "purge": TaskTypePurge, - "acceleration_maintenance": TaskTypeAccelerationMaintenance, + "saved_search": TaskTypeSavedSearch, + "acceleration": TaskTypeAcceleration, + "purge": TaskTypePurge, } // GetTaskTypeEnumValues Enumerates the set of values for TaskTypeEnum @@ -53,7 +50,6 @@ func GetTaskTypeEnumStringValues() []string { "SAVED_SEARCH", "ACCELERATION", "PURGE", - "ACCELERATION_MAINTENANCE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/trend_column.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/trend_column.go index 3df6a1ef263..97ada724156 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/trend_column.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/trend_column.go @@ -55,10 +55,13 @@ type TrendColumn struct { // Sum across all column values for a given timestamp. TotalIntervalCounts []int64 `mandatory:"false" json:"totalIntervalCounts"` + // Sum of column values for a given timestamp after applying filter. TotalIntervalCountsAfterFilter []int64 `mandatory:"false" json:"totalIntervalCountsAfterFilter"` + // Number of aggregated groups for a given timestamp. IntervalGroupCounts []int64 `mandatory:"false" json:"intervalGroupCounts"` + // Number of aggregated groups for a given timestamp after applying filter. IntervalGroupCountsAfterFilter []int64 `mandatory:"false" json:"intervalGroupCountsAfterFilter"` // Subsystem column belongs to. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/update_storage_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/update_storage_details.go index e183da9e858..cc41f95287c 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/update_storage_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/update_storage_details.go @@ -15,7 +15,7 @@ import ( "strings" ) -// UpdateStorageDetails This is the input to update storage configuration of a tenancy in Logan Analytics application +// UpdateStorageDetails This is the input to update storage configuration of a tenancy in Logging Analytics application type UpdateStorageDetails struct { ArchivingConfiguration *ArchivingConfiguration `mandatory:"true" json:"archivingConfiguration"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_association.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_association.go index afb462cb1c1..6797bd0dba1 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_association.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_association.go @@ -41,6 +41,9 @@ type UpsertLogAnalyticsAssociation struct { // The log group unique identifier. LogGroupId *string `mandatory:"false" json:"logGroupId"` + + // A list of association properties. + AssociationProperties []AssociationProperty `mandatory:"false" json:"associationProperties"` } func (m UpsertLogAnalyticsAssociation) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_source_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_source_details.go index 93c34b93208..f267ddb6deb 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_source_details.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/upsert_log_analytics_source_details.go @@ -10,6 +10,7 @@ package loganalytics import ( + "encoding/json" "fmt" "github.com/oracle/oci-go-sdk/v65/common" "strings" @@ -106,6 +107,12 @@ type UpsertLogAnalyticsSourceDetails struct { // An array of categories to assign to the source. Specifying the name attribute for each category would suffice. // Oracle-defined category assignments cannot be removed. Categories []LogAnalyticsCategory `mandatory:"false" json:"categories"` + + // An array of REST API endpoints for log collection. + Endpoints []LogAnalyticsEndpoint `mandatory:"false" json:"endpoints"` + + // A list of source properties. + SourceProperties []LogAnalyticsProperty `mandatory:"false" json:"sourceProperties"` } func (m UpsertLogAnalyticsSourceDetails) String() string { @@ -123,3 +130,171 @@ func (m UpsertLogAnalyticsSourceDetails) ValidateEnumValue() (bool, error) { } return false, nil } + +// UnmarshalJSON unmarshals from json +func (m *UpsertLogAnalyticsSourceDetails) UnmarshalJSON(data []byte) (e error) { + model := struct { + LabelConditions []LogAnalyticsSourceLabelCondition `json:"labelConditions"` + DataFilterDefinitions []LogAnalyticsSourceDataFilter `json:"dataFilterDefinitions"` + DatabaseCredential *string `json:"databaseCredential"` + ExtendedFieldDefinitions []LogAnalyticsSourceExtendedFieldDefinition `json:"extendedFieldDefinitions"` + IsForCloud *bool `json:"isForCloud"` + Labels []LogAnalyticsLabelView `json:"labels"` + MetricDefinitions []LogAnalyticsMetric `json:"metricDefinitions"` + Metrics []LogAnalyticsSourceMetric `json:"metrics"` + OobParsers []LogAnalyticsParser `json:"oobParsers"` + Parameters []LogAnalyticsParameter `json:"parameters"` + Patterns []LogAnalyticsSourcePattern `json:"patterns"` + Description *string `json:"description"` + DisplayName *string `json:"displayName"` + EditVersion *int64 `json:"editVersion"` + Functions []LogAnalyticsSourceFunction `json:"functions"` + SourceId *int64 `json:"sourceId"` + Name *string `json:"name"` + IsSecureContent *bool `json:"isSecureContent"` + IsSystem *bool `json:"isSystem"` + Parsers []LogAnalyticsParser `json:"parsers"` + RuleId *int64 `json:"ruleId"` + TypeName *string `json:"typeName"` + WarningConfig *int64 `json:"warningConfig"` + MetadataFields []LogAnalyticsSourceMetadataField `json:"metadataFields"` + LabelDefinitions []LogAnalyticsLabelDefinition `json:"labelDefinitions"` + EntityTypes []LogAnalyticsSourceEntityType `json:"entityTypes"` + IsTimezoneOverride *bool `json:"isTimezoneOverride"` + UserParsers []LogAnalyticsParser `json:"userParsers"` + Categories []LogAnalyticsCategory `json:"categories"` + Endpoints []loganalyticsendpoint `json:"endpoints"` + SourceProperties []LogAnalyticsProperty `json:"sourceProperties"` + }{} + + e = json.Unmarshal(data, &model) + if e != nil { + return + } + var nn interface{} + m.LabelConditions = make([]LogAnalyticsSourceLabelCondition, len(model.LabelConditions)) + for i, n := range model.LabelConditions { + m.LabelConditions[i] = n + } + + m.DataFilterDefinitions = make([]LogAnalyticsSourceDataFilter, len(model.DataFilterDefinitions)) + for i, n := range model.DataFilterDefinitions { + m.DataFilterDefinitions[i] = n + } + + m.DatabaseCredential = model.DatabaseCredential + + m.ExtendedFieldDefinitions = make([]LogAnalyticsSourceExtendedFieldDefinition, len(model.ExtendedFieldDefinitions)) + for i, n := range model.ExtendedFieldDefinitions { + m.ExtendedFieldDefinitions[i] = n + } + + m.IsForCloud = model.IsForCloud + + m.Labels = make([]LogAnalyticsLabelView, len(model.Labels)) + for i, n := range model.Labels { + m.Labels[i] = n + } + + m.MetricDefinitions = make([]LogAnalyticsMetric, len(model.MetricDefinitions)) + for i, n := range model.MetricDefinitions { + m.MetricDefinitions[i] = n + } + + m.Metrics = make([]LogAnalyticsSourceMetric, len(model.Metrics)) + for i, n := range model.Metrics { + m.Metrics[i] = n + } + + m.OobParsers = make([]LogAnalyticsParser, len(model.OobParsers)) + for i, n := range model.OobParsers { + m.OobParsers[i] = n + } + + m.Parameters = make([]LogAnalyticsParameter, len(model.Parameters)) + for i, n := range model.Parameters { + m.Parameters[i] = n + } + + m.Patterns = make([]LogAnalyticsSourcePattern, len(model.Patterns)) + for i, n := range model.Patterns { + m.Patterns[i] = n + } + + m.Description = model.Description + + m.DisplayName = model.DisplayName + + m.EditVersion = model.EditVersion + + m.Functions = make([]LogAnalyticsSourceFunction, len(model.Functions)) + for i, n := range model.Functions { + m.Functions[i] = n + } + + m.SourceId = model.SourceId + + m.Name = model.Name + + m.IsSecureContent = model.IsSecureContent + + m.IsSystem = model.IsSystem + + m.Parsers = make([]LogAnalyticsParser, len(model.Parsers)) + for i, n := range model.Parsers { + m.Parsers[i] = n + } + + m.RuleId = model.RuleId + + m.TypeName = model.TypeName + + m.WarningConfig = model.WarningConfig + + m.MetadataFields = make([]LogAnalyticsSourceMetadataField, len(model.MetadataFields)) + for i, n := range model.MetadataFields { + m.MetadataFields[i] = n + } + + m.LabelDefinitions = make([]LogAnalyticsLabelDefinition, len(model.LabelDefinitions)) + for i, n := range model.LabelDefinitions { + m.LabelDefinitions[i] = n + } + + m.EntityTypes = make([]LogAnalyticsSourceEntityType, len(model.EntityTypes)) + for i, n := range model.EntityTypes { + m.EntityTypes[i] = n + } + + m.IsTimezoneOverride = model.IsTimezoneOverride + + m.UserParsers = make([]LogAnalyticsParser, len(model.UserParsers)) + for i, n := range model.UserParsers { + m.UserParsers[i] = n + } + + m.Categories = make([]LogAnalyticsCategory, len(model.Categories)) + for i, n := range model.Categories { + m.Categories[i] = n + } + + m.Endpoints = make([]LogAnalyticsEndpoint, len(model.Endpoints)) + for i, n := range model.Endpoints { + nn, e = n.UnmarshalPolymorphicJSON(n.JsonData) + if e != nil { + return e + } + if nn != nil { + m.Endpoints[i] = nn.(LogAnalyticsEndpoint) + } else { + m.Endpoints[i] = nil + } + } + + m.SourceProperties = make([]LogAnalyticsProperty, len(model.SourceProperties)) + for i, n := range model.SourceProperties { + m.SourceProperties[i] = n + } + + return +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_endpoint_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_endpoint_request_response.go new file mode 100644 index 00000000000..f6c85a04c50 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_endpoint_request_response.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ValidateEndpointRequest wrapper for the ValidateEndpoint operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ValidateEndpoint.go.html to see an example of how to use ValidateEndpointRequest. +type ValidateEndpointRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // Details of the REST endpoint configuration to validate. + ValidateEndpointDetails LogAnalyticsEndpoint `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ValidateEndpointRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ValidateEndpointRequest) 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 ValidateEndpointRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ValidateEndpointRequest) 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 ValidateEndpointRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ValidateEndpointResponse wrapper for the ValidateEndpoint operation +type ValidateEndpointResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ValidateEndpointResult instance + ValidateEndpointResult `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ValidateEndpointResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ValidateEndpointResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_endpoint_result.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_endpoint_result.go new file mode 100644 index 00000000000..f5732c043df --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_endpoint_result.go @@ -0,0 +1,45 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValidateEndpointResult The result of the endpoint configuration validation +type ValidateEndpointResult struct { + + // The validation status. + Status *string `mandatory:"true" json:"status"` + + // The validation status description. + StatusDescription *string `mandatory:"false" json:"statusDescription"` + + // Validation results for each specified endpoint. + ValidationResults []EndpointResult `mandatory:"false" json:"validationResults"` +} + +func (m ValidateEndpointResult) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValidateEndpointResult) 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/loganalytics/validate_label_condition_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_label_condition_details.go new file mode 100644 index 00000000000..39ea49689e8 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_label_condition_details.go @@ -0,0 +1,44 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValidateLabelConditionDetails Required information needed to evaluate a source label condition. +type ValidateLabelConditionDetails struct { + + // String representation of the label condition to validate. + ConditionString *string `mandatory:"false" json:"conditionString"` + + ConditionBlock *ConditionBlock `mandatory:"false" json:"conditionBlock"` + + // An array of field name-value pairs to evaluate the label condition. + FieldValues []LogAnalyticsProperty `mandatory:"false" json:"fieldValues"` +} + +func (m ValidateLabelConditionDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValidateLabelConditionDetails) 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/loganalytics/validate_label_condition_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_label_condition_request_response.go new file mode 100644 index 00000000000..47c10819873 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_label_condition_request_response.go @@ -0,0 +1,92 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ValidateLabelConditionRequest wrapper for the ValidateLabelCondition operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/loganalytics/ValidateLabelCondition.go.html to see an example of how to use ValidateLabelConditionRequest. +type ValidateLabelConditionRequest struct { + + // The Logging Analytics namespace used for the request. + NamespaceName *string `mandatory:"true" contributesTo:"path" name:"namespaceName"` + + // Details of source label condition to validate. + ValidateLabelConditionDetails `contributesTo:"body"` + + // The client request ID for tracing. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ValidateLabelConditionRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ValidateLabelConditionRequest) 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 ValidateLabelConditionRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ValidateLabelConditionRequest) 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 ValidateLabelConditionRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ValidateLabelConditionResponse wrapper for the ValidateLabelCondition operation +type ValidateLabelConditionResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The ValidateLabelConditionResult instance + ValidateLabelConditionResult `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. When you contact Oracle about a specific request, provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ValidateLabelConditionResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ValidateLabelConditionResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_label_condition_result.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_label_condition_result.go new file mode 100644 index 00000000000..c06a44a427f --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/validate_label_condition_result.go @@ -0,0 +1,53 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// LogAnalytics API +// +// The LogAnalytics API for the LogAnalytics service. +// + +package loganalytics + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ValidateLabelConditionResult The result of the label condition validation +type ValidateLabelConditionResult struct { + + // String representation of the validated label condition. + ConditionString *string `mandatory:"true" json:"conditionString"` + + ConditionBlock *ConditionBlock `mandatory:"true" json:"conditionBlock"` + + // The validation status. + Status *string `mandatory:"true" json:"status"` + + // Field values against which the label condition was evaluated. + FieldValues []LogAnalyticsProperty `mandatory:"false" json:"fieldValues"` + + // The validation status description. + StatusDescription *string `mandatory:"false" json:"statusDescription"` + + // The result of evaluating the condition blocks against the specified field values. Either true or false. + EvaluationResult *bool `mandatory:"false" json:"evaluationResult"` +} + +func (m ValidateLabelConditionResult) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ValidateLabelConditionResult) 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/loganalytics/value_type.go b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/value_type.go index 710765ac84c..003aae9c81b 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/value_type.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/loganalytics/value_type.go @@ -26,6 +26,7 @@ const ( ValueTypeInteger ValueTypeEnum = "INTEGER" ValueTypeTimestamp ValueTypeEnum = "TIMESTAMP" ValueTypeFacet ValueTypeEnum = "FACET" + ValueTypeTable ValueTypeEnum = "TABLE" ) var mappingValueTypeEnum = map[string]ValueTypeEnum{ @@ -37,6 +38,7 @@ var mappingValueTypeEnum = map[string]ValueTypeEnum{ "INTEGER": ValueTypeInteger, "TIMESTAMP": ValueTypeTimestamp, "FACET": ValueTypeFacet, + "TABLE": ValueTypeTable, } var mappingValueTypeEnumLowerCase = map[string]ValueTypeEnum{ @@ -48,6 +50,7 @@ var mappingValueTypeEnumLowerCase = map[string]ValueTypeEnum{ "integer": ValueTypeInteger, "timestamp": ValueTypeTimestamp, "facet": ValueTypeFacet, + "table": ValueTypeTable, } // GetValueTypeEnumValues Enumerates the set of values for ValueTypeEnum @@ -70,6 +73,7 @@ func GetValueTypeEnumStringValues() []string { "INTEGER", "TIMESTAMP", "FACET", + "TABLE", } } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/change_news_report_compartment_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/change_news_report_compartment_details.go new file mode 100644 index 00000000000..64a20e8c360 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/change_news_report_compartment_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// ChangeNewsReportCompartmentDetails The information to be updated. +type ChangeNewsReportCompartmentDetails struct { + + // The OCID of the compartment into which the resource will be moved. + CompartmentId *string `mandatory:"true" json:"compartmentId"` +} + +func (m ChangeNewsReportCompartmentDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m ChangeNewsReportCompartmentDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/change_news_report_compartment_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/change_news_report_compartment_request_response.go new file mode 100644 index 00000000000..7b4d57a25d6 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/change_news_report_compartment_request_response.go @@ -0,0 +1,106 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ChangeNewsReportCompartmentRequest wrapper for the ChangeNewsReportCompartment operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ChangeNewsReportCompartment.go.html to see an example of how to use ChangeNewsReportCompartmentRequest. +type ChangeNewsReportCompartmentRequest struct { + + // Unique news report identifier. + NewsReportId *string `mandatory:"true" contributesTo:"path" name:"newsReportId"` + + // The information to be updated. + ChangeNewsReportCompartmentDetails `contributesTo:"body"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + 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 ChangeNewsReportCompartmentRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ChangeNewsReportCompartmentRequest) 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 ChangeNewsReportCompartmentRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ChangeNewsReportCompartmentRequest) 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 ChangeNewsReportCompartmentRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ChangeNewsReportCompartmentResponse wrapper for the ChangeNewsReportCompartment operation +type ChangeNewsReportCompartmentResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response ChangeNewsReportCompartmentResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ChangeNewsReportCompartmentResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/create_news_report_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/create_news_report_details.go new file mode 100644 index 00000000000..4d3e7a05451 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/create_news_report_details.go @@ -0,0 +1,78 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// CreateNewsReportDetails The information about the news report to be created. +type CreateNewsReportDetails struct { + + // The news report name. + Name *string `mandatory:"true" json:"name"` + + // News report frequency. + NewsFrequency NewsFrequencyEnum `mandatory:"true" json:"newsFrequency"` + + // The description of the news report. + Description *string `mandatory:"true" json:"description"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. + OnsTopicId *string `mandatory:"true" json:"onsTopicId"` + + // Compartment Identifier where the news report will be created. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + ContentTypes *NewsContentTypes `mandatory:"true" json:"contentTypes"` + + // Language of the news report. + Locale NewsLocaleEnum `mandatory:"true" json:"locale"` + + // 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"` + + // Defines if the news report will be enabled or disabled. + Status ResourceStatusEnum `mandatory:"false" json:"status,omitempty"` +} + +func (m CreateNewsReportDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m CreateNewsReportDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNewsFrequencyEnum(string(m.NewsFrequency)); !ok && m.NewsFrequency != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NewsFrequency: %s. Supported values are: %s.", m.NewsFrequency, strings.Join(GetNewsFrequencyEnumStringValues(), ","))) + } + if _, ok := GetMappingNewsLocaleEnum(string(m.Locale)); !ok && m.Locale != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Locale: %s. Supported values are: %s.", m.Locale, strings.Join(GetNewsLocaleEnumStringValues(), ","))) + } + + if _, ok := GetMappingResourceStatusEnum(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(GetResourceStatusEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/create_news_report_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/create_news_report_request_response.go new file mode 100644 index 00000000000..e115aa07c04 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/create_news_report_request_response.go @@ -0,0 +1,110 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// CreateNewsReportRequest wrapper for the CreateNewsReport operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/CreateNewsReport.go.html to see an example of how to use CreateNewsReportRequest. +type CreateNewsReportRequest struct { + + // Details for the news report that will be created in Operations Insights. + CreateNewsReportDetails `contributesTo:"body"` + + // A token that uniquely identifies a request that can be retried in case of a timeout or + // server error without risk of executing the same action again. Retry tokens expire after 24 + // hours. + // *Note:* Retry tokens can be invalidated before the 24 hour time limit due to conflicting + // operations, such as a resource being deleted or purged from the system. + 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. + 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 CreateNewsReportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request CreateNewsReportRequest) 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 CreateNewsReportRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request CreateNewsReportRequest) 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 CreateNewsReportRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// CreateNewsReportResponse wrapper for the CreateNewsReport operation +type CreateNewsReportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NewsReport instance + NewsReport `presentIn:"body"` + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // URI of the resource + Location *string `presentIn:"header" name:"location"` + + // URI of the resource + ContentLocation *string `presentIn:"header" name:"content-location"` + + // For optimistic concurrency control. See `if-match`. + Etag *string `presentIn:"header" name:"etag"` +} + +func (response CreateNewsReportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response CreateNewsReportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go index b339831bb16..69eaddd71df 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/data_object_column_metadata.go @@ -27,7 +27,7 @@ type DataObjectColumnMetadata struct { // Category of the column. Category DataObjectColumnMetadataCategoryEnum `mandatory:"false" json:"category,omitempty"` - // Type of a data object column. + // Type name of a data object column. DataTypeName DataObjectColumnMetadataDataTypeNameEnum `mandatory:"false" json:"dataTypeName,omitempty"` // Display name of the column. diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/delete_news_report_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/delete_news_report_request_response.go new file mode 100644 index 00000000000..8d2247bab1b --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/delete_news_report_request_response.go @@ -0,0 +1,96 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// DeleteNewsReportRequest wrapper for the DeleteNewsReport operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DeleteNewsReport.go.html to see an example of how to use DeleteNewsReportRequest. +type DeleteNewsReportRequest struct { + + // Unique news report identifier. + NewsReportId *string `mandatory:"true" contributesTo:"path" name:"newsReportId"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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. + 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 DeleteNewsReportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request DeleteNewsReportRequest) 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 DeleteNewsReportRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request DeleteNewsReportRequest) 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 DeleteNewsReportRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// DeleteNewsReportResponse wrapper for the DeleteNewsReport operation +type DeleteNewsReportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response DeleteNewsReportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response DeleteNewsReportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insight_resource_forecast_trend_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insight_resource_forecast_trend_summary.go index 68bf81acbfe..13c1c427eae 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insight_resource_forecast_trend_summary.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/exadata_insight_resource_forecast_trend_summary.go @@ -37,6 +37,9 @@ type ExadataInsightResourceForecastTrendSummary struct { // Time series data result of the forecasting analysis. ProjectedData []ProjectedDataItem `mandatory:"true" json:"projectedData"` + + // Auto-ML algorithm leveraged for the forecast. Only applicable for Auto-ML forecast. + SelectedForecastAlgorithm *string `mandatory:"false" json:"selectedForecastAlgorithm"` } func (m ExadataInsightResourceForecastTrendSummary) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/get_news_report_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/get_news_report_request_response.go new file mode 100644 index 00000000000..9a79e5382f5 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/get_news_report_request_response.go @@ -0,0 +1,94 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// GetNewsReportRequest wrapper for the GetNewsReport operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetNewsReport.go.html to see an example of how to use GetNewsReportRequest. +type GetNewsReportRequest struct { + + // Unique news report identifier. + NewsReportId *string `mandatory:"true" contributesTo:"path" name:"newsReportId"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request GetNewsReportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request GetNewsReportRequest) 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 GetNewsReportRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request GetNewsReportRequest) 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 GetNewsReportRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// GetNewsReportResponse wrapper for the GetNewsReport operation +type GetNewsReportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // The NewsReport instance + NewsReport `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 GetNewsReportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response GetNewsReportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/ingest_my_sql_sql_text_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/ingest_my_sql_sql_text_details.go new file mode 100644 index 00000000000..8234fbe20fe --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/ingest_my_sql_sql_text_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// IngestMySqlSqlTextDetails Collection of SQL Text Entries +type IngestMySqlSqlTextDetails struct { + + // List of SQL Text Entries. + Items []MySqlSqlText `mandatory:"false" json:"items"` +} + +func (m IngestMySqlSqlTextDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m IngestMySqlSqlTextDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/ingest_my_sql_sql_text_response_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/ingest_my_sql_sql_text_response_details.go new file mode 100644 index 00000000000..f85a432ee7e --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/ingest_my_sql_sql_text_response_details.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// IngestMySqlSqlTextResponseDetails The response object returned from IngestMySqlSqlTextDetails operation. +type IngestMySqlSqlTextResponseDetails struct { + + // Success message returned as a result of the upload. + Message *string `mandatory:"true" json:"message"` +} + +func (m IngestMySqlSqlTextResponseDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m IngestMySqlSqlTextResponseDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_news_reports_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_news_reports_request_response.go new file mode 100644 index 00000000000..3dd54f89301 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/list_news_reports_request_response.go @@ -0,0 +1,231 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// ListNewsReportsRequest wrapper for the ListNewsReports operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListNewsReports.go.html to see an example of how to use ListNewsReportsRequest. +type ListNewsReportsRequest struct { + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"false" contributesTo:"query" name:"compartmentId"` + + // Unique Operations Insights news report identifier + NewsReportId *string `mandatory:"false" contributesTo:"query" name:"newsReportId"` + + // Resource Status + Status []ResourceStatusEnum `contributesTo:"query" name:"status" omitEmpty:"true" collectionFormat:"multi"` + + // Lifecycle states + LifecycleState []LifecycleStateEnum `contributesTo:"query" name:"lifecycleState" omitEmpty:"true" collectionFormat:"multi"` + + // For list pagination. The maximum number of results per page, or items to + // return in a paginated "List" call. + // For important details about how pagination works, see + // List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + // Example: `50` + Limit *int `mandatory:"false" contributesTo:"query" name:"limit"` + + // For list pagination. The value of the `opc-next-page` response header from + // the previous "List" call. For important details about how pagination works, + // see List Pagination (https://docs.cloud.oracle.com/Content/API/Concepts/usingapi.htm#nine). + Page *string `mandatory:"false" contributesTo:"query" name:"page"` + + // The sort order to use, either ascending (`ASC`) or descending (`DESC`). + SortOrder ListNewsReportsSortOrderEnum `mandatory:"false" contributesTo:"query" name:"sortOrder" omitEmpty:"true"` + + // News report list sort options. If `fields` parameter is selected, the `sortBy` parameter must be one of the fields specified. + SortBy ListNewsReportsSortByEnum `mandatory:"false" contributesTo:"query" name:"sortBy" omitEmpty:"true"` + + // A flag to search all resources within a given compartment and all sub-compartments. + CompartmentIdInSubtree *bool `mandatory:"false" contributesTo:"query" name:"compartmentIdInSubtree"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `mandatory:"false" contributesTo:"header" name:"opc-request-id"` + + // Metadata about the request. This information will not be transmitted to the service, but + // represents information that the SDK will consume to drive retry behavior. + RequestMetadata common.RequestMetadata +} + +func (request ListNewsReportsRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request ListNewsReportsRequest) 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 ListNewsReportsRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request ListNewsReportsRequest) 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 ListNewsReportsRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + for _, val := range request.Status { + if _, ok := GetMappingResourceStatusEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Status: %s. Supported values are: %s.", val, strings.Join(GetResourceStatusEnumStringValues(), ","))) + } + } + + for _, val := range request.LifecycleState { + if _, ok := GetMappingLifecycleStateEnum(string(val)); !ok && val != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", val, strings.Join(GetLifecycleStateEnumStringValues(), ","))) + } + } + + if _, ok := GetMappingListNewsReportsSortOrderEnum(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(GetListNewsReportsSortOrderEnumStringValues(), ","))) + } + if _, ok := GetMappingListNewsReportsSortByEnum(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(GetListNewsReportsSortByEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// ListNewsReportsResponse wrapper for the ListNewsReports operation +type ListNewsReportsResponse struct { + + // The underlying http response + RawResponse *http.Response + + // A list of NewsReportCollection instances + NewsReportCollection `presentIn:"body"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` + + // For pagination of a list of items. The total number of items in the result. + OpcTotalItems *int `presentIn:"header" name:"opc-total-items"` + + // For pagination of a list of items. When paging through a list, if this header appears in the response, + // then a partial list might have been returned. Include this value as the `page` parameter for the + // subsequent GET request to get the next batch of items. + OpcNextPage *string `presentIn:"header" name:"opc-next-page"` +} + +func (response ListNewsReportsResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response ListNewsReportsResponse) HTTPResponse() *http.Response { + return response.RawResponse +} + +// ListNewsReportsSortOrderEnum Enum with underlying type: string +type ListNewsReportsSortOrderEnum string + +// Set of constants representing the allowable values for ListNewsReportsSortOrderEnum +const ( + ListNewsReportsSortOrderAsc ListNewsReportsSortOrderEnum = "ASC" + ListNewsReportsSortOrderDesc ListNewsReportsSortOrderEnum = "DESC" +) + +var mappingListNewsReportsSortOrderEnum = map[string]ListNewsReportsSortOrderEnum{ + "ASC": ListNewsReportsSortOrderAsc, + "DESC": ListNewsReportsSortOrderDesc, +} + +var mappingListNewsReportsSortOrderEnumLowerCase = map[string]ListNewsReportsSortOrderEnum{ + "asc": ListNewsReportsSortOrderAsc, + "desc": ListNewsReportsSortOrderDesc, +} + +// GetListNewsReportsSortOrderEnumValues Enumerates the set of values for ListNewsReportsSortOrderEnum +func GetListNewsReportsSortOrderEnumValues() []ListNewsReportsSortOrderEnum { + values := make([]ListNewsReportsSortOrderEnum, 0) + for _, v := range mappingListNewsReportsSortOrderEnum { + values = append(values, v) + } + return values +} + +// GetListNewsReportsSortOrderEnumStringValues Enumerates the set of values in String for ListNewsReportsSortOrderEnum +func GetListNewsReportsSortOrderEnumStringValues() []string { + return []string{ + "ASC", + "DESC", + } +} + +// GetMappingListNewsReportsSortOrderEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNewsReportsSortOrderEnum(val string) (ListNewsReportsSortOrderEnum, bool) { + enum, ok := mappingListNewsReportsSortOrderEnumLowerCase[strings.ToLower(val)] + return enum, ok +} + +// ListNewsReportsSortByEnum Enum with underlying type: string +type ListNewsReportsSortByEnum string + +// Set of constants representing the allowable values for ListNewsReportsSortByEnum +const ( + ListNewsReportsSortByName ListNewsReportsSortByEnum = "name" + ListNewsReportsSortByNewsfrequency ListNewsReportsSortByEnum = "newsFrequency" +) + +var mappingListNewsReportsSortByEnum = map[string]ListNewsReportsSortByEnum{ + "name": ListNewsReportsSortByName, + "newsFrequency": ListNewsReportsSortByNewsfrequency, +} + +var mappingListNewsReportsSortByEnumLowerCase = map[string]ListNewsReportsSortByEnum{ + "name": ListNewsReportsSortByName, + "newsfrequency": ListNewsReportsSortByNewsfrequency, +} + +// GetListNewsReportsSortByEnumValues Enumerates the set of values for ListNewsReportsSortByEnum +func GetListNewsReportsSortByEnumValues() []ListNewsReportsSortByEnum { + values := make([]ListNewsReportsSortByEnum, 0) + for _, v := range mappingListNewsReportsSortByEnum { + values = append(values, v) + } + return values +} + +// GetListNewsReportsSortByEnumStringValues Enumerates the set of values in String for ListNewsReportsSortByEnum +func GetListNewsReportsSortByEnumStringValues() []string { + return []string{ + "name", + "newsFrequency", + } +} + +// GetMappingListNewsReportsSortByEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingListNewsReportsSortByEnum(val string) (ListNewsReportsSortByEnum, bool) { + enum, ok := mappingListNewsReportsSortByEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/my_sql_sql_text.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/my_sql_sql_text.go new file mode 100644 index 00000000000..2f3c8ad8d35 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/my_sql_sql_text.go @@ -0,0 +1,58 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// MySqlSqlText MySql SQL Text type object. +type MySqlSqlText struct { + + // digest + // Example: `"323k3k99ua09a90adf"` + Digest *string `mandatory:"true" json:"digest"` + + // Collection timestamp. + // Example: `"2020-05-06T00:00:00.000Z"` + TimeCollected *common.SDKTime `mandatory:"true" json:"timeCollected"` + + // The normalized statement string. + // Example: `"SELECT username,profile,default_tablespace,temporary_tablespace FROM dba_users"` + DigestText *string `mandatory:"true" json:"digestText"` + + // Name of Database Schema. + // Example: `"performance_schema"` + SchemaName *string `mandatory:"false" json:"schemaName"` + + // SQL event name + // Example: `"SELECT"` + CommandType *string `mandatory:"false" json:"commandType"` +} + +func (m MySqlSqlText) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m MySqlSqlText) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_content_types.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_content_types.go new file mode 100644 index 00000000000..78fcd966873 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_content_types.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NewsContentTypes Content types that the news report can handle. +type NewsContentTypes struct { + + // Supported resources for capacity planning content type. + CapacityPlanningResources []NewsContentTypesResourceEnum `mandatory:"true" json:"capacityPlanningResources"` +} + +func (m NewsContentTypes) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NewsContentTypes) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_content_types_resource.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_content_types_resource.go new file mode 100644 index 00000000000..be174c37bc4 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_content_types_resource.go @@ -0,0 +1,62 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// NewsContentTypesResourceEnum Enum with underlying type: string +type NewsContentTypesResourceEnum string + +// Set of constants representing the allowable values for NewsContentTypesResourceEnum +const ( + NewsContentTypesResourceHost NewsContentTypesResourceEnum = "HOST" + NewsContentTypesResourceDatabase NewsContentTypesResourceEnum = "DATABASE" + NewsContentTypesResourceExadata NewsContentTypesResourceEnum = "EXADATA" +) + +var mappingNewsContentTypesResourceEnum = map[string]NewsContentTypesResourceEnum{ + "HOST": NewsContentTypesResourceHost, + "DATABASE": NewsContentTypesResourceDatabase, + "EXADATA": NewsContentTypesResourceExadata, +} + +var mappingNewsContentTypesResourceEnumLowerCase = map[string]NewsContentTypesResourceEnum{ + "host": NewsContentTypesResourceHost, + "database": NewsContentTypesResourceDatabase, + "exadata": NewsContentTypesResourceExadata, +} + +// GetNewsContentTypesResourceEnumValues Enumerates the set of values for NewsContentTypesResourceEnum +func GetNewsContentTypesResourceEnumValues() []NewsContentTypesResourceEnum { + values := make([]NewsContentTypesResourceEnum, 0) + for _, v := range mappingNewsContentTypesResourceEnum { + values = append(values, v) + } + return values +} + +// GetNewsContentTypesResourceEnumStringValues Enumerates the set of values in String for NewsContentTypesResourceEnum +func GetNewsContentTypesResourceEnumStringValues() []string { + return []string{ + "HOST", + "DATABASE", + "EXADATA", + } +} + +// GetMappingNewsContentTypesResourceEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNewsContentTypesResourceEnum(val string) (NewsContentTypesResourceEnum, bool) { + enum, ok := mappingNewsContentTypesResourceEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_frequency.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_frequency.go new file mode 100644 index 00000000000..e93876dcaac --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_frequency.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// NewsFrequencyEnum Enum with underlying type: string +type NewsFrequencyEnum string + +// Set of constants representing the allowable values for NewsFrequencyEnum +const ( + NewsFrequencyWeekly NewsFrequencyEnum = "WEEKLY" +) + +var mappingNewsFrequencyEnum = map[string]NewsFrequencyEnum{ + "WEEKLY": NewsFrequencyWeekly, +} + +var mappingNewsFrequencyEnumLowerCase = map[string]NewsFrequencyEnum{ + "weekly": NewsFrequencyWeekly, +} + +// GetNewsFrequencyEnumValues Enumerates the set of values for NewsFrequencyEnum +func GetNewsFrequencyEnumValues() []NewsFrequencyEnum { + values := make([]NewsFrequencyEnum, 0) + for _, v := range mappingNewsFrequencyEnum { + values = append(values, v) + } + return values +} + +// GetNewsFrequencyEnumStringValues Enumerates the set of values in String for NewsFrequencyEnum +func GetNewsFrequencyEnumStringValues() []string { + return []string{ + "WEEKLY", + } +} + +// GetMappingNewsFrequencyEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNewsFrequencyEnum(val string) (NewsFrequencyEnum, bool) { + enum, ok := mappingNewsFrequencyEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_locale.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_locale.go new file mode 100644 index 00000000000..960f1827ad1 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_locale.go @@ -0,0 +1,54 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "strings" +) + +// NewsLocaleEnum Enum with underlying type: string +type NewsLocaleEnum string + +// Set of constants representing the allowable values for NewsLocaleEnum +const ( + NewsLocaleEn NewsLocaleEnum = "EN" +) + +var mappingNewsLocaleEnum = map[string]NewsLocaleEnum{ + "EN": NewsLocaleEn, +} + +var mappingNewsLocaleEnumLowerCase = map[string]NewsLocaleEnum{ + "en": NewsLocaleEn, +} + +// GetNewsLocaleEnumValues Enumerates the set of values for NewsLocaleEnum +func GetNewsLocaleEnumValues() []NewsLocaleEnum { + values := make([]NewsLocaleEnum, 0) + for _, v := range mappingNewsLocaleEnum { + values = append(values, v) + } + return values +} + +// GetNewsLocaleEnumStringValues Enumerates the set of values in String for NewsLocaleEnum +func GetNewsLocaleEnumStringValues() []string { + return []string{ + "EN", + } +} + +// GetMappingNewsLocaleEnum performs case Insensitive comparison on enum value and return the desired enum +func GetMappingNewsLocaleEnum(val string) (NewsLocaleEnum, bool) { + enum, ok := mappingNewsLocaleEnumLowerCase[strings.ToLower(val)] + return enum, ok +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report.go new file mode 100644 index 00000000000..9b2d6e999cf --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NewsReport News report resource. +type NewsReport struct { + + // News report frequency. + NewsFrequency NewsFrequencyEnum `mandatory:"true" json:"newsFrequency"` + + ContentTypes *NewsContentTypes `mandatory:"true" json:"contentTypes"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the news report resource. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. + OnsTopicId *string `mandatory:"true" json:"onsTopicId"` + + // Language of the news report. + Locale NewsLocaleEnum `mandatory:"false" json:"locale,omitempty"` + + // The description of the news report. + Description *string `mandatory:"false" json:"description"` + + // The news report name. + Name *string `mandatory:"false" json:"name"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Indicates the status of a news report in Operations Insights. + Status ResourceStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The time the the news report was first enabled. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the news report was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The current state of the news report. + LifecycleState LifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // 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"` +} + +func (m NewsReport) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NewsReport) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNewsFrequencyEnum(string(m.NewsFrequency)); !ok && m.NewsFrequency != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NewsFrequency: %s. Supported values are: %s.", m.NewsFrequency, strings.Join(GetNewsFrequencyEnumStringValues(), ","))) + } + + if _, ok := GetMappingNewsLocaleEnum(string(m.Locale)); !ok && m.Locale != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Locale: %s. Supported values are: %s.", m.Locale, strings.Join(GetNewsLocaleEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceStatusEnum(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(GetResourceStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleStateEnum(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(GetLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report_collection.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report_collection.go new file mode 100644 index 00000000000..b6839f355d7 --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report_collection.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NewsReportCollection Collection of news reports summary objects. +type NewsReportCollection struct { + + // Array of news reports summary objects. + Items []NewsReportSummary `mandatory:"true" json:"items"` +} + +func (m NewsReportCollection) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NewsReportCollection) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report_summary.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report_summary.go new file mode 100644 index 00000000000..c41f54fb49a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_report_summary.go @@ -0,0 +1,100 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NewsReportSummary Summary of a news report resource. +type NewsReportSummary struct { + + // News report frequency. + NewsFrequency NewsFrequencyEnum `mandatory:"true" json:"newsFrequency"` + + ContentTypes *NewsContentTypes `mandatory:"true" json:"contentTypes"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the news report resource. + Id *string `mandatory:"true" json:"id"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. + CompartmentId *string `mandatory:"true" json:"compartmentId"` + + // Language of the news report. + Locale NewsLocaleEnum `mandatory:"false" json:"locale,omitempty"` + + // The description of the news report. + Description *string `mandatory:"false" json:"description"` + + // The news report name. + Name *string `mandatory:"false" json:"name"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. + OnsTopicId *string `mandatory:"false" json:"onsTopicId"` + + // Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. + // Example: `{"bar-key": "value"}` + FreeformTags map[string]string `mandatory:"false" json:"freeformTags"` + + // Defined tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"foo-namespace": {"bar-key": "value"}}` + DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"` + + // System tags for this resource. Each key is predefined and scoped to a namespace. + // Example: `{"orcl-cloud": {"free-tier-retained": "true"}}` + SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"` + + // Indicates the status of a news report in Operations Insights. + Status ResourceStatusEnum `mandatory:"false" json:"status,omitempty"` + + // The time the the news report was first enabled. An RFC3339 formatted datetime string. + TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"` + + // The time the news report was updated. An RFC3339 formatted datetime string. + TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"` + + // The current state of the news report. + LifecycleState LifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"` + + // 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"` +} + +func (m NewsReportSummary) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NewsReportSummary) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if _, ok := GetMappingNewsFrequencyEnum(string(m.NewsFrequency)); !ok && m.NewsFrequency != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NewsFrequency: %s. Supported values are: %s.", m.NewsFrequency, strings.Join(GetNewsFrequencyEnumStringValues(), ","))) + } + + if _, ok := GetMappingNewsLocaleEnum(string(m.Locale)); !ok && m.Locale != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Locale: %s. Supported values are: %s.", m.Locale, strings.Join(GetNewsLocaleEnumStringValues(), ","))) + } + if _, ok := GetMappingResourceStatusEnum(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(GetResourceStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingLifecycleStateEnum(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(GetLifecycleStateEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_reports.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_reports.go new file mode 100644 index 00000000000..d95906b111a --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/news_reports.go @@ -0,0 +1,41 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// NewsReports Logical grouping used for Operations Insights news reports related operations. +type NewsReports struct { + + // News report object. + NewsReports *interface{} `mandatory:"false" json:"newsReports"` +} + +func (m NewsReports) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m NewsReports) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go index d302d3c32b6..4ddc83267a5 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/opsi_operationsinsights_client.go @@ -463,6 +463,69 @@ func (client OperationsInsightsClient) changeHostInsightCompartment(ctx context. return response, err } +// ChangeNewsReportCompartment Moves a news report resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ChangeNewsReportCompartment.go.html to see an example of how to use ChangeNewsReportCompartment API. +// A default retry strategy applies to this operation ChangeNewsReportCompartment() +func (client OperationsInsightsClient) ChangeNewsReportCompartment(ctx context.Context, request ChangeNewsReportCompartmentRequest) (response ChangeNewsReportCompartmentResponse, 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.changeNewsReportCompartment, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ChangeNewsReportCompartmentResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ChangeNewsReportCompartmentResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ChangeNewsReportCompartmentResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ChangeNewsReportCompartmentResponse") + } + return +} + +// changeNewsReportCompartment implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) changeNewsReportCompartment(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/newsReports/{newsReportId}/actions/changeCompartment", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ChangeNewsReportCompartmentResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/NewsReports/ChangeNewsReportCompartment" + err = common.PostProcessServiceError(err, "OperationsInsights", "ChangeNewsReportCompartment", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ChangeOperationsInsightsPrivateEndpointCompartment Moves a private endpoint from one compartment to another. When provided, If-Match is checked against ETag values of the resource. // // See also @@ -968,6 +1031,69 @@ func (client OperationsInsightsClient) createHostInsight(ctx context.Context, re return response, err } +// CreateNewsReport Create a news report in Operations Insights. The report will be enabled in Operations Insights. Insights will be emailed as per selected frequency. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/CreateNewsReport.go.html to see an example of how to use CreateNewsReport API. +// A default retry strategy applies to this operation CreateNewsReport() +func (client OperationsInsightsClient) CreateNewsReport(ctx context.Context, request CreateNewsReportRequest) (response CreateNewsReportResponse, 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.createNewsReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = CreateNewsReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = CreateNewsReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(CreateNewsReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into CreateNewsReportResponse") + } + return +} + +// createNewsReport implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) createNewsReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPost, "/newsReports", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response CreateNewsReportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/NewsReports/CreateNewsReport" + err = common.PostProcessServiceError(err, "OperationsInsights", "CreateNewsReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // CreateOperationsInsightsPrivateEndpoint Create a private endpoint resource for the tenant in Operations Insights. // This resource will be created in customer compartment. // @@ -1514,6 +1640,64 @@ func (client OperationsInsightsClient) deleteHostInsight(ctx context.Context, re return response, err } +// DeleteNewsReport Deletes a news report. The news report will be deleted and cannot be enabled again. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/DeleteNewsReport.go.html to see an example of how to use DeleteNewsReport API. +// A default retry strategy applies to this operation DeleteNewsReport() +func (client OperationsInsightsClient) DeleteNewsReport(ctx context.Context, request DeleteNewsReportRequest) (response DeleteNewsReportResponse, 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.deleteNewsReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = DeleteNewsReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = DeleteNewsReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(DeleteNewsReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into DeleteNewsReportResponse") + } + return +} + +// deleteNewsReport implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) deleteNewsReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodDelete, "/newsReports/{newsReportId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response DeleteNewsReportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/NewsReports/DeleteNewsReport" + err = common.PostProcessServiceError(err, "OperationsInsights", "DeleteNewsReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // DeleteOperationsInsightsPrivateEndpoint Deletes a private endpoint. // // See also @@ -2780,6 +2964,64 @@ func (client OperationsInsightsClient) getHostInsight(ctx context.Context, reque return response, err } +// GetNewsReport Gets details of a news report. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/GetNewsReport.go.html to see an example of how to use GetNewsReport API. +// A default retry strategy applies to this operation GetNewsReport() +func (client OperationsInsightsClient) GetNewsReport(ctx context.Context, request GetNewsReportRequest) (response GetNewsReportResponse, 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.getNewsReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = GetNewsReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = GetNewsReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(GetNewsReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into GetNewsReportResponse") + } + return +} + +// getNewsReport implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) getNewsReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/newsReports/{newsReportId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response GetNewsReportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/NewsReports/GetNewsReport" + err = common.PostProcessServiceError(err, "OperationsInsights", "GetNewsReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // GetOperationsInsightsPrivateEndpoint Gets the details of the specified private endpoint. // // See also @@ -4876,6 +5118,64 @@ func (client OperationsInsightsClient) listImportableEnterpriseManagerEntities(c return response, err } +// ListNewsReports Gets a list of news reports based on the query parameters specified. Either compartmentId or id query parameter must be specified. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/ListNewsReports.go.html to see an example of how to use ListNewsReports API. +// A default retry strategy applies to this operation ListNewsReports() +func (client OperationsInsightsClient) ListNewsReports(ctx context.Context, request ListNewsReportsRequest) (response ListNewsReportsResponse, 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.listNewsReports, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = ListNewsReportsResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = ListNewsReportsResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(ListNewsReportsResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into ListNewsReportsResponse") + } + return +} + +// listNewsReports implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) listNewsReports(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodGet, "/newsReports", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response ListNewsReportsResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/NewsReport/ListNewsReports" + err = common.PostProcessServiceError(err, "OperationsInsights", "ListNewsReports", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // ListOperationsInsightsPrivateEndpoints Gets a list of Operation Insights private endpoints. // // See also @@ -8914,6 +9214,64 @@ func (client OperationsInsightsClient) updateHostInsight(ctx context.Context, re return response, err } +// UpdateNewsReport Updates the configuration of a news report. +// +// See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/UpdateNewsReport.go.html to see an example of how to use UpdateNewsReport API. +// A default retry strategy applies to this operation UpdateNewsReport() +func (client OperationsInsightsClient) UpdateNewsReport(ctx context.Context, request UpdateNewsReportRequest) (response UpdateNewsReportResponse, 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.updateNewsReport, policy) + if err != nil { + if ociResponse != nil { + if httpResponse := ociResponse.HTTPResponse(); httpResponse != nil { + opcRequestId := httpResponse.Header.Get("opc-request-id") + response = UpdateNewsReportResponse{RawResponse: httpResponse, OpcRequestId: &opcRequestId} + } else { + response = UpdateNewsReportResponse{} + } + } + return + } + if convertedResponse, ok := ociResponse.(UpdateNewsReportResponse); ok { + response = convertedResponse + } else { + err = fmt.Errorf("failed to convert OCIResponse into UpdateNewsReportResponse") + } + return +} + +// updateNewsReport implements the OCIOperation interface (enables retrying operations) +func (client OperationsInsightsClient) updateNewsReport(ctx context.Context, request common.OCIRequest, binaryReqBody *common.OCIReadSeekCloser, extraHeaders map[string]string) (common.OCIResponse, error) { + + httpRequest, err := request.HTTPRequest(http.MethodPut, "/newsReports/{newsReportId}", binaryReqBody, extraHeaders) + if err != nil { + return nil, err + } + + var response UpdateNewsReportResponse + var httpResponse *http.Response + httpResponse, err = client.Call(ctx, &httpRequest) + defer common.CloseBodyIfValid(httpResponse) + response.RawResponse = httpResponse + if err != nil { + apiReferenceLink := "https://docs.oracle.com/iaas/api/#/en/operations-insights/20200630/NewsReports/UpdateNewsReport" + err = common.PostProcessServiceError(err, "OperationsInsights", "UpdateNewsReport", apiReferenceLink) + return response, err + } + + err = common.UnmarshalResponse(httpResponse, &response) + return response, err +} + // UpdateOperationsInsightsPrivateEndpoint Updates one or more attributes of the specified private endpoint. // // See also diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go index deacbed0bc6..68e23c8b096 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/query_data_object_result_set_column_metadata.go @@ -23,7 +23,7 @@ type QueryDataObjectResultSetColumnMetadata struct { // Name of the column in a data object query result set. Name *string `mandatory:"true" json:"name"` - // Type of the column in a data object query result set. + // Type name of the column in a data object query result set. DataTypeName QueryDataObjectResultSetColumnMetadataDataTypeNameEnum `mandatory:"false" json:"dataTypeName,omitempty"` } diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/resource_filters.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/resource_filters.go index 1dc8b3a1fa8..5d0900f351d 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/resource_filters.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/resource_filters.go @@ -18,7 +18,7 @@ import ( ) // ResourceFilters Information to filter the actual target resources in an operation. -// e.g: While quering a DATABASE_INSIGHTS_DATA_OBJECT using /opsiDataObjects/{opsiDataObjectidentifier}/actions/queryData API, +// e.g: While querying a DATABASE_INSIGHTS_DATA_OBJECT using /opsiDataObjects/actions/queryData API, // if resourceFilters is set with valid value for definedTagEquals field, only data of the database insights // resources for which the specified freeform tags exist will be considered for the actual query scope. type ResourceFilters struct { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_database_insight_resource_forecast_trend_aggregation.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_database_insight_resource_forecast_trend_aggregation.go index f1daf7c80f4..9171a199747 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_database_insight_resource_forecast_trend_aggregation.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_database_insight_resource_forecast_trend_aggregation.go @@ -49,6 +49,9 @@ type SummarizeDatabaseInsightResourceForecastTrendAggregation struct { // Time series data result of the forecasting analysis. ProjectedData []ProjectedDataItem `mandatory:"true" json:"projectedData"` + + // Auto-ML algorithm leveraged for the forecast. Only applicable for Auto-ML forecast. + SelectedForecastAlgorithm *string `mandatory:"false" json:"selectedForecastAlgorithm"` } func (m SummarizeDatabaseInsightResourceForecastTrendAggregation) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_exadata_insight_resource_forecast_trend_aggregation.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_exadata_insight_resource_forecast_trend_aggregation.go index 0d4ad61126b..2f44057e1ea 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_exadata_insight_resource_forecast_trend_aggregation.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_exadata_insight_resource_forecast_trend_aggregation.go @@ -46,6 +46,9 @@ type SummarizeExadataInsightResourceForecastTrendAggregation struct { // Time series data result of the forecasting analysis. ProjectedData []ProjectedDataItem `mandatory:"true" json:"projectedData"` + + // Auto-ML algorithm leveraged for the forecast. Only applicable for Auto-ML forecast. + SelectedForecastAlgorithm *string `mandatory:"false" json:"selectedForecastAlgorithm"` } func (m SummarizeExadataInsightResourceForecastTrendAggregation) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_host_insight_resource_forecast_trend_aggregation.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_host_insight_resource_forecast_trend_aggregation.go index 26202e9cf89..c97295ee891 100644 --- a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_host_insight_resource_forecast_trend_aggregation.go +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/summarize_host_insight_resource_forecast_trend_aggregation.go @@ -46,6 +46,9 @@ type SummarizeHostInsightResourceForecastTrendAggregation struct { // Time series data result of the forecasting analysis. ProjectedData []ProjectedDataItem `mandatory:"true" json:"projectedData"` + + // Auto-ML algorithm leveraged for the forecast. Only applicable for Auto-ML forecast. + SelectedForecastAlgorithm *string `mandatory:"false" json:"selectedForecastAlgorithm"` } func (m SummarizeHostInsightResourceForecastTrendAggregation) String() string { diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/update_news_report_details.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/update_news_report_details.go new file mode 100644 index 00000000000..ab57fdda75c --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/update_news_report_details.go @@ -0,0 +1,69 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +// Operations Insights API +// +// Use the Operations Insights API to perform data extraction operations to obtain database +// resource utilization, performance statistics, and reference information. For more information, +// see About Oracle Cloud Infrastructure Operations Insights (https://docs.cloud.oracle.com/en-us/iaas/operations-insights/doc/operations-insights.html). +// + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "strings" +) + +// UpdateNewsReportDetails The information about the news report to be updated. +type UpdateNewsReportDetails struct { + + // Defines if the news report will be enabled or disabled. + Status ResourceStatusEnum `mandatory:"false" json:"status,omitempty"` + + // News report frequency. + NewsFrequency NewsFrequencyEnum `mandatory:"false" json:"newsFrequency,omitempty"` + + // Language of the news report. + Locale NewsLocaleEnum `mandatory:"false" json:"locale,omitempty"` + + ContentTypes *NewsContentTypes `mandatory:"false" json:"contentTypes"` + + // The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. + OnsTopicId *string `mandatory:"false" json:"onsTopicId"` + + // 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 UpdateNewsReportDetails) String() string { + return common.PointerString(m) +} + +// ValidateEnumValue returns an error when providing an unsupported enum value +// This function is being called during constructing API request process +// Not recommended for calling this function directly +func (m UpdateNewsReportDetails) ValidateEnumValue() (bool, error) { + errMessage := []string{} + + if _, ok := GetMappingResourceStatusEnum(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(GetResourceStatusEnumStringValues(), ","))) + } + if _, ok := GetMappingNewsFrequencyEnum(string(m.NewsFrequency)); !ok && m.NewsFrequency != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for NewsFrequency: %s. Supported values are: %s.", m.NewsFrequency, strings.Join(GetNewsFrequencyEnumStringValues(), ","))) + } + if _, ok := GetMappingNewsLocaleEnum(string(m.Locale)); !ok && m.Locale != "" { + errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Locale: %s. Supported values are: %s.", m.Locale, strings.Join(GetNewsLocaleEnumStringValues(), ","))) + } + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} diff --git a/vendor/github.com/oracle/oci-go-sdk/v65/opsi/update_news_report_request_response.go b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/update_news_report_request_response.go new file mode 100644 index 00000000000..dcd74e69fed --- /dev/null +++ b/vendor/github.com/oracle/oci-go-sdk/v65/opsi/update_news_report_request_response.go @@ -0,0 +1,99 @@ +// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. +// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. +// Code generated. DO NOT EDIT. + +package opsi + +import ( + "fmt" + "github.com/oracle/oci-go-sdk/v65/common" + "net/http" + "strings" +) + +// UpdateNewsReportRequest wrapper for the UpdateNewsReport operation +// +// # See also +// +// Click https://docs.cloud.oracle.com/en-us/iaas/tools/go-sdk-examples/latest/opsi/UpdateNewsReport.go.html to see an example of how to use UpdateNewsReportRequest. +type UpdateNewsReportRequest struct { + + // Unique news report identifier. + NewsReportId *string `mandatory:"true" contributesTo:"path" name:"newsReportId"` + + // The configuration to be updated. + UpdateNewsReportDetails `contributesTo:"body"` + + // Used for optimistic concurrency control. In the update or delete call for a resource, set the `if-match` + // parameter to the value of the etag from a previous get, create, or update 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. + 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 UpdateNewsReportRequest) String() string { + return common.PointerString(request) +} + +// HTTPRequest implements the OCIRequest interface +func (request UpdateNewsReportRequest) 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 UpdateNewsReportRequest) BinaryRequestBody() (*common.OCIReadSeekCloser, bool) { + + return nil, false + +} + +// RetryPolicy implements the OCIRetryableRequest interface. This retrieves the specified retry policy. +func (request UpdateNewsReportRequest) 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 UpdateNewsReportRequest) ValidateEnumValue() (bool, error) { + errMessage := []string{} + if len(errMessage) > 0 { + return true, fmt.Errorf(strings.Join(errMessage, "\n")) + } + return false, nil +} + +// UpdateNewsReportResponse wrapper for the UpdateNewsReport operation +type UpdateNewsReportResponse struct { + + // The underlying http response + RawResponse *http.Response + + // Unique Oracle-assigned identifier for the asynchronous request. You can use this to query status of the asynchronous operation. + OpcWorkRequestId *string `presentIn:"header" name:"opc-work-request-id"` + + // Unique Oracle-assigned identifier for the request. If you need to contact + // Oracle about a particular request, please provide the request ID. + OpcRequestId *string `presentIn:"header" name:"opc-request-id"` +} + +func (response UpdateNewsReportResponse) String() string { + return common.PointerString(response) +} + +// HTTPResponse implements the OCIResponse interface +func (response UpdateNewsReportResponse) HTTPResponse() *http.Response { + return response.RawResponse +} diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go index f50f196e2ca..279a20ee535 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go @@ -538,7 +538,7 @@ func flattener(flattenList cty.Value) ([]cty.Value, []cty.ValueMarks, bool) { // Any dynamic types could result in more collections that need to be // flattened, so the type cannot be known. - if val.Type().Equals(cty.DynamicPseudoType) { + if val == cty.DynamicVal { isKnown = false } diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go index 5070a5adf57..339d04dbdbd 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/csv.go @@ -30,7 +30,7 @@ var CSVDecodeFunc = function.New(&function.Spec{ return cty.DynamicPseudoType, fmt.Errorf("missing header line") } if err != nil { - return cty.DynamicPseudoType, err + return cty.DynamicPseudoType, csvError(err) } atys := make(map[string]cty.Type, len(headers)) @@ -64,7 +64,7 @@ var CSVDecodeFunc = function.New(&function.Spec{ break } if err != nil { - return cty.DynamicVal, err + return cty.DynamicVal, csvError(err) } vals := make(map[string]cty.Value, len(cols)) @@ -91,3 +91,12 @@ var CSVDecodeFunc = function.New(&function.Spec{ func CSVDecode(str cty.Value) (cty.Value, error) { return CSVDecodeFunc.Call([]cty.Value{str}) } + +func csvError(err error) error { + switch err := err.(type) { + case *csv.ParseError: + return fmt.Errorf("CSV parse error on line %d: %w", err.Line, err.Err) + default: + return err + } +} diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go index 63881f58531..8b17758950c 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go @@ -114,6 +114,8 @@ var FormatListFunc = function.New(&function.Spec{ continue } iterators[i] = arg.ElementIterator() + case arg == cty.DynamicVal: + unknowns[i] = true default: singleVals[i] = arg } diff --git a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go index 7bbe584b0a1..4effeb7bb8d 100644 --- a/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go +++ b/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go @@ -371,14 +371,21 @@ var CeilFunc = function.New(&function.Spec{ }, Type: function.StaticReturnType(cty.Number), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { - var val float64 - if err := gocty.FromCtyValue(args[0], &val); err != nil { - return cty.UnknownVal(cty.String), err + f := args[0].AsBigFloat() + + if f.IsInf() { + return cty.NumberVal(f), nil } - if math.IsInf(val, 0) { - return cty.NumberFloatVal(val), nil + + i, acc := f.Int(nil) + switch acc { + case big.Exact, big.Above: + // Done. + case big.Below: + i.Add(i, big.NewInt(1)) } - return cty.NumberIntVal(int64(math.Ceil(val))), nil + + return cty.NumberVal(f.SetInt(i)), nil }, }) @@ -393,14 +400,21 @@ var FloorFunc = function.New(&function.Spec{ }, Type: function.StaticReturnType(cty.Number), Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { - var val float64 - if err := gocty.FromCtyValue(args[0], &val); err != nil { - return cty.UnknownVal(cty.String), err + f := args[0].AsBigFloat() + + if f.IsInf() { + return cty.NumberVal(f), nil } - if math.IsInf(val, 0) { - return cty.NumberFloatVal(val), nil + + i, acc := f.Int(nil) + switch acc { + case big.Exact, big.Below: + // Done. + case big.Above: + i.Sub(i, big.NewInt(1)) } - return cty.NumberIntVal(int64(math.Floor(val))), nil + + return cty.NumberVal(f.SetInt(i)), nil }, }) diff --git a/vendor/github.com/zclconf/go-cty/cty/primitive_type.go b/vendor/github.com/zclconf/go-cty/cty/primitive_type.go index 7b3d1196cd0..603901732b1 100644 --- a/vendor/github.com/zclconf/go-cty/cty/primitive_type.go +++ b/vendor/github.com/zclconf/go-cty/cty/primitive_type.go @@ -52,6 +52,51 @@ func (t primitiveType) GoString() string { } } +// rawNumberEqual is our cty-specific definition of whether two big floats +// underlying cty.Number are "equal" for the purposes of the Value.Equals and +// Value.RawEquals methods. +// +// The built-in equality for big.Float is a direct comparison of the mantissa +// bits and the exponent, but that's too precise a check for cty because we +// routinely send numbers through decimal approximations and back and so +// we only promise to accurately represent the subset of binary floating point +// numbers that can be derived from a decimal string representation. +// +// In respect of the fact that cty only tries to preserve numbers that can +// reasonably be written in JSON documents, we use the string representation of +// a decimal approximation of the number as our comparison, relying on the +// big.Float type's heuristic for discarding extraneous mantissa bits that seem +// likely to only be there as a result of an earlier decimal-to-binary +// approximation during parsing, e.g. in ParseNumberVal. +func rawNumberEqual(a, b *big.Float) bool { + switch { + case (a == nil) != (b == nil): + return false + case a == nil: // b == nil too then, due to previous case + return true + default: + // This format and precision matches that used by cty/json.Marshal, + // and thus achieves our definition of "two numbers are equal if + // we'd use the same JSON serialization for both of them". + const format = 'f' + const prec = -1 + aStr := a.Text(format, prec) + bStr := b.Text(format, prec) + + // The one exception to our rule about equality-by-stringification is + // negative zero, because we want -0 to always be equal to +0. + const posZero = "0" + const negZero = "-0" + if aStr == negZero { + aStr = posZero + } + if bStr == negZero { + bStr = posZero + } + return aStr == bStr + } +} + // Number is the numeric type. Number values are arbitrary-precision // decimal numbers, which can then be converted into Go's various numeric // types only if they are in the appropriate range. diff --git a/vendor/github.com/zclconf/go-cty/cty/value_ops.go b/vendor/github.com/zclconf/go-cty/cty/value_ops.go index 8c37535c885..cdcc1506f01 100644 --- a/vendor/github.com/zclconf/go-cty/cty/value_ops.go +++ b/vendor/github.com/zclconf/go-cty/cty/value_ops.go @@ -116,9 +116,9 @@ func (val Value) GoString() string { // Use RawEquals to compare if two values are equal *ignoring* the // short-circuit rules and the exception for null values. func (val Value) Equals(other Value) Value { - if val.IsMarked() || other.IsMarked() { - val, valMarks := val.Unmark() - other, otherMarks := other.Unmark() + if val.ContainsMarked() || other.ContainsMarked() { + val, valMarks := val.UnmarkDeep() + other, otherMarks := other.UnmarkDeep() return val.Equals(other).WithMarks(valMarks, otherMarks) } @@ -191,7 +191,7 @@ func (val Value) Equals(other Value) Value { switch { case ty == Number: - result = val.v.(*big.Float).Cmp(other.v.(*big.Float)) == 0 + result = rawNumberEqual(val.v.(*big.Float), other.v.(*big.Float)) case ty == Bool: result = val.v.(bool) == other.v.(bool) case ty == String: @@ -1283,9 +1283,7 @@ func (val Value) AsBigFloat() *big.Float { } // Copy the float so that callers can't mutate our internal state - ret := *(val.v.(*big.Float)) - - return &ret + return new(big.Float).Copy(val.v.(*big.Float)) } // AsValueSlice returns a []cty.Value representation of a non-null, non-unknown diff --git a/vendor/github.com/zclconf/go-cty/cty/walk.go b/vendor/github.com/zclconf/go-cty/cty/walk.go index d17f48ccd1e..87ba32e796b 100644 --- a/vendor/github.com/zclconf/go-cty/cty/walk.go +++ b/vendor/github.com/zclconf/go-cty/cty/walk.go @@ -33,10 +33,15 @@ func walk(path Path, val Value, cb func(Path, Value) (bool, error)) error { return nil } + // The callback already got a chance to see the mark in our + // call above, so can safely strip it off here in order to + // visit the child elements, which might still have their own marks. + rawVal, _ := val.Unmark() + ty := val.Type() switch { case ty.IsObjectType(): - for it := val.ElementIterator(); it.Next(); { + for it := rawVal.ElementIterator(); it.Next(); { nameVal, av := it.Element() path := append(path, GetAttrStep{ Name: nameVal.AsString(), @@ -46,8 +51,8 @@ func walk(path Path, val Value, cb func(Path, Value) (bool, error)) error { return err } } - case val.CanIterateElements(): - for it := val.ElementIterator(); it.Next(); { + case rawVal.CanIterateElements(): + for it := rawVal.ElementIterator(); it.Next(); { kv, ev := it.Element() path := append(path, IndexStep{ Key: kv, @@ -134,6 +139,12 @@ func transform(path Path, val Value, t Transformer) (Value, error) { ty := val.Type() var newVal Value + // We need to peel off any marks here so that we can dig around + // inside any collection values. We'll reapply these to any + // new collections we construct, but the transformer's Exit + // method gets the final say on what to do with those. + rawVal, marks := val.Unmark() + switch { case val.IsNull() || !val.IsKnown(): @@ -141,14 +152,14 @@ func transform(path Path, val Value, t Transformer) (Value, error) { newVal = val case ty.IsListType() || ty.IsSetType() || ty.IsTupleType(): - l := val.LengthInt() + l := rawVal.LengthInt() switch l { case 0: // No deep transform for an empty sequence newVal = val default: elems := make([]Value, 0, l) - for it := val.ElementIterator(); it.Next(); { + for it := rawVal.ElementIterator(); it.Next(); { kv, ev := it.Element() path := append(path, IndexStep{ Key: kv, @@ -161,25 +172,25 @@ func transform(path Path, val Value, t Transformer) (Value, error) { } switch { case ty.IsListType(): - newVal = ListVal(elems) + newVal = ListVal(elems).WithMarks(marks) case ty.IsSetType(): - newVal = SetVal(elems) + newVal = SetVal(elems).WithMarks(marks) case ty.IsTupleType(): - newVal = TupleVal(elems) + newVal = TupleVal(elems).WithMarks(marks) default: panic("unknown sequence type") // should never happen because of the case we are in } } case ty.IsMapType(): - l := val.LengthInt() + l := rawVal.LengthInt() switch l { case 0: // No deep transform for an empty map newVal = val default: elems := make(map[string]Value) - for it := val.ElementIterator(); it.Next(); { + for it := rawVal.ElementIterator(); it.Next(); { kv, ev := it.Element() path := append(path, IndexStep{ Key: kv, @@ -190,7 +201,7 @@ func transform(path Path, val Value, t Transformer) (Value, error) { } elems[kv.AsString()] = newEv } - newVal = MapVal(elems) + newVal = MapVal(elems).WithMarks(marks) } case ty.IsObjectType(): @@ -212,7 +223,7 @@ func transform(path Path, val Value, t Transformer) (Value, error) { } newAVs[name] = newAV } - newVal = ObjectVal(newAVs) + newVal = ObjectVal(newAVs).WithMarks(marks) } default: diff --git a/vendor/modules.txt b/vendor/modules.txt index 0149c4b2c2e..739b1a1c9ea 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -99,8 +99,8 @@ github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/empty github.com/golang/protobuf/ptypes/timestamp -# github.com/google/go-cmp v0.5.6 -## explicit; go 1.8 +# github.com/google/go-cmp v0.5.9 +## explicit; go 1.13 github.com/google/go-cmp/cmp github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags @@ -146,7 +146,7 @@ github.com/hashicorp/go-safetemp # github.com/hashicorp/go-uuid v1.0.1 ## explicit github.com/hashicorp/go-uuid -# github.com/hashicorp/go-version v1.3.0 +# github.com/hashicorp/go-version v1.6.0 ## explicit github.com/hashicorp/go-version # github.com/hashicorp/hcl/v2 v2.8.2 @@ -167,7 +167,7 @@ github.com/hashicorp/logutils github.com/hashicorp/terraform-exec/internal/version github.com/hashicorp/terraform-exec/tfexec github.com/hashicorp/terraform-exec/tfinstall -# github.com/hashicorp/terraform-json v0.12.0 +# github.com/hashicorp/terraform-json v0.15.0 ## explicit; go 1.13 github.com/hashicorp/terraform-json # github.com/hashicorp/terraform-plugin-go v0.3.0 @@ -248,7 +248,7 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.0.0 ## explicit github.com/oklog/run -# github.com/oracle/oci-go-sdk/v65 v65.44.0 +# github.com/oracle/oci-go-sdk/v65 v65.46.0 ## explicit; go 1.13 github.com/oracle/oci-go-sdk/v65/adm github.com/oracle/oci-go-sdk/v65/aianomalydetection @@ -269,6 +269,7 @@ github.com/oracle/oci-go-sdk/v65/bastion github.com/oracle/oci-go-sdk/v65/bds github.com/oracle/oci-go-sdk/v65/blockchain github.com/oracle/oci-go-sdk/v65/budget +github.com/oracle/oci-go-sdk/v65/certificates github.com/oracle/oci-go-sdk/v65/certificatesmanagement github.com/oracle/oci-go-sdk/v65/cloudbridge github.com/oracle/oci-go-sdk/v65/cloudguard @@ -381,7 +382,7 @@ github.com/ulikunitz/xz/lzma ## explicit github.com/vmihailenco/msgpack github.com/vmihailenco/msgpack/codes -# github.com/zclconf/go-cty v1.8.4 +# github.com/zclconf/go-cty v1.10.0 ## explicit; go 1.12 github.com/zclconf/go-cty/cty github.com/zclconf/go-cty/cty/convert diff --git a/website/docs/d/ai_document_model.html.markdown b/website/docs/d/ai_document_model.html.markdown index 516031f2102..5966dbdb2da 100644 --- a/website/docs/d/ai_document_model.html.markdown +++ b/website/docs/d/ai_document_model.html.markdown @@ -32,12 +32,16 @@ The following arguments are supported: The following attributes are exported: +* `alias_name` - the alias name of the model. * `compartment_id` - The compartment identifier. +* `component_models` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) collection of active custom Key Value models that need to be composed. + * `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of active custom Key Value model that need to be composed. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For example: `{"foo-namespace": {"bar-key": "value"}}` * `description` - An optional description of the model. * `display_name` - A human-friendly name for the model, which can be changed. * `freeform_tags` - A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{"bar-key": "value"}` * `id` - A unique identifier that is immutable after creation. +* `is_composed_model` - Set to true when the model is created by using multiple key value extraction models. * `is_quick_mode` - Set to true when experimenting with a new model type or dataset, so model training is quick, with a predefined low number of passes through the training data. * `labels` - The collection of labels used to train the custom model. * `lifecycle_details` - A message describing the current state in more detail, that can provide actionable information if training failed. @@ -72,6 +76,7 @@ The following attributes are exported: * `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project that contains the model. * `state` - The current state of the model. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. For example: `{"orcl-cloud": {"free-tier-retained": "true"}}` +* `tenancy_id` - The tenancy id of the model. * `testing_dataset` - The base entity which is the input for creating and training a model. * `bucket` - The name of the Object Storage bucket that contains the input data file. * `dataset_id` - OCID of the Data Labeling dataset. diff --git a/website/docs/d/ai_document_models.html.markdown b/website/docs/d/ai_document_models.html.markdown index ad827a00d5c..4ad34f1d233 100644 --- a/website/docs/d/ai_document_models.html.markdown +++ b/website/docs/d/ai_document_models.html.markdown @@ -48,12 +48,16 @@ The following attributes are exported: The following attributes are exported: +* `alias_name` - the alias name of the model. * `compartment_id` - The compartment identifier. +* `component_models` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) collection of active custom Key Value models that need to be composed. + * `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of active custom Key Value model that need to be composed. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For example: `{"foo-namespace": {"bar-key": "value"}}` * `description` - An optional description of the model. * `display_name` - A human-friendly name for the model, which can be changed. * `freeform_tags` - A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{"bar-key": "value"}` * `id` - A unique identifier that is immutable after creation. +* `is_composed_model` - Set to true when the model is created by using multiple key value extraction models. * `is_quick_mode` - Set to true when experimenting with a new model type or dataset, so model training is quick, with a predefined low number of passes through the training data. * `labels` - The collection of labels used to train the custom model. * `lifecycle_details` - A message describing the current state in more detail, that can provide actionable information if training failed. @@ -88,6 +92,7 @@ The following attributes are exported: * `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project that contains the model. * `state` - The current state of the model. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. For example: `{"orcl-cloud": {"free-tier-retained": "true"}}` +* `tenancy_id` - The tenancy id of the model. * `testing_dataset` - The base entity which is the input for creating and training a model. * `bucket` - The name of the Object Storage bucket that contains the input data file. * `dataset_id` - OCID of the Data Labeling dataset. diff --git a/website/docs/d/ai_document_processor_job.html.markdown b/website/docs/d/ai_document_processor_job.html.markdown index 4d96fc04a8b..81ce73819f8 100644 --- a/website/docs/d/ai_document_processor_job.html.markdown +++ b/website/docs/d/ai_document_processor_job.html.markdown @@ -46,7 +46,7 @@ The following attributes are exported: * `OBJECT_STORAGE_LOCATIONS`: A list of object locations in Object Storage. * `INLINE_DOCUMENT_CONTENT`: The content of an inline document. * `lifecycle_details` - The detailed status of FAILED state. -* `output_location` - The Object Storage Location. +* `output_location` - The object storage location where to store analysis results. * `bucket` - The Object Storage bucket name. * `namespace` - The Object Storage namespace. * `prefix` - The Object Storage folder name. @@ -63,6 +63,7 @@ The following attributes are exported: * `generate_searchable_pdf` - Whether or not to generate a searchable PDF file. * `max_results` - The maximum number of results to return. * `model_id` - The custom model ID. + * `tenancy_id` - The custom model tenancy ID when modelId represents aliasName. * `is_zip_output_enabled` - Whether or not to generate a ZIP file containing the results. * `language` - The document language, abbreviated according to the BCP 47 Language-Tag syntax. * `processor_type` - The type of the processor. diff --git a/website/docs/d/budget_budget.html.markdown b/website/docs/d/budget_budget.html.markdown index 246ce798b21..44263fc1402 100644 --- a/website/docs/d/budget_budget.html.markdown +++ b/website/docs/d/budget_budget.html.markdown @@ -40,11 +40,13 @@ The following attributes are exported: * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` * `description` - The description of the budget. * `display_name` - The display name of the budget. Avoid entering confidential information. +* `end_date` - The time when the one-time budget concludes. For example, - `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `forecasted_spend` - The forecasted spend in currency by the end of the current budget cycle. * `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 budget. -* `processing_period_type` - The type of the budget processing period. Valid values are INVOICE and MONTH. +* `processing_period_type` - The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE. * `reset_period` - The reset period for the budget. +* `start_date` - The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `state` - The current state of the budget. * `target_compartment_id` - This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty. * `target_type` - The type of target on which the budget is applied. diff --git a/website/docs/d/budget_budgets.html.markdown b/website/docs/d/budget_budgets.html.markdown index c9609b0e708..f951c5df965 100644 --- a/website/docs/d/budget_budgets.html.markdown +++ b/website/docs/d/budget_budgets.html.markdown @@ -16,8 +16,7 @@ By default, ListBudgets returns budgets of the 'COMPARTMENT' target type, and th To list all budgets, set the targetType query parameter to ALL (for example: 'targetType=ALL'). -Additional targetTypes would be available in future releases. Clients should ignore new targetTypes, -or upgrade to the latest version of the client SDK to handle new targetTypes. +Clients should ignore new targetTypes, or upgrade to the latest version of the client SDK to handle new targetTypes. ## Example Usage @@ -65,11 +64,13 @@ The following attributes are exported: * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` * `description` - The description of the budget. * `display_name` - The display name of the budget. Avoid entering confidential information. +* `end_date` - The time when the one-time budget concludes. For example, - `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `forecasted_spend` - The forecasted spend in currency by the end of the current budget cycle. * `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 budget. -* `processing_period_type` - The type of the budget processing period. Valid values are INVOICE and MONTH. +* `processing_period_type` - The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE. * `reset_period` - The reset period for the budget. +* `start_date` - The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `state` - The current state of the budget. * `target_compartment_id` - This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty. * `target_type` - The type of target on which the budget is applied. diff --git a/website/docs/d/certificates_certificate_authority_bundle.html.markdown b/website/docs/d/certificates_certificate_authority_bundle.html.markdown new file mode 100644 index 00000000000..01b5d2a81a4 --- /dev/null +++ b/website/docs/d/certificates_certificate_authority_bundle.html.markdown @@ -0,0 +1,71 @@ +--- +subcategory: "Certificates" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_certificates_certificate_authority_bundle" +sidebar_current: "docs-oci-datasource-certificates-certificate_authority_bundle" +description: |- +Provides details about a certificate authority bundle in Oracle Cloud Infrastructure Certificates Retrieval service +--- + +# Data Source: oci_certificates_certificate_bundle +This data source provides details about a specific certificate authority bundle in Oracle Cloud Infrastructure Certificates Retrieval service. + +Gets details about the specified certificate authority bundle. + +## Example Usage + +```hcl +data "oci_certificates_certificate_authority_bundle" "test_certificate_authority_bundle" { + #Required + certificate_authority_id = oci_certificates_management_certificate_authority.test_certificate_authority.id + + #Optional + certificate_version_name = oci_certificates_management_certificate_authority.test_certificate_authority.current_version.version_name + stage = "CURRENT" + version_number = oci_certificates_management_certificate_authority.test_certificate_authority.current_version.version_number +} +``` + +## Argument Reference + +The following arguments are supported: + +* `certificate_authority_id` - (Required) The OCID of the certificate authority (CA). +* `certificate_version_name` - (Optional) The name of the certificate authority (CA). (This might be referred to as the +name of the CA version, as every CA consists of at least one version.) Names are unique across versions of a given CA. +* `stage` - (Optional) The rotation state of the certificate authority version. Valid values are: `CURRENT`, `PENDING`, +`LATEST`, `PREVIOUS` or `DEPRECATED`. +* `version_number` - (Optional) The version number of the certificate authority (CA). + +## Attributes Reference + +The following attributes are exported: + +* `cert_chain_pem` - The certificate chain (in PEM format) for this CA version. +* `certificate_authority_id` - The OCID of the certificate authority (CA). +* `certificate_authority_name` - The name of the CA. +* `certificate_pem` - The certificate (in PEM format) for this CA version. +* `revocation_status` - The revocation status of the certificate. +* `serial_number` - A unique certificate identifier used in certificate revocation tracking, formatted as octets. +* `stages` - A list of rotation states for this CA. +* `time_created` - An optional property indicating when the certificate version was created, expressed in RFC 3339 +timestamp format. +* `validity` - The validity of the certificate. +* `version_name` - The name of the CA version. +* `version_number` - The version number of the CA. + +### Revocation Status Reference + +The following attributes are exported: + +* `revocation_reason` - The reason that the CA was revoked. +* `time_revoked` - The time when the CA was revoked. + +### Validity Reference + +The following attributes are exported: + +* `time_of_validity_not_after` - The date on which the CA validity period ends, expressed in RFC 3339 timestamp +format. +* `time_of_validity_not_before` - The date on which the CA validity period begins, expressed in RFC 3339 +timestamp format. diff --git a/website/docs/d/certificates_certificate_bundle.html.markdown b/website/docs/d/certificates_certificate_bundle.html.markdown new file mode 100644 index 00000000000..b0d0a5e1805 --- /dev/null +++ b/website/docs/d/certificates_certificate_bundle.html.markdown @@ -0,0 +1,82 @@ +--- +subcategory: "Certificates" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_certificates_certificate_bundle" +sidebar_current: "docs-oci-datasource-certificates-certificate_bundle" +description: |- +Provides details about a certificate bundle in Oracle Cloud Infrastructure Certificates Retrieval service +--- + +# Data Source: oci_certificates_certificate_bundle +This data source provides details about a specific certificate bundle in Oracle Cloud Infrastructure Certificates Retrieval service. + +Gets details about the specified certificate bundle. + +## Example Usage + +```hcl +data "oci_certificates_certificate_bundle" "test_certificate_bundle" { + #Required + certificate_id = oci_certificates_management_certificate.test_certificate.id + + #Optional + certificate_bundle_type = "CERTIFICATE_CONTENT_WITH_PRIVATE_KEY" + certificate_version_name = oci_certificates_management_certificate.test_certificate.current_version.version_name + stage = "CURRENT" + version_number = oci_certificates_management_certificate.test_certificate.current_version.version_number +} +``` + +## Argument Reference + +The following arguments are supported: + +* `certificate_id` - (Required) The OCID of the certificate. +* `certificate_bundle_type` - (Optional) The type of certificate bundle. By default, the private key fields are not +returned. When querying for certificate bundles, to return results with certificate contents, the private key in PEM +format, and the private key passphrase, specify the value of this parameter as CERTIFICATE_CONTENT_WITH_PRIVATE_KEY. +Valid values are: `CERTIFICATE_CONTENT_PUBLIC_ONLY` or `CERTIFICATE_CONTENT_WITH_PRIVATE_KEY`. +* `certificate_version_name` - (Optional) The name of the certificate. (This might be referred to as the name of the +certificate version, as every certificate consists of at least one version.) Names are unique across versions of a +given certificate. +* `stage` - (Optional) The rotation state of the certificate version. Valid values are: `CURRENT`, `PENDING`, `LATEST`, +`PREVIOUS` or `DEPRECATED`. +* `version_number` - (Optional) The version number of the certificate. + +## Attributes Reference + +The following attributes are exported: + +* `cert_chain_pem` - The certificate chain (in PEM format) for the certificate bundle. +* `certificate_bundle_type` - The type of certificate bundle, which indicates whether the private key fields are included. +* `certificate_id` - The OCID of the certificate. +* `certificate_name` - The name of the certificate. +* `certificate_pem` - The certificate (in PEM format) for the certificate bundle. +* `private_key_pem` - The private key (in PEM format) for the certificate. This is only set if `certificate_bundle_type` +is set to `CERTIFICATE_CONTENT_WITH_PRIVATE_KEY`. +* `private_key_pem_passphrase` - The passphrase for the private key. This is only set if `certificate_bundle_type` +is set to `CERTIFICATE_CONTENT_WITH_PRIVATE_KEY`. +* `revocation_status` - The revocation status of the certificate. +* `serial_number` - A unique certificate identifier used in certificate revocation tracking, formatted as octets. +* `stages` - A list of rotation states for the certificate bundle. +* `time_created` - An optional property indicating when the certificate version was created, expressed in RFC 3339 +timestamp format. +* `validity` - The validity of the certificate. +* `version_name` - The name of the certificate version. +* `version_number` - The version number of the certificate. + +### Revocation Status Reference + +The following attributes are exported: + +* `revocation_reason` - The reason that the certificate was revoked. +* `time_revoked` - The time when the certificate was revoked. + +### Validity Reference + +The following attributes are exported: + +* `time_of_validity_not_after` - The date on which the certificate validity period ends, expressed in RFC 3339 timestamp +format. +* `time_of_validity_not_before` - The date on which the certificate validity period begins, expressed in RFC 3339 +timestamp format. diff --git a/website/docs/d/containerengine_cluster_credential_rotation_status.html.markdown b/website/docs/d/containerengine_cluster_credential_rotation_status.html.markdown new file mode 100644 index 00000000000..37724a33741 --- /dev/null +++ b/website/docs/d/containerengine_cluster_credential_rotation_status.html.markdown @@ -0,0 +1,38 @@ +--- +subcategory: "Container Engine" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_containerengine_cluster_credential_rotation_status" +sidebar_current: "docs-oci-datasource-containerengine-cluster_credential_rotation_status" +description: |- + Provides details about a specific Cluster Credential Rotation Status in Oracle Cloud Infrastructure Container Engine service +--- + +# Data Source: oci_containerengine_cluster_credential_rotation_status +This data source provides details about a specific Cluster Credential Rotation Status resource in Oracle Cloud Infrastructure Container Engine service. + +Get cluster credential rotation status. + +## Example Usage + +```hcl +data "oci_containerengine_cluster_credential_rotation_status" "test_cluster_credential_rotation_status" { + #Required + cluster_id = oci_containerengine_cluster.test_cluster.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `cluster_id` - (Required) The OCID of the cluster. + + +## Attributes Reference + +The following attributes are exported: + +* `status` - Credential rotation status of a kubernetes cluster IN_PROGRESS: Issuing new credentials to kubernetes cluster control plane and worker nodes or retiring old credentials from kubernetes cluster control plane and worker nodes. WAITING: Waiting for customer to invoke the complete rotation action or the automcatic complete rotation action. COMPLETED: New credentials are functional on kuberentes cluster. +* `status_details` - Details of a kuberenetes cluster credential rotation status: ISSUING_NEW_CREDENTIALS: Credential rotation is in progress. Starting to issue new credentials to kubernetes cluster control plane and worker nodes. NEW_CREDENTIALS_ISSUED: New credentials are added. At this stage cluster has both old and new credentials and is awaiting old credentials retirement. RETIRING_OLD_CREDENTIALS: Retirement of old credentials is in progress. Starting to remove old credentials from kubernetes cluster control plane and worker nodes. COMPLETED: Credential rotation is complete. Old credentials are retired. +* `time_auto_completion_scheduled` - The time by which retirement of old credentials should start. + diff --git a/website/docs/d/containerengine_clusters.html.markdown b/website/docs/d/containerengine_clusters.html.markdown index d45f52d5324..d92416c129c 100644 --- a/website/docs/d/containerengine_clusters.html.markdown +++ b/website/docs/d/containerengine_clusters.html.markdown @@ -73,6 +73,7 @@ The following attributes are exported: * `deleted_by_user_id` - The user who deleted the cluster. * `deleted_by_work_request_id` - The OCID of the work request which deleted the cluster. * `time_created` - The time the cluster was created. + * `time_credential_expiration` - The time until which the cluster credential is valid. * `time_deleted` - The time the cluster was deleted. * `time_updated` - The time the cluster was updated. * `updated_by_user_id` - The user who updated the cluster. diff --git a/website/docs/d/core_instance_pool.html.markdown b/website/docs/d/core_instance_pool.html.markdown index 32f7cb5dcd6..71bb1e9cb2d 100644 --- a/website/docs/d/core_instance_pool.html.markdown +++ b/website/docs/d/core_instance_pool.html.markdown @@ -38,6 +38,8 @@ 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](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance pool. * `instance_configuration_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance configuration associated with the instance pool. +* `instance_display_name_formatter` - A user-friendly formatter for the instance pool's instances. Instance displaynames follow the format. The formatter does not retroactively change instance's displaynames, only instance displaynames in the future follow the format +* `instance_hostname_formatter` - A user-friendly formatter for the instance pool's instances. Instance hostnames follow the format. The formatter does not retroactively change instance's hostnames, only instance hostnames in the future follow the format * `load_balancers` - The load balancers attached to the instance pool. * `backend_set_name` - The name of the backend set on the load balancer. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the load balancer attachment. diff --git a/website/docs/d/core_instance_pools.html.markdown b/website/docs/d/core_instance_pools.html.markdown index 248ba555890..30802ff238f 100644 --- a/website/docs/d/core_instance_pools.html.markdown +++ b/website/docs/d/core_instance_pools.html.markdown @@ -50,6 +50,8 @@ 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](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance pool. * `instance_configuration_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance configuration associated with the instance pool. +* `instance_display_name_formatter` - A user-friendly formatter for the instance pool's instances. Instance displaynames follow the format. The formatter does not retroactively change instance's displaynames, only instance displaynames in the future follow the format +* `instance_hostname_formatter` - A user-friendly formatter for the instance pool's instances. Instance hostnames follow the format. The formatter does not retroactively change instance's hostnames, only instance hostnames in the future follow the format * `load_balancers` - The load balancers attached to the instance pool. * `backend_set_name` - The name of the backend set on the load balancer. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the load balancer attachment. diff --git a/website/docs/d/database_autonomous_vm_cluster.html.markdown b/website/docs/d/database_autonomous_vm_cluster.html.markdown index 9d80d71ee96..abedb4dd52a 100644 --- a/website/docs/d/database_autonomous_vm_cluster.html.markdown +++ b/website/docs/d/database_autonomous_vm_cluster.html.markdown @@ -78,6 +78,8 @@ The following attributes are exported: * `scan_listener_port_tls` - The SCAN Listener TLS port number. Default value is 2484. * `state` - The current state of the Autonomous VM cluster. * `time_created` - The date and time that the Autonomous VM cluster was created. +* `time_database_ssl_certificate_expires` - The date and time of Database SSL certificate expiration. +* `time_ords_certificate_expires` - The date and time of ORDS certificate expiration. * `time_zone` - The time zone to use for the Autonomous VM cluster. For details, see [DB System Time Zones](https://docs.cloud.oracle.com/iaas/Content/Database/References/timezones.htm). * `total_container_databases` - The total number of Autonomous Container Databases that can be created. * `vm_cluster_network_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM cluster network. diff --git a/website/docs/d/database_autonomous_vm_clusters.html.markdown b/website/docs/d/database_autonomous_vm_clusters.html.markdown index b84e2516f9a..009d29f9dd6 100644 --- a/website/docs/d/database_autonomous_vm_clusters.html.markdown +++ b/website/docs/d/database_autonomous_vm_clusters.html.markdown @@ -92,6 +92,8 @@ The following attributes are exported: * `scan_listener_port_tls` - The SCAN Listener TLS port number. Default value is 2484. * `state` - The current state of the Autonomous VM cluster. * `time_created` - The date and time that the Autonomous VM cluster was created. +* `time_database_ssl_certificate_expires` - The date and time of Database SSL certificate expiration. +* `time_ords_certificate_expires` - The date and time of ORDS certificate expiration. * `time_zone` - The time zone to use for the Autonomous VM cluster. For details, see [DB System Time Zones](https://docs.cloud.oracle.com/iaas/Content/Database/References/timezones.htm). * `total_container_databases` - The total number of Autonomous Container Databases that can be created. * `vm_cluster_network_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM cluster network. diff --git a/website/docs/d/opsi_news_report.html.markdown b/website/docs/d/opsi_news_report.html.markdown new file mode 100644 index 00000000000..8a57d45ca3a --- /dev/null +++ b/website/docs/d/opsi_news_report.html.markdown @@ -0,0 +1,52 @@ +--- +subcategory: "Opsi" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_opsi_news_report" +sidebar_current: "docs-oci-datasource-opsi-news_report" +description: |- + Provides details about a specific News Report in Oracle Cloud Infrastructure Opsi service +--- + +# Data Source: oci_opsi_news_report +This data source provides details about a specific News Report resource in Oracle Cloud Infrastructure Opsi service. + +Gets details of a news report. + +## Example Usage + +```hcl +data "oci_opsi_news_report" "test_news_report" { + #Required + news_report_id = oci_opsi_news_report.test_news_report.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `news_report_id` - (Required) Unique news report identifier. + + +## 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. +* `content_types` - Content types that the news report can handle. + * `capacity_planning_resources` - Supported resources for capacity planning content type. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - The description of the news report. +* `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 news report resource. +* `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. +* `locale` - Language of the news report. +* `name` - The news report name. +* `news_frequency` - News report frequency. +* `ons_topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. +* `state` - The current state of the news report. +* `status` - Indicates the status of a news report in Operations Insights. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The time the the news report was first enabled. An RFC3339 formatted datetime string. +* `time_updated` - The time the news report was updated. An RFC3339 formatted datetime string. + diff --git a/website/docs/d/opsi_news_reports.html.markdown b/website/docs/d/opsi_news_reports.html.markdown new file mode 100644 index 00000000000..f8dd4db6d4c --- /dev/null +++ b/website/docs/d/opsi_news_reports.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "Opsi" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_opsi_news_reports" +sidebar_current: "docs-oci-datasource-opsi-news_reports" +description: |- + Provides the list of News Reports in Oracle Cloud Infrastructure Opsi service +--- + +# Data Source: oci_opsi_news_reports +This data source provides the list of News Reports in Oracle Cloud Infrastructure Opsi service. + +Gets a list of news reports based on the query parameters specified. Either compartmentId or id query parameter must be specified. + + +## Example Usage + +```hcl +data "oci_opsi_news_reports" "test_news_reports" { + + #Optional + compartment_id = var.compartment_id + compartment_id_in_subtree = var.news_report_compartment_id_in_subtree + news_report_id = oci_opsi_news_report.test_news_report.id + state = var.news_report_state + status = var.news_report_status +} +``` + +## 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. +* `compartment_id_in_subtree` - (Optional) A flag to search all resources within a given compartment and all sub-compartments. +* `news_report_id` - (Optional) Unique Operations Insights news report identifier +* `state` - (Optional) Lifecycle states +* `status` - (Optional) Resource Status + + +## Attributes Reference + +The following attributes are exported: + +* `news_report_collection` - The list of news_report_collection. + +### NewsReport Reference + +The following attributes are exported: + +* `compartment_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. +* `content_types` - Content types that the news report can handle. + * `capacity_planning_resources` - Supported resources for capacity planning content type. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - The description of the news report. +* `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 news report resource. +* `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. +* `locale` - Language of the news report. +* `name` - The news report name. +* `news_frequency` - News report frequency. +* `ons_topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. +* `state` - The current state of the news report. +* `status` - Indicates the status of a news report in Operations Insights. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The time the the news report was first enabled. An RFC3339 formatted datetime string. +* `time_updated` - The time the news report was updated. An RFC3339 formatted datetime string. + diff --git a/website/docs/guides/resource_discovery.html.markdown b/website/docs/guides/resource_discovery.html.markdown index 0c0615fc7fd..88aa7affa8d 100644 --- a/website/docs/guides/resource_discovery.html.markdown +++ b/website/docs/guides/resource_discovery.html.markdown @@ -937,6 +937,7 @@ opsi * oci\_opsi\_operations\_insights\_warehouse\_rotate\_warehouse\_wallet * oci\_opsi\_operations\_insights\_private\_endpoint * oci\_opsi\_opsi\_configuration +* oci\_opsi\_news\_report optimizer diff --git a/website/docs/r/ai_document_model.html.markdown b/website/docs/r/ai_document_model.html.markdown index cebd756b215..7d0a9f7a88d 100644 --- a/website/docs/r/ai_document_model.html.markdown +++ b/website/docs/r/ai_document_model.html.markdown @@ -12,6 +12,7 @@ This resource provides the Model resource in Oracle Cloud Infrastructure Ai Docu Create a new model. + Updates the model metadata only selected path parameter. ## Example Usage @@ -19,20 +20,17 @@ Create a new model. resource "oci_ai_document_model" "test_model" { #Required compartment_id = var.compartment_id + model_id = var.model_model_id model_type = var.model_model_type project_id = oci_ai_document_project.test_project.id - training_dataset { - #Required - dataset_type = var.model_training_dataset_dataset_type + + #Optional + alias_name = var.model_alias_name + component_models { #Optional - bucket = var.model_training_dataset_bucket - dataset_id = oci_data_labeling_service_dataset.test_dataset.id - namespace = var.model_training_dataset_namespace - object = var.model_training_dataset_object + model_id = oci_ai_document_model.test_model.id } - - #Optional defined_tags = var.model_defined_tags description = var.model_description display_name = var.model_display_name @@ -40,6 +38,13 @@ resource "oci_ai_document_model" "test_model" { is_quick_mode = var.model_is_quick_mode max_training_time_in_hours = var.model_max_training_time_in_hours model_version = var.model_model_version + operations { + + #Optional + operation = var.model_operations_operation + path = var.model_operations_path + value = var.model_operations_value + } testing_dataset { #Required dataset_type = var.model_testing_dataset_dataset_type @@ -50,6 +55,16 @@ resource "oci_ai_document_model" "test_model" { namespace = var.model_testing_dataset_namespace object = var.model_testing_dataset_object } + training_dataset { + #Required + dataset_type = var.model_training_dataset_dataset_type + + #Optional + bucket = var.model_training_dataset_bucket + dataset_id = oci_data_labeling_service_dataset.test_dataset.id + namespace = var.model_training_dataset_namespace + object = var.model_training_dataset_object + } validation_dataset { #Required dataset_type = var.model_validation_dataset_dataset_type @@ -67,15 +82,23 @@ resource "oci_ai_document_model" "test_model" { The following arguments are supported: +* `alias_name` - (Optional) the alias name of the model. * `compartment_id` - (Required) (Updatable) The compartment identifier. +* `component_models` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) list of active custom Key Value models that need to be composed. + * `model_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of active custom Key Value model that need to be composed. * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For example: `{"foo-namespace": {"bar-key": "value"}}` * `description` - (Optional) (Updatable) An optional description of the model. * `display_name` - (Optional) (Updatable) A human-friendly name for the model, which can be changed. * `freeform_tags` - (Optional) (Updatable) A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{"bar-key": "value"}` * `is_quick_mode` - (Optional) Set to true when experimenting with a new model type or dataset, so the model training is quick, with a predefined low number of passes through the training data. * `max_training_time_in_hours` - (Optional) The maximum model training time in hours, expressed as a decimal fraction. +* `model_id` - (Required) * `model_type` - (Required) The type of the Document model. * `model_version` - (Optional) The model version +* `operations` - (Optional) (Updatable) + * `operation` - (Optional) (Updatable) + * `path` - (Optional) (Updatable) + * `value` - (Optional) (Updatable) * `project_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project that contains the model. * `testing_dataset` - (Optional) The base entity which is the input for creating and training a model. * `bucket` - (Required when dataset_type=OBJECT_STORAGE) The name of the Object Storage bucket that contains the input data file. @@ -83,7 +106,7 @@ The following arguments are supported: * `dataset_type` - (Required) The dataset type, based on where it is stored. * `namespace` - (Required when dataset_type=OBJECT_STORAGE) The namespace name of the Object Storage bucket that contains the input data file. * `object` - (Required when dataset_type=OBJECT_STORAGE) The object name of the input data file. -* `training_dataset` - (Required) The base entity which is the input for creating and training a model. +* `training_dataset` - (Optional) The base entity which is the input for creating and training a model. * `bucket` - (Required when dataset_type=OBJECT_STORAGE) The name of the Object Storage bucket that contains the input data file. * `dataset_id` - (Required when dataset_type=DATA_SCIENCE_LABELING) OCID of the Data Labeling dataset. * `dataset_type` - (Required) The dataset type, based on where it is stored. @@ -104,12 +127,16 @@ Any change to a property that does not support update will force the destruction The following attributes are exported: +* `alias_name` - the alias name of the model. * `compartment_id` - The compartment identifier. +* `component_models` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) collection of active custom Key Value models that need to be composed. + * `model_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of active custom Key Value model that need to be composed. * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For example: `{"foo-namespace": {"bar-key": "value"}}` * `description` - An optional description of the model. * `display_name` - A human-friendly name for the model, which can be changed. * `freeform_tags` - A simple key-value pair that is applied without any predefined name, type, or scope. It exists for cross-compatibility only. For example: `{"bar-key": "value"}` * `id` - A unique identifier that is immutable after creation. +* `is_composed_model` - Set to true when the model is created by using multiple key value extraction models. * `is_quick_mode` - Set to true when experimenting with a new model type or dataset, so model training is quick, with a predefined low number of passes through the training data. * `labels` - The collection of labels used to train the custom model. * `lifecycle_details` - A message describing the current state in more detail, that can provide actionable information if training failed. @@ -144,6 +171,7 @@ The following attributes are exported: * `project_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the project that contains the model. * `state` - The current state of the model. * `system_tags` - Usage of system tag keys. These predefined keys are scoped to namespaces. For example: `{"orcl-cloud": {"free-tier-retained": "true"}}` +* `tenancy_id` - The tenancy id of the model. * `testing_dataset` - The base entity which is the input for creating and training a model. * `bucket` - The name of the Object Storage bucket that contains the input data file. * `dataset_id` - OCID of the Data Labeling dataset. diff --git a/website/docs/r/ai_document_processor_job.html.markdown b/website/docs/r/ai_document_processor_job.html.markdown index 9ccbef928de..2c0da3d09fa 100644 --- a/website/docs/r/ai_document_processor_job.html.markdown +++ b/website/docs/r/ai_document_processor_job.html.markdown @@ -49,6 +49,7 @@ resource "oci_ai_document_processor_job" "test_processor_job" { generate_searchable_pdf = var.processor_job_processor_config_features_generate_searchable_pdf max_results = var.processor_job_processor_config_features_max_results model_id = oci_ai_document_model.test_model.id + tenancy_id = oci_identity_tenancy.test_tenancy.id } processor_type = var.processor_job_processor_config_processor_type @@ -78,7 +79,7 @@ The following arguments are supported: * `source_type` - (Required) The type of input location. The allowed values are: * `OBJECT_STORAGE_LOCATIONS`: A list of object locations in Object Storage. * `INLINE_DOCUMENT_CONTENT`: The content of an inline document. -* `output_location` - (Required) The Object Storage Location. +* `output_location` - (Required) The object storage location where to store analysis results. * `bucket` - (Required) The Object Storage bucket name. * `namespace` - (Required) The Object Storage namespace. * `prefix` - (Required) The Object Storage folder name. @@ -94,6 +95,7 @@ The following arguments are supported: * `generate_searchable_pdf` - (Applicable when feature_type=TEXT_EXTRACTION) Whether or not to generate a searchable PDF file. * `max_results` - (Applicable when feature_type=DOCUMENT_CLASSIFICATION | LANGUAGE_CLASSIFICATION) The maximum number of results to return. * `model_id` - (Applicable when feature_type=DOCUMENT_CLASSIFICATION | KEY_VALUE_EXTRACTION) The custom model ID. + * `tenancy_id` - (Applicable when feature_type=DOCUMENT_CLASSIFICATION | KEY_VALUE_EXTRACTION) The custom model tenancy ID when modelId represents aliasName. * `is_zip_output_enabled` - (Optional) Whether or not to generate a ZIP file containing the results. * `language` - (Optional) The document language, abbreviated according to the BCP 47 Language-Tag syntax. * `processor_type` - (Required) The type of the processor. @@ -119,7 +121,7 @@ The following attributes are exported: * `OBJECT_STORAGE_LOCATIONS`: A list of object locations in Object Storage. * `INLINE_DOCUMENT_CONTENT`: The content of an inline document. * `lifecycle_details` - The detailed status of FAILED state. -* `output_location` - The Object Storage Location. +* `output_location` - The object storage location where to store analysis results. * `bucket` - The Object Storage bucket name. * `namespace` - The Object Storage namespace. * `prefix` - The Object Storage folder name. @@ -136,6 +138,7 @@ The following attributes are exported: * `generate_searchable_pdf` - Whether or not to generate a searchable PDF file. * `max_results` - The maximum number of results to return. * `model_id` - The custom model ID. + * `tenancy_id` - The custom model tenancy ID when modelId represents aliasName. * `is_zip_output_enabled` - Whether or not to generate a ZIP file containing the results. * `language` - The document language, abbreviated according to the BCP 47 Language-Tag syntax. * `processor_type` - The type of the processor. diff --git a/website/docs/r/budget_budget.html.markdown b/website/docs/r/budget_budget.html.markdown index 81ad29a7151..781d797ad3a 100644 --- a/website/docs/r/budget_budget.html.markdown +++ b/website/docs/r/budget_budget.html.markdown @@ -27,8 +27,10 @@ resource "oci_budget_budget" "test_budget" { defined_tags = {"Operations.CostCenter"= "42"} description = var.budget_description display_name = var.budget_display_name + end_date = var.budget_end_date freeform_tags = {"Department"= "Finance"} processing_period_type = var.budget_processing_period_type + start_date = var.budget_start_date target_compartment_id = oci_identity_compartment.test_compartment.id target_type = var.budget_target_type targets = var.budget_targets @@ -45,9 +47,11 @@ The following arguments are supported: * `defined_tags` - (Optional) (Updatable) Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` * `description` - (Optional) (Updatable) The description of the budget. * `display_name` - (Optional) (Updatable) The displayName of the budget. Avoid entering confidential information. +* `end_date` - (Optional) (Updatable) The date when the one-time budget concludes. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `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"}` -* `processing_period_type` - (Optional) (Updatable) The type of the budget processing period. Valid values are INVOICE and MONTH. +* `processing_period_type` - (Optional) (Updatable) The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE. * `reset_period` - (Required) (Updatable) The reset period for the budget. Valid value is MONTHLY. +* `start_date` - (Optional) (Updatable) The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `target_compartment_id` - (Optional) This is DEPRECATED. Set the target compartment ID in targets instead. * `target_type` - (Optional) The type of target on which the budget is applied. * `targets` - (Optional) The list of targets on which the budget is applied. If targetType is "COMPARTMENT", the targets contain the list of compartment OCIDs. If targetType is "TAG", the targets contain the list of cost tracking tag identifiers in the form of "{tagNamespace}.{tagKey}.{tagValue}". Curerntly, the array should contain exactly one item. @@ -68,11 +72,13 @@ The following attributes are exported: * `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}` * `description` - The description of the budget. * `display_name` - The display name of the budget. Avoid entering confidential information. +* `end_date` - The time when the one-time budget concludes. For example, - `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `forecasted_spend` - The forecasted spend in currency by the end of the current budget cycle. * `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 budget. -* `processing_period_type` - The type of the budget processing period. Valid values are INVOICE and MONTH. +* `processing_period_type` - The type of the budget processing period. Valid values are INVOICE, MONTH, and SINGLE_USE. * `reset_period` - The reset period for the budget. +* `start_date` - The date when the one-time budget begins. For example, `2023-03-23`. The date-time format conforms to RFC 3339, and will be truncated to the starting point of the date provided after being converted to UTC time. * `state` - The current state of the budget. * `target_compartment_id` - This is DEPRECATED. For backwards compatability, the property is populated when the targetType is "COMPARTMENT", and targets contain the specific target compartment OCID. For all other scenarios, this property will be left empty. * `target_type` - The type of target on which the budget is applied. diff --git a/website/docs/r/containerengine_cluster.html.markdown b/website/docs/r/containerengine_cluster.html.markdown index 7e2327f63c7..b4e08d848be 100644 --- a/website/docs/r/containerengine_cluster.html.markdown +++ b/website/docs/r/containerengine_cluster.html.markdown @@ -161,6 +161,7 @@ The following attributes are exported: * `deleted_by_user_id` - The user who deleted the cluster. * `deleted_by_work_request_id` - The OCID of the work request which deleted the cluster. * `time_created` - The time the cluster was created. + * `time_credential_expiration` - The time until which the cluster credential is valid. * `time_deleted` - The time the cluster was deleted. * `time_updated` - The time the cluster was updated. * `updated_by_user_id` - The user who updated the cluster. diff --git a/website/docs/r/containerengine_cluster_complete_credential_rotation_management.html.markdown b/website/docs/r/containerengine_cluster_complete_credential_rotation_management.html.markdown new file mode 100644 index 00000000000..15ab0138bb7 --- /dev/null +++ b/website/docs/r/containerengine_cluster_complete_credential_rotation_management.html.markdown @@ -0,0 +1,51 @@ +--- +subcategory: "Container Engine" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_containerengine_cluster_complete_credential_rotation_management" +sidebar_current: "docs-oci-resource-containerengine-cluster_complete_credential_rotation_management" +description: |- + Provides the Cluster Complete Credential Rotation Management resource in Oracle Cloud Infrastructure Container Engine service +--- + +# oci_containerengine_cluster_complete_credential_rotation_management +This resource provides the Cluster Complete Credential Rotation Management resource in Oracle Cloud Infrastructure Container Engine service. + +Complete cluster credential rotation. Retire old credentials from kubernetes components. + +## Example Usage + +```hcl +resource "oci_containerengine_cluster_complete_credential_rotation_management" "test_cluster_complete_credential_rotation_management" { + #Required + cluster_id = oci_containerengine_cluster.test_cluster.id + depends_on = [oci_containerengine_cluster_start_credential_rotation_management.test_cluster_start_credential_rotation_management] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `cluster_id` - (Required) The OCID of the cluster. + + +** 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 Cluster Complete Credential Rotation Management + * `update` - (Defaults to 20 minutes), when updating the Cluster Complete Credential Rotation Management + * `delete` - (Defaults to 20 minutes), when destroying the Cluster Complete Credential Rotation Management + + +## Import + +Import is not supported for this resource. + diff --git a/website/docs/r/containerengine_cluster_start_credential_rotation_management.html.markdown b/website/docs/r/containerengine_cluster_start_credential_rotation_management.html.markdown new file mode 100644 index 00000000000..4b567303de1 --- /dev/null +++ b/website/docs/r/containerengine_cluster_start_credential_rotation_management.html.markdown @@ -0,0 +1,52 @@ +--- +subcategory: "Container Engine" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_containerengine_cluster_start_credential_rotation_management" +sidebar_current: "docs-oci-resource-containerengine-cluster_start_credential_rotation_management" +description: |- + Provides the Cluster Start Credential Rotation Management resource in Oracle Cloud Infrastructure Container Engine service +--- + +# oci_containerengine_cluster_start_credential_rotation_management +This resource provides the Cluster Start Credential Rotation Management resource in Oracle Cloud Infrastructure Container Engine service. + +Start cluster credential rotation by adding new credentials, old credentials will still work after this operation. + +## Example Usage + +```hcl +resource "oci_containerengine_cluster_start_credential_rotation_management" "test_cluster_start_credential_rotation_management" { + #Required + auto_completion_delay_duration = var.cluster_start_credential_rotation_management_auto_completion_delay_duration + cluster_id = oci_containerengine_cluster.test_cluster.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `auto_completion_delay_duration` - (Required) The duration in days(in ISO 8601 notation eg. P5D) after which the old credentials should be retired. Maximum delay duration is 14 days. +* `cluster_id` - (Required) The OCID of the cluster. + + +** 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 Cluster Start Credential Rotation Management + * `update` - (Defaults to 20 minutes), when updating the Cluster Start Credential Rotation Management + * `delete` - (Defaults to 20 minutes), when destroying the Cluster Start Credential Rotation Management + + +## Import + +Import is not supported for this resource. + diff --git a/website/docs/r/core_instance_pool.html.markdown b/website/docs/r/core_instance_pool.html.markdown index 75545acdf56..680b7b9980d 100644 --- a/website/docs/r/core_instance_pool.html.markdown +++ b/website/docs/r/core_instance_pool.html.markdown @@ -45,6 +45,8 @@ resource "oci_core_instance_pool" "test_instance_pool" { defined_tags = {"Operations.CostCenter"= "42"} display_name = var.instance_pool_display_name freeform_tags = {"Department"= "Finance"} + instance_display_name_formatter = var.instance_pool_instance_display_name_formatter + instance_hostname_formatter = var.instance_pool_instance_hostname_formatter load_balancers { #Required backend_set_name = oci_load_balancer_backend_set.test_backend_set.name @@ -64,6 +66,8 @@ The following arguments are supported: * `display_name` - (Optional) (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. * `freeform_tags` - (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Department": "Finance"}` * `instance_configuration_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance configuration associated with the instance pool. +* `instance_display_name_formatter` - (Optional) (Updatable) A user-friendly formatter for the instance pool's instances. Instance displaynames follow the format. The formatter does not retroactively change instance's displaynames, only instance displaynames in the future follow the format +* `instance_hostname_formatter` - (Optional) (Updatable) A user-friendly formatter for the instance pool's instances. Instance hostnames follow the format. The formatter does not retroactively change instance's hostnames, only instance hostnames in the future follow the format * `load_balancers` - (Optional) The load balancers to attach to the instance pool. * `backend_set_name` - (Required) The name of the backend set on the load balancer to add instances to. * `load_balancer_id` - (Required) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the load balancer to attach to the instance pool. @@ -103,6 +107,8 @@ 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](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance pool. * `instance_configuration_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the instance configuration associated with the instance pool. +* `instance_display_name_formatter` - A user-friendly formatter for the instance pool's instances. Instance displaynames follow the format. The formatter does not retroactively change instance's displaynames, only instance displaynames in the future follow the format +* `instance_hostname_formatter` - A user-friendly formatter for the instance pool's instances. Instance hostnames follow the format. The formatter does not retroactively change instance's hostnames, only instance hostnames in the future follow the format * `load_balancers` - The load balancers attached to the instance pool. * `backend_set_name` - The name of the backend set on the load balancer. * `id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the load balancer attachment. diff --git a/website/docs/r/database_autonomous_vm_cluster.html.markdown b/website/docs/r/database_autonomous_vm_cluster.html.markdown index 7609b8b24df..863b94eb063 100644 --- a/website/docs/r/database_autonomous_vm_cluster.html.markdown +++ b/website/docs/r/database_autonomous_vm_cluster.html.markdown @@ -148,6 +148,8 @@ The following attributes are exported: * `scan_listener_port_tls` - The SCAN Listener TLS port number. Default value is 2484. * `state` - The current state of the Autonomous VM cluster. * `time_created` - The date and time that the Autonomous VM cluster was created. +* `time_database_ssl_certificate_expires` - The date and time of Database SSL certificate expiration. +* `time_ords_certificate_expires` - The date and time of ORDS certificate expiration. * `time_zone` - The time zone to use for the Autonomous VM cluster. For details, see [DB System Time Zones](https://docs.cloud.oracle.com/iaas/Content/Database/References/timezones.htm). * `total_container_databases` - The total number of Autonomous Container Databases that can be created. * `vm_cluster_network_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the VM cluster network. diff --git a/website/docs/r/database_autonomous_vm_cluster_ords_certificate_management.html.markdown b/website/docs/r/database_autonomous_vm_cluster_ords_certificate_management.html.markdown new file mode 100644 index 00000000000..cd990514a8b --- /dev/null +++ b/website/docs/r/database_autonomous_vm_cluster_ords_certificate_management.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "Database" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_database_autonomous_vm_cluster_ords_certificate_management" +sidebar_current: "docs-oci-resource-database-autonomous_vm_cluster_ords_certificate_management" +description: |- + Provides the Autonomous Vm Cluster Ords Certificate Management resource in Oracle Cloud Infrastructure Database service +--- + +# oci_database_autonomous_vm_cluster_ords_certificate_management +This resource provides the Autonomous Vm Cluster Ords Certificate Management resource in Oracle Cloud Infrastructure Database service. + +Rotates the Oracle REST Data Services (ORDS) certificates for Autonomous Exadata VM cluster. + + +## Example Usage + +```hcl +resource "oci_database_autonomous_vm_cluster_ords_certificate_management" "test_autonomous_vm_cluster_ords_certificate_management" { + #Required + autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id + certificate_generation_type = var.autonomous_vm_cluster_ords_certificate_management_certificate_generation_type + + #Optional + ca_bundle_id = oci_certificates_management_ca_bundle.test_ca_bundle.id + certificate_authority_id = oci_certificates_management_certificate_authority.test_certificate_authority.id + certificate_id = oci_apigateway_certificate.test_certificate.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `autonomous_vm_cluster_id` - (Required) The autonomous VM cluster [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `ca_bundle_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate bundle. +* `certificate_authority_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate authority. +* `certificate_generation_type` - (Required) Specify SYSTEM for using Oracle managed certificates. Specify BYOC when you want to bring your own certificate. +* `certificate_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate to use. + + +** 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 Autonomous Vm Cluster Ords Certificate Management + * `update` - (Defaults to 20 minutes), when updating the Autonomous Vm Cluster Ords Certificate Management + * `delete` - (Defaults to 20 minutes), when destroying the Autonomous Vm Cluster Ords Certificate Management + + +## Import + +Import is not supported for this resource. + diff --git a/website/docs/r/database_autonomous_vm_cluster_ssl_certificate_management.html.markdown b/website/docs/r/database_autonomous_vm_cluster_ssl_certificate_management.html.markdown new file mode 100644 index 00000000000..90d9c01174a --- /dev/null +++ b/website/docs/r/database_autonomous_vm_cluster_ssl_certificate_management.html.markdown @@ -0,0 +1,61 @@ +--- +subcategory: "Database" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_database_autonomous_vm_cluster_ssl_certificate_management" +sidebar_current: "docs-oci-resource-database-autonomous_vm_cluster_ssl_certificate_management" +description: |- + Provides the Autonomous Vm Cluster Ssl Certificate Management resource in Oracle Cloud Infrastructure Database service +--- + +# oci_database_autonomous_vm_cluster_ssl_certificate_management +This resource provides the Autonomous Vm Cluster Ssl Certificate Management resource in Oracle Cloud Infrastructure Database service. + +Rotates the SSL certificates for Autonomous Exadata VM cluster. + + +## Example Usage + +```hcl +resource "oci_database_autonomous_vm_cluster_ssl_certificate_management" "test_autonomous_vm_cluster_ssl_certificate_management" { + #Required + autonomous_vm_cluster_id = oci_database_autonomous_vm_cluster.test_autonomous_vm_cluster.id + certificate_generation_type = var.autonomous_vm_cluster_ssl_certificate_management_certificate_generation_type + + #Optional + ca_bundle_id = oci_certificates_management_ca_bundle.test_ca_bundle.id + certificate_authority_id = oci_certificates_management_certificate_authority.test_certificate_authority.id + certificate_id = oci_apigateway_certificate.test_certificate.id +} +``` + +## Argument Reference + +The following arguments are supported: + +* `autonomous_vm_cluster_id` - (Required) The autonomous VM cluster [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm). +* `ca_bundle_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate bundle. +* `certificate_authority_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate authority. +* `certificate_generation_type` - (Required) Specify SYSTEM for using Oracle managed certificates. Specify BYOC when you want to bring your own certificate. +* `certificate_id` - (Optional) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the certificate to use. + + +** 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 Autonomous Vm Cluster Ssl Certificate Management + * `update` - (Defaults to 20 minutes), when updating the Autonomous Vm Cluster Ssl Certificate Management + * `delete` - (Defaults to 20 minutes), when destroying the Autonomous Vm Cluster Ssl Certificate Management + + +## Import + +Import is not supported for this resource. + diff --git a/website/docs/r/opsi_exadata_insight.html.markdown b/website/docs/r/opsi_exadata_insight.html.markdown index daf1e87b08b..8362a177ea9 100644 --- a/website/docs/r/opsi_exadata_insight.html.markdown +++ b/website/docs/r/opsi_exadata_insight.html.markdown @@ -169,3 +169,4 @@ ExadataInsights can be imported using the `id`, e.g. $ terraform import oci_opsi_exadata_insight.test_exadata_insight "id" ``` + diff --git a/website/docs/r/opsi_news_report.html.markdown b/website/docs/r/opsi_news_report.html.markdown new file mode 100644 index 00000000000..48fdc0efdb1 --- /dev/null +++ b/website/docs/r/opsi_news_report.html.markdown @@ -0,0 +1,96 @@ +--- +subcategory: "Opsi" +layout: "oci" +page_title: "Oracle Cloud Infrastructure: oci_opsi_news_report" +sidebar_current: "docs-oci-resource-opsi-news_report" +description: |- + Provides the News Report resource in Oracle Cloud Infrastructure Opsi service +--- + +# oci_opsi_news_report +This resource provides the News Report resource in Oracle Cloud Infrastructure Opsi service. + +Create a news report in Operations Insights. The report will be enabled in Operations Insights. Insights will be emailed as per selected frequency. + + +## Example Usage + +```hcl +resource "oci_opsi_news_report" "test_news_report" { + #Required + compartment_id = var.compartment_id + content_types { + #Required + capacity_planning_resources = var.news_report_content_types_capacity_planning_resources + } + description = var.news_report_description + locale = var.news_report_locale + name = var.news_report_name + news_frequency = var.news_report_news_frequency + ons_topic_id = oci_opsi_ons_topic.test_ons_topic.id + + #Optional + defined_tags = {"foo-namespace.bar-key"= "value"} + freeform_tags = {"bar-key"= "value"} + status = var.news_report_status +} +``` + +## Argument Reference + +The following arguments are supported: + +* `compartment_id` - (Required) (Updatable) Compartment Identifier where the news report will be created. +* `content_types` - (Required) (Updatable) Content types that the news report can handle. + * `capacity_planning_resources` - (Required) (Updatable) Supported resources for capacity planning content type. +* `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` - (Required) The description of the news report. +* `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"}` +* `locale` - (Required) (Updatable) Language of the news report. +* `name` - (Required) The news report name. +* `news_frequency` - (Required) (Updatable) News report frequency. +* `ons_topic_id` - (Required) (Updatable) The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. +* `status` - (Optional) (Updatable) Defines if the news report will be enabled or disabled. + + +** 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. +* `content_types` - Content types that the news report can handle. + * `capacity_planning_resources` - Supported resources for capacity planning content type. +* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace.bar-key": "value"}` +* `description` - The description of the news report. +* `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 news report resource. +* `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. +* `locale` - Language of the news report. +* `name` - The news report name. +* `news_frequency` - News report frequency. +* `ons_topic_id` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the ONS topic. +* `state` - The current state of the news report. +* `status` - Indicates the status of a news report in Operations Insights. +* `system_tags` - System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud.free-tier-retained": "true"}` +* `time_created` - The time the the news report was first enabled. An RFC3339 formatted datetime string. +* `time_updated` - The time the news report was updated. An RFC3339 formatted datetime string. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/oracle/oci/latest/docs/guides/changing_timeouts) for certain operations: + * `create` - (Defaults to 20 minutes), when creating the News Report + * `update` - (Defaults to 20 minutes), when updating the News Report + * `delete` - (Defaults to 20 minutes), when destroying the News Report + + +## Import + +NewsReports can be imported using the `id`, e.g. + +``` +$ terraform import oci_opsi_news_report.test_news_report "id" +``` + diff --git a/website/oci.erb b/website/oci.erb index dd0a716d866..c33b78b2b2f 100644 --- a/website/oci.erb +++ b/website/oci.erb @@ -6097,6 +6097,12 @@
  • oci_opsi_importable_compute_entity
  • +
  • + oci_opsi_news_report +
  • +
  • + oci_opsi_news_reports +
  • oci_opsi_operations_insights_private_endpoint
  • @@ -6144,6 +6150,9 @@
  • oci_opsi_host_insight
  • +
  • + oci_opsi_news_report +
  • oci_opsi_operations_insights_private_endpoint