diff --git a/CHANGELOG.md b/CHANGELOG.md index e6042d8e019..54ef035dfe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 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 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 e46c6e420c0..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 915321c3179..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 5c981ef3cb7..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 b1491ffb6a8..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 ba3ae4a0a2c..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 a3875f2bea3..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 8ef53011c92..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 b347289d9a7..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 be337be5dd8..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 02153b6f825..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 d196b52de4e..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 1a141c9c889..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 0c705a01a21..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 3d978d5fe9a..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 663900161b5..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 ab590fba7d1..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 363db5bb410..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 60853218559..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 2b6f628294f..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 4d9cdda3237..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 5dc31d47d70..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 6dbce564f2c..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 dc72aa2cb8b..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 68c81803304..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 fca4c280bf8..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 829e06ddbe9..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 f510b404122..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 6d387346d04..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 644bfdd81b2..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 10f4213e9ae..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 9c22a54437b..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 d36c2349d8e..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 574ff9a8c33..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 01686453b44..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 3ae35b9033c..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 0e707c11734..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 c9b346def91..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 084410def13..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 9b9a220f06d..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 cdfcee37e3f..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 6ede4862b50..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 efb9581c44e..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 51432655102..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 b9c85773645..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 c795c851c95..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 11379cbac7a..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 633483ca738..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 6780ef462db..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 b7292a38186..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 46769088740..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 77255fbdfaa..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 87d9848fc41..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 a33c7b6bb4b..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 f576a263578..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 9fb9f31c831..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 027f9223b66..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 e2c41fed9fe..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 bc54fc7abbf..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 8c5414e1642..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 b2f70707b14..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 4d2e5e5ee89..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 0fa13fce445..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 758d6fa4e08..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 539ccba2836..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 3879ed3fe1f..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 595b65655a0..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 4e297a4ad95..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 33ce45372ff..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 6e97f158cc0..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 be7559ce702..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 cbaa2cb87dd..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 c5b00b801d9..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 abc28a8d7f2..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 1623cb20df8..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 da3c3490fdd..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 e7a66fd100b..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 07e0ca7c6fb..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 349eab24ed4..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 3294e71afff..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 e05a8c1b1b1..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 5be7fd78980..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 f5c9f9aac69..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 87cb0ef5cb6..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 5e590b64bfe..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 e5250217b91..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 0b5e3d8942f..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 7099929ed58..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 c5d40f1d017..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 63cbf2104dc..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 4cc617cd609..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 f4aa6ccbb29..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 f632dc64ba6..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 be857be4170..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 6e5e93c99d4..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 a43fc02f745..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 6c1d8f5688e..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 98b7e0dd448..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 c5be967e985..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 5f93528e719..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 7247d2e4cfc..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 c756092ff8b..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 5afb97de2e2..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 8f71784f869..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 298bd5d324e..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 0fcb30e80e9..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 28951bfa304..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 2fdd1b0144f..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 9ac0b408c89..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 e7d61916f4f..5d490859750 100644 --- a/go.mod +++ b/go.mod @@ -53,7 +53,7 @@ require ( github.com/mitchellh/mapstructure v1.1.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect - github.com/oracle/oci-go-sdk/v65 v65.45.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 diff --git a/go.sum b/go.sum index 5217f818551..a2f7ac5bb21 100644 --- a/go.sum +++ b/go.sum @@ -289,8 +289,8 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/oracle/oci-go-sdk/v65 v65.45.0 h1:EpCst/iZma9s8eYS0QJ9qsTmGxX5GPehYGN1jwGIteU= -github.com/oracle/oci-go-sdk/v65 v65.45.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= diff --git a/internal/globalvar/version.go b/internal/globalvar/version.go index d102ab19d9f..7dee63ed500 100644 --- a/internal/globalvar/version.go +++ b/internal/globalvar/version.go @@ -7,8 +7,8 @@ import ( "log" ) -const Version = "5.6.0" -const ReleaseDate = "2023-07-26" +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/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/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/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/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/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/oracle/oci-go-sdk/v65/common/version.go b/vendor/github.com/oracle/oci-go-sdk/v65/common/version.go index c97ae2dc7b7..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 = "45" + 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/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/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/modules.txt b/vendor/modules.txt index ac48a82781d..3daf611832a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -248,7 +248,7 @@ github.com/mitchellh/reflectwalk # github.com/oklog/run v1.0.0 ## explicit github.com/oklog/run -# github.com/oracle/oci-go-sdk/v65 v65.45.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 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/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/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/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